s3: pass DCE RPC handle type to create_policy_hnd
[samba.git] / source3 / rpc_server / winreg / srv_winreg_nt.c
index 98af44114d7edf91812d3987ec1c252798cda809..c59413d92e60f074019528352a9f945667c30394 100644 (file)
@@ -35,6 +35,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
 
+enum handle_types { HTYPE_REGVAL, HTYPE_REGKEY };
+
 /******************************************************************
  Find a registry key handle and return a struct registry_key *
  *****************************************************************/
@@ -82,7 +84,7 @@ static WERROR open_registry_key(struct pipes_struct *p,
                return result;
        }
 
-       if ( !create_policy_hnd( p, hnd, key ) ) {
+       if ( !create_policy_hnd( p, hnd, HTYPE_REGKEY, key ) ) {
                return WERR_FILE_NOT_FOUND;
        }
 
@@ -708,7 +710,7 @@ WERROR _winreg_CreateKey(struct pipes_struct *p,
                return result;
        }
 
-       if (!create_policy_hnd(p, r->out.new_handle, new_key)) {
+       if (!create_policy_hnd(p, r->out.new_handle, HTYPE_REGKEY, new_key)) {
                TALLOC_FREE(new_key);
                return WERR_FILE_NOT_FOUND;
        }