don't try to free the ansi strings passed by the caller
[reactos.git] / reactos / lib / advapi32 / misc / shutdown.c
index 49369dd..c43c555 100644 (file)
@@ -10,7 +10,8 @@
  *      19990515 EA
  */
 
  *      19990515 EA
  */
 
-#include "advapi32.h"
+#include <advapi32.h>
+#include <wine/debug.h>
 
 #define USZ {0,0,0}
 
 
 #define USZ {0,0,0}
 
@@ -47,7 +48,6 @@ AbortSystemShutdownA(LPCSTR lpMachineName)
             return FALSE;
     }
     rv = AbortSystemShutdownW(MachineNameW.Buffer);
             return FALSE;
     }
     rv = AbortSystemShutdownW(MachineNameW.Buffer);
-    RtlFreeAnsiString(&MachineNameA);
     RtlFreeUnicodeString(&MachineNameW);
     SetLastError(ERROR_SUCCESS);
     return rv;
     RtlFreeUnicodeString(&MachineNameW);
     SetLastError(ERROR_SUCCESS);
     return rv;
@@ -109,7 +109,6 @@ InitiateSystemShutdownA(
         RtlInitAnsiString(&MachineNameA, lpMachineName);
         Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
         if (STATUS_SUCCESS != Status) {
         RtlInitAnsiString(&MachineNameA, lpMachineName);
         Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE);
         if (STATUS_SUCCESS != Status) {
-            RtlFreeAnsiString(&MachineNameA);
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
@@ -119,10 +118,8 @@ InitiateSystemShutdownA(
         Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
         if (STATUS_SUCCESS != Status) {
             if (MachineNameW.Length) {
         Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE);
         if (STATUS_SUCCESS != Status) {
             if (MachineNameW.Length) {
-                RtlFreeAnsiString(&MachineNameA);
                 RtlFreeUnicodeString(&MachineNameW);
             }
                 RtlFreeUnicodeString(&MachineNameW);
             }
-            RtlFreeAnsiString(&MessageA);
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
@@ -135,15 +132,28 @@ InitiateSystemShutdownA(
             bRebootAfterShutdown);
     LastError = GetLastError();
     if (lpMachineName) {
             bRebootAfterShutdown);
     LastError = GetLastError();
     if (lpMachineName) {
-        RtlFreeAnsiString(&MachineNameA);
         RtlFreeUnicodeString(&MachineNameW);
     }
     if (lpMessage) {
         RtlFreeUnicodeString(&MachineNameW);
     }
     if (lpMessage) {
-        RtlFreeAnsiString(&MessageA);
         RtlFreeUnicodeString(&MessageW);
     }
     SetLastError(LastError);
     return rv;
 }
 
         RtlFreeUnicodeString(&MessageW);
     }
     SetLastError(LastError);
     return rv;
 }
 
+/******************************************************************************
+ * InitiateSystemShutdownExW [ADVAPI32.@]
+ *
+ * see InitiateSystemShutdownExA
+ */
+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);
+     return TRUE;
+} 
+
 /* EOF */
 /* EOF */