*/
#include <advapi32.h>
-#include <wine/debug.h>
+#include <debug.h>
#define USZ {0,0,0}
RtlInitAnsiString(&MachineNameA, (LPSTR)lpMachineName);
Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
- if (STATUS_SUCCESS != Status) {
+ if (STATUS_SUCCESS != Status)
+ {
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
rv = AbortSystemShutdownW(MachineNameW.Buffer);
RtlFreeUnicodeString(&MachineNameW);
SetLastError(ERROR_SUCCESS);
* @unimplemented
*/
BOOL STDCALL
-InitiateSystemShutdownW(
- LPWSTR lpMachineName,
- LPWSTR lpMessage,
- DWORD dwTimeout,
- BOOL bForceAppsClosed,
- BOOL bRebootAfterShutdown)
+InitiateSystemShutdownW(LPWSTR lpMachineName,
+ LPWSTR lpMessage,
+ DWORD dwTimeout,
+ BOOL bForceAppsClosed,
+ BOOL bRebootAfterShutdown)
{
SHUTDOWN_ACTION Action = ShutdownNoReboot;
- NTSTATUS Status;
+ NTSTATUS Status;
- if (lpMachineName) {
- /* FIXME: remote machine shutdown not supported yet */
+ if (lpMachineName)
+ {
+ /* FIXME: remote machine shutdown not supported yet */
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
- if (dwTimeout) {
+
+ if (dwTimeout)
+ {
}
+
Status = NtShutdownSystem(Action);
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
*/
BOOL
STDCALL
-InitiateSystemShutdownA(
- LPSTR lpMachineName,
- LPSTR lpMessage,
- DWORD dwTimeout,
- BOOL bForceAppsClosed,
- BOOL bRebootAfterShutdown)
+InitiateSystemShutdownA(LPSTR lpMachineName,
+ LPSTR lpMessage,
+ DWORD dwTimeout,
+ BOOL bForceAppsClosed,
+ BOOL bRebootAfterShutdown)
{
ANSI_STRING MachineNameA;
ANSI_STRING MessageA;
INT LastError;
BOOL rv;
- if (lpMachineName) {
+ if (lpMachineName)
+ {
RtlInitAnsiString(&MachineNameA, lpMachineName);
Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
- if (STATUS_SUCCESS != Status) {
+ if (STATUS_SUCCESS != Status)
+ {
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
}
- if (lpMessage) {
+
+ if (lpMessage)
+ {
RtlInitAnsiString(&MessageA, lpMessage);
Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
- if (STATUS_SUCCESS != Status) {
- if (MachineNameW.Length) {
+ if (STATUS_SUCCESS != Status)
+ {
+ if (MachineNameW.Length)
+ {
RtlFreeUnicodeString(&MachineNameW);
}
+
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
}
- rv = InitiateSystemShutdownW(
- MachineNameW.Buffer,
- MessageW.Buffer,
- dwTimeout,
- bForceAppsClosed,
- bRebootAfterShutdown);
+
+ rv = InitiateSystemShutdownW(MachineNameW.Buffer,
+ MessageW.Buffer,
+ dwTimeout,
+ bForceAppsClosed,
+ bRebootAfterShutdown);
LastError = GetLastError();
- if (lpMachineName) {
+ if (lpMachineName)
+ {
RtlFreeUnicodeString(&MachineNameW);
}
- if (lpMessage) {
+
+ if (lpMessage)
+ {
RtlFreeUnicodeString(&MessageW);
}
+
SetLastError(LastError);
return rv;
}
*
* see InitiateSystemShutdownExA
*/
-BOOL WINAPI InitiateSystemShutdownExW( LPWSTR lpMachineName, LPWSTR lpMessage,
- DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown,
- DWORD dwReason)
+BOOL WINAPI
+InitiateSystemShutdownExW(LPWSTR lpMachineName,
+ LPWSTR lpMessage,
+ DWORD dwTimeout,
+ BOOL bForceAppsClosed,
+ BOOL bRebootAfterShutdown,
+ DWORD dwReason)
{
- FIXME("%s %s %ld %d %d %ld\n", debugstr_w(lpMachineName),
- debugstr_w(lpMessage), dwTimeout, bForceAppsClosed,
- bRebootAfterShutdown, dwReason);
+ UNIMPLEMENTED;
return TRUE;
-}
+}
/* EOF */