[FORMATTING] No code changes!
[reactos.git] / reactos / dll / win32 / advapi32 / misc / shutdown.c
index da1ab65..494c7aa 100644 (file)
@@ -43,10 +43,12 @@ AbortSystemShutdownA(LPCSTR lpMachineName)
 
     RtlInitAnsiString(&MachineNameA, (LPSTR)lpMachineName);
     Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
 
     RtlInitAnsiString(&MachineNameA, (LPSTR)lpMachineName);
     Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
-    if (STATUS_SUCCESS != Status) {
+    if (STATUS_SUCCESS != Status)
+    {
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
     }
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
     }
+
     rv = AbortSystemShutdownW(MachineNameW.Buffer);
     RtlFreeUnicodeString(&MachineNameW);
     SetLastError(ERROR_SUCCESS);
     rv = AbortSystemShutdownW(MachineNameW.Buffer);
     RtlFreeUnicodeString(&MachineNameW);
     SetLastError(ERROR_SUCCESS);
@@ -60,23 +62,26 @@ AbortSystemShutdownA(LPCSTR lpMachineName)
  * @unimplemented
  */
 BOOL STDCALL
  * @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;
 {
     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;
     }
         SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
         return FALSE;
     }
-    if (dwTimeout) {
+
+    if (dwTimeout)
+    {
     }
     }
+
     Status = NtShutdownSystem(Action);
     SetLastError(RtlNtStatusToDosError(Status));
     return FALSE;
     Status = NtShutdownSystem(Action);
     SetLastError(RtlNtStatusToDosError(Status));
     return FALSE;
@@ -90,12 +95,11 @@ InitiateSystemShutdownW(
  */
 BOOL
 STDCALL
  */
 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;
 {
     ANSI_STRING     MachineNameA;
     ANSI_STRING     MessageA;
@@ -105,38 +109,49 @@ InitiateSystemShutdownA(
     INT         LastError;
     BOOL        rv;
 
     INT         LastError;
     BOOL        rv;
 
-    if (lpMachineName) {
+    if (lpMachineName)
+    {
         RtlInitAnsiString(&MachineNameA, lpMachineName);
         Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
         RtlInitAnsiString(&MachineNameA, lpMachineName);
         Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
-        if (STATUS_SUCCESS != Status) {
+        if (STATUS_SUCCESS != Status)
+        {
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
     }
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
     }
-    if (lpMessage) {
+
+    if (lpMessage)
+    {
         RtlInitAnsiString(&MessageA, lpMessage);
         Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
         RtlInitAnsiString(&MessageA, lpMessage);
         Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
-        if (STATUS_SUCCESS != Status) {
-            if (MachineNameW.Length) {
+        if (STATUS_SUCCESS != Status)
+        {
+            if (MachineNameW.Length)
+            {
                 RtlFreeUnicodeString(&MachineNameW);
             }
                 RtlFreeUnicodeString(&MachineNameW);
             }
+
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
     }
             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();
     LastError = GetLastError();
-    if (lpMachineName) {
+    if (lpMachineName)
+    {
         RtlFreeUnicodeString(&MachineNameW);
     }
         RtlFreeUnicodeString(&MachineNameW);
     }
-    if (lpMessage) {
+
+    if (lpMessage)
+    {
         RtlFreeUnicodeString(&MessageW);
     }
         RtlFreeUnicodeString(&MessageW);
     }
+
     SetLastError(LastError);
     return rv;
 }
     SetLastError(LastError);
     return rv;
 }
@@ -146,9 +161,13 @@ InitiateSystemShutdownA(
  *
  * see InitiateSystemShutdownExA
  */
  *
  * 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)
 {
      UNIMPLEMENTED;
      return TRUE;
 {
      UNIMPLEMENTED;
      return TRUE;