return werror_to_ntstatus(result);
}
- result = rpccli_reg_open_entry(pipe_hnd, mem_ctx, &pol_hive, subpath, MAXIMUM_ALLOWED_ACCESS, &pol_key );
- if ( !W_ERROR_IS_OK(result) ) {
- d_printf("Unable to open [%s]\n", argv[0]);
- return werror_to_ntstatus(result);
+ if ( strlen( subpath ) != 0 ) {
+ result = rpccli_reg_open_entry(pipe_hnd, mem_ctx, &pol_hive, subpath, MAXIMUM_ALLOWED_ACCESS, &pol_key );
+ if ( !W_ERROR_IS_OK(result) ) {
+ d_printf("Unable to open [%s]\n", argv[0]);
+ return werror_to_ntstatus(result);
+ }
}
+ memcpy( &pol_key, &pol_hive, sizeof(POLICY_HND) );
/* get the subkeys */
out:
/* cleanup */
- rpccli_reg_close(pipe_hnd, mem_ctx, &pol_key );
+ if ( strlen( subpath ) != 0 )
+ rpccli_reg_close(pipe_hnd, mem_ctx, &pol_key );
rpccli_reg_close(pipe_hnd, mem_ctx, &pol_hive );
return werror_to_ntstatus(result);