Created
February 17, 2014 04:40
-
-
Save rossy/9044827 to your computer and use it in GitHub Desktop.
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 <stdio.h> | |
#include <stdbool.h> | |
static bool is_network_path(const wchar_t *path) | |
{ | |
wchar_t vol[32768]; | |
if (GetVolumePathNameW(path, vol, sizeof(vol) / sizeof(wchar_t))) | |
return GetDriveTypeW(vol) == DRIVE_REMOTE; | |
return false; | |
} | |
int wmain(int argc, wchar_t **argv) | |
{ | |
wprintf(L"is_network_path() = %ls\n", | |
is_network_path(argv[1]) ? L"true" : L"false"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment