X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1cb41536a6106968b546cdba8d3d89805f802bc..05ac7ac5785ef0ddb1bd04585f3c59c5d53089be:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index d9fcbb0033..66414baaa2 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -199,7 +199,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) if ( pHostEnt ) { - host = pHostEnt->h_name; + host = wxString::FromAscii(pHostEnt->h_name); } } } @@ -600,14 +600,16 @@ bool wxGetEnv(const wxString& var, wxString *value) { #ifdef __WIN16__ const wxChar* ret = wxGetenv(var); - if (ret) + if ( !ret ) + return FALSE; + + if ( value ) { *value = ret; - return TRUE; } - else - return FALSE; -#else + + return TRUE; +#else // Win32 // first get the size of the buffer DWORD dwRet = ::GetEnvironmentVariable(var, NULL, 0); if ( !dwRet ) @@ -623,7 +625,7 @@ bool wxGetEnv(const wxString& var, wxString *value) } return TRUE; -#endif +#endif // Win16/32 } bool wxSetEnv(const wxString& var, const wxChar *value) @@ -867,7 +869,7 @@ bool wxShell(const wxString& command) cmd.Printf(wxT("%s /c %s"), shell, command.c_str()); } - return wxExecute(cmd, TRUE /* sync */) != 0; + return wxExecute(cmd, wxEXEC_SYNC) == 0; } // Shutdown or reboot the PC @@ -883,6 +885,7 @@ bool wxShutdown(wxShutdownFlags wFlags) bOK = ::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken) != 0; +#ifndef __WXWINE__ if ( bOK ) { TOKEN_PRIVILEGES tkp; @@ -901,6 +904,7 @@ bool wxShutdown(wxShutdownFlags wFlags) // Cannot test the return value of AdjustTokenPrivileges. bOK = ::GetLastError() == ERROR_SUCCESS; } +#endif } if ( bOK )