| 195 | } |
| 196 | |
| 197 | bool 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 | } |
no outgoing calls
no test coverage detected