From 8138a2b7211761f6100c3f648692e1da31f1c72f Mon Sep 17 00:00:00 2001 From: ColumbusUtigas Date: Tue, 10 Dec 2019 21:45:56 +0300 Subject: [PATCH] msvc fix --- corinfo.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/corinfo.h b/corinfo.h index c4cb386..3c6dd33 100644 --- a/corinfo.h +++ b/corinfo.h @@ -244,7 +244,7 @@ int __corinfo_hdd_info(struct corinfo* info); info->Cpu.SSE42 = (cpu[2] >> 20) & 0x1; info->Cpu.AVX = (cpu[2] >> 28) & 0x1; - struct + struct PPIStruct { ULONG Number; ULONG MaxMhz; @@ -257,7 +257,7 @@ int __corinfo_hdd_info(struct corinfo* info); BYTE* buf = (BYTE*)malloc(sizeof(PROCESSOR_POWER_INFORMATION) * 4); if (buf == NULL) return -1; CallNtPowerInformation(ProcessorInformation, NULL, 0, buf, sizeof(PROCESSOR_POWER_INFORMATION) * sys.dwNumberOfProcessors); - PPI = buf; + PPI = (PPIStruct*)buf; if (PPI != NULL) info->Cpu.Frequency = PPI->MaxMhz; if (buf) free(buf); @@ -309,7 +309,7 @@ int __corinfo_hdd_info(struct corinfo* info); int corinfo_GetInfo(struct corinfo* info) { if (info == NULL) return -1; - *info = (struct corinfo) { 0 }; + memset(info, 0, sizeof(struct corinfo)); if (__corinfo_cpu_info(info) == -1) return -1; if (__corinfo_ram_info(info) == -1) return -1;