2 * Help Viewer - DLL callback into WineHelp
4 * Copyright 2004 Eric Pouech
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(winhelp
);
30 static WORD CALLBACK
WHD_GetFSError(void)
36 static HANDLE CALLBACK
WHD_Open(LPSTR name
, BYTE flags
)
40 WINE_FIXME("(%s %x)\n", wine_dbgstr_a(name
), flags
);
43 case 0: mode
= GENERIC_READ
| GENERIC_WRITE
; break;
44 case 2: mode
= GENERIC_READ
; break;
45 default: WINE_FIXME("Undocumented flags %x\n", flags
);
47 return CreateFile(name
, mode
, FILE_SHARE_READ
| FILE_SHARE_WRITE
, NULL
,
48 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
51 static WORD CALLBACK
WHD_Close(HANDLE fs
)
53 WINE_FIXME("(%p)\n", fs
);
58 static HANDLE CALLBACK
WHD_OpenBag(HANDLE fs
, LPSTR name
, BYTE flags
)
60 WINE_FIXME("(%p %s %x)\n", fs
, name
, flags
);
64 static HANDLE CALLBACK
WHD_CloseBag(HANDLE bag
)
70 static LONG CALLBACK
WHD_ReadBag(HANDLE bag
, BYTE
* ptr
, LONG len
)
76 static LONG CALLBACK
WHD_TellBag(HANDLE bag
)
82 static LONG CALLBACK
WHD_SeekBag(HANDLE bag
, LONG offset
, WORD whence
)
88 static BOOL CALLBACK
WHD_IsEofBag(HANDLE bag
)
94 static LONG CALLBACK
WHD_SizeBag(HANDLE bag
)
100 static BOOL CALLBACK
WHD_Access(HANDLE fs
, LPSTR name
, BYTE flags
)
106 static WORD CALLBACK
WHD_LLInfoFromBag(HANDLE bag
, WORD opt
, LPWORD p1
, LPLONG p2
, LPLONG p3
)
112 static WORD CALLBACK
WHD_LLInfoFromFile(HANDLE fs
, LPSTR name
, WORD opt
, LPWORD p1
, LPLONG p2
, LPLONG p3
)
118 static void CALLBACK
WHD_Error(int err
)
123 static void CALLBACK
WHD_ErrorString(LPSTR err
)
128 static LONG CALLBACK
WHD_GetInfo(WORD what
, HWND hnd
)
132 WINE_TRACE("(%x %p)\n", what
, hnd
);
136 case 1: /* instance */ ret
= (LONG
)Globals
.hInstance
; break;
137 case 3: /* current window */ ret
= (LONG
)Globals
.active_win
->hMainWnd
; break;
138 case 2: /* main window */
139 case 4: /* handle to opened file */
140 case 5: /* foreground color */
141 case 6: /* background color */
142 case 7: /* topic number */
143 case 8: /* current opened file name */
144 WINE_FIXME("NIY %u\n", what
);
147 WINE_FIXME("Undocumented %u\n", what
);
153 static LONG CALLBACK
WHD_API(LPSTR x
, WORD xx
, DWORD xxx
)
159 FARPROC Callbacks
[] =
161 (FARPROC
)WHD_GetFSError
,
164 (FARPROC
)WHD_OpenBag
,
165 (FARPROC
)WHD_CloseBag
,
166 (FARPROC
)WHD_ReadBag
,
167 (FARPROC
)WHD_TellBag
,
168 (FARPROC
)WHD_SeekBag
,
169 (FARPROC
)WHD_IsEofBag
,
170 (FARPROC
)WHD_SizeBag
,
172 (FARPROC
)WHD_LLInfoFromBag
,
173 (FARPROC
)WHD_LLInfoFromFile
,
175 (FARPROC
)WHD_ErrorString
,
176 (FARPROC
)WHD_GetInfo
,