X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bin%2Fwinvlc.c;h=b91cea1a791b845ab38f4853a35f2341a36465fe;hb=c60652e38ac6afd74bd8225e9dae5406f13aaa4f;hp=874116035847621e195a4aae3262b5224efe6ac8;hpb=4675f892ad1e6262b981f7618ede09b4c82205ab;p=vlc diff --git a/bin/winvlc.c b/bin/winvlc.c index 8741160358..b91cea1a79 100644 --- a/bin/winvlc.c +++ b/bin/winvlc.c @@ -46,11 +46,6 @@ static void check_crashdump(void); LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo); # endif -typedef enum _HEAP_INFORMATION_CLASS { - HeapCompatibilityInformation, - HeapEnableTerminationOnCorruption -} HEAP_INFORMATION_CLASS; -WINBASEAPI BOOL WINAPI HeapSetInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T); #define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1 #endif @@ -123,9 +118,23 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, #endif int nCmdShow ) { - int argc, ret; + int argc; #ifndef UNDER_CE HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); + + HINSTANCE h_Kernel32 = LoadLibraryW(L"kernel32.dll"); + if(h_Kernel32) + { + BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags); +# define PROCESS_DEP_ENABLE 1 + + mySetProcessDEPPolicy = (BOOL WINAPI (*)(DWORD)) + GetProcAddress(h_Kernel32, "SetProcessDEPPolicy"); + if(mySetProcessDEPPolicy) + mySetProcessDEPPolicy(PROCESS_DEP_ENABLE); + FreeLibrary(h_Kernel32); + } + wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc); if (wargv == NULL) return 1; @@ -169,12 +178,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, argc = parse_cmdline (psz_cmdline, &argv); #endif - libvlc_exception_t ex; - libvlc_exception_init (&ex); - /* Initialize libvlc */ libvlc_instance_t *vlc; - vlc = libvlc_new (argc, (const char **)argv, &ex); + vlc = libvlc_new (argc, (const char **)argv); if (vlc != NULL) { libvlc_add_intf (vlc, "globalhotkeys,none"); @@ -184,14 +190,11 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, libvlc_release (vlc); } - ret = libvlc_exception_raised (&ex); - libvlc_exception_clear (&ex); - for (int i = 0; i < argc; i++) free (argv[i]); (void)hInstance; (void)hPrevInstance; (void)lpCmdLine; (void)nCmdShow; - return ret; + return 0; } #if !defined( UNDER_CE ) && !defined( _WIN64 )