summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-13 11:00:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:22 -0500
commitfedca61e8fd1755d9777672b62c9833dce9331dc (patch)
tree279d549a1eb1e9db30ae762fb2e23a645094f74d /source4
parentedf98253fa8fe627d8824d975731ea068debf4b5 (diff)
downloadsamba-fedca61e8fd1755d9777672b62c9833dce9331dc.tar.gz
samba-fedca61e8fd1755d9777672b62c9833dce9331dc.tar.bz2
samba-fedca61e8fd1755d9777672b62c9833dce9331dc.zip
r4175: InitiateSystemShutdownEx IDL and torture test
(This used to be commit 3538130bf5d656ed4b0e2c84294e995814860e34)
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/winreg.idl8
-rw-r--r--source4/torture/rpc/winreg.c31
2 files changed, 38 insertions, 1 deletions
diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl
index 37049142d2..a77af21a4b 100644
--- a/source4/librpc/idl/winreg.idl
+++ b/source4/librpc/idl/winreg.idl
@@ -324,7 +324,13 @@
/******************/
/* Function: 0x1e */
WERROR winreg_InitiateSystemShutdownEx(
- );
+ [in] uint16 *hostname,
+ [in] winreg_String *message,
+ [in] uint32 timeout,
+ [in] uint8 force_apps,
+ [in] uint8 reboot,
+ [in] uint32 reason
+ );
/******************/
/* Function: 0x1f */
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 97bf091d51..e15ee23c37 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -578,6 +578,35 @@ static BOOL test_InitiateSystemShutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_c
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)
{
struct winreg_AbortSystemShutdown r;
@@ -746,6 +775,8 @@ BOOL torture_rpc_winreg(void)
} else {
ret &= test_InitiateSystemShutdown(p, mem_ctx, "spottyfood", 30);
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++) {