[SNDVOL32] Add the small line dialog
[reactos.git] / base / applications / winhlp32 / callback.c
1 /*
2 * Help Viewer - DLL callback into WineHelp
3 *
4 * Copyright 2004 Eric Pouech
5 *
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.
10 *
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.
15 *
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
19 */
20
21 #include "winhelp.h"
22
23 static WORD CALLBACK WHD_GetFSError(void)
24 {
25 WINE_FIXME("()\n");
26 return 0;
27 }
28
29 static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags)
30 {
31 unsigned mode = 0;
32
33 WINE_FIXME("(%s %x)\n", debugstr_a(name), flags);
34 switch (flags)
35 {
36 case 0: mode = GENERIC_READ | GENERIC_WRITE; break;
37 case 2: mode = GENERIC_READ; break;
38 default: WINE_FIXME("Undocumented flags %x\n", flags);
39 }
40 return CreateFileA(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
41 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
42 }
43
44 static WORD CALLBACK WHD_Close(HANDLE fs)
45 {
46 WINE_FIXME("(%p)\n", fs);
47 CloseHandle(fs);
48 return 0;
49 }
50
51 static HANDLE CALLBACK WHD_OpenBag(HANDLE fs, LPSTR name, BYTE flags)
52 {
53 WINE_FIXME("(%p %s %x)\n", fs, debugstr_a(name), flags);
54 return NULL;
55 }
56
57 static HANDLE CALLBACK WHD_CloseBag(HANDLE bag)
58 {
59 WINE_FIXME("()\n");
60 return NULL;
61 }
62
63 static LONG CALLBACK WHD_ReadBag(HANDLE bag, BYTE* ptr, LONG len)
64 {
65 WINE_FIXME("()\n");
66 return 0;
67 }
68
69 static LONG CALLBACK WHD_TellBag(HANDLE bag)
70 {
71 WINE_FIXME("()\n");
72 return 0;
73 }
74
75 static LONG CALLBACK WHD_SeekBag(HANDLE bag, LONG offset, WORD whence)
76 {
77 WINE_FIXME("()\n");
78 return 0;
79 }
80
81 static BOOL CALLBACK WHD_IsEofBag(HANDLE bag)
82 {
83 WINE_FIXME("()\n");
84 return FALSE;
85 }
86
87 static LONG CALLBACK WHD_SizeBag(HANDLE bag)
88 {
89 WINE_FIXME("()\n");
90 return 0;
91 }
92
93 static BOOL CALLBACK WHD_Access(HANDLE fs, LPSTR name, BYTE flags)
94 {
95 WINE_FIXME("()\n");
96 return FALSE;
97 }
98
99 static WORD CALLBACK WHD_LLInfoFromBag(HANDLE bag, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3)
100 {
101 WINE_FIXME("()\n");
102 return 0;
103 }
104
105 static WORD CALLBACK WHD_LLInfoFromFile(HANDLE fs, LPSTR name, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3)
106 {
107 WINE_FIXME("()\n");
108 return 0;
109 }
110
111 static void CALLBACK WHD_Error(int err)
112 {
113 WINE_FIXME("()\n");
114 }
115
116 static void CALLBACK WHD_ErrorString(LPSTR err)
117 {
118 WINE_FIXME("()\n");
119 }
120
121 static ULONG_PTR CALLBACK WHD_GetInfo(WORD what, HWND hnd)
122 {
123 ULONG_PTR ret = 0;
124
125 WINE_TRACE("(%x %p)\n", what, hnd);
126 switch (what)
127 {
128 case 0: break;
129 case 1: /* instance */ ret = (ULONG_PTR)Globals.hInstance; break;
130 case 3: /* current window */ ret = (ULONG_PTR)Globals.active_win->hMainWnd; break;
131 case 2: /* main window */
132 case 4: /* handle to opened file */
133 case 5: /* foreground color */
134 case 6: /* background color */
135 case 7: /* topic number */
136 case 8: /* current opened file name */
137 WINE_FIXME("NIY %u\n", what);
138 break;
139 default:
140 WINE_FIXME("Undocumented %u\n", what);
141 break;
142 }
143 return ret;
144 }
145
146 static LONG CALLBACK WHD_API(LPSTR x, WORD xx, DWORD xxx)
147 {
148 WINE_FIXME("()\n");
149 return 0;
150 }
151
152 const struct winhelp_callbacks Callbacks =
153 {
154 WHD_GetFSError,
155 WHD_Open,
156 WHD_Close,
157 WHD_OpenBag,
158 WHD_CloseBag,
159 WHD_ReadBag,
160 WHD_TellBag,
161 WHD_SeekBag,
162 WHD_IsEofBag,
163 WHD_SizeBag,
164 WHD_Access,
165 WHD_LLInfoFromBag,
166 WHD_LLInfoFromFile,
167 WHD_Error,
168 WHD_ErrorString,
169 WHD_GetInfo,
170 WHD_API
171 };