Use pidl for _PNP_GetDeviceListSize().
authorGünther Deschner <gd@samba.org>
Sun, 17 Feb 2008 23:21:56 +0000 (00:21 +0100)
committerGünther Deschner <gd@samba.org>
Sun, 17 Feb 2008 23:31:14 +0000 (00:31 +0100)
Guenther
(This used to be commit da6636577dbbdabd248ea87a07819c5e63577f86)

source3/rpc_server/srv_ntsvcs.c
source3/rpc_server/srv_ntsvcs_nt.c

index cd2248926c55cd051cdd000e1bf8ab19d47c6fc7..73d4b4f4ed0e030d84c0a8def643551078bf5429 100644 (file)
@@ -56,23 +56,7 @@ static bool api_ntsvcs_get_version(pipes_struct *p)
 
 static bool api_ntsvcs_get_device_list_size(pipes_struct *p)
 {
-       NTSVCS_Q_GET_DEVICE_LIST_SIZE q_u;
-       NTSVCS_R_GET_DEVICE_LIST_SIZE 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_list_size("", &q_u, data, 0))
-               return False;
-
-       r_u.status = _ntsvcs_get_device_list_size(p, &q_u, &r_u);
-
-       if(!ntsvcs_io_r_get_device_list_size("", &r_u, rdata, 0))
-               return False;
-
-       return True;
+       return proxy_ntsvcs_call(p, NDR_PNP_GETDEVICELISTSIZE);
 }
 
 /*******************************************************************
index b6e0126fa65c0a28768d9902df79b9ae15405874..76bc24e7bac6ae196ced70915973a9906143dc98 100644 (file)
@@ -45,21 +45,20 @@ WERROR _PNP_GetVersion(pipes_struct *p,
 /********************************************************************
 ********************************************************************/
 
-WERROR _ntsvcs_get_device_list_size( pipes_struct *p, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u )
+WERROR _PNP_GetDeviceListSize(pipes_struct *p,
+                             struct PNP_GetDeviceListSize *r)
 {
-       fstring device;
        char *devicepath;
 
-       if ( !q_u->devicename )
+       if (!r->in.devicename) {
                return WERR_ACCESS_DENIED;
+       }
 
-       rpcstr_pull(device, q_u->devicename->buffer, sizeof(device), q_u->devicename->uni_str_len*2, 0);
-
-       if (!(devicepath = get_device_path(p->mem_ctx, device))) {
+       if (!(devicepath = get_device_path(p->mem_ctx, r->in.devicename))) {
                return WERR_NOMEM;
        }
 
-       r_u->size = strlen(devicepath) + 2;
+       *r->out.size = strlen(devicepath) + 2;
 
        TALLOC_FREE(devicepath);
 
@@ -269,16 +268,6 @@ WERROR _PNP_GetDeviceList(pipes_struct *p,
 /****************************************************************
 ****************************************************************/
 
-WERROR _PNP_GetDeviceListSize(pipes_struct *p,
-                             struct PNP_GetDeviceListSize *r)
-{
-       p->rng_fault_state = true;
-       return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
-****************************************************************/
-
 WERROR _PNP_GetDepth(pipes_struct *p,
                     struct PNP_GetDepth *r)
 {