X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_open.c;h=a6ac387c8842dc1f476c376ac37d7f213554ade4;hb=4955ba67ce17eb49d6ac19668d140ade0b501b06;hp=bfdb8975c49bfb9726306749e7a1a1444670f390;hpb=cc343a7e1383e2f6b8309cb7cb36ab8250586cb4;p=pdclib.old diff --git a/platform/win32/functions/_PDCLIB/_PDCLIB_open.c b/platform/win32/functions/_PDCLIB/_PDCLIB_open.c index bfdb897..a6ac387 100644 --- a/platform/win32/functions/_PDCLIB/_PDCLIB_open.c +++ b/platform/win32/functions/_PDCLIB/_PDCLIB_open.c @@ -59,6 +59,21 @@ HANDLE _PDCLIB_open( char const * const filename, unsigned int mode ) NULL, creationDisposition, FILE_ATTRIBUTE_NORMAL, NULL); if(fd == INVALID_HANDLE_VALUE) { +#if 0 + DWORD dw = GetLastError(); + char* msgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR) &msgBuf, + 0, NULL ); + + fprintf(stderr, "Error: %s\n", msgBuf); +#endif _PDCLIB_w32errno(); return NULL; }