[LT2013]
[reactos.git] / base / system / rundll32 / rundll32.c
index 065e165..be5b364 100644 (file)
@@ -4,13 +4,11 @@
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS rundll32.exe
- * FILE:            apps/utils/rundll32/rundll32.c
+ * FILE:            base/system/rundll32/rundll32.c
  * PURPOSE:         Run a DLL as a program
  * PROGRAMMER:      ShadowFlare (blakflare@hotmail.com)
  */
 
-#define WIN32_LEAN_AND_MEAN
-
 // Both UNICODE and _UNICODE must be either defined or undefined
 // because some headers use UNICODE and others use _UNICODE
 #ifdef UNICODE
 #endif
 #endif
 
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <malloc.h>
+#define WIN32_NO_STATUS
+#include <stdarg.h>
+#include <stdlib.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winnls.h>
+#include <winuser.h>
 #include <tchar.h>
+
 #include "resource.h"
 
 typedef int (WINAPI *DllWinMainW)(
@@ -341,7 +343,7 @@ int WINAPI _tWinMain(
     DllWinMainW fnDllWinMainW;
     DllWinMainA fnDllWinMainA;
     HWND hWindow;
-    int nRetVal,i;
+    int i;
     size_t nStrLen;
 
     // Get command-line in argc-argv format
@@ -379,8 +381,6 @@ int WINAPI _tWinMain(
     else
         lptCmdLine = _T("");
 
-    nRetVal = 0;
-
     // Everything is all setup, so load the dll now
     hDll = LoadLibrary(lptDllName);
     if (hDll) {
@@ -437,13 +437,13 @@ int WINAPI _tWinMain(
         if (fnDllWinMainW) {
             // Convert the command-line string to unicode and call the dll function
             lpwCmdLine = ConvertToWideChar(lptCmdLine);
-            nRetVal = fnDllWinMainW(hWindow,hInstance,lpwCmdLine,nCmdShow);
+            fnDllWinMainW(hWindow,hInstance,lpwCmdLine,nCmdShow);
             FreeConvertedWideChar(lpwCmdLine);
         }
         else if (fnDllWinMainA) {
             // Convert the command-line string to ansi and call the dll function
             lpaCmdLine = ConvertToMultiByte(lptCmdLine);
-            nRetVal = fnDllWinMainA(hWindow,hInstance,lpaCmdLine,nCmdShow);
+            fnDllWinMainA(hWindow,hInstance,lpaCmdLine,nCmdShow);
             FreeConvertedMultiByte(lpaCmdLine);
         }
         else {
@@ -476,6 +476,6 @@ int WINAPI _tWinMain(
     }
 
     if (argv) free(argv);
-    return nRetVal;
+    return 0; /* rundll32 always returns 0! */
 }