Skip to content

Commit 21bcb53

Browse files
committed
small tidy
1 parent bb5ce77 commit 21bcb53

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

IntelPresentMon/CommonUtilities/file/SecureSubdirectory.cpp

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,19 @@ namespace pmon::util::file
3333
return h;
3434
}
3535

36-
// Minimal header for FSCTL_DELETE_REPARSE_POINT (no reparse data on input).
37-
struct REPARSE_DATA_BUFFER_HEADER
38-
{
39-
DWORD ReparseTag;
40-
WORD ReparseDataLength;
41-
WORD Reserved;
42-
};
43-
4436
// Attempt to delete the reparse point attribute on an object handle (directory)
4537
// Leaves the object in place as a normal directory if supported by the tag.
4638
static bool TryDeleteReparsePointByHandle_(HANDLE h, DWORD tag)
4739
{
48-
REPARSE_DATA_BUFFER_HEADER hdr{};
49-
hdr.ReparseTag = tag;
50-
hdr.ReparseDataLength = 0;
51-
hdr.Reserved = 0;
40+
// Minimal header for FSCTL_DELETE_REPARSE_POINT (no reparse data on input).
41+
struct {
42+
DWORD ReparseTag;
43+
WORD ReparseDataLength;
44+
WORD Reserved;
45+
} hdr{ .ReparseTag = tag };
5246
DWORD bytes = 0;
53-
return (bool)DeviceIoControl(
54-
h,
55-
FSCTL_DELETE_REPARSE_POINT,
56-
&hdr,
57-
sizeof(hdr),
58-
nullptr,
59-
0,
60-
&bytes,
61-
nullptr
62-
);
47+
return (bool)DeviceIoControl(h, FSCTL_DELETE_REPARSE_POINT, &hdr, sizeof(hdr),
48+
nullptr, 0, &bytes, nullptr);
6349
}
6450

6551
// check if a directory referenced by the handle has a reparse point

0 commit comments

Comments
 (0)