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
5feea8ce
Commit
5feea8ce
authored
Jul 16, 2012
by
Alexandre Goujon
Committed by
Alexandre Julliard
Jul 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add a IOCTL_DVD_READ_STRUCTURE (DvdManufacturerDescriptor) test.
parent
27880abb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
4 deletions
+53
-4
volume.c
dlls/kernel32/tests/volume.c
+36
-0
cdrom.c
dlls/ntdll/cdrom.c
+17
-4
No files found.
dlls/kernel32/tests/volume.c
View file @
5feea8ce
...
...
@@ -34,6 +34,16 @@ struct COMPLETE_DVD_LAYER_DESCRIPTOR
#include <poppack.h>
C_ASSERT
(
sizeof
(
struct
COMPLETE_DVD_LAYER_DESCRIPTOR
)
==
22
);
#include <pshpack1.h>
struct
COMPLETE_DVD_MANUFACTURER_DESCRIPTOR
{
DVD_DESCRIPTOR_HEADER
Header
;
DVD_MANUFACTURER_DESCRIPTOR
Descriptor
;
UCHAR
Padding
;
};
#include <poppack.h>
C_ASSERT
(
sizeof
(
struct
COMPLETE_DVD_MANUFACTURER_DESCRIPTOR
)
==
2053
);
static
HINSTANCE
hdll
;
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointA
)(
LPCSTR
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumeNameForVolumeMountPointW
)(
LPCWSTR
,
LPWSTR
,
DWORD
);
...
...
@@ -750,6 +760,7 @@ static void test_dvd_read_structure(HANDLE handle)
DVD_LAYER_DESCRIPTOR
dvdLayerDescriptor
;
struct
COMPLETE_DVD_LAYER_DESCRIPTOR
completeDvdLayerDescriptor
;
DVD_COPYRIGHT_DESCRIPTOR
dvdCopyrightDescriptor
;
struct
COMPLETE_DVD_MANUFACTURER_DESCRIPTOR
completeDvdManufacturerDescriptor
;
dvdReadStructure
.
BlockByteOffset
.
QuadPart
=
0
;
dvdReadStructure
.
SessionId
=
0
;
...
...
@@ -839,6 +850,31 @@ static void test_dvd_read_structure(HANDLE handle)
&
dvdCopyrightDescriptor
,
i
,
&
nbBytes
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"IOCTL_DVD_READ_STRUCTURE should have failed %d %u
\n
"
,
ret
,
GetLastError
());
}
/* DvdManufacturerDescriptor */
dvdReadStructure
.
Format
=
4
;
SetLastError
(
0xdeadbeef
);
ret
=
DeviceIoControl
(
handle
,
IOCTL_DVD_READ_STRUCTURE
,
&
dvdReadStructure
,
sizeof
(
DVD_READ_STRUCTURE
),
&
completeDvdManufacturerDescriptor
,
sizeof
(
DVD_MANUFACTURER_DESCRIPTOR
),
&
nbBytes
,
NULL
);
ok
(
ret
||
broken
(
GetLastError
()
==
ERROR_NOT_READY
),
"IOCTL_DVD_READ_STRUCTURE (DvdManufacturerDescriptor) failed, last error = %u
\n
"
,
GetLastError
());
if
(
!
ret
)
return
;
/* Confirm there is always a header before the actual data */
ok
(
completeDvdManufacturerDescriptor
.
Header
.
Length
==
0x0802
,
"Length is 0x%04x instead of 0x0802
\n
"
,
completeDvdManufacturerDescriptor
.
Header
.
Length
);
ok
(
completeDvdManufacturerDescriptor
.
Header
.
Reserved
[
0
]
==
0
,
"Reserved[0] is %x instead of 0
\n
"
,
completeDvdManufacturerDescriptor
.
Header
.
Reserved
[
0
]);
ok
(
completeDvdManufacturerDescriptor
.
Header
.
Reserved
[
1
]
==
0
,
"Reserved[1] is %x instead of 0
\n
"
,
completeDvdManufacturerDescriptor
.
Header
.
Reserved
[
1
]);
SetLastError
(
0xdeadbeef
);
/* Basic parameter check */
ret
=
DeviceIoControl
(
handle
,
IOCTL_DVD_READ_STRUCTURE
,
&
dvdReadStructure
,
sizeof
(
DVD_READ_STRUCTURE
),
NULL
,
sizeof
(
DVD_MANUFACTURER_DESCRIPTOR
),
&
nbBytes
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"IOCTL_DVD_READ_STRUCTURE should have failed %d %u
\n
"
,
ret
,
GetLastError
());
}
static
void
test_cdrom_ioctl
(
void
)
...
...
dlls/ntdll/cdrom.c
View file @
5feea8ce
...
...
@@ -231,6 +231,13 @@ typedef struct
}
internal_dvd_layer_descriptor
;
C_ASSERT
(
sizeof
(
internal_dvd_layer_descriptor
)
==
22
);
typedef
struct
{
DVD_DESCRIPTOR_HEADER
Header
;
DVD_MANUFACTURER_DESCRIPTOR
Descriptor
;
UCHAR
Padding
;
}
internal_dvd_manufacturer_descriptor
;
C_ASSERT
(
sizeof
(
internal_dvd_manufacturer_descriptor
)
==
2053
);
static
NTSTATUS
CDROM_ReadTOC
(
int
,
int
,
CDROM_TOC
*
);
static
NTSTATUS
CDROM_GetStatusCode
(
int
);
...
...
@@ -2595,9 +2602,12 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure,
case
DvdManufacturerDescriptor
:
{
PDVD_MANUFACTURER_DESCRIPTOR
p
=
(
PDVD_MANUFACTURER_DESCRIPTOR
)
layer
;
internal_dvd_manufacturer_descriptor
*
p
=
(
internal_dvd_manufacturer_descriptor
*
)
layer
;
memcpy
(
p
->
ManufacturingInformation
,
s
.
manufact
.
value
,
2048
);
p
->
Header
.
Length
=
0x0802
;
p
->
Header
.
Reserved
[
0
]
=
0
;
p
->
Header
.
Reserved
[
1
]
=
0
;
memcpy
(
p
->
Descriptor
.
ManufacturingInformation
,
s
.
manufact
.
value
,
2048
);
}
break
;
...
...
@@ -2620,7 +2630,7 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure,
internal_dvd_layer_descriptor
*
xlayer
;
PDVD_COPYRIGHT_DESCRIPTOR
copy
;
PDVD_DISK_KEY_DESCRIPTOR
disk_key
;
PDVD_MANUFACTURER_DESCRIPTOR
manf
;
internal_dvd_manufacturer_descriptor
*
manf
;
}
nt_desc
;
nt_desc
.
layer
=
layer
;
...
...
@@ -2705,8 +2715,11 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure,
break
;
case
DvdManufacturerDescriptor
:
nt_desc
.
manf
->
Header
.
Length
=
0x0802
;
nt_desc
.
manf
->
Header
.
Reserved
[
0
]
=
0
;
nt_desc
.
manf
->
Header
.
Reserved
[
1
]
=
0
;
memcpy
(
nt_desc
.
manf
->
ManufacturingInformation
,
nt_desc
.
manf
->
Descriptor
.
ManufacturingInformation
,
desc
.
manf
.
discManufacturingInfo
,
2048
);
break
;
...
...
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