![]() |
| | #1 |
| Registered User Join Date: Sep 2009
Posts: 37
| GetPerformanceInfo directly out from the psapi.dll it returns Code: error 24, The Programm puts out an Command but the Command length is wrong! #### Just for additional information the Performance struct is defined!! Code: HANDLE PSAPI;
PSAPI=LoadLibrary("PSAPI.DLL");
if(!PSAPI){
ErrorExit("<EF> LoadLibrary");
}
GetPerformanceInfo=(GetPerformanceInfoPtr)GetProcAddress(PSAPI,"GetPerformanceInfo");
if(!GetPerformanceInfo){
ErrorExit("<EF> Cant do GetPerformanceInfo [psapi.dll]!\n");
}
Last edited by punkywow; 10-26-2009 at 04:19 AM. |
| punkywow is offline | |
| | #2 |
| Registered User Join Date: Mar 2005 Location: Mountaintop, Pa
Posts: 1,054
| Error 24 is a ERROR_BAD_LENGTH. It usually means that the call to GetPerformanceInfo cannot properly return all the information. Have you cleared and then initialized the structure prior to calling GetPerformanceInfo? Example: Code: PERFORMANCE_INFORMATION pi;
ZeroMemory (&pi, sizeof(PERFORMANCE_INFORMATION));
pi.cb = sizeof(PERFORMANCE_INFORMATION);
if (!p_GetPerformanceInfo (&pi, sizeof(PERFORMANCE_INFORMATION)))
{
printf("Failed\n");
}
|
| BobS0327 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|