1 /* Windows-specific code for wimlib-imagex. */
4 # error "This file contains Windows code"
7 #include "imagex-win32.h"
13 /* Set a file descriptor to binary mode. */
14 void set_fd_to_binary_mode(int fd)
16 _setmode(fd, _O_BINARY);
22 get_security_descriptor_string(PSECURITY_DESCRIPTOR desc)
25 /* 52 characters!!! */
26 ConvertSecurityDescriptorToStringSecurityDescriptorW(
29 OWNER_SECURITY_INFORMATION |
30 GROUP_SECURITY_INFORMATION |
31 DACL_SECURITY_INFORMATION |
32 SACL_SECURITY_INFORMATION,
39 win32_print_security_descriptor(const uint8_t *sd, size_t size)
42 const wchar_t *printstr;
44 /* 'size' is ignored here due to the crappy Windows APIs. Oh well, this
45 * is just for debugging anyway. */
46 str = get_security_descriptor_string((PSECURITY_DESCRIPTOR)sd);
50 printstr = L"(invalid)";
52 wprintf(L"Security Descriptor = %ls\n", printstr);