950{
952 DWORD dwNukeOnDelete, dwType, VolSerialNumber, MaxComponentLength;
956 WCHAR szKey[150] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\BitBucket\\Volume\\";
957
958 if (wszPath[1] !=
L':')
959 {
960
962 }
963
964
966 StringCbCopyW(wszRootPathName,
sizeof(wszRootPathName), wszPath);
968
969
971 {
972
974 }
975
977 {
980 }
981
984
986 {
987 ERR(
"RegCreateKeyExW failed\n");
989 }
990
992 {
993
994 dwNukeOnDelete = 0;
996
1001 }
1002 else
1003 {
1004 dwSize =
sizeof(dwNukeOnDelete);
1007 {
1009 {
1010
1011 dwNukeOnDelete = 0;
1013 }
1016 }
1017 else if (dwNukeOnDelete)
1018 {
1019
1022 }
1023
1024
1025
1028 }
1029}
#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