in reply to Re^2: wchar_t*, char* and perl XS
in thread wchar_t*, char* and perl XS
Choice 3 is to undef those last 3 lines and use the A postfix functions. Choice 4, if you HAVE to have use the wide APIs, and pass unicode into Perl language, that is a completely different topic, I suggest doing exactly what is done here https://github.com/jandubois/win32/blob/841409b37dea45266c2afb68919d80c4e5dea657/Win32.xs#L174 for converting UTF16 into "Perl Unicode".typedef struct tagPROCESSENTRY32W { DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; // this process ULONG_PTR th32DefaultHeapID; DWORD th32ModuleID; // associated exe DWORD cntThreads; DWORD th32ParentProcessID; // this process's parent process LONG pcPriClassBase; // Base priority of process's thre +ads DWORD dwFlags; WCHAR szExeFile[MAX_PATH]; // Path } PROCESSENTRY32W; typedef PROCESSENTRY32W * PPROCESSENTRY32W; typedef PROCESSENTRY32W * LPPROCESSENTRY32W; ......................... typedef struct tagPROCESSENTRY32 { DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; // this process ULONG_PTR th32DefaultHeapID; DWORD th32ModuleID; // associated exe DWORD cntThreads; DWORD th32ParentProcessID; // this process's parent process LONG pcPriClassBase; // Base priority of process's thre +ads DWORD dwFlags; CHAR szExeFile[MAX_PATH]; // Path } PROCESSENTRY32; typedef PROCESSENTRY32 * PPROCESSENTRY32; typedef PROCESSENTRY32 * LPPROCESSENTRY32; #ifdef UNICODE #define Process32First Process32FirstW #define Process32Next Process32NextW #define PROCESSENTRY32 PROCESSENTRY32W #define PPROCESSENTRY32 PPROCESSENTRY32W #define LPPROCESSENTRY32 LPPROCESSENTRY32W #endif // !UNICODE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: wchar_t*, char* and perl XS
by xiaoyafeng (Deacon) on Jul 14, 2012 at 03:34 UTC | |
by bulk88 (Priest) on Jul 14, 2012 at 14:05 UTC |