[10073] | 1 | /* $Id: hmfile.h,v 1.11 2003-05-06 12:06:10 sandervl Exp $ */
|
---|
[3642] | 2 |
|
---|
| 3 | /*
|
---|
| 4 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 5 | * Win32 Unified Handle Manager for OS/2
|
---|
| 6 | * 1999/06/17 PH Patrick Haller (phaller@gmx.net)
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 | #ifndef __HMFILE_H__
|
---|
| 10 | #define __HMFILE_H__
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | /*****************************************************************************
|
---|
| 14 | * Remark *
|
---|
| 15 | *****************************************************************************
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | /*****************************************************************************
|
---|
| 20 | * Includes *
|
---|
| 21 | *****************************************************************************/
|
---|
| 22 |
|
---|
| 23 | #include "HMDevice.h"
|
---|
| 24 | #include "HMOpen32.h"
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | /*****************************************************************************
|
---|
| 28 | * Structures *
|
---|
| 29 | *****************************************************************************/
|
---|
| 30 |
|
---|
| 31 | class HMDeviceFileClass : public HMDeviceHandler
|
---|
| 32 | {
|
---|
| 33 | public:
|
---|
| 34 | HMDeviceFileClass(LPCSTR lpDeviceName) : HMDeviceHandler(lpDeviceName) {}
|
---|
| 35 |
|
---|
| 36 | /* this is a handler method for calls to CreateFile() */
|
---|
[7549] | 37 | virtual DWORD CreateFile (LPCSTR lpFileName,
|
---|
[3642] | 38 | PHMHANDLEDATA pHMHandleData,
|
---|
| 39 | PVOID lpSecurityAttributes,
|
---|
| 40 | PHMHANDLEDATA pHMHandleDataTemplate);
|
---|
| 41 |
|
---|
| 42 | /* this is a handler method for calls to OpenFile() */
|
---|
[7549] | 43 | virtual DWORD OpenFile (LPCSTR lpFileName,
|
---|
[3642] | 44 | PHMHANDLEDATA pHMHandleData,
|
---|
| 45 | OFSTRUCT* pOFStruct,
|
---|
| 46 | UINT fuMode);
|
---|
| 47 |
|
---|
[9748] | 48 | virtual BOOL DuplicateHandle(HANDLE srchandle, PHMHANDLEDATA pHMHandleData, HANDLE srcprocess,
|
---|
[3642] | 49 | PHMHANDLEDATA pHMSrcHandle,
|
---|
| 50 | HANDLE destprocess,
|
---|
| 51 | DWORD fdwAccess,
|
---|
| 52 | BOOL fInherit,
|
---|
[3948] | 53 | DWORD fdwOptions,
|
---|
| 54 | DWORD fdwOdinOptions);
|
---|
[3642] | 55 |
|
---|
[9653] | 56 | virtual BOOL SetHandleInformation(PHMHANDLEDATA pHMHandleData,
|
---|
| 57 | DWORD dwMask,
|
---|
| 58 | DWORD dwFlags);
|
---|
| 59 |
|
---|
[3642] | 60 | /* this is a handler method for calls to CloseHandle() */
|
---|
[5587] | 61 | virtual BOOL CloseHandle(PHMHANDLEDATA pHMHandleData);
|
---|
[3642] | 62 |
|
---|
[7549] | 63 | /* this is a handler method for calls to ReadFile/Ex */
|
---|
[3642] | 64 | virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData,
|
---|
| 65 | LPCVOID lpBuffer,
|
---|
| 66 | DWORD nNumberOfBytesToRead,
|
---|
| 67 | LPDWORD lpNumberOfBytesRead,
|
---|
[7549] | 68 | LPOVERLAPPED lpOverlapped,
|
---|
| 69 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
---|
[3642] | 70 |
|
---|
[7549] | 71 | /* this is a handler method for calls to WriteFile/Ex */
|
---|
[3642] | 72 | virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData,
|
---|
| 73 | LPCVOID lpBuffer,
|
---|
| 74 | DWORD nNumberOfBytesToWrite,
|
---|
| 75 | LPDWORD lpNumberOfBytesWritten,
|
---|
[7549] | 76 | LPOVERLAPPED lpOverlapped,
|
---|
| 77 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
---|
[3642] | 78 |
|
---|
[7549] | 79 | /* this is a handler method for calls to GetFileType() */
|
---|
[3642] | 80 | virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData);
|
---|
| 81 |
|
---|
[22025] | 82 | /* this is a handler method for calls to GetFileInformationByHandle() */
|
---|
[22024] | 83 | virtual BOOL GetFileInformationByHandle(PHMHANDLEDATA pHMHandleData,
|
---|
| 84 | BY_HANDLE_FILE_INFORMATION* pHFI);
|
---|
[3642] | 85 |
|
---|
| 86 | /* this is a handler method for calls to SetEndOfFile() */
|
---|
| 87 | virtual BOOL SetEndOfFile(PHMHANDLEDATA pHMHandleData);
|
---|
| 88 |
|
---|
| 89 | /* this is a handler method for calls to SetFileTime() */
|
---|
| 90 | virtual BOOL SetFileTime (PHMHANDLEDATA pHMHandleData,
|
---|
| 91 | LPFILETIME pFT1,
|
---|
| 92 | LPFILETIME pFT2,
|
---|
| 93 | LPFILETIME pFT3);
|
---|
| 94 |
|
---|
| 95 | /* this is a handler method for calls to GetFileTime() */
|
---|
| 96 | virtual BOOL GetFileTime (PHMHANDLEDATA pHMHandleData,
|
---|
| 97 | LPFILETIME pFT1,
|
---|
| 98 | LPFILETIME pFT2,
|
---|
| 99 | LPFILETIME pFT3);
|
---|
| 100 |
|
---|
| 101 | /* this is a handler method for calls to GetFileSize() */
|
---|
| 102 | virtual DWORD GetFileSize(PHMHANDLEDATA pHMHandleData,
|
---|
| 103 | PDWORD pSizeHigh);
|
---|
| 104 |
|
---|
| 105 | /* this is a handler method for calls to SetFilePointer() */
|
---|
| 106 | virtual DWORD SetFilePointer(PHMHANDLEDATA pHMHandleData,
|
---|
| 107 | LONG lDistanceToMove,
|
---|
| 108 | PLONG lpDistanceToMoveHigh,
|
---|
| 109 | DWORD dwMoveMethod);
|
---|
| 110 |
|
---|
| 111 | /* this is a handler method for calls to LockFile() */
|
---|
[3765] | 112 | virtual BOOL LockFile(PHMHANDLEDATA pHMHandleData,
|
---|
[3642] | 113 | DWORD arg2,
|
---|
| 114 | DWORD arg3,
|
---|
| 115 | DWORD arg4,
|
---|
| 116 | DWORD arg5);
|
---|
| 117 |
|
---|
| 118 | /* this is a handler method for calls to LockFileEx() */
|
---|
[3765] | 119 | virtual BOOL LockFileEx(PHMHANDLEDATA pHMHandleData,
|
---|
[3642] | 120 | DWORD dwFlags,
|
---|
| 121 | DWORD dwReserved,
|
---|
| 122 | DWORD nNumberOfBytesToLockLow,
|
---|
| 123 | DWORD nNumberOfBytesToLockHigh,
|
---|
| 124 | LPOVERLAPPED lpOverlapped);
|
---|
| 125 |
|
---|
| 126 | /* this is a handler method for calls to UnlockFile() */
|
---|
[3765] | 127 | virtual BOOL UnlockFile(PHMHANDLEDATA pHMHandleData,
|
---|
[3642] | 128 | DWORD arg2,
|
---|
| 129 | DWORD arg3,
|
---|
| 130 | DWORD arg4,
|
---|
| 131 | DWORD arg5);
|
---|
| 132 |
|
---|
| 133 | /* this is a handler method for calls to UnlockFileEx() */
|
---|
[3765] | 134 | virtual BOOL UnlockFileEx(PHMHANDLEDATA pHMHandleData,
|
---|
[3642] | 135 | DWORD dwReserved,
|
---|
| 136 | DWORD nNumberOfBytesToLockLow,
|
---|
| 137 | DWORD nNumberOfBytesToLockHigh,
|
---|
| 138 | LPOVERLAPPED lpOverlapped);
|
---|
| 139 |
|
---|
| 140 | /* this is a handler method for calls to FlushFileBuffers */
|
---|
| 141 | virtual BOOL FlushFileBuffers(PHMHANDLEDATA pHMHandleData);
|
---|
| 142 |
|
---|
| 143 | /* this is a handler method for calls to GetOverlappedResult */
|
---|
| 144 | virtual BOOL GetOverlappedResult(PHMHANDLEDATA pHMHandleData,
|
---|
| 145 | LPOVERLAPPED arg2,
|
---|
| 146 | LPDWORD arg3,
|
---|
| 147 | BOOL arg4);
|
---|
| 148 |
|
---|
[10073] | 149 | virtual BOOL GetFileNameFromHandle(PHMHANDLEDATA pHMHandleData, LPSTR lpszFileName, DWORD cbFileName);
|
---|
[10064] | 150 | };
|
---|
[4682] | 151 |
|
---|
[10064] | 152 |
|
---|
| 153 | class HMDeviceInfoFileClass : public HMDeviceHandler
|
---|
| 154 | {
|
---|
| 155 | public:
|
---|
| 156 | HMDeviceInfoFileClass(LPCSTR lpDeviceName) : HMDeviceHandler(lpDeviceName) {}
|
---|
| 157 |
|
---|
| 158 | /* this is a handler method for calls to CreateFile() */
|
---|
| 159 | virtual DWORD CreateFile (LPCSTR lpFileName,
|
---|
| 160 | PHMHANDLEDATA pHMHandleData,
|
---|
| 161 | PVOID lpSecurityAttributes,
|
---|
| 162 | PHMHANDLEDATA pHMHandleDataTemplate);
|
---|
| 163 |
|
---|
| 164 | /* this is a handler method for calls to CloseHandle() */
|
---|
| 165 | virtual BOOL CloseHandle(PHMHANDLEDATA pHMHandleData);
|
---|
| 166 |
|
---|
| 167 | /* this is a handler method for calls to GetFileTime() */
|
---|
| 168 | virtual BOOL GetFileTime (PHMHANDLEDATA pHMHandleData,
|
---|
| 169 | LPFILETIME pFT1,
|
---|
| 170 | LPFILETIME pFT2,
|
---|
| 171 | LPFILETIME pFT3);
|
---|
| 172 |
|
---|
| 173 | /* this is a handler method for calls to GetFileSize() */
|
---|
| 174 | virtual DWORD GetFileSize(PHMHANDLEDATA pHMHandleData,
|
---|
| 175 | PDWORD pSizeHigh);
|
---|
| 176 |
|
---|
| 177 | /* this is a handler method for calls to GetFileType() */
|
---|
| 178 | virtual DWORD GetFileType (PHMHANDLEDATA pHMHandleData);
|
---|
[10073] | 179 |
|
---|
[22025] | 180 | /* this is a handler method for calls to GetFileInformationByHandle() */
|
---|
| 181 | virtual BOOL GetFileInformationByHandle(PHMHANDLEDATA pHMHandleData,
|
---|
| 182 | BY_HANDLE_FILE_INFORMATION* pHFI);
|
---|
| 183 |
|
---|
[10073] | 184 | virtual BOOL GetFileNameFromHandle(PHMHANDLEDATA pHMHandleData, LPSTR lpszFileName, DWORD cbFileName);
|
---|
| 185 |
|
---|
[3642] | 186 | };
|
---|
| 187 |
|
---|
| 188 | #endif /* __HMFILE_H__ */
|
---|
| 189 |
|
---|