Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1873ebdd
Commit
1873ebdd
authored
Oct 17, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Delete the .windows-label file if the label is empty.
Add a trailing \n to the label file.
parent
f150ddc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
volume.c
dlls/kernel32/volume.c
+7
-2
No files found.
dlls/kernel32/volume.c
View file @
1873ebdd
...
...
@@ -723,6 +723,10 @@ BOOL WINAPI SetVolumeLabelW( LPCWSTR root, LPCWSTR label )
WCHAR
labelW
[]
=
{
'A'
,
':'
,
'\\'
,
'.'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'-'
,
'l'
,
'a'
,
'b'
,
'e'
,
'l'
,
0
};
labelW
[
0
]
=
device
[
4
];
if
(
!
label
[
0
])
/* delete label file when setting an empty label */
return
DeleteFileW
(
labelW
)
||
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
handle
=
CreateFileW
(
labelW
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
...
...
@@ -730,8 +734,9 @@ BOOL WINAPI SetVolumeLabelW( LPCWSTR root, LPCWSTR label )
char
buffer
[
64
];
DWORD
size
;
if
(
!
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
label
,
-
1
,
buffer
,
sizeof
(
buffer
),
NULL
,
NULL
))
buffer
[
sizeof
(
buffer
)
-
1
]
=
0
;
if
(
!
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
label
,
-
1
,
buffer
,
sizeof
(
buffer
)
-
1
,
NULL
,
NULL
))
buffer
[
sizeof
(
buffer
)
-
2
]
=
0
;
strcat
(
buffer
,
"
\n
"
);
WriteFile
(
handle
,
buffer
,
strlen
(
buffer
),
&
size
,
NULL
);
CloseHandle
(
handle
);
return
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment