comparison libdha/sysdep/libdha_win32.c @ 10980:e687fa1d55c6

port libdha to mingw
author faust3
date Thu, 02 Oct 2003 14:48:17 +0000
parents 2e3262002acb
children 3a727f52c4a2
comparison
equal deleted inserted replaced
10979:ea4426db0db5 10980:e687fa1d55c6
3 Copyright (c) 1996 Vireo Software, Inc. 3 Copyright (c) 1996 Vireo Software, Inc.
4 Modified for libdha by Nick Kurshev. 4 Modified for libdha by Nick Kurshev.
5 */ 5 */
6 6
7 #include <windows.h> 7 #include <windows.h>
8
9 /* 8 /*
10 This is the request structure that applications use 9 This is the request structure that applications use
11 to request services from the MAPDEV VxD. 10 to request services from the MAPDEV VxD.
12 */ 11 */
13 12
32 #define FILE_ANY_ACCESS 0 31 #define FILE_ANY_ACCESS 0
33 #define CTL_CODE( DeviceType, Function, Method, Access ) ( \ 32 #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
34 ((DeviceType)<<16) | ((Access)<<14) | ((Function)<<2) | (Method) ) 33 ((DeviceType)<<16) | ((Access)<<14) | ((Function)<<2) | (Method) )
35 34
36 /* Memory Map a piece of Real Memory */ 35 /* Memory Map a piece of Real Memory */
37 void *map_phys_mem(unsigned base, unsigned size) { 36 void *map_phys_mem(unsigned long base, unsigned long size) {
38 37
39 HANDLE hDevice ; 38 HANDLE hDevice ;
40 PVOID inBuf[1] ; /* buffer for struct pointer to VxD */ 39 PVOID inBuf[1] ; /* buffer for struct pointer to VxD */
41 DWORD RetInfo[2] ; /* buffer to receive data from VxD */ 40 DWORD RetInfo[2] ; /* buffer to receive data from VxD */
42 DWORD cbBytesReturned ; /* count of bytes returned from VxD */ 41 DWORD cbBytesReturned ; /* count of bytes returned from VxD */
64 fprintf(stderr, "Failed to map device\n") ; exit(1) ; } 63 fprintf(stderr, "Failed to map device\n") ; exit(1) ; }
65 64
66 return (void*)req.mdr_LinearAddress ; 65 return (void*)req.mdr_LinearAddress ;
67 } 66 }
68 67
69 void unmap_phys_mem(void *ptr, unsigned size) { } 68 void unmap_phys_mem(void *ptr, unsigned long size) { }
70