[bb] generate a log report when bad blocks are found

* closes #6
This commit is contained in:
Pete Batard 2011-12-30 21:23:13 +00:00
parent 8db7e1720a
commit d27e73137d
5 changed files with 91 additions and 18 deletions

View file

@ -159,6 +159,20 @@ static __inline HWND CreateWindowU(char* lpClassName, char* lpWindowName,
return ret;
}
static __inline int MessageBoxU(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
{
int ret;
DWORD err = ERROR_INVALID_DATA;
wconvert(lpText);
wconvert(lpCaption);
ret = MessageBoxW(hWnd, wlpText, wlpCaption, uType);
err = GetLastError();
wfree(lpText);
wfree(lpCaption);
SetLastError(err);
return ret;
}
static __inline int GetWindowTextU(HWND hWnd, char* lpString, int nMaxCount)
{
int ret = 0;
@ -579,6 +593,16 @@ static __inline FILE* fopenU(const char* filename, const char* mode)
return ret;
}
// returned UTF-8 string must be freed
static __inline char* getenvU(const char* varname)
{
wconvert(varname);
char* ret;
ret = wchar_to_utf8(_wgetenv(wvarname));
wfree(varname);
return ret;
}
#ifdef __cplusplus
}
#endif