Skip to content

Commit

Permalink
To future me
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Oct 1, 2018
1 parent 741942e commit 6daf749
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rescle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -883,14 +883,16 @@ BOOL CALLBACK ResourceUpdater::OnEnumResourceManifest(HMODULE hModule, LPCTSTR l
HGLOBAL hResData = LoadResource(hModule, hResInfo);
const BYTE *pResource = (const BYTE *)LockResource(hResData);

// FIXME(zcbenz): Do a real UTF string convertion.
int len = strlen(reinterpret_cast<const char*>(pResource));
std::wstring manifestStringLocal(pResource, pResource + len);


// FIXME(zcbenz): Strip the BOM instead of doing string search.
size_t start = manifestStringLocal.find(L"<?xml");
if (start > 0) {
manifestStringLocal = manifestStringLocal.substr(start);
}

size_t found = manifestStringLocal.find(L"requestedExecutionLevel");
size_t end = manifestStringLocal.find(L"uiAccess");

Expand Down

0 comments on commit 6daf749

Please sign in to comment.