MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / IsDeleteAllowed

Function IsDeleteAllowed

KernelLibrary/MiniFilter.cpp:197–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197bool IsDeleteAllowed(PCUNICODE_STRING filename) {
198 UNICODE_STRING ext;
199 if (NT_SUCCESS(FltParseFileName(filename, &ext, nullptr, nullptr))) {
200 WCHAR uext[16] = { 0 };
201 UNICODE_STRING suext;
202 suext.Buffer = uext;
203 //
204 // save space for NULL terminator and a semicolon
205 //
206 suext.MaximumLength = sizeof(uext) - 2 * sizeof(WCHAR);
207 RtlUpcaseUnicodeString(&suext, &ext, FALSE);
208 RtlAppendUnicodeToString(&suext, L";");
209
210 //
211 // search for the prefix
212 //
213 return wcsstr(g_State.Extensions.Buffer, uext) == nullptr;
214 }
215
216 return true;
217}

Callers 2

DelProtectPreCreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected