[togo] Add Windows To Go support - part 2

* Closes #126
* Only supported on Windows 8 or later for now
* Also fix MinGW and WDK compilation issues
This commit is contained in:
Pete Batard 2015-01-16 01:51:24 +00:00
parent 295650a8b4
commit 032d4413c8
17 changed files with 251 additions and 70 deletions

View file

@ -506,9 +506,9 @@ static __inline int SHDeleteDirectoryExU(HWND hwnd, const char* pszPath, FILEOP_
// which is always expected to be larger than our UTF-16 one, and add 2 chars for good measure.
size_t wpszPath_len = strlen(pszPath) + 2;
wchar_t* wpszPath = (wchar_t*)calloc(wpszPath_len, sizeof(wchar_t));
SHFILEOPSTRUCTW shfo = { hwnd, FO_DELETE, wpszPath, NULL, fFlags, FALSE, NULL, NULL };
utf8_to_wchar_no_alloc(pszPath, wpszPath, wpszPath_len);
// FOF_SILENT | FOF_NOERRORUI | FOF_NOCONFIRMATION,
SHFILEOPSTRUCTW shfo = { hwnd, FO_DELETE, wpszPath, NULL, fFlags, FALSE, NULL, NULL };
ret = SHFileOperationW(&shfo);
wfree(pszPath);
return ret;