ext/wdm/utils.c in wdm-0.0.3 vs ext/wdm/utils.c in wdm-0.1.0
- old
+ new
@@ -6,22 +6,24 @@
// ---------------------------------------------------------
// Paths functions
// ---------------------------------------------------------
LPWSTR
-wdm_utils_convert_back_to_forward_slashes(LPWSTR path, DWORD path_len) {
+wdm_utils_convert_back_to_forward_slashes(LPWSTR path, DWORD path_len)
+{
UINT i;
for(i = 0; i < (path_len - 1); ++i) { // path_len-1 because we don't need to check the NULL-char!
if ( path[i] == L'\\' ) path[i] = L'/';
}
return path;
}
LPWSTR
-wdm_utils_full_pathname(const LPWSTR path) {
+wdm_utils_full_pathname(const LPWSTR path)
+{
WCHAR maxed_path[WDM_MAX_WCHAR_LONG_PATH];
LPWSTR full_path;
size_t full_path_len;
BOOL is_directory;
@@ -40,11 +42,12 @@
return full_path;
}
BOOL
-wdm_utils_unicode_is_directory(const LPWSTR path) {
+wdm_utils_unicode_is_directory(const LPWSTR path)
+{
WCHAR unicode_path[WDM_MAX_WCHAR_LONG_PATH];
wcscpy(unicode_path, L"\\\\?\\");
if ( wdm_utils_is_unc_path(path) ) {
@@ -57,16 +60,18 @@
return wdm_utils_is_directory(unicode_path);
}
BOOL
-wdm_utils_is_directory(const LPWSTR path) {
+wdm_utils_is_directory(const LPWSTR path)
+{
DWORD dwAttrib = GetFileAttributesW(path);
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
}
BOOL
-wdm_utils_is_unc_path(const LPWSTR path) {
+wdm_utils_is_unc_path(const LPWSTR path)
+{
return path[0] == path[1] && path[0] == L'\\';
}
\ No newline at end of file