1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r4175: InitiateSystemShutdownEx IDL and torture test

(This used to be commit 3538130bf5)
This commit is contained in:
Jelmer Vernooij 2004-12-13 11:00:24 +00:00 committed by Gerald (Jerry) Carter
parent edf98253fa
commit fedca61e8f
2 changed files with 38 additions and 1 deletions

View File

@ -324,6 +324,12 @@
/******************/ /******************/
/* Function: 0x1e */ /* Function: 0x1e */
WERROR winreg_InitiateSystemShutdownEx( WERROR winreg_InitiateSystemShutdownEx(
[in] uint16 *hostname,
[in] winreg_String *message,
[in] uint32 timeout,
[in] uint8 force_apps,
[in] uint8 reboot,
[in] uint32 reason
); );
/******************/ /******************/

View File

@ -578,6 +578,35 @@ static BOOL test_InitiateSystemShutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_c
return True; return True;
} }
static BOOL test_InitiateSystemShutdownEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
const char *msg, uint32_t timeout)
{
struct winreg_InitiateSystemShutdownEx r;
NTSTATUS status;
r.in.hostname = NULL;
r.in.message = talloc_p(mem_ctx, struct winreg_String);
init_winreg_String(r.in.message, msg);
r.in.force_apps = 1;
r.in.timeout = timeout;
r.in.reboot = 1;
r.in.reason = 0;
status = dcerpc_winreg_InitiateSystemShutdownEx(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("InitiateSystemShutdownEx failed - %s\n", nt_errstr(status));
return False;
}
if (!W_ERROR_IS_OK(r.out.result)) {
printf("InitiateSystemShutdownEx failed - %s\n", win_errstr(r.out.result));
return False;
}
return True;
}
static BOOL test_AbortSystemShutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) static BOOL test_AbortSystemShutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{ {
struct winreg_AbortSystemShutdown r; struct winreg_AbortSystemShutdown r;
@ -746,6 +775,8 @@ BOOL torture_rpc_winreg(void)
} else { } else {
ret &= test_InitiateSystemShutdown(p, mem_ctx, "spottyfood", 30); ret &= test_InitiateSystemShutdown(p, mem_ctx, "spottyfood", 30);
ret &= test_AbortSystemShutdown(p, mem_ctx); ret &= test_AbortSystemShutdown(p, mem_ctx);
ret &= test_InitiateSystemShutdownEx(p, mem_ctx, "spottyfood", 30);
ret &= test_AbortSystemShutdown(p, mem_ctx);
} }
for (i = 0; i < ARRAY_SIZE(open_fns); i++) { for (i = 0; i < ARRAY_SIZE(open_fns); i++) {