Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5ef127a0
Commit
5ef127a0
authored
Jul 21, 2003
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a couple of bugs in CDROM_GetSerial:
- it would fail if DeviceIoControl succeeded. - it would leak handles in some cases.
parent
ec0d4252
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
drive.c
files/drive.c
+23
-6
No files found.
files/drive.c
View file @
5ef127a0
...
...
@@ -861,12 +861,18 @@ failure:
*/
static
DWORD
CDROM_GetLabel
(
int
drive
,
WCHAR
*
label
)
{
HANDLE
h
=
CDROM_Open
(
drive
)
;
HANDLE
h
;
CDROM_DISK_DATA
cdd
;
DWORD
br
;
DWORD
ret
=
1
;
DWORD
br
,
ret
=
1
;
BOOL
r
;
if
(
!
h
||
!
DeviceIoControl
(
h
,
IOCTL_CDROM_DISK_TYPE
,
NULL
,
0
,
&
cdd
,
sizeof
(
cdd
),
&
br
,
0
))
h
=
CDROM_Open
(
drive
);
if
(
!
h
)
return
0
;
r
=
DeviceIoControl
(
h
,
IOCTL_CDROM_DISK_TYPE
,
NULL
,
0
,
&
cdd
,
sizeof
(
cdd
),
&
br
,
0
);
CloseHandle
(
h
);
if
(
!
r
)
return
0
;
switch
(
cdd
.
DiskData
&
0x03
)
...
...
@@ -1032,12 +1038,23 @@ static DWORD CDROM_Data_GetSerial(int drive)
static
DWORD
CDROM_GetSerial
(
int
drive
)
{
DWORD
serial
=
0
;
HANDLE
h
=
CDROM_Open
(
drive
)
;
HANDLE
h
;
CDROM_DISK_DATA
cdd
;
DWORD
br
;
BOOL
r
;
if
(
!
h
||
!
!
DeviceIoControl
(
h
,
IOCTL_CDROM_DISK_TYPE
,
NULL
,
0
,
&
cdd
,
sizeof
(
cdd
),
&
br
,
0
))
TRACE
(
"%d
\n
"
,
drive
);
h
=
CDROM_Open
(
drive
);
if
(
!
h
)
return
0
;
r
=
DeviceIoControl
(
h
,
IOCTL_CDROM_DISK_TYPE
,
NULL
,
0
,
&
cdd
,
sizeof
(
cdd
),
&
br
,
0
);
if
(
!
r
)
{
CloseHandle
(
h
);
return
0
;
}
switch
(
cdd
.
DiskData
&
0x03
)
{
...
...
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