| 2719 | #ifdef _UNICODE |
| 2720 | |
| 2721 | static int GetAnsiFileName(LPCWSTR name, char * buf, int nBufSize) |
| 2722 | { |
| 2723 | memset(buf, 0, nBufSize); |
| 2724 | |
| 2725 | int n = WideCharToMultiByte(CP_ACP, // code page |
| 2726 | 0, // performance and mapping flags |
| 2727 | name, // wide-character string |
| 2728 | -1, // number of chars in string |
| 2729 | buf, // buffer for new string |
| 2730 | nBufSize, // size of buffer |
| 2731 | NULL, // default for unmappable chars |
| 2732 | NULL); // set when default char used |
| 2733 | return n; |
| 2734 | } |
| 2735 | |
| 2736 | static int GetUnicodeFileName(const char * name, LPWSTR buf, int nBufSize) |
| 2737 | { |