933{
935 DWORD dwNukeOnDelete, dwType, VolSerialNumber, MaxComponentLength;
939 WCHAR szKey[150] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\BitBucket\\Volume\\";
940
941 if (wszPath[1] !=
L':')
942 {
943
945 }
946
947
949 StringCbCopyW(wszRootPathName,
sizeof(wszRootPathName), wszPath);
951
952
954 {
955
957 }
958
960 {
963 }
964
967
969 {
970 ERR(
"RegCreateKeyExW failed\n");
972 }
973
975 {
976
977 dwNukeOnDelete = 0;
979
984 }
985 else
986 {
987 dwSize =
sizeof(dwNukeOnDelete);
990 {
992 {
993
994 dwNukeOnDelete = 0;
996 }
999 }
1000 else if (dwNukeOnDelete)
1001 {
1002
1005 }
1006
1007
1008
1011 }
1012}
#define RegCloseKey(hKey)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define REG_CREATED_NEW_KEY
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
DWORD WINAPI GetLastError(void)
#define HKEY_CURRENT_USER