Skip to content

Commit d04a263

Browse files
committed
Swap (Windows): removes unused code
1 parent 2afe8d1 commit d04a263

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

src/detection/swap/swap_windows.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
#include <winternl.h>
66
#include <ntstatus.h>
77
#include <windows.h>
8-
#include <psapi.h>
98
#include <stdalign.h>
109

11-
const char* detectByNqsi(FFlist* result)
10+
const char* ffDetectSwap(FFlist* result)
1211
{
1312
alignas(SYSTEM_PAGEFILE_INFORMATION) uint8_t buffer[4096];
1413
ULONG size = sizeof(buffer);
@@ -30,25 +29,3 @@ const char* detectByNqsi(FFlist* result)
3029
}
3130
return NULL;
3231
}
33-
34-
const char* detectByKgpi(FFlist* result)
35-
{
36-
PERFORMANCE_INFORMATION pi = {};
37-
if (!K32GetPerformanceInfo(&pi, sizeof(pi)))
38-
return "K32GetPerformanceInfo(&pi, sizeof(pi)) failed";
39-
FFSwapResult* swap = ffListAdd(result);
40-
ffStrbufInitS(&swap->name, "Page File");
41-
swap->bytesTotal = (uint64_t) (pi.CommitLimit > pi.PhysicalTotal ? pi.CommitLimit - pi.PhysicalTotal : 0) * pi.PageSize;
42-
swap->bytesUsed = (uint64_t) (pi.CommitTotal > pi.PhysicalTotal ? pi.CommitTotal - pi.PhysicalTotal : 0) * pi.PageSize;
43-
44-
return NULL;
45-
}
46-
47-
const char* ffDetectSwap(FFlist* result)
48-
{
49-
const char* err = detectByNqsi(result);
50-
if (err == NULL)
51-
return NULL;
52-
53-
return detectByKgpi(result);
54-
}

0 commit comments

Comments
 (0)