[CSCRIPT][WSCRIPT] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / base / applications / cmdutils / wscript / main.c
index 0923c33..0191b5a 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "wscript.h"
+#include <stdarg.h>
+
+#define COBJMACROS
+#ifdef __REACTOS__
+#define CONST_VTABLE
+#endif
 
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
+#include <ole2.h>
 #include <shellapi.h>
 #include <activscp.h>
+#include <initguid.h>
+
+#include "wscript.h"
+
+#include <wine/debug.h>
+#include <wine/unicode.h>
 
 #ifdef _WIN64
 
@@ -35,6 +50,8 @@
 
 #endif
 
+WINE_DEFAULT_DEBUG_CHANNEL(wscript);
+
 static const WCHAR wscriptW[] = {'W','S','c','r','i','p','t',0};
 static const WCHAR wshW[] = {'W','S','H',0};
 WCHAR scriptFullName[MAX_PATH];
@@ -174,7 +191,7 @@ static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless(IActiveScriptSiteWin
     return S_OK;
 }
 
-static IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl = {
+static const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl = {
     ActiveScriptSiteWindow_QueryInterface,
     ActiveScriptSiteWindow_AddRef,
     ActiveScriptSiteWindow_Release,
@@ -412,11 +429,11 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
 
     WINE_TRACE("(%p %p %s %x)\n", hInst, hPrevInst, wine_dbgstr_w(cmdline), cmdshow);
 
-    argv = CommandLineToArgvW(cmdline, &argc);
+    argv = CommandLineToArgvW(GetCommandLineW(), &argc);
     if(!argv)
         return 1;
 
-    for(i=0; i<argc; i++) {
+    for(i=1; i<argc; i++) {
         if(*argv[i] == '/' || *argv[i] == '-') {
             if(!set_host_properties(argv[i]))
                 return 1;