llvm.org GIT mirror llvm / 00fb6ab
Explicitly specify the ANSI version of these Win32 APIs. While these are seemingly unrelated changes, they are all NFC because we currently default to the ANSI versions of the APIs when building for Windows. This simply makes the ANSI usage explicit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273564 91177308-0d34-0410-b5e6-96231b3b80d8 Aaron Ballman 4 years ago
3 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
587587 /// \returns a valid HKEY if the location exists, else NULL.
588588 static HKEY FindWERKey(const llvm::Twine &RegistryLocation) {
589589 HKEY Key;
590 if (ERROR_SUCCESS != ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,
591 RegistryLocation.str().c_str(), 0,
592 KEY_QUERY_VALUE | KEY_READ, &Key))
590 if (ERROR_SUCCESS != ::RegOpenKeyExA(HKEY_LOCAL_MACHINE,
591 RegistryLocation.str().c_str(), 0,
592 KEY_QUERY_VALUE | KEY_READ, &Key))
593593 return NULL;
594594
595595 return Key;
6767 Mask) != FALSE;
6868 }
6969
70 inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) {
70 inline bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix) {
7171 if (!ErrMsg)
7272 return true;
7373 char *buffer = NULL;
7474 DWORD LastError = GetLastError();
75 DWORD R = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
76 FORMAT_MESSAGE_FROM_SYSTEM |
77 FORMAT_MESSAGE_MAX_WIDTH_MASK,
78 NULL, LastError, 0, (LPSTR)&buffer, 1, NULL);
75 DWORD R = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
76 FORMAT_MESSAGE_FROM_SYSTEM |
77 FORMAT_MESSAGE_MAX_WIDTH_MASK,
78 NULL, LastError, 0, (LPSTR)&buffer, 1, NULL);
7979 if (R)
8080 *ErrMsg = prefix + ": " + buffer;
8181 else
336336 errs() << ToolName << ": Program Image Path: " << ProgramToRun << '\n'
337337 << ToolName << ": Command Line: " << CommandLine << '\n';
338338
339 STARTUPINFO StartupInfo;
339 STARTUPINFOA StartupInfo;
340340 PROCESS_INFORMATION ProcessInfo;
341341 std::memset(&StartupInfo, 0, sizeof(StartupInfo));
342342 StartupInfo.cb = sizeof(StartupInfo);