Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libdvdcss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
libdvdcss
Commits
41dc1176
Commit
41dc1176
authored
Nov 16, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ioctl: Drop single-use INIT_SPTD/SEND_SPTD macros
parent
00abe6bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
src/ioctl.c
src/ioctl.c
+11
-2
src/ioctl.h
src/ioctl.h
+0
-14
test/dvd_region.c
test/dvd_region.c
+11
-2
No files found.
src/ioctl.c
View file @
41dc1176
...
...
@@ -169,7 +169,13 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
*
pi_copyright
=
dvdbs
.
copyrightProtectionSystemType
;
#elif defined( WIN32 )
INIT_SPTD
(
GPCMD_READ_DVD_STRUCTURE
,
8
);
DWORD
tmp
;
SCSI_PASS_THROUGH_DIRECT
sptd
=
{
0
};
uint8_t
p_buffer
[
8
];
sptd
.
Length
=
sizeof
(
SCSI_PASS_THROUGH_DIRECT
);
sptd
.
DataBuffer
=
p_buffer
;
sptd
.
DataTransferLength
=
sizeof
(
p_buffer
);
WinInitSPTD
(
&
sptd
,
GPCMD_READ_DVD_STRUCTURE
);
/* When using IOCTL_DVD_READ_STRUCTURE and
DVD_COPYRIGHT_DESCRIPTOR, CopyrightProtectionType
...
...
@@ -180,7 +186,10 @@ int ioctl_ReadCopyright( int i_fd, int i_layer, int *pi_copyright )
sptd
.
Cdb
[
6
]
=
i_layer
;
sptd
.
Cdb
[
7
]
=
DVD_STRUCT_COPYRIGHT
;
i_ret
=
SEND_SPTD
(
i_fd
,
&
sptd
,
&
tmp
);
i_ret
=
DeviceIoControl
(
(
HANDLE
)
i_fd
,
IOCTL_SCSI_PASS_THROUGH_DIRECT
,
&
sptd
,
sizeof
(
SCSI_PASS_THROUGH_DIRECT
),
&
sptd
,
sizeof
(
SCSI_PASS_THROUGH_DIRECT
),
&
tmp
,
NULL
)
?
0
:
-
1
;
if
(
i_ret
==
0
)
{
...
...
src/ioctl.h
View file @
41dc1176
...
...
@@ -65,20 +65,6 @@ int ioctl_ReportRPC ( int, int *, int *, int * );
dvd.format = FORMAT; \
dvd.buffer = &dvdbs; \
dvd.bufferLength = sizeof(dvdbs);
#elif defined( WIN32 )
#define INIT_SPTD( TYPE, SIZE ) \
DWORD tmp; \
SCSI_PASS_THROUGH_DIRECT sptd = { 0 }; \
uint8_t p_buffer[ (SIZE) ]; \
sptd.Length = sizeof( SCSI_PASS_THROUGH_DIRECT ); \
sptd.DataBuffer = p_buffer; \
sptd.DataTransferLength = (SIZE); \
WinInitSPTD( &sptd, (TYPE) );
#define SEND_SPTD( DEV, SPTD, TMP ) \
(DeviceIoControl( (HANDLE)(DEV), IOCTL_SCSI_PASS_THROUGH_DIRECT, \
(SPTD), sizeof( SCSI_PASS_THROUGH_DIRECT ), \
(SPTD), sizeof( SCSI_PASS_THROUGH_DIRECT ), \
(TMP), NULL ) ? 0 : -1)
#elif defined( __QNXNTO__ )
#define INIT_CPT( TYPE, SIZE ) \
CAM_PASS_THRU * p_cpt = { 0 }; \
...
...
test/dvd_region.c
View file @
41dc1176
...
...
@@ -93,14 +93,23 @@ static int ioctl_SendRPC( int i_fd, int i_pdrc )
i_ret
=
ioctl
(
i_fd
,
DKIOCDVDSENDKEY
,
&
dvd
);
#elif defined( WIN32 )
INIT_SPTD
(
GPCMD_SEND_KEY
,
8
);
DWORD
tmp
;
SCSI_PASS_THROUGH_DIRECT
sptd
=
{
0
};
uint8_t
p_buffer
[
8
];
sptd
.
Length
=
sizeof
(
SCSI_PASS_THROUGH_DIRECT
);
sptd
.
DataBuffer
=
p_buffer
;
sptd
.
DataTransferLength
=
sizeof
(
p_buffer
);
WinInitSPTD
(
&
sptd
,
GPCMD_SEND_KEY
);
sptd
.
Cdb
[
10
]
=
DVD_SEND_RPC
;
p_buffer
[
1
]
=
6
;
p_buffer
[
4
]
=
i_pdrc
;
i_ret
=
SEND_SPTD
(
i_fd
,
&
sptd
,
&
tmp
);
i_ret
=
DeviceIoControl
(
(
HANDLE
)
i_fd
,
IOCTL_SCSI_PASS_THROUGH_DIRECT
,
&
sptd
,
sizeof
(
SCSI_PASS_THROUGH_DIRECT
),
&
sptd
,
sizeof
(
SCSI_PASS_THROUGH_DIRECT
),
&
tmp
,
NULL
)
?
0
:
-
1
;
#elif defined( __QNXNTO__ )
...
...
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