reSIProcate/rutil  9694
Classes | Defines | Functions | Variables
WinCompat.cxx File Reference
#include <Winsock2.h>
#include <Iphlpapi.h>
#include "rutil/GenericIPAddress.hxx"
#include "rutil/WinCompat.hxx"
#include "rutil/DnsUtil.hxx"
#include "rutil/Log.hxx"
#include "rutil/Logger.hxx"
#include "rutil/WinLeakCheck.hxx"
Include dependency graph for WinCompat.cxx:

Go to the source code of this file.

Classes

class  WinCompatInstanceCleaner

Defines

#define RESIPROCATE_SUBSYSTEM   Subsystem::TRANSPORT

Functions

static char * ConvertLPWSTRToLPSTR (LPWSTR lpwszStrIn)

Variables

class WinCompatInstanceCleaner winCompatInstanceCleaner

Define Documentation

#define RESIPROCATE_SUBSYSTEM   Subsystem::TRANSPORT

Definition at line 15 of file WinCompat.cxx.


Function Documentation

static char* ConvertLPWSTRToLPSTR ( LPWSTR  lpwszStrIn) [static]

Definition at line 18 of file WinCompat.cxx.

{
   LPSTR pszOut = NULL;
   if (lpwszStrIn != NULL)
   {
      int nInputStrLen = (int)wcslen(lpwszStrIn);

      // Double NULL Termination
      int nOutputStrLen = WideCharToMultiByte (CP_ACP, 0, lpwszStrIn, nInputStrLen, NULL, 0, 0, 0) + 2;
      pszOut = new char [nOutputStrLen];

      if (pszOut)
      {
         memset (pszOut, 0x00, nOutputStrLen);
         WideCharToMultiByte(CP_ACP, 0, lpwszStrIn, nInputStrLen, pszOut, nOutputStrLen, 0, 0);
      }
   }
   return pszOut;
}

Variable Documentation