mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
s3-ntsvcs: use pidl for _PNP_GetDeviceRegProp.
Guenther
This commit is contained in:
parent
9b40d26e30
commit
12fdb5eb46
@ -97,23 +97,7 @@ static bool api_ntsvcs_validate_device_instance(pipes_struct *p)
|
|||||||
|
|
||||||
static bool api_ntsvcs_get_device_reg_property(pipes_struct *p)
|
static bool api_ntsvcs_get_device_reg_property(pipes_struct *p)
|
||||||
{
|
{
|
||||||
NTSVCS_Q_GET_DEVICE_REG_PROPERTY q_u;
|
return proxy_ntsvcs_call(p, NDR_PNP_GETDEVICEREGPROP);
|
||||||
NTSVCS_R_GET_DEVICE_REG_PROPERTY r_u;
|
|
||||||
prs_struct *data = &p->in_data.data;
|
|
||||||
prs_struct *rdata = &p->out_data.rdata;
|
|
||||||
|
|
||||||
ZERO_STRUCT(q_u);
|
|
||||||
ZERO_STRUCT(r_u);
|
|
||||||
|
|
||||||
if(!ntsvcs_io_q_get_device_reg_property("", &q_u, data, 0))
|
|
||||||
return False;
|
|
||||||
|
|
||||||
r_u.status = _ntsvcs_get_device_reg_property(p, &q_u, &r_u);
|
|
||||||
|
|
||||||
if(!ntsvcs_io_r_get_device_reg_property("", &r_u, rdata, 0))
|
|
||||||
return False;
|
|
||||||
|
|
||||||
return True;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
|
@ -93,26 +93,26 @@ WERROR _ntsvcs_get_device_list( pipes_struct *p, NTSVCS_Q_GET_DEVICE_LIST *q_u,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
|
_PNP_GetDeviceRegProp
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
WERROR _ntsvcs_get_device_reg_property( pipes_struct *p, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u )
|
WERROR _PNP_GetDeviceRegProp(pipes_struct *p,
|
||||||
|
struct PNP_GetDeviceRegProp *r)
|
||||||
{
|
{
|
||||||
fstring devicepath;
|
|
||||||
char *ptr;
|
char *ptr;
|
||||||
REGVAL_CTR *values;
|
REGVAL_CTR *values;
|
||||||
REGISTRY_VALUE *val;
|
REGISTRY_VALUE *val;
|
||||||
|
|
||||||
rpcstr_pull(devicepath, q_u->devicepath.buffer, sizeof(devicepath), q_u->devicepath.uni_str_len*2, 0);
|
switch( r->in.property ) {
|
||||||
|
|
||||||
switch( q_u->property ) {
|
|
||||||
case DEV_REGPROP_DESC:
|
case DEV_REGPROP_DESC:
|
||||||
|
|
||||||
/* just parse the service name from the device path and then
|
/* just parse the service name from the device path and then
|
||||||
lookup the display name */
|
lookup the display name */
|
||||||
if ( !(ptr = strrchr_m( devicepath, '\\' )) )
|
if ( !(ptr = strrchr_m( r->in.devicepath, '\\' )) )
|
||||||
return WERR_GENERAL_FAILURE;
|
return WERR_GENERAL_FAILURE;
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
||||||
if ( !(ptr = strrchr_m( devicepath, '_' )) )
|
if ( !(ptr = strrchr_m( r->in.devicepath, '_' )) )
|
||||||
return WERR_GENERAL_FAILURE;
|
return WERR_GENERAL_FAILURE;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
@ -124,16 +124,27 @@ WERROR _ntsvcs_get_device_reg_property( pipes_struct *p, NTSVCS_Q_GET_DEVICE_REG
|
|||||||
return WERR_GENERAL_FAILURE;
|
return WERR_GENERAL_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
r_u->unknown1 = 0x1; /* always 1...tested using a remove device manager connection */
|
if (*r->in.buffer_size < val->size) {
|
||||||
r_u->size = reg_init_regval_buffer( &r_u->value, val );
|
*r->out.needed = val->size;
|
||||||
r_u->needed = r_u->size;
|
*r->out.buffer_size = 0;
|
||||||
|
TALLOC_FREE( values );
|
||||||
|
return WERR_CM_BUFFER_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
r->out.buffer = (uint8_t *)talloc_memdup(p->mem_ctx, val->data_p, val->size);
|
||||||
TALLOC_FREE(values);
|
TALLOC_FREE(values);
|
||||||
|
if (!r->out.buffer) {
|
||||||
|
return WERR_NOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
*r->out.reg_data_type = REG_SZ; /* always 1...tested using a remove device manager connection */
|
||||||
|
*r->out.buffer_size = val->size;
|
||||||
|
*r->out.needed = val->size;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
r_u->unknown1 = 0x00437c98;
|
*r->out.reg_data_type = 0x00437c98; /* ??? */
|
||||||
return WERR_CM_NO_SUCH_VALUE;
|
return WERR_CM_NO_SUCH_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,16 +290,6 @@ WERROR _PNP_GetDepth(pipes_struct *p,
|
|||||||
/****************************************************************
|
/****************************************************************
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
WERROR _PNP_GetDeviceRegProp(pipes_struct *p,
|
|
||||||
struct PNP_GetDeviceRegProp *r)
|
|
||||||
{
|
|
||||||
p->rng_fault_state = true;
|
|
||||||
return WERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************
|
|
||||||
****************************************************************/
|
|
||||||
|
|
||||||
WERROR _PNP_SetDeviceRegProp(pipes_struct *p,
|
WERROR _PNP_SetDeviceRegProp(pipes_struct *p,
|
||||||
struct PNP_SetDeviceRegProp *r)
|
struct PNP_SetDeviceRegProp *r)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user