105 {
106 get
107 {
110 {
111 if (!global::Interop.Kernel32.GetVolumeInformation(
Name,
ptr, 261,
null,
null,
out var _,
null, 0))
112 {
113 throw Error.GetExceptionForLastWin32DriveError(
Name);
114 }
115 }
117 }
120 set
121 {
123 bool flag = global::Interop.Kernel32.SetThreadErrorMode(1
u,
out lpOldMode);
124 try
125 {
126 if (!global::Interop.Kernel32.SetVolumeLabel(
Name,
value))
127 {
130 {
132 }
134 }
135 }
136 finally
137 {
138 if (flag)
139 {
141 }
142 }
143 }
144 }
static int GetLastPInvokeError()
static string InvalidOperation_SetVolumeLabelFailed