..........
pe32.dwSize = sizeof( PROCESSENTRY32 );
if( !Process32First( hProcessSnap, &pe32 ) )
{
printError(wszMsgBuff,&err );
sv_upgrade(perror,SVt_PVIV);
sv_setpvn(perror, (char*)wszMsgBuff, strlen(wszMsgBuff));
sv_setiv(perror,(IV) err);
SvPOK_on(perror);
XPUSHs(sv_2mortal(newSViv(-1)));
CloseHandle( hProcessSnap );
} else
{
do
{
sprintf(temp, "%d", pe32.th32ProcessID);
if(debug==1) {
printf("Temp: %s\n",pe32.szExeFile);
}
if(hv_store(rh,temp,strlen(temp),newSVpv(pe32.szExeFile, strlen(pe32.szExeFile)), 0)==NULL)
//if(hv_store(rh,pe32.szExeFile,strlen(pe32.szExeFile),newSVuv(pe32.th32ProcessID), 0)==NULL)
{
printf("can not store %s in hash!\n", pe32.szExeFile);
}
} while( Process32Next( hProcessSnap, &pe32 ) );
CloseHandle( hProcessSnap );
.....
####
typedef struct tagPROCESSENTRY32 {
DWORD dwSize;
DWORD cntUsage;
DWORD th32ProcessID;
ULONG_PTR th32DefaultHeapID;
DWORD th32ModuleID;
DWORD cntThreads;
DWORD th32ParentProcessID;
LONG pcPriClassBase;
DWORD dwFlags;
TCHAR szExeFile[MAX_PATH];
} PROCESSENTRY32, *PPROCESSENTRY32;
##
##
wchar_t * T_PV
.......
.......
T_PV
sv_setpv((SV*)$arg, $var);
##
##
: error C2664: 'Perl_sv_setpv' : cannot convert parameter 3 from 'WCHAR [260]' to 'const char *const ' (I think it more makes sense tho)