eric pouech (@epo) commented about dlls/ntdll/tests/directory.c:
- test_NtQueryDirectoryFile_mask(dirh, TRUE, &testmask, STATUS_SUCCESS, FALSE, TRUE);
 - test_NtQueryDirectoryFile_mask(dirh, TRUE, &emptymask, STATUS_SUCCESS, FALSE, FALSE);
 - test_NtQueryDirectoryFile_mask(dirh, FALSE, &emptymask, STATUS_SUCCESS, FALSE, FALSE);
 - /* Test empty mask with a fresh handle */
 - test_NtQueryDirectoryFile_mask(dirh_test_fresh_empty, TRUE, &emptymask, STATUS_SUCCESS, FALSE, FALSE);
 - test_NtQueryDirectoryFile_mask(dirh_test_fresh_empty, FALSE, &emptymask, STATUS_SUCCESS, FALSE, FALSE);
 - /* Cleanup */
 +done:
- tear_down_mask_test(testdir);
 - pRtlFreeUnicodeString(&ntdirname);
 - pRtlFreeUnicodeString(&atestfile);
 - pRtlFreeUnicodeString(&anothertestfile);
 - pRtlFreeUnicodeString(¬atestfile);
 +}
but you're leaking all the created handles... from comment above, for the ones that are really local to a couple of lines, NtClose should be put within the same code area... dirh should be closed here