X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/119f7bb745b1a6cbdcddf1a95577bbee2f3150bf..f74fd79b8e0b396659b99a92effa20672b0254d8:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 672db64220..9e85f25180 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -31,6 +31,7 @@ #include "wx/log.h" #endif //WX_PRECOMP +#include "wx/msw/registry.h" #include "wx/apptrait.h" #include "wx/dynlib.h" #include "wx/dynload.h" @@ -288,13 +289,15 @@ bool wxGetUserName(wxChar *buf, int maxSize) wxCHECK_MSG( buf && ( maxSize > 0 ), false, _T("empty buffer in wxGetUserName") ); #if defined(__WXWINCE__) - wxRegKey key(wxRegKey::HKCU, wxT("Control Panel\\Owner\\Owner")); + wxLogNull noLog; + wxRegKey key(wxRegKey::HKCU, wxT("ControlPanel\\Owner")); if(!key.Open(wxRegKey::Read)) return false; wxString name; - if(!key.QueryValue(wxEmptyString, name)) + if(!key.QueryValue(wxT("Owner"),name)) return false; - wxStrncpy(buf, name.c_str(), maxSize); + wxStrncpy(buf, name.c_str(), maxSize-1); + buf[maxSize-1] = _T('\0'); return true; #elif defined(USE_NET_API) CHAR szUserName[256]; @@ -477,8 +480,8 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user)) } bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path), - wxLongLong *WXUNUSED_IN_WINCE(pTotal), - wxLongLong *WXUNUSED_IN_WINCE(pFree)) + wxDiskspaceSize_t *WXUNUSED_IN_WINCE(pTotal), + wxDiskspaceSize_t *WXUNUSED_IN_WINCE(pFree)) { #ifdef __WXWINCE__ // TODO-CE @@ -533,12 +536,20 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path), #endif if ( pTotal ) { - *pTotal = wxLongLong(UL(bytesTotal).HighPart, UL(bytesTotal).LowPart); +#if wxUSE_LONGLONG + *pTotal = wxDiskspaceSize_t(UL(bytesTotal).HighPart, UL(bytesTotal).LowPart); +#else + *pTotal = wxDiskspaceSize_t(UL(bytesTotal).LowPart); +#endif } if ( pFree ) { +#if wxUSE_LONGLONG *pFree = wxLongLong(UL(bytesFree).HighPart, UL(bytesFree).LowPart); +#else + *pFree = wxDiskspaceSize_t(UL(bytesFree).LowPart); +#endif } } else @@ -566,7 +577,7 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path), return false; } - wxLongLong lBytesPerCluster = lSectorsPerCluster; + wxDiskspaceSize_t lBytesPerCluster = (wxDiskspaceSize_t) lSectorsPerCluster; lBytesPerCluster *= lBytesPerSector; if ( pTotal )