mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-31 06:48:26 -04:00
[appstore] add AppStore version detection
* Also make sure we don't include appstore.listing.csv in the app and remove unneeded call to GetModuleHandle() in pki.c.
This commit is contained in:
parent
b3daef6a67
commit
1062dde076
7 changed files with 65 additions and 49 deletions
|
@ -571,13 +571,23 @@ static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE l
|
|||
return ret;
|
||||
}
|
||||
|
||||
// A UTF-8 alternative to MS GetCurrentDirectory() since the latter is useless for
|
||||
// apps installed from the App Store...
|
||||
static __inline DWORD GetCurrentDirectoryU(DWORD nBufferLength, char* lpBuffer)
|
||||
{
|
||||
DWORD ret = 0, err = ERROR_INVALID_DATA;
|
||||
DWORD i, ret = 0, err = ERROR_INVALID_DATA;
|
||||
// coverity[returned_null]
|
||||
walloc(lpBuffer, nBufferLength);
|
||||
ret = GetCurrentDirectoryW(nBufferLength, wlpBuffer);
|
||||
ret = GetModuleFileNameW(NULL, wlpBuffer, nBufferLength);
|
||||
err = GetLastError();
|
||||
if (ret > 0) {
|
||||
for (i = ret - 1; i > 0; i--) {
|
||||
if (wlpBuffer[i] == L'\\') {
|
||||
wlpBuffer[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferLength)) == 0)) {
|
||||
err = GetLastError();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue