Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

oemxlate.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

BOOL WINAPI CharToOemA (LPCSTR pSrc, LPSTR pDst)
BOOL WINAPI CharToOemBuffA (LPCSTR pSrc, LPSTR pDst, DWORD nLength)
BOOL WINAPI OemToCharA (LPCSTR pSrc, LPSTR pDst)
BOOL WINAPI OemToCharBuffA (LPCSTR pSrc, LPSTR pDst, DWORD nLength)
BOOL WINAPI CharToOemW (LPCWSTR pSrc, LPSTR pDst)
BOOL WINAPI CharToOemBuffW (LPCWSTR pSrc, LPSTR pDst, DWORD nLength)
BOOL WINAPI OemToCharW (LPCSTR pSrc, LPWSTR pDst)
BOOL WINAPI OemToCharBuffW (LPCSTR pSrc, LPWSTR pDst, DWORD nLength)
DWORD WINAPI OemKeyScan (WORD wOemChar)


Function Documentation

BOOL WINAPI CharToOemA LPCSTR  pSrc,
LPSTR  pDst
 

Definition at line 33 of file oemxlate.c.

References tagSERVERINFO::acAnsiToOem, BOOL, FALSE, gpsi, NULL, and TRUE.

00036 { 00037 UserAssert(gpsi); 00038 00039 if (pSrc == NULL || pDst == NULL) { 00040 return FALSE; 00041 } 00042 00043 do { 00044 *pDst++ = gpsi->acAnsiToOem[(UCHAR)*pSrc]; 00045 } while (*pSrc++); 00046 00047 return TRUE; 00048 }

BOOL WINAPI CharToOemBuffA LPCSTR  pSrc,
LPSTR  pDst,
DWORD  nLength
 

Definition at line 59 of file oemxlate.c.

References tagSERVERINFO::acAnsiToOem, BOOL, FALSE, gpsi, NULL, and TRUE.

Referenced by ECInsertText().

00063 { 00064 UserAssert(gpsi); 00065 00066 if (pSrc == NULL || pDst == NULL) { 00067 return FALSE; 00068 } 00069 00070 while (nLength--) { 00071 *pDst++ = gpsi->acAnsiToOem[(UCHAR)*pSrc++]; 00072 } 00073 00074 return TRUE; 00075 }

BOOL WINAPI CharToOemBuffW LPCWSTR  pSrc,
LPSTR  pDst,
DWORD  nLength
 

Definition at line 182 of file oemxlate.c.

References BOOL, FALSE, NULL, and TRUE.

Referenced by ECInsertText().

