File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed
Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change 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- }
You can’t perform that action at this time.
0 commit comments