+ static bool IsAtLeastWin2kSP4()
+ {
+#ifdef __WXWINCE__
+ return false;
+#else
+ static int s_isAtLeastWin2kSP4 = -1;
+
+ if ( s_isAtLeastWin2kSP4 == -1 )
+ {
+ OSVERSIONINFOEX ver;
+
+ memset(&ver, 0, sizeof(ver));
+ ver.dwOSVersionInfoSize = sizeof(ver);
+ GetVersionEx((OSVERSIONINFO*)&ver);
+
+ s_isAtLeastWin2kSP4 =
+ ((ver.dwMajorVersion > 5) || // Vista+
+ (ver.dwMajorVersion == 5 && ver.dwMinorVersion > 0) || // XP/2003
+ (ver.dwMajorVersion == 5 && ver.dwMinorVersion == 0 &&
+ ver.wServicePackMajor >= 4)) // 2000 SP4+
+ ? 1 : 0;
+ }
+
+ return s_isAtLeastWin2kSP4 == 1;
+#endif
+ }
+
+ virtual const char *GetMBNul(size_t *nulLen) const
+ {
+ if ( m_nulLen == (size_t)-2 )
+ {
+ wxMBConv_win32 * const self = wxConstCast(this, wxMBConv_win32);
+
+ self->m_nulLen = ::WideCharToMultiByte
+ (
+ m_CodePage, // code page
+ 0, // no flags
+ L"", // input string
+ 1, // translate just NUL
+ self->m_nulBuf, // output buffer
+ WXSIZEOF(m_nulBuf), // and its size
+ NULL, // "replacement" char
+ NULL // [out] was it used?
+ );
+
+ if ( m_nulLen == 0 )
+ self->m_nulLen = (size_t)-1;
+ }
+
+ *nulLen = m_nulLen;
+ return m_nulBuf;
+ }
+