Author: jerry
Date: 2005-09-16 14:49:09 +0000 (Fri, 16 Sep 2005)
New Revision: 10265

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10265

Log:
<Met Dante for coffee this morning....>

* More work on the GetDeviceRegProperty() call.  Sometimes
  the client likes the reply and sometimes (even on the same)
  service, the client complains about an invalid Device ID.

<Still waiting for Virgil to show up....>


Modified:
   trunk/source/include/doserr.h
   trunk/source/include/rpc_ntsvcs.h
   trunk/source/rpc_parse/parse_ntsvcs.c
   trunk/source/rpc_server/srv_ntsvcs_nt.c


Changeset:
Modified: trunk/source/include/doserr.h
===================================================================
--- trunk/source/include/doserr.h       2005-09-16 14:47:21 UTC (rev 10264)
+++ trunk/source/include/doserr.h       2005-09-16 14:49:09 UTC (rev 10265)
@@ -5,6 +5,7 @@
    Copyright (C) John H Terpstra              1996-2000
    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
    Copyright (C) Paul Ashton                  1998-2000
+   Copyright (C) Gerald (Jerry) Carter        2005
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -228,7 +229,12 @@
 #define WERR_PRINT_MONITOR_IN_USE W_ERROR(ERRprintmonitorinuse)
 #define WERR_PRINTER_HAS_JOBS_QUEUED W_ERROR(ERRprinterhasjobsqueued)
 
+/* Configuration Manager Errors */
+/* Basically Win32 errors meanings are specific to the \ntsvcs pipe */
 
+#define WERR_CM_NO_SUCH_VALUE W_ERROR(37)
+
+
 /* DFS errors */
 
 #ifndef NERR_BASE

Modified: trunk/source/include/rpc_ntsvcs.h
===================================================================
--- trunk/source/include/rpc_ntsvcs.h   2005-09-16 14:47:21 UTC (rev 10264)
+++ trunk/source/include/rpc_ntsvcs.h   2005-09-16 14:49:09 UTC (rev 10265)
@@ -87,21 +87,22 @@
 
 /**************************/
 
-#define DEVICE_REG_PROPERTY_DEVICENAME 1
+#define DEV_REGPROP_DESC       1
 
 typedef struct {
        UNISTR2 devicepath;
        uint32 property;
        uint32 unknown2;
-       uint32 unknown3;
-       uint32 unknown4;
+       uint32 buffer_size1;
+       uint32 buffer_size2;
        uint32 unknown5;
 } NTSVCS_Q_GET_DEVICE_REG_PROPERTY;
 
 typedef struct {
-       uint32 type;
+       uint32 unknown1;
        REGVAL_BUFFER value;
        uint32 size;
+       uint32 needed;
        WERROR status;
 } NTSVCS_R_GET_DEVICE_REG_PROPERTY;
 

Modified: trunk/source/rpc_parse/parse_ntsvcs.c
===================================================================
--- trunk/source/rpc_parse/parse_ntsvcs.c       2005-09-16 14:47:21 UTC (rev 
10264)
+++ trunk/source/rpc_parse/parse_ntsvcs.c       2005-09-16 14:49:09 UTC (rev 
10265)
@@ -235,9 +235,9 @@
                return False;
        if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
                return False;
-       if ( !prs_uint32("unknown3", ps, depth, &q_u->unknown3) )
+       if ( !prs_uint32("buffer_size1", ps, depth, &q_u->buffer_size1) )
                return False;
-       if ( !prs_uint32("unknown4", ps, depth, &q_u->unknown4) )
+       if ( !prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2) )
                return False;
        if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
                return False;
@@ -260,7 +260,7 @@
        if ( !prs_align(ps) )
                return False;
 
-       if ( !prs_uint32("type", ps, depth, &r_u->type) )
+       if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
                return False;
 
        if ( !smb_io_regval_buffer("value", ps, depth, &r_u->value) )
@@ -270,7 +270,8 @@
 
        if ( !prs_uint32("size", ps, depth, &r_u->size) )
                return False;
-       if ( !prs_uint32("size", ps, depth, &r_u->size) )
+
+       if ( !prs_uint32("needed", ps, depth, &r_u->needed) )
                return False;
 
        if(!prs_werror("status", ps, depth, &r_u->status))

Modified: trunk/source/rpc_server/srv_ntsvcs_nt.c
===================================================================
--- trunk/source/rpc_server/srv_ntsvcs_nt.c     2005-09-16 14:47:21 UTC (rev 
10264)
+++ trunk/source/rpc_server/srv_ntsvcs_nt.c     2005-09-16 14:49:09 UTC (rev 
10265)
@@ -103,7 +103,7 @@
        rpcstr_pull(devicepath, q_u->devicepath.buffer, sizeof(devicepath), 
q_u->devicepath.uni_str_len*2, 0);
 
        switch( q_u->property ) {
-       case DEVICE_REG_PROPERTY_DEVICENAME:
+       case DEV_REGPROP_DESC:
                /* just parse the service name from the device path and then 
                   lookup the display name */
                if ( !(ptr = strrchr_m( devicepath, '\\' )) )
@@ -122,15 +122,16 @@
                        return WERR_GENERAL_FAILURE;
                }
                
-               r_u->type = REG_SZ;
+               r_u->unknown1 = 0x1;    /* always 1...tested using a remove 
device manager connection */
                r_u->size = reg_init_regval_buffer( &r_u->value, val );
+               r_u->needed = r_u->size;
 
                TALLOC_FREE(values);
 
                break;
                
        default:
-               return W_ERROR(37);     /* undocumented but this is what 
Windows 2000 returns */
+               return WERR_CM_NO_SUCH_VALUE;
        }
 
        return WERR_OK;

Reply via email to