Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.7 KiB

  1. #include "priv.h"
  2. int WinMainT(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow);
  3. extern "C" int _stdcall ModuleEntry(void)
  4. {
  5. int i;
  6. STARTUPINFOA si;
  7. LPTSTR pszCmdLine = GetCommandLine();
  8. //
  9. // We don't want the "No disk in drive X:" requesters, so we set
  10. // the critical error mask such that calls will just silently fail
  11. //
  12. SetErrorMode(SEM_FAILCRITICALERRORS);
  13. if ( *pszCmdLine == TEXT('\"') ) {
  14. /*
  15. * Scan, and skip over, subsequent characters until
  16. * another double-quote or a null is encountered.
  17. */
  18. while ( *++pszCmdLine && (*pszCmdLine
  19. != TEXT('\"')) );
  20. /*
  21. * If we stopped on a double-quote (usual case), skip
  22. * over it.
  23. */
  24. if ( *pszCmdLine == TEXT('\"') )
  25. pszCmdLine++;
  26. }
  27. else {
  28. while (*pszCmdLine > TEXT(' '))
  29. pszCmdLine++;
  30. }
  31. /*
  32. * Skip past any white space preceeding the second token.
  33. */
  34. while (*pszCmdLine && (*pszCmdLine <= TEXT(' '))) {
  35. pszCmdLine++;
  36. }
  37. si.dwFlags = 0;
  38. GetStartupInfoA(&si);
  39. i = WinMainT(GetModuleHandle(NULL), NULL, pszCmdLine,
  40. si.dwFlags & STARTF_USESHOWWINDOW ? si.wShowWindow : SW_SHOWDEFAULT);
  41. ExitThread(i); // We only come here when we are not the shell...
  42. return i;
  43. }
  44. //---------------------------------------------------------------------------
  45. int WinMainT(HINSTANCE hinst, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
  46. {
  47. return PackWizRunFromExe();
  48. }
  49. extern "C" int __cdecl _purecall(void) { return 0; }