Ignore:
Timestamp:
Jan 20, 2006 9:03:36 PM (18 years ago)
Author:
bennylp
Message:

Completed testing for WinCE port

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_error_win32.c

    r108 r126  
    2222#include <pj/compat/sprintf.h> 
    2323#include <pj/compat/vsprintf.h> 
     24#include <pj/unicode.h> 
    2425#include <pj/string.h> 
    2526 
     
    122123{ 
    123124    int len; 
     125    PJ_DECL_UNICODE_TEMP_BUF(wbuf,128); 
    124126 
    125127    pj_assert(buf != NULL); 
     
    132134     */ 
    133135 
     136#if PJ_NATIVE_STRING_IS_UNICODE 
    134137    len = FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM  
    135138                         | FORMAT_MESSAGE_IGNORE_INSERTS, 
     
    137140                         os_errcode, 
    138141                         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),  
    139                          (LPTSTR)buf, 
    140                          (DWORD)bufsize, 
     142                         wbuf, 
     143                         sizeof(wbuf), 
    141144                         NULL); 
     145    if (len) { 
     146        pj_unicode_to_ansi(wbuf, len, buf, bufsize); 
     147    } 
     148#else 
     149    len = FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM  
     150                         | FORMAT_MESSAGE_IGNORE_INSERTS, 
     151                         NULL, 
     152                         os_errcode, 
     153                         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),  
     154                         buf, 
     155                         bufsize, 
     156                         NULL); 
     157#endif 
    142158 
    143159    if (!len) { 
Note: See TracChangeset for help on using the changeset viewer.