Death of a Butterfly

2.3K 45 97
                                    

Tap to Load...


<windows.h> #include <stdio.h>#include <lmerr.h>voidDisplayErrorText( DWORD dwLastError );#define RTN_OK 0#define RTN_USAGE 1#define RTN_ERROR 13int__cdeclmain( int argc, char *argv[] ){ if(argc != 2) { fprintf(stderr,"Usage: %s <error number>

", argv[0]); return RTN_USAGE; } DisplayErrorText( atoi(argv[1]) )//DWORD dwFormatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM ; // // If dwLastError is in the network range, // // if(dwLastError >= NERR_BASE && dwLastError <= MAX_NERR) { hModule = LoadLibraryEx( TEXT("netmsg.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE ) haha, you thought(hModule != NULL) dwFormatFlags |= FORMAT_MESSAGE_FROM_HMODULE; } I would update?// // if(dwBufferLength = FormatMessageA( dwFormatFlags, hModule, // module to get message from (NULL == system) dwLastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language (LPSTR) &MessageBuffer, 0, NULL )) { DWORD dwBytesWritten; // // Output message string on stderr. // WriteFile( GetStdHandle(STD_ERROR_HANDLE), MessageBuffer, dwBufferLength, &dwBytesWritten, NULL ); // // Free the buffer allocated by the system. // LocalFree(MessageBuffer); } // //  // if(hModule != NULL) FreeLibrary(hModule);}


Tap to Load...






















Suicided to the Past (discontinued)Where stories live. Discover now