VMMDLL_ProcessGetInformationAll is unavailable
Space-CN-G opened this issue · 2 comments
BOOL VMMDLL_ProcessGetInformationAll_Impl(Out PVMMDLL_PROCESS_INFORMATION *ppProcInfoAll, Out PDWORD pcProcInfo)
{
DWORD i, cProcInfo = 0;
SIZE_T cbAlloc, cbProcInfo, cPIDs = 0;
PDWORD pdwPIDs = NULL;
PVMMDLL_PROCESS_INFORMATION pe, pProcInfoAll = NULL;
// 1: get pid-list
VmmProcessListPIDs(H, NULL, &cPIDs, VMM_FLAG_PROCESS_SHOW_TERMINATED);
if(!cPIDs) { goto fail; }
if(!(pdwPIDs = LocalAlloc(LMEM_ZEROINIT, cPIDs * sizeof(DWORD)))) { goto fail; }
VmmProcessListPIDs(H, pdwPIDs, &cPIDs, VMM_FLAG_PROCESS_SHOW_TERMINATED);
if(!cPIDs) { goto fail; }
cbAlloc = cPIDs * sizeof(VMMDLL_PROCESS_INFORMATION);//<--------- cbAlloc is too large, exceeding 0x40000000
// 2: create and fill result array:
if(!(pProcInfoAll = VmmDllCore_MemAllocExternal(H, OB_TAG_API_PROCESS_INFORMATION, cbAlloc, cbAlloc))) { goto fail; }
for(i = 0; i < cPIDs; i++) {
pe = pProcInfoAll + cProcInfo;
pe->magic = VMMDLL_PROCESS_INFORMATION_MAGIC;
pe->wVersion = VMMDLL_PROCESS_INFORMATION_VERSION;
cbProcInfo = sizeof(VMMDLL_PROCESS_INFORMATION);
if(VMMDLL_ProcessGetInformation_Impl(H, pdwPIDs[i], pe, &cbProcInfo)) {
cProcInfo++;
}
}
*pcProcInfo = cProcInfo;
*ppProcInfoAll = pProcInfoAll;
LocalFree(pdwPIDs);
return TRUE;
fail:
*pcProcInfo = 0;
*ppProcInfoAll = NULL;
VmmDllCore_MemFreeExternal(pProcInfoAll);
LocalFree(pdwPIDs);
return FALSE;
}
What do you mean its unavailable? it's in the header file here:
Line 2280 in 5a50667
It's also exported.
Why did you post the internal implementation (which is not exported)?
My bad, I modified the source code incorrectly.