Commit 85b689eb authored by Cezar Elnazli's avatar Cezar Elnazli Committed by Jean-Baptiste Kempf

Cosmetic: Max 78 chars/line (bin/winvlc.c)

Reformat bin/winvlc.c so that no lines are longer than 78 characters.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 62fb76aa
...@@ -142,7 +142,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ...@@ -142,7 +142,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
mySetProcessDEPPolicy(PROCESS_DEP_ENABLE); mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
/* Do NOT load any library from cwd. */ /* Do NOT load any library from cwd. */
mySetDllDirectoryA = (BOOL WINAPI (*)(const char*)) GetProcAddress(h_Kernel32, "SetDllDirectoryA"); mySetDllDirectoryA = (BOOL WINAPI (*)(const char*))
GetProcAddress(h_Kernel32, "SetDllDirectoryA");
if(mySetDllDirectoryA) if(mySetDllDirectoryA)
mySetDllDirectoryA(""); mySetDllDirectoryA("");
...@@ -234,31 +235,38 @@ static void check_crashdump(void) ...@@ -234,31 +235,38 @@ static void check_crashdump(void)
if(answer == IDYES) if(answer == IDYES)
{ {
HINTERNET Hint = InternetOpen(L"VLC Crash Reporter", INTERNET_OPEN_TYPE_PRECONFIG, NULL,NULL,0); HINTERNET Hint = InternetOpen(L"VLC Crash Reporter",
INTERNET_OPEN_TYPE_PRECONFIG, NULL,NULL,0);
if(Hint) if(Hint)
{ {
HINTERNET ftp = InternetConnect(Hint, L"crash.videolan.org", INTERNET_DEFAULT_FTP_PORT, HINTERNET ftp = InternetConnect(Hint, L"crash.videolan.org",
NULL, NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); INTERNET_DEFAULT_FTP_PORT, NULL, NULL
INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if(ftp) if(ftp)
{ {
SYSTEMTIME now; SYSTEMTIME now;
GetSystemTime(&now); GetSystemTime(&now);
wchar_t remote_file[MAX_PATH]; wchar_t remote_file[MAX_PATH];
swprintf( remote_file, L"/crashes-win32/%04d%02d%02d%02d%02d%02d", swprintf(remote_file,
now.wYear, now.wMonth, now.wDay, now.wHour, now.wMinute, now.wSecond ); L"/crashes-win32/%04d%02d%02d%02d%02d%02d",
now.wYear, now.wMonth, now.wDay, now.wHour,
if( FtpPutFile( ftp, crashdump_path, remote_file, FTP_TRANSFER_TYPE_BINARY, 0) ) now.wMinute, now.wSecond );
MessageBox( NULL, L"Report sent correctly. Thanks a lot for the help.",
L"Report sent", MB_OK); if( FtpPutFile( ftp, crashdump_path, remote_file,
FTP_TRANSFER_TYPE_BINARY, 0) )
MessageBox( NULL, L"Report sent correctly. Thanks a lot \
for the help.", L"Report sent", MB_OK);
else else
MessageBox( NULL, L"There was an error while transferring to the FTP server. "\ MessageBox( NULL, L"There was an error while \
transferring to the FTP server. "\
"Thanks a lot for the help anyway.", "Thanks a lot for the help anyway.",
L"Report sending failed", MB_OK); L"Report sending failed", MB_OK);
InternetCloseHandle(ftp); InternetCloseHandle(ftp);
} }
else else
{ {
MessageBox( NULL, L"There was an error while connecting to the FTP server. "\ MessageBox( NULL, L"There was an error while connecting to \
the FTP server. "\
"Thanks a lot for the help anyway.", "Thanks a lot for the help anyway.",
L"Report sending failed", MB_OK); L"Report sending failed", MB_OK);
fprintf(stderr,"Can't connect to FTP server 0x%08lu\n", fprintf(stderr,"Can't connect to FTP server 0x%08lu\n",
...@@ -268,7 +276,8 @@ static void check_crashdump(void) ...@@ -268,7 +276,8 @@ static void check_crashdump(void)
} }
else else
{ {
MessageBox( NULL, L"There was an error while connecting to Internet. "\ MessageBox( NULL, L"There was an error while connecting to the \
Internet. "\
"Thanks a lot for the help anyway.", "Thanks a lot for the help anyway.",
L"Report sending failed", MB_OK); L"Report sending failed", MB_OK);
} }
...@@ -284,7 +293,8 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo) ...@@ -284,7 +293,8 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
{ {
if(IsDebuggerPresent()) if(IsDebuggerPresent())
{ {
//If a debugger is present, pass the exception to the debugger with EXCEPTION_CONTINUE_SEARCH //If a debugger is present, pass the exception to the debugger
//with EXCEPTION_CONTINUE_SEARCH
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
} }
else else
...@@ -304,17 +314,17 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo) ...@@ -304,17 +314,17 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
GetVersionEx( &osvi ); GetVersionEx( &osvi );
fwprintf( fd, L"[version]\nOS=%d.%d.%d.%d.%s\nVLC=" VERSION_MESSAGE, osvi.dwMajorVersion, fwprintf( fd, L"[version]\nOS=%d.%d.%d.%d.%s\nVLC=" VERSION_MESSAGE,
osvi.dwMinorVersion, osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber,
osvi.dwBuildNumber, osvi.dwPlatformId, osvi.szCSDVersion);
osvi.dwPlatformId,
osvi.szCSDVersion); const CONTEXT *const pContext = (const CONTEXT *)
lpExceptionInfo->ContextRecord;
const CONTEXT *const pContext = (const CONTEXT *)lpExceptionInfo->ContextRecord; const EXCEPTION_RECORD *const pException = (const EXCEPTION_RECORD *)
const EXCEPTION_RECORD *const pException = (const EXCEPTION_RECORD *)lpExceptionInfo->ExceptionRecord; lpExceptionInfo->ExceptionRecord;
/*No nested exceptions for now*/ /* No nested exceptions for now */
fwprintf( fd, L"\n\n[exceptions]\n%08x at %px",pException->ExceptionCode, fwprintf( fd, L"\n\n[exceptions]\n%08x at %px",
pException->ExceptionAddress ); pException->ExceptionCode, pException->ExceptionAddress );
for( unsigned int i = 0; i < pException->NumberParameters; i++ ) for( unsigned int i = 0; i < pException->NumberParameters; i++ )
fwprintf( fd, L" | %p", pException->ExceptionInformation[i] ); fwprintf( fd, L" | %p", pException->ExceptionInformation[i] );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment