@@ -43,8 +43,7 @@ static NTSTATUS GetOtherOperationCount(PULONGLONG otherOperationCount)
43
43
{
44
44
*otherOperationCount = 0 ;
45
45
ULONGLONG otherOperationCountSystemProcessInformation = 0 ,
46
- otherOperationCountSystemExtendedProcessInformation = 0 ,
47
- otherOperationCountSystemSessionProcessInformation = 0 ;
46
+ otherOperationCountSystemExtendedProcessInformation = 0 ;
48
47
49
48
// NtQSI(SystemProcessInformation)
50
49
ULONG size;
@@ -117,43 +116,6 @@ static NTSTATUS GetOtherOperationCount(PULONGLONG otherOperationCount)
117
116
if (!NT_SUCCESS (status))
118
117
return status;
119
118
120
- // NtQSI(SystemSessionProcessInformation)
121
- SYSTEM_SESSION_PROCESS_INFORMATION sessionProcessInfo = { NtCurrentPeb ()->SessionId , sizeof (SYSTEM_SESSION_PROCESS_INFORMATION), &sessionProcessInfo };
122
- status = NtQuerySystemInformation (SystemSessionProcessInformation, &sessionProcessInfo, sizeof (sessionProcessInfo), &sessionProcessInfo.SizeOfBuf );
123
- if (status != STATUS_INFO_LENGTH_MISMATCH)
124
- return status;
125
- sessionProcessInfo.SizeOfBuf *= 2 ;
126
- sessionProcessInfo.Buffer = RtlAllocateHeap (RtlProcessHeap (), HEAP_ZERO_MEMORY, sessionProcessInfo.SizeOfBuf );
127
- if (SystemProcessInfo == nullptr )
128
- return STATUS_INSUFFICIENT_RESOURCES;
129
- status = NtQuerySystemInformation (SystemSessionProcessInformation, &sessionProcessInfo, sizeof (sessionProcessInfo), nullptr );
130
- if (!NT_SUCCESS (status))
131
- {
132
- RtlFreeHeap (RtlProcessHeap (), 0 , sessionProcessInfo.Buffer );
133
- return status;
134
- }
135
-
136
- entry = (PSYSTEM_PROCESS_INFORMATION)sessionProcessInfo.Buffer ;
137
- status = STATUS_NOT_FOUND;
138
-
139
- while (true )
140
- {
141
- if (entry->UniqueProcessId == NtCurrentTeb ()->ClientId .UniqueProcess )
142
- {
143
- otherOperationCountSystemSessionProcessInformation = entry->OtherOperationCount .QuadPart ;
144
- status = STATUS_SUCCESS;
145
- break ;
146
- }
147
-
148
- if (entry->NextEntryOffset == 0 )
149
- break ;
150
- entry = (PSYSTEM_PROCESS_INFORMATION)((ULONG_PTR)entry + entry->NextEntryOffset );
151
- }
152
-
153
- RtlFreeHeap (RtlProcessHeap (), 0 , sessionProcessInfo.Buffer );
154
- if (!NT_SUCCESS (status))
155
- return status;
156
-
157
119
// NtQIP(IoCounters)
158
120
IO_COUNTERS ioCounters;
159
121
status = NtQueryInformationProcess (g_proc_handle, ProcessIoCounters, &ioCounters, sizeof (ioCounters), nullptr );
@@ -162,7 +124,6 @@ static NTSTATUS GetOtherOperationCount(PULONGLONG otherOperationCount)
162
124
163
125
// All four counts should be the same
164
126
if (otherOperationCountSystemProcessInformation != otherOperationCountSystemExtendedProcessInformation ||
165
- otherOperationCountSystemProcessInformation != otherOperationCountSystemSessionProcessInformation ||
166
127
otherOperationCountSystemProcessInformation != ioCounters.OtherOperationCount )
167
128
return STATUS_DATA_NOT_ACCEPTED;
168
129
0 commit comments