[IPHLPAPI_APITEST]
[reactos.git] / rostests / apitests / kernel32 / GetModuleFileName.c
index 7022d91..43c5ec3 100644 (file)
@@ -2,15 +2,15 @@
  * PROJECT:         ReactOS api tests
  * LICENSE:         GPLv2+ - See COPYING in the top level directory
  * PURPOSE:         Test for GetModuleFileName
- * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
+ * PROGRAMMER:      Thomas Faber <thomas.faber@reactos.org>
  */
 
+#include <apitest.h>
+
 #define WIN32_NO_STATUS
 #define _INC_WINDOWS
 #define COM_NO_WINDOWS_H
-#define UNICODE
 #include <stdio.h>
-#include <wine/test.h>
 #include <winreg.h>
 #include <winnls.h>
 #include <shlwapi.h>
@@ -24,7 +24,7 @@ StartChild(char **argv)
     PWSTR FileName;
     PWSTR Slash;
     WCHAR CommandLine[MAX_PATH];
-    STARTUPINFO StartupInfo;
+    STARTUPINFOW StartupInfo;
     PROCESS_INFORMATION ProcessInfo;
     DWORD Ret;
     int Length;
@@ -35,6 +35,7 @@ StartChild(char **argv)
                                  -1,
                                  Path,
                                  sizeof(Path) / sizeof(WCHAR));
+    ok(Length > 0, "Length = %d\n", Length);
 
     FileName = wcsrchr(Path, '\\');
     Slash = wcsrchr(Path, L'/');
@@ -47,7 +48,7 @@ StartChild(char **argv)
         FileName++;
         FileName[-1] = L'\0';
 
-        Success = SetCurrentDirectory(Path);
+        Success = SetCurrentDirectoryW(Path);
         ok(Success == TRUE, "SetCurrentDirectory failed for path '%ls'\n", Path);
 
         trace("Starting '%ls' in path '%ls'\n", FileName, Path);
@@ -63,16 +64,16 @@ StartChild(char **argv)
     RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
     StartupInfo.cb = sizeof(StartupInfo);
 
-    Success = CreateProcess(FileName,
-                            CommandLine,
-                            NULL,
-                            NULL,
-                            FALSE,
-                            0,
-                            NULL,
-                            NULL,
-                            &StartupInfo,
-                            &ProcessInfo);
+    Success = CreateProcessW(FileName,
+                             CommandLine,
+                             NULL,
+                             NULL,
+                             FALSE,
+                             0,
+                             NULL,
+                             NULL,
+                             &StartupInfo,
+                             &ProcessInfo);
     if (!Success)
     {
         skip("CreateProcess failed with %lu\n", GetLastError());
@@ -113,7 +114,7 @@ TestGetModuleFileNameW(VOID)
     ok(Length < sizeof(Buffer) / sizeof(WCHAR), "Length = %lu\n", Length);
     ok(Buffer[Length] == 0, "Buffer not null terminated\n");
     Relative = PathIsRelativeW(Buffer);
-    ok(Relative == FALSE, "GetModuleFileNameA returned relative path: %ls\n", Buffer);
+    ok(Relative == FALSE, "GetModuleFileNameW returned relative path: %ls\n", Buffer);
 }
 
 START_TEST(GetModuleFileName)