diff options
author | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-03-23 10:34:24 +0000 |
---|---|---|
committer | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-03-23 10:34:24 +0000 |
commit | 543c00752d19e74fcde0c6139eee985d3c1476c0 (patch) | |
tree | 6e30007919772b1211dd61ace28d922f8a638432 /libdha/sysdep/pci_win32.c | |
parent | a977756617ef6bffd6a05c0ca1a96683c1bb38ca (diff) | |
download | mpv-543c00752d19e74fcde0c6139eee985d3c1476c0.tar.bz2 mpv-543c00752d19e74fcde0c6139eee985d3c1476c0.tar.xz |
windows xp support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12057 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/sysdep/pci_win32.c')
-rw-r--r-- | libdha/sysdep/pci_win32.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libdha/sysdep/pci_win32.c b/libdha/sysdep/pci_win32.c index 1c88cb13e8..a4a08077eb 100644 --- a/libdha/sysdep/pci_win32.c +++ b/libdha/sysdep/pci_win32.c @@ -4,15 +4,35 @@ Modified for readability by Nick Kurshev */ #include <windows.h> +#include <ddk/ntddk.h> +#include "../dhahelperwin/dhahelper.h" + +static HANDLE hDriver; +extern int IsWinNT(); + + + -/* Nothing to do for Win9x. For WinNT I have no solution */ static __inline__ int enable_os_io(void) { + if(IsWinNT()){ + DWORD dwBytesReturned; + hDriver = CreateFile("\\\\.\\DHAHELPER",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); + if(!DeviceIoControl(hDriver, IOCTL_DHAHELPER_ENABLEDIRECTIO, NULL,0, NULL, 0, &dwBytesReturned, NULL)){ + printf("unable to enable directio please install dhahelper.sys\n"); + return(1); + } + } return(0); } static __inline__ int disable_os_io(void) { + if(IsWinNT()){ + DWORD dwBytesReturned; + DeviceIoControl(hDriver, IOCTL_DHAHELPER_DISABLEDIRECTIO, NULL,0, NULL, 0, &dwBytesReturned, NULL); + CloseHandle(hDriver); + } return(0); } |