Last active
March 5, 2018 05:20
-
-
Save 0xbadfca11/09bf8efefcdc6e1681370f4ff5335056 to your computer and use it in GitHub Desktop.
BOOLEAN WINAPI RtlAreLongPathsEnabled()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <atlalloc.h> | |
#include <atlcore.h> | |
#include <clocale> | |
#include <cstdio> | |
int wmain(int, PWSTR argv[]) | |
{ | |
setlocale(LC_ALL, ""); | |
IFDYNAMICGETCACHEDFUNCTIONTYPEDEF(L"ntdll", BOOLEAN(WINAPI*)(), "RtlAreLongPathsEnabled", RtlAreLongPathsEnabled) | |
{ | |
printf("RtlAreLongPathsEnabled()=%d\n", RtlAreLongPathsEnabled()); | |
} | |
if (!CreateDirectoryW(argv[1], nullptr)) | |
{ | |
ATL::CHeapPtr<WCHAR> msg; | |
ATLENSURE(msg.Allocate(USHRT_MAX)); | |
ATLENSURE(FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(), 0, msg, USHRT_MAX, nullptr)); | |
_putws(msg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment