Hola fary he estado mirando tu codigo, pero no se de donde te sacaste
la estructura system_process_information
segun la documentacion de microsoft es esta
typedef struct _SYSTEM_PROCESS_INFORMATION {
ULONG NextEntryOffset;
BYTE Reserved1[52];
PVOID Reserved2[3];
HANDLE UniqueProcessId;
PVOID Reserved3;
ULONG HandleCount;
BYTE Reserved4[4];
PVOID Reserved5[11];
SIZE_T PeakPagefileUsage;
SIZE_T PrivatePageCount;
LARGE_INTEGER Reserved6[6];
} SYSTEM_PROCESS_INFORMATION;
pero obviamente no funciona ya que el tamano de la estructura es diferente me he dado cuenta que a fuerza se necesitan reservan 56 bytes para que la siguiente variable pueda almacenar la direccion del nombre del proceso en este caso para que funcione tengo que comentar la variable reserved2 y reasginar el tamano de reserved1 a 56
algo asi
typedef struct _SYSTEM_PROCESS_INFORMATION
{
ULONG NextEntryOffset;
BYTE Reserved1[56];
// PVOID Reserved2[3];
HANDLE UniqueProcessId;
PVOID Reserved3;
ULONG HandleCount;
BYTE Reserved4[4];
PVOID Reserved5[11];
SIZE_T PeakPagefileUsage;
SIZE_T PrivatePageCount;
LARGE_INTEGER Reserved6[6];
} SYSTEM_PROCESS_INFORMATION;
Asi si funciona pero algo no cuadra ya que presiento que los valores de la estrucutra que publico microsoft por algo son y no entiendo porque hay que estar modificandolos o no alcanzo a entenderlo del todo.
la info la he sacado de aqui :
https://msdn.microsoft.com/en-gb/library/windows/desktop/ms724509.aspxademas cuesta trabajo leer esto
ret = __SystemProcessInformation(5, spi, 1024*1024, NULL);
no se que sicnifica ese cinco, te recomiendo que pongas el enumerado que le corresponde en este caso
typedef enum _SYSTEM_INFORMATION_CLASS
{
SystemBasicInformation = 0,
SystemPerformanceInformation = 2,
SystemTimeOfDayInformation = 3,
SystemProcessInformation = 5,
SystemProcessorPerformanceInformation = 8,
SystemInterruptInformation = 23,
SystemExceptionInformation = 33,
SystemRegistryQuotaInformation = 37,
SystemLookasideInformation = 45
} SYSTEM_INFORMATION_CLASS;
y obivamente la llamada seria
__SystemProcessInformation(SystemProcessInformation, spi, 1024*1024, NULL);