r9410: - a winreg_CloseKey() should return a zero key on success (zeroing the
authorAndrew Tridgell <tridge@samba.org>
Sat, 20 Aug 2005 04:40:08 +0000 (04:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:33:35 +0000 (13:33 -0500)
callers key). This is the normal pattern with rpc handles.

- fixed reference to undefined error variable in winreg_DeleteKey()
(This used to be commit 6757d51a280d6c393648a384f1ef3ca403517352)

source4/rpc_server/winreg/rpc_winreg.c

index f1dced3817ba090fb8a36f9e189f3d36acce1a23..e20d9aa6b667ef95d70294fcf2d68ff05e372159 100644 (file)
@@ -85,6 +85,8 @@ static WERROR winreg_CloseKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
 
        talloc_free(h);
 
+       ZERO_STRUCTP(r->out.handle);
+
        return WERR_OK;
 }
 
@@ -123,15 +125,10 @@ static WERROR winreg_DeleteKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *m
                       struct winreg_DeleteKey *r)
 {
        struct dcesrv_handle *h;
-       WERROR result;
 
        DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY);
-
-       if (W_ERROR_IS_OK(result)) {
-               return reg_key_del((struct registry_key *)h->data, r->in.key.name);
-       }
-
-       return result;
+       
+       return reg_key_del((struct registry_key *)h->data, r->in.key.name);
 }