Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / all-mingw32 / devs / filesys / emul_handler / emul_handler_intern.h
blob884dea754067ae4a38735f82f97dac40d10b6715
1 #ifndef __EMUL_HANDLER_INTERN_H
2 #define __EMUL_HANDLER_INTERN_H
3 /*
4 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
5 $Id$
7 Desc: Internal header-file for emulation-handler.
8 Lang: english
9 */
11 struct AsyncReaderControl
13 unsigned char cmd;
14 void *CmdEvent;
15 void *thread;
16 void *fh;
17 void *addr;
18 unsigned long len;
19 unsigned long actual;
20 unsigned long error;
21 unsigned long sig;
22 void *task;
25 #define ASYNC_CMD_SHUTDOWN 0
26 #define ASYNC_CMD_READ 1
28 #ifdef __AROS__
30 #include <exec/libraries.h>
31 #include <exec/types.h>
32 #include <dos/dosextens.h>
33 #include <hidd/hidd.h>
35 #include "winapi.h"
37 struct emulbase
39 struct Device device;
40 /* nlorentz: Cal it eb_std* because std* is reserved */
41 struct filehandle * eb_stdin;
42 struct filehandle * eb_stdout;
43 struct filehandle * eb_stderr;
44 void * stdin_handle;
45 void * stdout_handle;
46 void * stderr_handle;
47 struct SignalSemaphore memsem;
48 APTR mempool;
49 void * EmulHandle;
50 void * KernelHandle;
51 void * ConsoleInt;
52 struct AsyncReaderControl * ConsoleReader;
53 struct Interrupt EmulInt;
56 struct filehandle
58 char * hostname; /* full host's pathname (includes volume root prefix */
59 char * name; /* full name including pathname */
60 int type; /* type can either be FHD_FILE or FHD_DIRECTORY */
61 char * pathname; /* if type == FHD_FILE then you'll find the pathname here */
62 char * volumename;
63 void * fd;
64 ULONG dirpos;
65 struct DosList *dl;
67 #define FHD_FILE 0
68 #define FHD_DIRECTORY 1
70 struct EmulInterface
72 struct AsyncReaderControl *(*EmulInitNative)(void);
73 LONG (*EmulStat)(char *path, WIN32_FILE_ATTRIBUTE_DATA *FIB);
74 ULONG (*EmulDelete)(char *filename);
75 unsigned long (*EmulGetHome)(char *name, char *home);
76 ULONG (*EmulStatFS)(char *path, struct InfoData *id);
79 #define InitNative EmulIFace->EmulInitNative
80 #define Stat EmulIFace->EmulStat
81 #define Delete EmulIFace->EmulDelete
82 #define GetHome EmulIFace->EmulGetHome
83 #define StatFS EmulIFace->EmulStatFS
85 /* The following functions are availible on not all Windows versions, so they are optional for us.
86 If they are present, we will use them. If not, produce error or fail back to emulation (for example,
87 softlinks can be implemented using shell shortcuts) */
89 struct KernelInterface
91 __attribute__((stdcall)) void *(*CreateFile)(char *lpFileName, ULONG dwDesiredAccess, ULONG dwShareMode, void *lpSecurityAttributes,
92 ULONG dwCreationDisposition, ULONG dwFlagsAndAttributes, void *hTemplateFile);
93 __attribute__((stdcall)) ULONG (*CloseHandle)(void *hObject);
94 __attribute__((stdcall)) ULONG (*ReadFile)(void *hFile, void *lpBuffer, ULONG nNumberOfBytesToRead, ULONG *lpNumberOfBytesRead, void *lpOverlapped);
95 __attribute__((stdcall)) ULONG (*WriteFile)(void *hFile, void *lpBuffer, ULONG nNumberOfBytesToWrite, ULONG *lpNumberOfBytesWritten, void *lpOverlapped);
96 __attribute__((stdcall)) ULONG (*SetFilePointer)(void *hFile, LONG lDistanceToMove, LONG *lpDistanceToMoveHigh, ULONG dwMoveMethod);
97 __attribute__((stdcall)) ULONG (*SetEndOfFile)(void *hFile);
98 __attribute__((stdcall)) ULONG (*GetFileType)(void *hFile);
99 __attribute__((stdcall)) void *(*GetStdHandle)(ULONG nStdHandle);
100 __attribute__((stdcall)) ULONG (*MoveFile)(char *lpExistingFileName, char *lpNewFileName);
101 __attribute__((stdcall)) ULONG (*GetCurrentDirectory)(ULONG nBufferLength, char *lpBuffer);
102 __attribute__((stdcall)) void *(*FindFirstFile)(char *lpFileName, LPWIN32_FIND_DATA lpFindFileData);
103 __attribute__((stdcall)) ULONG (*FindNextFile)(void *hFindFile, LPWIN32_FIND_DATA lpFindFileData);
104 __attribute__((stdcall)) ULONG (*FindClose)(void *hFindFile);
105 __attribute__((stdcall)) ULONG (*CreateDirectory)(char *lpPathName, void *lpSecurityAttributes);
106 __attribute__((stdcall)) ULONG (*SetFileAttributes)(char *lpFileName, ULONG dwFileAttributes);
107 __attribute__((stdcall)) ULONG (*GetLastError)(void);
108 __attribute__((stdcall)) ULONG (*CreateHardLink)(char *lpFileName, char *lpExistingFileName, void *lpSecurityAttributes);
109 __attribute__((stdcall)) ULONG (*CreateSymbolicLink)(char *lpSymlinkFileName, char *lpTargetFileName, ULONG dwFlags);
110 __attribute__((stdcall)) ULONG (*SetEvent)(void *hEvent);
113 #define OpenFile KernelIFace->CreateFile
114 #define DoClose KernelIFace->CloseHandle
115 #define DoRead KernelIFace->ReadFile
116 #define DoWrite KernelIFace->WriteFile
117 #define LSeek KernelIFace->SetFilePointer
118 #define SetEOF KernelIFace->SetEndOfFile
119 #define GetFileType KernelIFace->GetFileType
120 #define GetStdFile KernelIFace->GetStdHandle
121 #define DoRename KernelIFace->MoveFile
122 #define GetCWD KernelIFace->GetCurrentDirectory
123 #define FindFirst KernelIFace->FindFirstFile
124 #define FindNext KernelIFace->FindNextFile
125 #define FindEnd KernelIFace->FindClose
126 #define MKDir KernelIFace->CreateDirectory
127 #define Chmod KernelIFace->SetFileAttributes
128 #define GetLastError KernelIFace->GetLastError
129 #define Link KernelIFace->CreateHardLink
130 #define SymLink KernelIFace->CreateSymbolicLink
131 #define RaiseEvent KernelIFace->SetEvent
133 #endif
135 #endif /* __EMUL_HANDLER_INTERN_H */