widl: Implemented __finally support in stub functions.
[wine/multimedia.git] / programs / winhlp32 / callback.c
blob0b3e62e014d764efe6f4e595c1bb7b2901f7ae33
1 /*
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define WIN32_LEAN_AND_MEAN
23 #include <stdio.h>
25 #include "windows.h"
26 #include "winhelp.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
32 static WORD CALLBACK WHD_GetFSError(void)
34 WINE_FIXME("()\n");
35 return 0;
38 static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags)
40 unsigned mode = 0;
42 WINE_FIXME("(%s %x)\n", wine_dbgstr_a(name), flags);
43 switch (flags)
45 case 0: mode = GENERIC_READ | GENERIC_WRITE; break;
46 case 2: mode = GENERIC_READ; break;
47 default: WINE_FIXME("Undocumented flags %x\n", flags);
49 return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
50 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
53 static WORD CALLBACK WHD_Close(HANDLE fs)
55 WINE_FIXME("(%p)\n", fs);
56 CloseHandle(fs);
57 return 0;
60 static HANDLE CALLBACK WHD_OpenBag(HANDLE fs, LPSTR name, BYTE flags)
62 WINE_FIXME("(%p %s %x)\n", fs, name, flags);
63 return NULL;
66 static HANDLE CALLBACK WHD_CloseBag(HANDLE bag)
68 WINE_FIXME("()\n");
69 return NULL;
72 static LONG CALLBACK WHD_ReadBag(HANDLE bag, BYTE* ptr, LONG len)
74 WINE_FIXME("()\n");
75 return 0;
78 static LONG CALLBACK WHD_TellBag(HANDLE bag)
80 WINE_FIXME("()\n");
81 return 0;
84 static LONG CALLBACK WHD_SeekBag(HANDLE bag, LONG offset, WORD whence)
86 WINE_FIXME("()\n");
87 return 0;
90 static BOOL CALLBACK WHD_IsEofBag(HANDLE bag)
92 WINE_FIXME("()\n");
93 return FALSE;
96 static LONG CALLBACK WHD_SizeBag(HANDLE bag)
98 WINE_FIXME("()\n");
99 return 0;
102 static BOOL CALLBACK WHD_Access(HANDLE fs, LPSTR name, BYTE flags)
104 WINE_FIXME("()\n");
105 return FALSE;
108 static WORD CALLBACK WHD_LLInfoFromBag(HANDLE bag, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3)
110 WINE_FIXME("()\n");
111 return 0;
114 static WORD CALLBACK WHD_LLInfoFromFile(HANDLE fs, LPSTR name, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3)
116 WINE_FIXME("()\n");
117 return 0;
120 static void CALLBACK WHD_Error(int err)
122 WINE_FIXME("()\n");
125 static void CALLBACK WHD_ErrorString(LPSTR err)
127 WINE_FIXME("()\n");
130 static ULONG_PTR CALLBACK WHD_GetInfo(WORD what, HWND hnd)
132 ULONG_PTR ret = 0;
134 WINE_TRACE("(%x %p)\n", what, hnd);
135 switch (what)
137 case 0: break;
138 case 1: /* instance */ ret = (ULONG_PTR)Globals.hInstance; break;
139 case 3: /* current window */ ret = (ULONG_PTR)Globals.active_win->hMainWnd; break;
140 case 2: /* main window */
141 case 4: /* handle to opened file */
142 case 5: /* foreground color */
143 case 6: /* background color */
144 case 7: /* topic number */
145 case 8: /* current opened file name */
146 WINE_FIXME("NIY %u\n", what);
147 break;
148 default:
149 WINE_FIXME("Undocumented %u\n", what);
150 break;
152 return ret;
155 static LONG CALLBACK WHD_API(LPSTR x, WORD xx, DWORD xxx)
157 WINE_FIXME("()\n");
158 return 0;
161 FARPROC Callbacks[] =
163 (FARPROC)WHD_GetFSError,
164 (FARPROC)WHD_Open,
165 (FARPROC)WHD_Close,
166 (FARPROC)WHD_OpenBag,
167 (FARPROC)WHD_CloseBag,
168 (FARPROC)WHD_ReadBag,
169 (FARPROC)WHD_TellBag,
170 (FARPROC)WHD_SeekBag,
171 (FARPROC)WHD_IsEofBag,
172 (FARPROC)WHD_SizeBag,
173 (FARPROC)WHD_Access,
174 (FARPROC)WHD_LLInfoFromBag,
175 (FARPROC)WHD_LLInfoFromFile,
176 (FARPROC)WHD_Error,
177 (FARPROC)WHD_ErrorString,
178 (FARPROC)WHD_GetInfo,
179 (FARPROC)WHD_API