00186 { 00187 if (pSrc == NULL || pDst == NULL) { 00188 return FALSE; 00189 } else if (pSrc == (LPCWSTR)pDst) { 00190 /* 00191 * WideCharToMultiByte() requires pSrc != pDst: fail this call. 00192 * LATER: Is this really true? 00193 */ 00194 return FALSE; 00195 } 00196 00197 WideCharToMultiByte( 00198 CP_OEMCP, // Unicode -> OEM 00199 0, // gives best visual match 00200 (LPWSTR)pSrc, (int)nLength, // source & length 00201 pDst, // dest 00202 (int)nLength * 2, // max poss. length (DBCS may * 2) 00203 "_", // default char 00204 NULL); // (don't care whether defaulted) 00205 00206 return TRUE; 00207 }

BOOL WINAPI CharToOemW LPCWSTR  pSrc,
LPSTR  pDst
 

Definition at line 144 of file oemxlate.c.

References BOOL, FALSE, NULL, and TRUE.

00147 { 00148 int cch; 00149 if (pSrc == NULL || pDst == NULL) { 00150 return FALSE; 00151 } else if (pSrc == (LPCWSTR)pDst) { 00152 /* 00153 * WideCharToMultiByte() requires pSrc != pDst: fail this call. 00154 * LATER: Is this really true? 00155 */ 00156 return FALSE; 00157 } 00158 00159 cch = wcslen(pSrc) + 1; 00160 00161 WideCharToMultiByte( 00162 CP_OEMCP, // Unicode -> OEM 00163 0, // gives best visual match 00164 (LPWSTR)pSrc, cch, // source & length 00165 pDst, // dest 00166 cch * 2, // max poss.length (DBCS may * 2) 00167 "_", // default char 00168 NULL); // (don't care whether defaulted) 00169 00170 return TRUE; 00171 }

DWORD WINAPI OemKeyScan WORD  wOemChar  ) 
 

Definition at line 288 of file oemxlate.c.

References DWORD, LOBYTE, OemToCharBuffW(), SHORT, UINT, and VkKeyScanW.

00290 { 00291 WCHAR wchOem; 00292 SHORT sVk; 00293 UINT dwRet; 00294 00295 #ifdef FE_SB // OemKeyScan() 00296 /* 00297 * Return 0xFFFFFFFF for DBCS LeadByte character. 00298 */ 00299 if (IsDBCSLeadByte(LOBYTE(wOemChar))) { 00300 return 0xFFFFFFFF; 00301 } 00302 #endif // FE_SB 00303 00304 if (!OemToCharBuffW((LPCSTR)&wOemChar, &wchOem, 1)) { 00305 return 0xFFFFFFFF; 00306 } 00307 00308 sVk = VkKeyScanW(wchOem); 00309 if ((dwRet = MapVirtualKeyW(LOBYTE(sVk), 0)) == 0) { 00310 return 0xFFFFFFFF; 00311 } 00312 return dwRet | ((sVk & 0xFF00) << 8); 00313 }

BOOL WINAPI OemToCharA LPCSTR  pSrc,
LPSTR  pDst
 

Definition at line 88 of file oemxlate.c.

References tagSERVERINFO::acOemToAnsi, BOOL, FALSE, gpsi, NULL, and TRUE.

00091 { 00092 UserAssert(gpsi); 00093 00094 if (pSrc == NULL || pDst == NULL) { 00095 return FALSE; 00096 } 00097 00098 do { 00099 *pDst++ = gpsi->acOemToAnsi[(UCHAR)*pSrc]; 00100 } while (*pSrc++); 00101 00102 return TRUE; 00103 }

BOOL WINAPI OemToCharBuffA LPCSTR  pSrc,
LPSTR  pDst,
DWORD  nLength
 

Definition at line 117 of file oemxlate.c.

References tagSERVERINFO::acOemToAnsi, BOOL, FALSE, gpsi, NULL, and TRUE.

Referenced by ECInsertText().

00121 { 00122 UserAssert(gpsi); 00123 00124 if (pSrc == NULL || pDst == NULL) { 00125 return FALSE; 00126 } 00127 00128 while (nLength--) { 00129 *pDst++ = gpsi->acOemToAnsi[(UCHAR)*pSrc++]; 00130 } 00131 00132 return TRUE; 00133 }

BOOL WINAPI OemToCharBuffW LPCSTR  pSrc,
LPWSTR  pDst,
DWORD  nLength
 

Definition at line 253 of file oemxlate.c.

References BOOL, FALSE, NULL, and TRUE.

Referenced by ECInsertText(), and OemKeyScan().

00257 { 00258 if (pSrc == NULL || pDst == NULL) { 00259 return FALSE; 00260 } else if (pSrc == (LPCSTR)pDst) { 00261 /* 00262 * MultiByteToWideChar() requires pSrc != pDst: fail this call. 00263 * LATER: Is this really true? 00264 */ 00265 return FALSE; 00266 } 00267 00268 MultiByteToWideChar( 00269 CP_OEMCP, // Unicode -> OEM 00270 MB_PRECOMPOSED | MB_USEGLYPHCHARS, // visual map to precomposed 00271 (LPSTR)pSrc, nLength, // source & length 00272 pDst, // destination 00273 nLength); // max poss. precomposed length 00274 00275 return TRUE; 00276 }

BOOL WINAPI OemToCharW LPCSTR  pSrc,
LPWSTR  pDst
 

Definition at line 217 of file oemxlate.c.

References BOOL, FALSE, NULL, strlen(), and TRUE.

00220 { 00221 int cch; 00222 if (pSrc == NULL || pDst == NULL) { 00223 return FALSE; 00224 } else if (pSrc == (LPCSTR)pDst) { 00225 /* 00226 * MultiByteToWideChar() requires pSrc != pDst: fail this call. 00227 * LATER: Is this really true? 00228 */ 00229 return FALSE; 00230 } 00231 00232 cch = strlen(pSrc) + 1; 00233 00234 MultiByteToWideChar( 00235 CP_OEMCP, // Unicode -> OEM 00236 MB_PRECOMPOSED | MB_USEGLYPHCHARS, // visual map to precomposed 00237 (LPSTR)pSrc, cch, // source & length 00238 pDst, // destination 00239 cch); // max poss. precomposed length 00240 00241 return TRUE; 00242 }


Generated on Sat May 15 19:44:59 2004 for test by doxygen 1.3.7