Compare commits

...

2 Commits

Author SHA1 Message Date
TheTank20 38f6894e94 general fixes 2025-05-07 20:36:34 -04:00
TheTank20 3955009541 accidentally used a Vista+ function xDDDDDD 2025-05-07 20:33:47 -04:00
1 changed files with 6 additions and 10 deletions

View File

@ -532,7 +532,7 @@ static BSTR XP_GetWPALeft() {
return SysAllocString(L"An error occurred at GetWPALeft: Windows is activated"); return SysAllocString(L"An error occurred at GetWPALeft: Windows is activated");
} }
wchar_t buffer[16]; wchar_t buffer[16];
swprintf_s(buffer, 16, L"%lu", dwWPALeft); swprintf(buffer, L"%lu", dwWPALeft);
return SysAllocString(buffer); return SysAllocString(buffer);
} }
@ -559,7 +559,7 @@ static BSTR XP_GetEvalLeft() {
return SysAllocString(L"An error occurred at GetEvalLeft: Not an evaluation copy"); return SysAllocString(L"An error occurred at GetEvalLeft: Not an evaluation copy");
} }
wchar_t buffer[16]; wchar_t buffer[16];
swprintf_s(buffer, 16, L"%lu", dwWPALeft); swprintf(buffer, L"%lu", dwWPALeft);
return SysAllocString(buffer); return SysAllocString(buffer);
} }
@ -734,7 +734,7 @@ static BSTR O2003_VerifyCheckDigits(BSTR cidChunk) {
std::wstring result = error + numberStr; std::wstring result = error + numberStr;
wchar_t buffer[100]; wchar_t buffer[100];
swprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), L"%s 0x%X %d", error, status, pbValue); swprintf(buffer, std::size(buffer), L"%s 0x%X %d", error, status, pbValue);
return SysAllocString(buffer); return SysAllocString(buffer);
} }
@ -835,13 +835,9 @@ int main(int argc, char* argv[])
if (cmdOptionExists(argv, argv + argc, "--Office2003")) { if (cmdOptionExists(argv, argv + argc, "--Office2003")) {
#ifdef ENVIRONMENT32 #ifdef ENVIRONMENT32
if (cmdOptionExists(argv, argv + argc, "--BypassInstallCheck")) { if (cmdOptionExists(argv, argv + argc, "--BypassInstallCheck") || RegistryKeyExists(HKEY_CLASSES_ROOT, "CLSID\\{000C0114-0000-0000-C000-000000000046}")) {
specifiedProduct = "Office2003"; specifiedProduct = "Office2003";
} } else {
else if (RegistryKeyExists(HKEY_CLASSES_ROOT, "CLSID\\{000C0114-0000-0000-C000-000000000046}")) {
specifiedProduct = "Office2003";
}
else {
std::cout << "An error occurred at RegistryKeyExists: Office 2003 isn't detected (specifically, it's COM Module, responsible for activation). Please (re)install Office 2003, since you wouldn't be able to activate via the GUI anyway."; std::cout << "An error occurred at RegistryKeyExists: Office 2003 isn't detected (specifically, it's COM Module, responsible for activation). Please (re)install Office 2003, since you wouldn't be able to activate via the GUI anyway.";
return 0; return 0;
} }