X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/011a524e9e60a28719f34b1f78d40e35a08a41a8..00dd3b1897bd74276234f449f68e3f0805eb77dc:/src/msw/utils.cpp?ds=sidebyside diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 047ef9a22e..986e6602bf 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -48,7 +48,7 @@ #include "wx/timer.h" -#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__) +#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__) #include #ifndef __MWERKS__ @@ -78,8 +78,10 @@ #include #endif // USE_NET_API -#if defined(__WIN32__) && !defined(__WXWINE__) && !defined(__WXMICROWIN__) - #include +#if defined(__WIN32__) && !defined(__WXMICROWIN__) + #ifndef __UNIX__ + #include + #endif #ifndef __GNUWIN32__ #include @@ -199,7 +201,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) if ( pHostEnt ) { - host = pHostEnt->h_name; + host = wxString::FromAscii(pHostEnt->h_name); } } } @@ -600,14 +602,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 +627,7 @@ bool wxGetEnv(const wxString& var, wxString *value) } return TRUE; -#endif +#endif // Win16/32 } bool wxSetEnv(const wxString& var, const wxChar *value) @@ -660,6 +664,8 @@ struct wxFindByPidParams // the PID we're looking from DWORD pid; + + DECLARE_NO_COPY_CLASS(wxFindByPidParams) }; // wxKill helper: EnumWindows() callback which is used to find the first (top @@ -883,7 +889,6 @@ bool wxShutdown(wxShutdownFlags wFlags) bOK = ::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken) != 0; -#ifndef __WXWINE__ if ( bOK ) { TOKEN_PRIVILEGES tkp; @@ -902,7 +907,6 @@ bool wxShutdown(wxShutdownFlags wFlags) // Cannot test the return value of AdjustTokenPrivileges. bOK = ::GetLastError() == ERROR_SUCCESS; } -#endif } if ( bOK )