{
WERROR result;
uint32 level = 1, num_jobs, i;
- bool got_hnd = False;
const char *printername;
POLICY_HND hnd;
JOB_INFO_CTR ctr;
if (!W_ERROR_IS_OK(result))
goto done;
- got_hnd = True;
-
/* Enumerate ports */
result = rpccli_spoolss_enumjobs(cli, mem_ctx, &hnd, level, 0, 1000,
}
done:
- if (got_hnd)
+ if (is_valid_policy_hnd(&hnd))
rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
{
WERROR result;
uint32 i=0, val_needed, data_needed;
- bool got_hnd = False;
const char *printername;
POLICY_HND hnd;
if (!W_ERROR_IS_OK(result))
goto done;
- got_hnd = True;
-
/* Enumerate data */
result = rpccli_spoolss_enumprinterdata(cli, mem_ctx, &hnd, i, 0, 0,
result = W_ERROR(ERRsuccess);
done:
- if (got_hnd)
+ if (is_valid_policy_hnd(&hnd))
rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
{
WERROR result;
uint32 i;
- bool got_hnd = False;
const char *printername;
const char *keyname = NULL;
POLICY_HND hnd;
if (!W_ERROR_IS_OK(result))
goto done;
- got_hnd = True;
-
/* Enumerate subkeys */
if ( !(ctr = TALLOC_ZERO_P( mem_ctx, REGVAL_CTR )) )
TALLOC_FREE( ctr );
done:
- if (got_hnd)
+ if (is_valid_policy_hnd(&hnd))
rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
const char **argv)
{
WERROR result;
- bool got_hnd = False;
const char *printername;
const char *keyname = NULL;
POLICY_HND hnd;
if (!W_ERROR_IS_OK(result))
goto done;
- got_hnd = True;
-
/* Enumerate subkeys */
result = rpccli_spoolss_enumprinterkey(cli, mem_ctx, &hnd, keyname, &keylist, NULL);
SAFE_FREE(keylist);
- if (got_hnd)
+ if (is_valid_policy_hnd(&hnd))
rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;
const char *printername;
const char *clientname;
POLICY_HND hnd;
- bool got_hnd = False;
WERROR result;
NTSTATUS status;
struct spoolss_NotifyOption option;
goto done;
}
- got_hnd = True;
-
/* Create spool options */
option.version = 2;
}
done:
- if (got_hnd)
+ if (is_valid_policy_hnd(&hnd))
rpccli_spoolss_ClosePrinter(cli, mem_ctx, &hnd, NULL);
return result;