Int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWChar lpCmdLine, Int nCmdShow) { Int Result; UNREFERENCED_PARAMETER(hInstance); UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); UNREFERENCED_PARAMETER(nCmdShow); g_HeapHandle = RtlCreateHeap(0, NULL, 0, 0, NULL, NULL); // MyLib_Initialize(); /* WChar end; lpCmdLine = GetCommandLineW(); end = *lpCmdLine++ == '\"' ? '\"' : ' '; while (*lpCmdLine && *lpCmdLine != end) ++lpCmdLine; if (*++lpCmdLine) { while (*lpCmdLine == ' ' || *lpCmdLine == '\t') ++lpCmdLine; } */ Result = WinMain2(/*GetModuleHandleW*/(NULL), 0, lpCmdLine, SW_SHOWDEFAULT); RtlDestroyHeap(g_HeapHandle); // MyLib_UnInitialize(); NtTerminateProcess(NtCurrentProcess(), Result); }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, #ifdef UNDER_CE LPWSTR #else LPSTR #endif /* lpCmdLine */, int /* nCmdShow */) { g_hInstance = (HINSTANCE)hInstance; NT_CHECK try { return WinMain2(); } catch(const CNewException &) { ErrorMessageForHRESULT(E_OUTOFMEMORY); return NExitCode::kMemoryError; } catch(...) { ShowErrorMessage(kUnknownExceptionMessage); return NExitCode::kFatalError; } }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int /* nCmdShow */) { g_hInstance = (HINSTANCE)hInstance; #ifndef _UNICODE g_IsNT = IsItWindowsNT(); #endif try { return WinMain2(); } catch(const CNewException &) { ErrorMessageForHRESULT(E_OUTOFMEMORY); return NExitCode::kMemoryError; } catch(...) { ShowErrorMessage(kUnknownExceptionMessage); return NExitCode::kFatalError; } }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { lpCmdLine = GetCommandLine() + 1; while (*lpCmdLine != '"') ++lpCmdLine; ExitProcess(WinMain2(GetModuleHandleA(NULL), 0, ++lpCmdLine, SW_SHOWDEFAULT)); }