Mercurial > mplayer.hg
comparison libdha/sysdep/pci_win32.c @ 12056:3a727f52c4a2
windows xp support
author | faust3 |
---|---|
date | Tue, 23 Mar 2004 10:34:24 +0000 |
parents | 4cfb6b9a6da3 |
children | fd0d4b94b5ec |
comparison
equal
deleted
inserted
replaced
12055:174ff71996aa | 12056:3a727f52c4a2 |
---|---|
2 This file is based on: | 2 This file is based on: |
3 $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ | 3 $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ |
4 Modified for readability by Nick Kurshev | 4 Modified for readability by Nick Kurshev |
5 */ | 5 */ |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include <ddk/ntddk.h> | |
8 #include "../dhahelperwin/dhahelper.h" | |
7 | 9 |
8 /* Nothing to do for Win9x. For WinNT I have no solution */ | 10 static HANDLE hDriver; |
11 extern int IsWinNT(); | |
12 | |
13 | |
14 | |
15 | |
9 | 16 |
10 static __inline__ int enable_os_io(void) | 17 static __inline__ int enable_os_io(void) |
11 { | 18 { |
19 if(IsWinNT()){ | |
20 DWORD dwBytesReturned; | |
21 hDriver = CreateFile("\\\\.\\DHAHELPER",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); | |
22 if(!DeviceIoControl(hDriver, IOCTL_DHAHELPER_ENABLEDIRECTIO, NULL,0, NULL, 0, &dwBytesReturned, NULL)){ | |
23 printf("unable to enable directio please install dhahelper.sys\n"); | |
24 return(1); | |
25 } | |
26 } | |
12 return(0); | 27 return(0); |
13 } | 28 } |
14 | 29 |
15 static __inline__ int disable_os_io(void) | 30 static __inline__ int disable_os_io(void) |
16 { | 31 { |
32 if(IsWinNT()){ | |
33 DWORD dwBytesReturned; | |
34 DeviceIoControl(hDriver, IOCTL_DHAHELPER_DISABLEDIRECTIO, NULL,0, NULL, 0, &dwBytesReturned, NULL); | |
35 CloseHandle(hDriver); | |
36 } | |
17 return(0); | 37 return(0); |
18 } | 38 } |