771
|
1 /* Unicode-encapsulation of Win32 library functions.
|
2367
|
2 Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
|
771
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs is free software; you can redistribute it and/or modify it
|
|
7 under the terms of the GNU General Public License as published by the
|
|
8 Free Software Foundation; either version 2, or (at your option) any
|
|
9 later version.
|
|
10
|
|
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Synched up with: Not in FSF. */
|
|
22
|
|
23 /* Authorship:
|
|
24
|
|
25 Current primary author: Ben Wing <ben@xemacs.org>
|
|
26
|
|
27 Created summer 2000 by Ben Wing. Completed August 2001. Completely
|
|
28 written by Ben Wing.
|
|
29 */
|
|
30
|
|
31 #define NEED_MSWINDOWS_COMMCTRL
|
|
32 #define NEED_MSWINDOWS_SHLOBJ
|
|
33
|
|
34 #include <config.h>
|
|
35 #include "lisp.h"
|
|
36
|
|
37 #include "console-msw.h"
|
|
38
|
|
39 int no_mswin_unicode_lib_calls;
|
|
40
|
|
41
|
|
42 /************************************************************************/
|
|
43 /* auto-generation */
|
|
44 /************************************************************************/
|
|
45
|
|
46 /* we use a simple script to control the auto-generation.
|
|
47
|
|
48 \(The following is copied from lib-src/make-mswin-unicode.pl.)
|
|
49
|
|
50 file specifies a file to start reading from.
|
|
51 yes indicates a function to be automatically Unicode-encapsulated.
|
|
52 (All parameters either need no special processing or are LPTSTR or
|
|
53 LPCTSTR.)
|
|
54 soon indicates a function that should be automatically Unicode-encapsulated,
|
|
55 but we're not ready to process it yet.
|
|
56 no indicates a function we don't support (it will be #defined to cause
|
|
57 a compile error, with the text after the function included in the
|
|
58 erroneous definition to indicate why we don't support it).
|
|
59 skip indicates a function we support manually; only a comment about this
|
|
60 will be generated.
|
|
61 split indicates a function with a split structure (different versions
|
|
62 for Unicode and ANSI), but where the only difference is in pointer
|
|
63 types, and the actual size does not differ. The structure name
|
|
64 should follow the function name, and it will be automatically
|
|
65 Unicode-encapsulated with appropriate casts.
|
|
66 begin-bracket indicates a #if statement to be inserted here.
|
|
67 end-bracket indicates the corresponding #endif statement.
|
|
68 blank lines and lines beginning with // are ignored.
|
|
69
|
|
70 The generated files go into intl-auto-encap-win32.[ch].
|
|
71
|
|
72 To regenerate, go to the nt/ subdirectory and type
|
|
73
|
|
74 nmake -f xemacs.mak unicode-encapsulate
|
|
75
|
|
76 This does the following:
|
|
77
|
|
78 cd $(SRC)
|
|
79 perl ../lib-src/make-mswin-unicode.pl --c-output intl-auto-encap-win32.c --h-output intl-auto-encap-win32.h intl-encap-win32.c
|
|
80
|
|
81 */
|
|
82
|
|
83 /*
|
|
84
|
|
85 terminology used below:
|
|
86
|
|
87 "split-simple" means a structure where the A and W versions are the same
|
|
88 size, and the only differences are string pointer arguments. (This does NOT
|
|
89 include structures with a pointer to a split-sized structure within them.)
|
|
90 This can also refer to a function pointer whose only split arguments are
|
|
91 string pointers or split-simple structures.
|
|
92
|
|
93 "split-sized" means a structure where the A and W versions are different
|
|
94 sizes (typically because of an inline string argument), or where there's a
|
|
95 pointer to another split-sized structure.
|
|
96
|
|
97 "split-complex"
|
|
98
|
|
99 begin-unicode-encapsulation-script
|
|
100
|
800
|
101 // dir c:\Program Files\Microsoft Visual Studio\VC98\Include\
|
|
102
|
771
|
103 file WINBASE.H
|
|
104
|
|
105 yes GetBinaryType
|
|
106 yes GetShortPathName
|
1684
|
107 no GetLongPathName Win98/2K+ only
|
827
|
108 skip GetEnvironmentStrings misnamed ANSI version of the function
|
771
|
109 yes FreeEnvironmentStrings
|
|
110 yes FormatMessage
|
|
111 yes CreateMailslot
|
|
112 begin-bracket !defined (CYGWIN_HEADERS)
|
778
|
113 no EncryptFile Win2K+ only
|
|
114 no DecryptFile Win2K+ only
|
771
|
115 end-bracket
|
|
116 no OpenRaw error "The procedure entry point OpenRawW could not be located in the dynamic link library ADVAPI32.dll."
|
|
117 no QueryRecoveryAgents split-sized LPRECOVERY_AGENT_INFORMATION
|
|
118 yes lstrcmp
|
|
119 yes lstrcmpi
|
|
120 yes lstrcpyn
|
|
121 yes lstrcpy
|
|
122 yes lstrcat
|
|
123 yes lstrlen
|
|
124 yes CreateMutex
|
|
125 yes OpenMutex
|
|
126 yes CreateEvent
|
|
127 yes OpenEvent
|
|
128 yes CreateSemaphore
|
|
129 yes OpenSemaphore
|
|
130 yes CreateWaitableTimer
|
|
131 yes OpenWaitableTimer
|
|
132 yes CreateFileMapping
|
|
133 yes OpenFileMapping
|
|
134 yes GetLogicalDriveStrings
|
|
135 yes LoadLibrary
|
|
136 yes LoadLibraryEx
|
|
137 yes GetModuleFileName
|
|
138 yes GetModuleHandle
|
|
139 split CreateProcess LPSTARTUPINFO
|
|
140 yes FatalAppExit
|
|
141 split GetStartupInfo LPSTARTUPINFO
|
|
142 yes GetCommandLine
|
|
143 yes GetEnvironmentVariable
|
|
144 yes SetEnvironmentVariable
|
|
145 yes ExpandEnvironmentStrings
|
|
146 yes OutputDebugString
|
|
147 yes FindResource
|
|
148 yes FindResourceEx
|
2500
|
149 skip EnumResourceTypes different prototypes in VC6 and VC7
|
|
150 skip EnumResourceNames different prototypes in VC6 and VC7
|
|
151 skip EnumResourceLanguages different prototypes in VC6 and VC7
|
771
|
152 yes BeginUpdateResource
|
|
153 yes UpdateResource
|
|
154 yes EndUpdateResource
|
|
155 yes GlobalAddAtom
|
|
156 yes GlobalFindAtom
|
|
157 yes GlobalGetAtomName
|
|
158 yes AddAtom
|
|
159 yes FindAtom
|
|
160 yes GetAtomName
|
|
161 yes GetProfileInt
|
|
162 yes GetProfileString
|
|
163 yes WriteProfileString
|
|
164 yes GetProfileSection
|
|
165 yes WriteProfileSection
|
|
166 yes GetPrivateProfileInt
|
|
167 yes GetPrivateProfileString
|
|
168 yes WritePrivateProfileString
|
|
169 yes GetPrivateProfileSection
|
|
170 yes WritePrivateProfileSection
|
|
171 yes GetPrivateProfileSectionNames
|
|
172 yes GetPrivateProfileStruct
|
|
173 yes WritePrivateProfileStruct
|
|
174 yes GetDriveType
|
|
175 yes GetSystemDirectory
|
|
176 yes GetTempPath
|
|
177 yes GetTempFileName
|
|
178 yes GetWindowsDirectory
|
|
179 yes SetCurrentDirectory
|
|
180 yes GetCurrentDirectory
|
|
181 yes GetDiskFreeSpace
|
|
182 yes GetDiskFreeSpaceEx
|
|
183 yes CreateDirectory
|
|
184 yes CreateDirectoryEx
|
|
185 yes RemoveDirectory
|
|
186 yes GetFullPathName
|
|
187 yes DefineDosDevice
|
|
188 yes QueryDosDevice
|
|
189 yes CreateFile
|
|
190 yes SetFileAttributes
|
|
191 yes GetFileAttributes
|
|
192 yes GetFileAttributesEx
|
|
193 yes GetCompressedFileSize
|
|
194 yes DeleteFile
|
|
195 no FindFirstFileEx split-sized LPWIN32_FIND_DATA; not used, NT 4.0+ only
|
|
196 skip FindFirstFile split-sized LPWIN32_FIND_DATA
|
|
197 skip FindNextFile split-sized LPWIN32_FIND_DATA
|
|
198 yes SearchPath
|
|
199 yes CopyFile
|
|
200 yes CopyFileEx NT 4.0+ only
|
|
201 yes MoveFile
|
|
202 yes MoveFileEx
|
|
203 no MoveFileWithProgress NT 5.0+ only
|
|
204 no CreateHardLink NT 5.0+ only
|
|
205 yes CreateNamedPipe
|
|
206 yes GetNamedPipeHandleState
|
|
207 yes CallNamedPipe
|
|
208 yes WaitNamedPipe
|
|
209 yes SetVolumeLabel
|
|
210 yes GetVolumeInformation
|
|
211 yes ClearEventLog
|
|
212 yes BackupEventLog
|
|
213 yes OpenEventLog
|
|
214 yes RegisterEventSource
|
|
215 yes OpenBackupEventLog
|
|
216 yes ReadEventLog
|
|
217 yes ReportEvent
|
|
218 yes AccessCheckAndAuditAlarm
|
|
219 no AccessCheckByTypeAndAuditAlarm NT 5.0+ only
|
|
220 no AccessCheckByTypeResultListAndAuditAlarm NT 5.0+ only
|
|
221 yes ObjectOpenAuditAlarm
|
|
222 yes ObjectPrivilegeAuditAlarm
|
|
223 yes ObjectCloseAuditAlarm
|
|
224 yes ObjectDeleteAuditAlarm
|
|
225 yes PrivilegedServiceAuditAlarm
|
|
226 yes SetFileSecurity
|
|
227 yes GetFileSecurity
|
|
228 yes FindFirstChangeNotification
|
|
229 no ReadDirectoryChanges Unicode-only
|
|
230 yes IsBadStringPtr
|
|
231 yes LookupAccountSid
|
|
232 yes LookupAccountName
|
|
233 yes LookupPrivilegeValue
|
|
234 yes LookupPrivilegeName
|
|
235 yes LookupPrivilegeDisplayName
|
|
236 yes BuildCommDCB
|
|
237 yes BuildCommDCBAndTimeouts
|
|
238 yes CommConfigDialog
|
|
239 yes GetDefaultCommConfig
|
|
240 yes SetDefaultCommConfig
|
|
241 yes GetComputerName
|
|
242 yes SetComputerName
|
|
243 yes GetUserName
|
|
244 yes LogonUser
|
|
245 split CreateProcessAsUser LPSTARTUPINFO
|
|
246 no GetCurrentHwProfile split-sized LPHW_PROFILE_INFO; NT 4.0+ only
|
|
247 no GetVersionEx split-sized LPOSVERSIONINFO
|
|
248 no CreateJobObject NT 5.0+ only
|
|
249 no OpenJobObject NT 5.0+ only
|
|
250
|
|
251 file WINUSER.H
|
|
252
|
|
253 skip MAKEINTRESOURCE macro
|
|
254 yes wvsprintf
|
|
255 no wsprintf varargs
|
|
256 yes LoadKeyboardLayout
|
|
257 yes GetKeyboardLayoutName
|
|
258 no CreateDesktop split-sized LPDEVMODE
|
|
259 yes OpenDesktop
|
|
260 split EnumDesktops DESKTOPENUMPROC // callback fun differs only in string pointer type
|
|
261 yes CreateWindowStation
|
|
262 yes OpenWindowStation
|
|
263 split EnumWindowStations WINSTAENUMPROC // callback fun differs only in string pointer type
|
|
264 yes GetUserObjectInformation
|
|
265 yes SetUserObjectInformation
|
|
266 yes RegisterWindowMessage
|
|
267 yes GetMessage
|
|
268 yes DispatchMessage
|
|
269 yes PeekMessage
|
|
270 skip SendMessage split messages and structures
|
|
271 yes SendMessageTimeout
|
|
272 yes SendNotifyMessage
|
|
273 yes SendMessageCallback
|
|
274 no BroadcastSystemMessage win95 version not split; NT 4.0+ only
|
|
275 no RegisterDeviceNotification NT 5.0+ only
|
|
276 yes PostMessage
|
|
277 yes PostThreadMessage
|
|
278 no PostAppMessage macro
|
|
279 skip DefWindowProc return value is conditionalized on _MAC, messes up parser
|
|
280 no CallWindowProc two versions, STRICT and non-STRICT
|
|
281 skip RegisterClass need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS
|
|
282 skip UnregisterClass need to intercept for reasons related to RegisterClass
|
|
283 split GetClassInfo LPWNDCLASS
|
|
284 skip RegisterClassEx need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only
|
|
285 split GetClassInfoEx LPWNDCLASSEX NT 4.0+ only
|
|
286 yes CreateWindowEx
|
|
287 skip CreateWindow macro
|
|
288 yes CreateDialogParam
|
|
289 split CreateDialogIndirectParam LPCDLGTEMPLATE error in Cygwin prototype (no split) but fixable with typedef
|
|
290 no CreateDialog macro
|
|
291 no CreateDialogIndirect macro w/split LPCDLGTEMPLATE
|
|
292 yes DialogBoxParam
|
|
293 split DialogBoxIndirectParam LPCDLGTEMPLATE error in Cygwin prototype (no split) but fixable with typedef
|
|
294 no DialogBox macro
|
|
295 no DialogBoxIndirect macro w/split LPCDLGTEMPLATE
|
|
296 yes SetDlgItemText
|
|
297 yes GetDlgItemText
|
|
298 yes SendDlgItemMessage
|
|
299 no DefDlgProc return value is conditionalized on _MAC, messes up parser
|
|
300 begin-bracket !defined (CYGWIN_HEADERS)
|
|
301 yes CallMsgFilter
|
|
302 end-bracket
|
|
303 yes RegisterClipboardFormat
|
|
304 yes GetClipboardFormatName
|
|
305 yes CharToOem
|
|
306 yes OemToChar
|
|
307 yes CharToOemBuff
|
|
308 yes OemToCharBuff
|
|
309 yes CharUpper
|
|
310 yes CharUpperBuff
|
|
311 yes CharLower
|
|
312 yes CharLowerBuff
|
|
313 yes CharNext
|
|
314 yes CharPrev
|
|
315 no IsCharAlpha split CHAR
|
|
316 no IsCharAlphaNumeric split CHAR
|
|
317 no IsCharUpper split CHAR
|
|
318 no IsCharLower split CHAR
|
|
319 yes GetKeyNameText
|
|
320 skip VkKeyScan split CHAR
|
|
321 no VkKeyScanEx split CHAR; NT 4.0+ only
|
|
322 yes MapVirtualKey
|
|
323 yes MapVirtualKeyEx NT 4.0+ only
|
|
324 yes LoadAccelerators
|
|
325 yes CreateAcceleratorTable
|
|
326 yes CopyAcceleratorTable
|
|
327 yes TranslateAccelerator
|
|
328 yes LoadMenu
|
|
329 split LoadMenuIndirect MENUTEMPLATE
|
|
330 yes ChangeMenu
|
|
331 yes GetMenuString
|
|
332 yes InsertMenu
|
|
333 yes AppendMenu
|
|
334 yes ModifyMenu
|
|
335 split InsertMenuItem LPCMENUITEMINFO NT 4.0+ only
|
|
336 split GetMenuItemInfo LPMENUITEMINFO NT 4.0+ only
|
|
337 split SetMenuItemInfo LPCMENUITEMINFO NT 4.0+ only
|
|
338 yes DrawText
|
|
339 yes DrawTextEx NT 4.0+ only
|
|
340 yes GrayString
|
|
341 yes DrawState NT 4.0+ only
|
|
342 yes TabbedTextOut
|
|
343 yes GetTabbedTextExtent
|
|
344 yes SetProp
|
|
345 yes GetProp
|
|
346 yes RemoveProp
|
|
347 split EnumPropsEx PROPENUMPROCEX // callback fun differs only in string pointer type
|
|
348 split EnumProps PROPENUMPROC // callback fun differs only in string pointer type
|
|
349 yes SetWindowText
|
|
350 yes GetWindowText
|
|
351 yes GetWindowTextLength
|
|
352 yes MessageBox
|
|
353 yes MessageBoxEx
|
|
354 split MessageBoxIndirect LPMSGBOXPARAMS NT 4.0+ only
|
|
355 yes GetWindowLong
|
|
356 yes SetWindowLong
|
|
357 yes GetClassLong
|
|
358 yes SetClassLong
|
|
359 yes FindWindow
|
|
360 yes FindWindowEx NT 4.0+ only
|
|
361 yes GetClassName
|
|
362 no SetWindowsHook obsolete; two versions, STRICT and non-STRICT
|
|
363 yes SetWindowsHookEx
|
|
364 yes LoadBitmap
|
|
365 yes LoadCursor
|
|
366 yes LoadCursorFromFile
|
|
367 yes LoadIcon
|
|
368 yes LoadImage NT 4.0+ only
|
|
369 yes LoadString
|
|
370 yes IsDialogMessage
|
|
371 yes DlgDirList
|
|
372 yes DlgDirSelectEx
|
|
373 yes DlgDirListComboBox
|
|
374 yes DlgDirSelectComboBoxEx
|
|
375 yes DefFrameProc
|
|
376 no DefMDIChildProc return value is conditionalized on _MAC, messes up parser
|
|
377
|
|
378 yes CreateMDIWindow
|
|
379 yes WinHelp
|
|
380 no ChangeDisplaySettings split-sized LPDEVMODE
|
|
381 no ChangeDisplaySettingsEx split-sized LPDEVMODE; NT 5.0/Win98+ only
|
|
382 no EnumDisplaySettings split-sized LPDEVMODE
|
|
383 no EnumDisplayDevices split-sized PDISPLAY_DEVICE; NT 5.0+ only, no Win98
|
|
384 yes SystemParametersInfo probs w/ICONMETRICS, NONCLIENTMETRICS
|
|
385 no GetMonitorInfo NT 5.0/Win98+ only
|
|
386 no GetWindowModuleFileName NT 5.0+ only
|
|
387 no RealGetWindowClass NT 5.0+ only
|
|
388 no GetAltTabInfo NT 5.0+ only
|
|
389
|
|
390 file WINGDI.H
|
|
391
|
|
392 // split-sized LOGCOLORSPACE
|
|
393 // split-sized TEXTMETRIC
|
|
394 // split-sized NEWTEXTMETRIC
|
|
395 // split-sized NEWTEXTMETRICEX
|
|
396 // split-sized LOGFONT
|
|
397 // split-sized ENUMLOGFONT
|
|
398 // split-sized ENUMLOGFONTEX
|
|
399 // split-sized EXTLOGFONT, used in EMREXTCREATEFONTINDIRECTW (Unicode-only) and (???) in DEVINFO (DDK structure)
|
|
400 // split-sized DEVMODE
|
|
401 // split-sized DISPLAY_DEVICE, used in EnumDisplayDevices
|
|
402 // split-sized OUTLINETEXTMETRIC
|
|
403 // split-simple POLYTEXT
|
|
404 // split-simple GCP_RESULTS
|
|
405 // split-sized function pointer OLDFONTENUMPROC, same as FONTENUMPROC
|
|
406 // split-sized function pointer FONTENUMPROC
|
|
407 yes AddFontResource
|
|
408 yes CopyMetaFile
|
|
409 skip CreateDC split-sized DEVMODE
|
|
410 skip CreateFontIndirect split-sized LOGFONT
|
|
411 yes CreateFont
|
|
412 skip CreateIC split-sized DEVMODE
|
|
413 yes CreateMetaFile
|
|
414 yes CreateScalableFontResource
|
|
415 skip DeviceCapabilities split-sized DEVMODE
|
|
416 skip EnumFontFamiliesEx split-complex FONTENUMPROC; NT 4.0+ only
|
|
417 no EnumFontFamilies split-complex FONTENUMPROC
|
|
418 no EnumFonts split-complex FONTENUMPROC
|
|
419 yes GetCharWidth
|
|
420 yes GetCharWidth32
|
|
421 yes GetCharWidthFloat
|
|
422 yes GetCharABCWidths
|
|
423 yes GetCharABCWidthsFloat
|
|
424 yes GetGlyphOutline
|
|
425 yes GetMetaFile
|
|
426 no GetOutlineTextMetrics split-sized LPOUTLINETEXTMETRIC
|
|
427 yes GetTextExtentPoint
|
|
428 yes GetTextExtentPoint32
|
|
429 yes GetTextExtentExPoint
|
|
430 split GetCharacterPlacement LPGCP_RESULTS NT 4.0+ only
|
|
431 no GetGlyphIndices NT 5.0+ only
|
|
432 no AddFontResourceEx NT 5.0+ only
|
|
433 no RemoveFontResourceEx NT 5.0+ only
|
|
434 // split-sized AXISINFO, used in AXESLIST; NT 5.0+ only
|
|
435 // split-sized AXESLIST, used in ENUMLOGFONTEXDV; NT 5.0+ only
|
|
436 // split-sized ENUMLOGFONTEXDV; NT 5.0+ only
|
|
437 no CreateFontIndirectEx split-sized ENUMLOGFONTEXDV; NT 5.0+ only
|
|
438 // split-sized ENUMTEXTMETRIC, returned in EnumFontFamExProc, on NT 5.0+; NT 5.0+ only
|
|
439 skip ResetDC split-sized DEVMODE
|
|
440 yes RemoveFontResource
|
|
441 yes CopyEnhMetaFile
|
|
442 yes CreateEnhMetaFile
|
|
443 yes GetEnhMetaFile
|
|
444 yes GetEnhMetaFileDescription
|
|
445 skip GetTextMetrics split-sized LPTEXTMETRIC
|
|
446 // split-simple DOCINFO
|
|
447 split StartDoc DOCINFO
|
|
448 skip GetObject split-sized LOGFONT
|
|
449 yes TextOut
|
|
450 yes ExtTextOut
|
|
451 split PolyTextOut POLYTEXT
|
|
452 yes GetTextFace
|
|
453 yes GetKerningPairs
|
|
454 // split-simple function pointer ICMENUMPROC
|
|
455 no GetLogColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
|
|
456 no CreateColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
|
|
457 skip GetICMProfile NT 4.0+ only, error in Cygwin prototype
|
|
458 yes SetICMProfile NT 4.0+ only
|
|
459 split EnumICMProfiles ICMENUMPROC NT 4.0+ only
|
|
460 skip UpdateICMRegKey NT 4.0+ only, error in Cygwin prototype
|
|
461 // non-split EMREXTTEXTOUT (A and W versions identical)
|
|
462 // non-split EMRPOLYTEXTOUT (A and W versions identical)
|
|
463 // Unicode-only EMREXTCREATEFONTINDIRECTW
|
|
464 no wglUseFontBitmaps causes link error
|
|
465 no wglUseFontOutlines causes link error
|
|
466
|
|
467 file WINSPOOL.H
|
|
468
|
|
469 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
470 yes EnumPrinters #### problems with DEVMODE pointer in PRINTER_INFO_2
|
|
471 skip OpenPrinter split-sized DEVMODE pointer in split PRINTER_DEFAULTS
|
|
472 no ResetPrinter split-sized DEVMODE pointer in split PRINTER_DEFAULTS
|
|
473 no SetJob split-sized DEVMODE pointer in split JOB_INFO_2
|
|
474 no GetJob split-sized DEVMODE pointer in split JOB_INFO_2
|
|
475 no EnumJobs split-sized DEVMODE pointer in split JOB_INFO_2
|
|
476 no AddPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
477 no SetPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
478 no GetPrinter split-sized DEVMODE pointer in split PRINTER_INFO_2
|
|
479 // other than DocumentProperties below, we don't use any of the others,
|
|
480 // and they all pretty much have complicated interfaces with lots of
|
|
481 // split structures, etc.
|
|
482 no AddPrinterDriver not used, complicated interface with split structures
|
|
483 no AddPrinterDriverEx not used, complicated interface with split structures
|
|
484 no EnumPrinterDrivers not used, complicated interface with split structures
|
|
485 no GetPrinterDriver not used, complicated interface with split structures
|
|
486 no GetPrinterDriverDirectory not used, complicated interface with split structures
|
|
487 no DeletePrinterDriver not used, complicated interface with split structures
|
|
488 no DeletePrinterDriverEx not used, complicated interface with split structures
|
|
489 no AddPerMachineConnection not used, complicated interface with split structures
|
|
490 no DeletePerMachineConnection not used, complicated interface with split structures
|
|
491 no EnumPerMachineConnections not used, complicated interface with split structures
|
|
492 no AddPrintProcessor not used, complicated interface with split structures
|
|
493 no EnumPrintProcessors not used, complicated interface with split structures
|
|
494 no GetPrintProcessorDirectory not used, complicated interface with split structures
|
|
495 no EnumPrintProcessorDatatypes not used, complicated interface with split structures
|
|
496 no DeletePrintProcessor not used, complicated interface with split structures
|
|
497 no StartDocPrinter not used, complicated interface with split structures
|
|
498 no AddJob not used, complicated interface with split structures
|
|
499 skip DocumentProperties split-sized DEVMODE, error in Cygwin prototype
|
|
500 no AdvancedDocumentProperties not used, complicated interface with split structures
|
|
501 no GetPrinterData not used, complicated interface with split structures
|
|
502 no GetPrinterDataEx not used, complicated interface with split structures
|
|
503 no EnumPrinterData not used, complicated interface with split structures
|
|
504 no EnumPrinterDataEx not used, complicated interface with split structures
|
|
505 no EnumPrinterKey not used, complicated interface with split structures
|
|
506 no SetPrinterData not used, complicated interface with split structures
|
|
507 no SetPrinterDataEx not used, complicated interface with split structures
|
|
508 no DeletePrinterData not used, complicated interface with split structures
|
|
509 no DeletePrinterDataEx not used, complicated interface with split structures
|
|
510 no DeletePrinterKey not used, complicated interface with split structures
|
|
511 no PrinterMessageBox not used, complicated interface with split structures
|
|
512 no AddForm not used, complicated interface with split structures
|
|
513 no DeleteForm not used, complicated interface with split structures
|
|
514 no GetForm not used, complicated interface with split structures
|
|
515 no SetForm not used, complicated interface with split structures
|
|
516 no EnumForms not used, complicated interface with split structures
|
|
517 no EnumMonitors not used, complicated interface with split structures
|
|
518 no AddMonitor not used, complicated interface with split structures
|
|
519 no DeleteMonitor not used, complicated interface with split structures
|
|
520 no EnumPorts not used, complicated interface with split structures
|
|
521 no AddPort not used, complicated interface with split structures
|
|
522 no ConfigurePort not used, complicated interface with split structures
|
|
523 no DeletePort not used, complicated interface with split structures
|
|
524 no XcvData not used, complicated interface with split structures
|
|
525 no SetPort not used, complicated interface with split structures
|
|
526 no AddPrinterConnection not used, complicated interface with split structures
|
|
527 no DeletePrinterConnection not used, complicated interface with split structures
|
|
528 no AddPrintProvidor not used, complicated interface with split structures
|
|
529 no DeletePrintProvidor not used, complicated interface with split structures
|
|
530 no SetPrinterHTMLView not used, complicated interface with split structures
|
|
531 no GetPrinterHTMLView not used, complicated interface with split structures
|
|
532 end-bracket
|
|
533
|
|
534 file SHELLAPI.H
|
|
535
|
|
536 yes DragQueryFile
|
|
537 yes ShellExecute
|
|
538 yes FindExecutable
|
|
539 no CommandLineToArgv Unicode-only
|
|
540 yes ShellAbout
|
|
541 yes ExtractAssociatedIcon
|
|
542 yes ExtractIcon
|
|
543 // split-simple DRAGINFO, used ??? (docs say "Not currently supported")
|
|
544 begin-bracket !defined (CYGWIN_HEADERS)
|
|
545 yes DoEnvironmentSubst NT 4.0+ only
|
|
546 end-bracket
|
|
547 no FindEnvironmentString causes link error; NT 4.0+ only
|
|
548 skip ExtractIconEx NT 4.0+ only, error in Cygwin prototype
|
|
549 // split-simple SHFILEOPSTRUCT, used in SHFileOperation
|
|
550 // split-simple SHNAMEMAPPING, used in SHFileOperation
|
|
551 split SHFileOperation LPSHFILEOPSTRUCT NT 4.0+ only
|
|
552 // split-simple SHELLEXECUTEINFO, used in ShellExecuteEx
|
|
553 split ShellExecuteEx LPSHELLEXECUTEINFO NT 4.0+ only
|
|
554 no WinExecError causes link error; NT 4.0+ only
|
|
555 begin-bracket !defined (CYGWIN_HEADERS)
|
|
556 yes SHQueryRecycleBin NT 4.0+ only
|
|
557 yes SHEmptyRecycleBin NT 4.0+ only
|
|
558 end-bracket
|
|
559 // split-sized NOTIFYICONDATA, used in Shell_NotifyIcon
|
|
560 no Shell_NotifyIcon split-sized NOTIFYICONDATA, NT 4.0+ only
|
|
561 // split-sized SHFILEINFO, used in SHGetFileInfo
|
|
562 skip SHGetFileInfo split-sized SHFILEINFO, NT 4.0+ only
|
|
563 no SHGetDiskFreeSpace causes link error; NT 4.0+ only
|
|
564 begin-bracket !defined (CYGWIN_HEADERS)
|
|
565 yes SHGetNewLinkInfo NT 4.0+ only
|
|
566 yes SHInvokePrinterCommand NT 4.0+ only
|
|
567 end-bracket
|
|
568
|
|
569 end-unicode-encapsulation-script
|
|
570
|
|
571 file COMMCTRL.H
|
|
572
|
|
573 yes ImageList_LoadImage
|
|
574 WC_HEADER
|
|
575 HDITEM
|
|
576 LPHDITEM
|
|
577 HDM_INSERTITEM
|
|
578 HDM_GETITEM
|
|
579 HDM_SETITEM
|
|
580 HDN_ITEMCHANGING
|
|
581 HDN_ITEMCHANGED
|
|
582 HDN_ITEMCLICK
|
|
583 HDN_ITEMDBLCLICK
|
|
584 HDN_DIVIDERDBLCLICK
|
|
585 HDN_BEGINTRACK
|
|
586 HDN_ENDTRACK
|
|
587 HDN_TRACK
|
|
588 HDN_GETDISPINFO
|
|
589 NMHEADER
|
|
590 LPNMHEADER
|
|
591 NMHDDISPINFO
|
|
592 LPNMHDDISPINFO
|
|
593 TOOLBARCLASSNAME
|
|
594 TBSAVEPARAMS
|
|
595 LPTBSAVEPARAMS
|
|
596 TB_GETBUTTONTEXT
|
|
597 TB_SAVERESTORE
|
|
598 TB_ADDSTRING
|
|
599 TBBUTTONINFO
|
|
600 LPTBBUTTONINFO
|
|
601 TB_GETBUTTONINFO
|
|
602 TB_SETBUTTONINFO
|
|
603 TB_INSERTBUTTON
|
|
604 TB_ADDBUTTONS
|
|
605 TBN_GETINFOTIP
|
|
606 NMTBGETINFOTIP
|
|
607 LPNMTBGETINFOTIP
|
|
608 TBN_GETDISPINFO
|
|
609 LPNMTBDISPINFO
|
|
610 TBN_GETBUTTONINFO
|
|
611 NMTOOLBAR
|
|
612 LPNMTOOLBAR
|
|
613 REBARCLASSNAME
|
|
614 REBARBANDINFO
|
|
615 LPREBARBANDINFO
|
|
616 LPCREBARBANDINFO
|
|
617 RB_INSERTBAND
|
|
618 RB_SETBANDINFO
|
|
619 RB_GETBANDINFO
|
|
620 TOOLTIPS_CLASS
|
|
621 TTTOOLINFO
|
|
622 PTOOLINFO
|
|
623 LPTTTOOLINFO
|
|
624 TTM_ADDTOOL
|
|
625 TTM_DELTOOL
|
|
626 TTM_NEWTOOLRECT
|
|
627 TTM_GETTOOLINFO
|
|
628 TTM_SETTOOLINFO
|
|
629 TTM_HITTEST
|
|
630 TTM_GETTEXT
|
|
631 TTM_UPDATETIPTEXT
|
|
632 TTM_ENUMTOOLS
|
|
633 TTM_GETCURRENTTOOL
|
|
634 TTHITTESTINFO
|
|
635 LPTTHITTESTINFO
|
|
636 TTN_GETDISPINFO
|
|
637 NMTTDISPINFO
|
|
638 LPNMTTDISPINFO
|
|
639 CreateStatusWindow
|
|
640 DrawStatusText
|
|
641 STATUSCLASSNAME
|
|
642 SB_GETTEXT
|
|
643 SB_SETTEXT
|
|
644 SB_GETTEXTLENGTH
|
|
645 SB_SETTIPTEXT
|
|
646 SB_GETTIPTEXT
|
|
647 TRACKBAR_CLASS
|
|
648 UPDOWN_CLASS
|
|
649 PROGRESS_CLASS
|
|
650 HOTKEY_CLASS
|
|
651 WC_LISTVIEW
|
|
652 LVITEM
|
|
653 LPLVITEM
|
|
654 LPSTR_TEXTCALLBACK
|
|
655 LVM_GETITEM
|
|
656 LVM_SETITEM
|
|
657 LVM_INSERTITEM
|
|
658 LVFINDINFO
|
|
659 LVM_FINDITEM
|
|
660 LVM_GETSTRINGWIDTH
|
|
661 LVM_EDITLABEL
|
|
662 LVCOLUMN
|
|
663 LPLVCOLUMN
|
|
664 LVM_GETCOLUMN
|
|
665 LVM_SETCOLUMN
|
|
666 LVM_GETITEMTEXT
|
|
667 LVM_SETITEMTEXT
|
|
668 LVM_GETISEARCHSTRING
|
|
669 LVBKIMAGE
|
|
670 LPLVBKIMAGE
|
|
671 LVM_SETBKIMAGE
|
|
672 LVM_GETBKIMAGE
|
|
673 LVN_ODFINDITEM
|
|
674 LVN_BEGINLABELEDIT
|
|
675 LVN_ENDLABELEDIT
|
|
676 LVN_GETDISPINFO
|
|
677 LVN_SETDISPINFO
|
|
678 NMLVDISPINFO
|
|
679 LVN_GETINFOTIP
|
|
680 NMLVGETINFOTIP
|
|
681 LPNMLVGETINFOTIP
|
|
682 WC_TREEVIEW
|
|
683 TVITEM
|
|
684 LPTVITEM
|
|
685 TVINSERTSTRUCT
|
|
686 LPTVINSERTSTRUCT
|
|
687 TVM_INSERTITEM
|
|
688 TVM_GETITEM
|
|
689 TVM_SETITEM
|
|
690 TVM_EDITLABEL
|
|
691 TVM_GETISEARCHSTRING
|
|
692 NMTREEVIEW
|
|
693 LPNMTREEVIEW
|
|
694 NMTVDISPINFO
|
|
695 LPNMTVDISPINFO
|
|
696 TVN_SELCHANGING
|
|
697 TVN_SELCHANGED
|
|
698 TVN_GETDISPINFO
|
|
699 TVN_SETDISPINFO
|
|
700 TVN_ITEMEXPANDING
|
|
701 TVN_ITEMEXPANDED
|
|
702 TVN_BEGINDRAG
|
|
703 TVN_BEGINRDRAG
|
|
704 TVN_DELETEITEM
|
|
705 TVN_BEGINLABELEDIT
|
|
706 TVN_ENDLABELEDIT
|
|
707 TVN_GETINFOTIP
|
|
708 NMTVGETINFOTIP
|
|
709 LPNMTVGETINFOTIP
|
|
710 WC_COMBOBOXEX
|
|
711 COMBOBOXEXITEM
|
|
712 PCOMBOBOXEXITEM
|
|
713 PCCOMBOBOXEXITEM
|
|
714 CBEM_INSERTITEM
|
|
715 CBEM_SETITEM
|
|
716 CBEM_GETITEM
|
|
717 NMCOMBOBOXEX
|
|
718 PNMCOMBOBOXEX
|
|
719 CBEN_GETDISPINFO
|
|
720 CBEN_DRAGBEGIN
|
|
721 CBEN_ENDEDIT
|
|
722 NMCBEDRAGBEGIN
|
|
723 LPNMCBEDRAGBEGIN
|
|
724 PNMCBEDRAGBEGIN
|
|
725 NMCBEENDEDIT
|
|
726 LPNMCBEENDEDIT
|
|
727 PNMCBEENDEDIT
|
|
728 WC_TABCONTROL
|
|
729 TCITEMHEADER
|
|
730 LPTCITEMHEADER
|
|
731 TCITEM
|
|
732 LPTCITEM
|
|
733 TCM_GETITEM
|
|
734 TCM_SETITEM
|
|
735 TCM_INSERTITEM
|
|
736 ANIMATE_CLASS
|
|
737 ACM_OPEN
|
|
738 MONTHCAL_CLASS
|
|
739 DATETIMEPICK_CLASS
|
|
740 DTM_SETFORMAT
|
|
741 DTN_USERSTRING
|
|
742 NMDATETIMESTRING
|
|
743 LPNMDATETIMESTRING
|
|
744 DTN_WMKEYDOWN
|
|
745 NMDATETIMEWMKEYDOWN
|
|
746 LPNMDATETIMEWMKEYDOWN
|
|
747 DTN_FORMAT
|
|
748 NMDATETIMEFORMAT
|
|
749 LPNMDATETIMEFORMAT
|
|
750 DTN_FORMATQUERY
|
|
751 NMDATETIMEFORMATQUERY
|
|
752 LPNMDATETIMEFORMATQUERY
|
|
753 WC_IPADDRESS
|
|
754 WC_PAGESCROLLER
|
|
755 WC_NATIVEFONTCTL
|
|
756
|
|
757 begin-unicode-encapsulation-script
|
|
758
|
|
759 file COMMDLG.H
|
|
760
|
|
761 split GetOpenFileName LPOPENFILENAME
|
|
762 split GetSaveFileName LPOPENFILENAME
|
|
763 yes GetFileTitle
|
|
764 no CommDlg_OpenSave_GetSpec macro
|
|
765 no CommDlg_OpenSave_GetFilePath macro
|
|
766 no CommDlg_OpenSave_GetFolderPath macro
|
|
767 split ChooseColor LPCHOOSECOLOR
|
|
768 split FindText LPFINDREPLACE
|
|
769 split ReplaceText LPFINDREPLACE
|
|
770 no AfxReplaceText mac only
|
|
771 no ChooseFont split-sized LPLOGFONT in LPCHOOSEFONT
|
|
772 // LBSELCHSTRING
|
|
773 // SHAREVISTRING
|
|
774 // FILEOKSTRING
|
|
775 // COLOROKSTRING
|
|
776 // SETRGBSTRING
|
|
777 // HELPMSGSTRING
|
|
778 // FINDMSGSTRING
|
|
779 skip PrintDlg LPPRINTDLG with split-sized DEVMODE handle
|
|
780 skip PageSetupDlg LPPAGESETUPDLG with split-sized DEVMODE handle
|
|
781
|
|
782 file DDE.H
|
|
783
|
|
784 // nothing
|
|
785
|
|
786 file DDEML.H
|
|
787
|
|
788 yes DdeInitialize
|
1111
|
789 skip DdeCreateStringHandle error in Cygwin prototype
|
771
|
790 yes DdeQueryString
|
|
791 // #### split-sized (or split-simple??? not completely obvious) structure MONHSZSTRUCT, used when DDE event MF_HSZ_INFO is sent as part of the XTYP_MONITOR transaction sent to a DDE callback; not yet handled
|
|
792
|
|
793 file IMM.H
|
|
794
|
|
795 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
796 yes ImmInstallIME
|
|
797 yes ImmGetDescription
|
|
798 yes ImmGetIMEFileName
|
|
799 yes ImmGetCompositionString
|
2500
|
800 skip ImmSetCompositionString different prototypes in VC6 and VC7
|
771
|
801 yes ImmGetCandidateListCount
|
|
802 yes ImmGetCandidateList
|
|
803 yes ImmGetGuideLine
|
|
804 skip ImmGetCompositionFont split-sized LOGFONT
|
|
805 skip ImmSetCompositionFont split-sized LOGFONT
|
|
806 yes ImmConfigureIME // split-simple REGISTERWORD
|
|
807 yes ImmEscape // strings of various sorts
|
|
808 yes ImmGetConversionList
|
|
809 yes ImmIsUIMessage
|
|
810 yes ImmRegisterWord
|
|
811 yes ImmUnregisterWord
|
|
812 no ImmGetRegisterWordStyle split-sized STYLEBUF
|
|
813 split ImmEnumRegisterWord REGISTERWORDENUMPROC
|
|
814 no ImmGetImeMenuItems split-sized IMEMENUITEMINFO
|
|
815 end-bracket
|
|
816
|
|
817 file MMSYSTEM.H
|
|
818
|
|
819 yes sndPlaySound
|
|
820 yes PlaySound
|
|
821 no waveOutGetDevCaps split-sized LPWAVEOUTCAPS
|
|
822 yes waveOutGetErrorText
|
|
823 no waveInGetDevCaps split-sized LPWAVEINCAPS
|
|
824 yes waveInGetErrorText
|
|
825 no midiOutGetDevCaps split-sized LPMIDIOUTCAPS
|
|
826 yes midiOutGetErrorText
|
|
827 no midiInGetDevCaps split-sized LPMIDIOUTCAPS
|
|
828 yes midiInGetErrorText
|
|
829 no auxGetDevCaps split-sized LPAUXCAPS
|
|
830 no mixerGetDevCaps split-sized LPMIXERCAPS
|
|
831 no mixerGetLineInfo split-sized LPMIXERLINE
|
|
832 no mixerGetLineControls split-sized LPMIXERCONTROL
|
|
833 no mixerGetControlDetails split-sized LPMIXERCONTROL in LPMIXERLINECONTROLS in LPMIXERCONTROLDETAILS
|
|
834 no joyGetDevCaps split-sized LPJOYCAPS
|
|
835 yes mmioStringToFOURCC
|
|
836 yes mmioInstallIOProc
|
|
837 yes mmioOpen
|
|
838 yes mmioRename
|
|
839 yes mciSendCommand
|
|
840 yes mciSendString
|
|
841 yes mciGetDeviceID
|
|
842 begin-bracket !defined (MINGW)
|
778
|
843 no mciGetDeviceIDFromElementID missing from Win98se version of ADVAPI32.dll
|
771
|
844 end-bracket
|
|
845 yes mciGetErrorString
|
|
846
|
|
847 file WINNETWK.H
|
|
848
|
|
849 begin-bracket defined (HAVE_MS_WINDOWS)
|
|
850 yes WNetAddConnection
|
|
851 split WNetAddConnection2 LPNETRESOURCE
|
|
852 split WNetAddConnection3 LPNETRESOURCE
|
|
853 yes WNetCancelConnection
|
|
854 yes WNetCancelConnection2
|
|
855 yes WNetGetConnection
|
|
856 split WNetUseConnection LPNETRESOURCE
|
|
857 split WNetConnectionDialog1 LPCONNECTDLGSTRUCT contains split-simple LPNETRESOURCE
|
|
858 split WNetDisconnectDialog1 LPDISCDLGSTRUCT
|
|
859 split WNetOpenEnum LPNETRESOURCE
|
|
860 yes WNetEnumResource
|
|
861 yes WNetGetUniversalName
|
|
862 yes WNetGetUser
|
|
863 yes WNetGetProviderName
|
|
864 yes WNetGetNetworkInformation
|
|
865 // split-simple function pointer PFNGETPROFILEPATH
|
|
866 // split-simple function pointer PFNRECONCILEPROFILE
|
|
867 // split-simple function pointer PFNPROCESSPOLICIES
|
|
868 yes WNetGetLastError
|
|
869 split MultinetGetConnectionPerformance LPNETRESOURCE
|
|
870 end-bracket
|
|
871
|
|
872 file IME.H
|
|
873
|
|
874 no SendIMEMessageEx obsolete, no docs available
|
|
875
|
|
876 file OBJBASE.H
|
|
877
|
|
878 // nothing
|
|
879
|
|
880 file SHLOBJ.H
|
|
881
|
|
882 // #### split code for IContextMenu not yet written
|
|
883 // split flag constant GCS_VERB of IContextMenu::GetCommandString
|
|
884 // split flag constant GCS_HELPTEXT of IContextMenu::GetCommandString
|
|
885 // split flag constant GCS_VALIDATE of IContextMenu::GetCommandString
|
|
886 // split string constant CMDSTR_NEWFOLDER of CMINVOKECOMMANDINFO.lpVerb or CMINVOKECOMMANDINFOEX.lpVerbW of IContextMenu::InvokeCommand
|
|
887 // split string constant CMDSTR_VIEWLIST of same
|
|
888 // split string constant CMDSTR_VIEWDETAILS of same
|
|
889 // #### split code for IExtractIcon, IShellLink, IShellExecuteHook, INewShortcutHook, ICopyHook, IFileViewer not yet written
|
|
890 // split interface IExtractIcon
|
|
891 // split interface IShellLink
|
|
892 // split interface IShellExecuteHook
|
|
893 // split interface INewShortcutHook
|
|
894 // split interface ICopyHook
|
|
895 // split interface IFileViewer
|
|
896 yes SHGetPathFromIDList
|
|
897 skip SHGetSpecialFolderPath error in Cygwin prototype, missing from Cygwin libraries
|
|
898 // split-simple structure BROWSEINFO used in SHBrowseForFolder
|
|
899 skip SHBrowseForFolder need to intercept callback for SendMessage
|
|
900 // split message BFFM_SETSTATUSTEXT handled in qxeSendMessage
|
|
901 // split message BFFM_SETSELECTION handled in qxeSendMessage
|
|
902 // split message BFFM_VALIDATEFAILED handled in qxeSHBrowseForFolder intercept proc
|
|
903 // #### code to handle split clipboard formats not yet written. this will
|
|
904 // #### be tricky -- all functions that use such clipboard formats need to
|
|
905 // #### be split, and the data itself munged. this may be too much effort,
|
|
906 // #### and we may just need to require that the app itself does the
|
|
907 // #### splitting.
|
|
908 // split clipboard format CFSTR_FILEDESCRIPTOR
|
|
909 // split clipboard format CFSTR_FILENAME
|
|
910 // split clipboard format CFSTR_FILENAMEMAP
|
|
911 // split-sized structure FILEDESCRIPTOR
|
|
912 // split-sized structure FILEGROUPDESCRIPTOR
|
|
913 // split flag SHCNF_PATH; we intercept SHChangeNotify
|
|
914 // split flag SHCNF_PRINTER; we intercept SHChangeNotify
|
|
915 // split flag SHARD_PATH; we intercept SHAddToRecentDocs
|
|
916 skip SHGetDataFromIDList split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries
|
|
917
|
|
918 file WINNLS.H
|
|
919
|
798
|
920 no LOCALE_ENUMPROC not used, not examined yet
|
|
921 no CODEPAGE_ENUMPROC not used, not examined yet
|
|
922 no DATEFMT_ENUMPROC not used, not examined yet
|
|
923 no DATEFMT_ENUMPROCEX not used, not examined yet
|
|
924 no TIMEFMT_ENUMPROC not used, not examined yet
|
|
925 no CALINFO_ENUMPROC not used, not examined yet
|
|
926 no CALINFO_ENUMPROCEX not used, not examined yet
|
|
927 no GetCPInfoEx not used, not examined yet
|
|
928 no CompareString not used, not examined yet
|
|
929 no LCMapString not used, not examined yet
|
|
930 yes GetLocaleInfo
|
|
931 yes SetLocaleInfo
|
|
932 no GetTimeFormat not used, not examined yet
|
|
933 no GetDateFormat not used, not examined yet
|
|
934 no GetNumberFormat not used, not examined yet
|
|
935 no GetCurrencyFormat not used, not examined yet
|
|
936 no EnumCalendarInfo not used, not examined yet
|
|
937 no EnumCalendarInfoEx not used, not examined yet
|
|
938 no EnumTimeFormats not used, not examined yet
|
|
939 no EnumDateFormats not used, not examined yet
|
|
940 no EnumDateFormatsEx not used, not examined yet
|
|
941 no GetStringTypeEx not used, not examined yet
|
800
|
942 no GetStringType no such fun; A and W versions have different nos. of args
|
798
|
943 no FoldString not used, not examined yet
|
|
944 no EnumSystemLocales not used, not examined yet
|
|
945 no EnumSystemCodePages not used, not examined yet
|
|
946
|
|
947 end-unicode-encapsulation-script
|
771
|
948
|
|
949 file WINVER.H
|
|
950
|
|
951 VerFindFile
|
|
952 VerInstallFile
|
|
953 GetFileVersionInfoSize
|
|
954 GetFileVersionInfo
|
|
955 VerLanguageName
|
|
956 VerQueryValue
|
|
957
|
|
958 begin-unicode-encapsulation-script
|
|
959
|
|
960 file WINCON.H
|
|
961
|
|
962 yes PeekConsoleInput
|
|
963 yes ReadConsoleInput
|
|
964 yes WriteConsoleInput
|
|
965 yes ReadConsoleOutput
|
|
966 yes WriteConsoleOutput
|
|
967 yes ReadConsoleOutputCharacter
|
|
968 yes WriteConsoleOutputCharacter
|
|
969 no FillConsoleOutputCharacter split CHAR
|
|
970 yes ScrollConsoleScreenBuffer
|
|
971 yes GetConsoleTitle
|
|
972 yes SetConsoleTitle
|
|
973 yes ReadConsole
|
|
974 yes WriteConsole
|
|
975
|
|
976 file WINREG.H
|
|
977
|
|
978 skip RegConnectRegistry error in Cygwin prototype
|
|
979 yes RegCreateKey
|
|
980 yes RegCreateKeyEx
|
|
981 yes RegDeleteKey
|
|
982 yes RegDeleteValue
|
|
983 yes RegEnumKey
|
|
984 yes RegEnumKeyEx
|
|
985 yes RegEnumValue
|
|
986 yes RegLoadKey
|
|
987 yes RegOpenKey
|
|
988 yes RegOpenKeyEx
|
|
989 yes RegQueryInfoKey
|
|
990 yes RegQueryValue
|
|
991 split RegQueryMultipleValues PVALENT
|
|
992 yes RegQueryValueEx
|
|
993 yes RegReplaceKey
|
|
994 yes RegRestoreKey
|
|
995 yes RegSaveKey
|
|
996 yes RegSetValue
|
|
997 yes RegSetValueEx
|
|
998 yes RegUnLoadKey
|
|
999 yes InitiateSystemShutdown
|
|
1000 yes AbortSystemShutdown
|
|
1001
|
|
1002 file EXCPT.H
|
|
1003
|
|
1004 // nothing
|
|
1005
|
|
1006 file STDARG.H
|
|
1007
|
|
1008 // nothing
|
|
1009
|
|
1010 file CDERR.H
|
|
1011
|
|
1012 // nothing
|
|
1013
|
|
1014 file WINPERF.H
|
|
1015
|
|
1016 // nothing
|
|
1017
|
|
1018 file RPC.H
|
|
1019
|
|
1020 // nothing
|
|
1021
|
|
1022 file NB30.H
|
|
1023
|
|
1024 // nothing
|
|
1025
|
800
|
1026 end-unicode-encapsulation-script
|
|
1027
|
771
|
1028 file WINSOCK2.H
|
|
1029
|
|
1030 SO_PROTOCOL_INFO
|
|
1031 SERVICE_TYPE_VALUE_SAPID
|
|
1032 SERVICE_TYPE_VALUE_TCPPORT
|
|
1033 SERVICE_TYPE_VALUE_UDPPORT
|
|
1034 SERVICE_TYPE_VALUE_OBJECTID
|
|
1035 WSADuplicateSocket
|
|
1036 LPFN_WSADUPLICATESOCKET
|
|
1037 WSAEnumProtocols
|
|
1038 LPFN_WSAENUMPROTOCOLS
|
|
1039 WSASocket
|
|
1040 LPFN_WSASOCKET
|
|
1041 WSAAddressToString
|
|
1042 LPFN_WSAADDRESSTOSTRING
|
|
1043 WSAStringToAddress
|
|
1044 LPFN_WSASTRINGTOADDRESS
|
|
1045 WSALookupServiceBegin
|
|
1046 LPFN_WSALOOKUPSERVICEBEGIN
|
|
1047 WSALookupServiceNext
|
|
1048 LPFN_WSALOOKUPSERVICENEXT
|
|
1049 WSAInstallServiceClass
|
|
1050 LPFN_WSAINSTALLSERVICECLASS
|
|
1051 WSAGetServiceClassInfo
|
|
1052 LPFN_WSAGETSERVICECLASSINFO
|
|
1053 WSAEnumNameSpaceProviders
|
|
1054 LPFN_WSAENUMNAMESPACEPROVIDERS
|
|
1055 WSAGetServiceClassNameByClassId
|
|
1056 LPFN_WSAGETSERVICECLASSNAMEBYCLASSID
|
|
1057 WSASetService
|
|
1058 LPFN_WSASETSERVICE
|
|
1059
|
|
1060 file WINCRYPT.H
|
|
1061
|
|
1062 MS_DEF_PROV_
|
|
1063 MS_ENHANCED_PROV_
|
|
1064 MS_DEF_RSA_SIG_PROV_
|
|
1065 MS_DEF_RSA_SCHANNEL_PROV_
|
|
1066 MS_ENHANCED_RSA_SCHANNEL_PROV_
|
|
1067 MS_DEF_DSS_PROV_
|
|
1068 MS_DEF_DSS_DH_PROV_
|
|
1069 CryptAcquireContext
|
|
1070 CryptSignHash
|
|
1071 CryptVerifySignature
|
|
1072 CryptSetProvider
|
|
1073 CryptSetProviderEx
|
|
1074 CryptGetDefaultProvider
|
|
1075 CryptEnumProviderTypes
|
|
1076 CryptEnumProviders
|
|
1077 CERT_STORE_PROV_FILENAME_
|
|
1078 CERT_STORE_PROV_SYSTEM_
|
|
1079 sz_CERT_STORE_PROV_FILENAME_
|
|
1080 sz_CERT_STORE_PROV_SYSTEM_
|
|
1081 CERT_STORE_SAVE_TO_FILENAME_
|
|
1082 CERT_FIND_SUBJECT_STR_
|
|
1083 CERT_FIND_ISSUER_STR_
|
|
1084 CertRDNValueToStr
|
|
1085 CertNameToStr
|
|
1086 CertStrToName
|
|
1087 CertOpenSystemStore
|
|
1088 CertAddEncodedCertificateToSystemStore
|
|
1089
|
|
1090 */
|
|
1091
|
|
1092 /* the functions below are examples of hand-written Unicode-splitting
|
|
1093 code. note that it needs to be written very carefully and with
|
|
1094 intimate knowledge of the structures involved, and can sometimes be
|
|
1095 very hairy (EnumFontFamiliesEx is the most extreme example). it can
|
|
1096 be argued with some justification that this behind-the-scenes magic
|
|
1097 is confusing and potentially dangerous, and shouldn't be done. but
|
|
1098 making the calling code deal with the results in extremely hard-to-
|
|
1099 read code and is very error-prone. */
|
|
1100
|
|
1101
|
|
1102 /************************************************************************/
|
|
1103 /* would be encapsulatable but for parsing problems */
|
|
1104 /************************************************************************/
|
|
1105
|
|
1106 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1107 LRESULT
|
|
1108 qxeDefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1109 {
|
|
1110 if (XEUNICODE_P)
|
|
1111 return DefWindowProcW (hWnd, Msg, wParam, lParam);
|
|
1112 else
|
|
1113 return DefWindowProcA (hWnd, Msg, wParam, lParam);
|
|
1114 }
|
|
1115
|
|
1116
|
|
1117 /* NOTE: two versions, STRICT and non-STRICT */
|
|
1118 LRESULT
|
|
1119 qxeCallWindowProc (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1120 {
|
|
1121 if (XEUNICODE_P)
|
|
1122 return CallWindowProcW (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
|
|
1123 else
|
|
1124 return CallWindowProcA (lpPrevWndFunc, hWnd, Msg, wParam, lParam);
|
|
1125 }
|
|
1126
|
|
1127 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1128 LRESULT
|
|
1129 qxeDefDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
1130 {
|
|
1131 if (XEUNICODE_P)
|
|
1132 return DefDlgProcW (hDlg, Msg, wParam, lParam);
|
|
1133 else
|
|
1134 return DefDlgProcA (hDlg, Msg, wParam, lParam);
|
|
1135 }
|
|
1136
|
|
1137 /* NOTE: return value is conditionalized on _MAC, messes up parser */
|
|
1138 LRESULT
|
|
1139 qxeDefMDIChildProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
1140 {
|
|
1141 if (XEUNICODE_P)
|
|
1142 return DefMDIChildProcW (hWnd, uMsg, wParam, lParam);
|
|
1143 else
|
|
1144 return DefMDIChildProcA (hWnd, uMsg, wParam, lParam);
|
|
1145 }
|
|
1146
|
800
|
1147 /* This one has two entry points called GetEnvironmentStringsW and
|
|
1148 GetEnvironmentStrings. (misnamed A version) */
|
|
1149 Extbyte *
|
|
1150 qxeGetEnvironmentStrings (void)
|
|
1151 {
|
|
1152 if (XEUNICODE_P)
|
|
1153 return (Extbyte *) GetEnvironmentStringsW ();
|
|
1154 else
|
|
1155 return (Extbyte *) GetEnvironmentStrings ();
|
|
1156 }
|
|
1157
|
771
|
1158
|
|
1159 /************************************************************************/
|
|
1160 /* would be encapsulatable but for Cygwin problems */
|
|
1161 /************************************************************************/
|
|
1162
|
|
1163 LONG
|
|
1164 qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult)
|
|
1165 {
|
|
1166 /* Cygwin mistakenly omits const in first argument. */
|
|
1167 if (XEUNICODE_P)
|
|
1168 return RegConnectRegistryW ((LPWSTR) lpMachineName, hKey, phkResult);
|
|
1169 else
|
|
1170 return RegConnectRegistryA ((LPSTR) lpMachineName, hKey, phkResult);
|
|
1171 }
|
|
1172
|
1111
|
1173 HSZ
|
|
1174 qxeDdeCreateStringHandle (DWORD idInst, const Extbyte * psz, int iCodePage)
|
|
1175 {
|
|
1176 /* Cygwin mistakenly omits const in second argument. */
|
|
1177 if (XEUNICODE_P)
|
|
1178 return DdeCreateStringHandleW (idInst, (LPWSTR) psz, iCodePage);
|
|
1179 else
|
|
1180 return DdeCreateStringHandleA (idInst, (LPSTR) psz, iCodePage);
|
|
1181 }
|
|
1182
|
771
|
1183 /* NOTE: NT 4.0+ only */
|
|
1184 UINT
|
|
1185 qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons)
|
|
1186 {
|
|
1187 /* Cygwin mistakenly declares the return type as HICON. */
|
|
1188 if (XEUNICODE_P)
|
|
1189 return (UINT) ExtractIconExW ((LPCWSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
1190 else
|
|
1191 return (UINT) ExtractIconExA ((LPCSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
|
|
1192 }
|
|
1193
|
|
1194 /* NOTE: NT 4.0+ only */
|
|
1195 BOOL
|
|
1196 qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
|
|
1197 {
|
|
1198 #ifdef CYGWIN_HEADERS
|
|
1199 /* Cygwin mistakenly declares the second argument as DWORD. */
|
|
1200 if (XEUNICODE_P)
|
|
1201 return GetICMProfileW (arg1, (DWORD) arg2, (LPWSTR) arg3);
|
|
1202 else
|
|
1203 return GetICMProfileA (arg1, (DWORD) arg2, (LPSTR) arg3);
|
|
1204 #else
|
|
1205 if (XEUNICODE_P)
|
|
1206 return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
|
|
1207 else
|
|
1208 return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
|
|
1209 #endif /* CYGWIN_HEADERS */
|
|
1210 }
|
|
1211
|
|
1212 /* NOTE: NT 4.0+ only */
|
|
1213 BOOL
|
|
1214 qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4)
|
|
1215 {
|
|
1216 #ifdef CYGWIN_HEADERS
|
|
1217 /* Cygwin mistakenly declares the second argument as DWORD. */
|
|
1218 if (XEUNICODE_P)
|
|
1219 return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4);
|
|
1220 else
|
|
1221 return UpdateICMRegKeyA (arg1, (DWORD) arg2, (LPSTR) arg3, arg4);
|
|
1222 #else
|
|
1223 if (XEUNICODE_P)
|
|
1224 return UpdateICMRegKeyW (arg1, (LPWSTR) arg2, (LPWSTR) arg3, arg4);
|
|
1225 else
|
|
1226 return UpdateICMRegKeyA (arg1, (LPSTR) arg2, (LPSTR) arg3, arg4);
|
|
1227 #endif /* CYGWIN_HEADERS */
|
|
1228 }
|
|
1229
|
|
1230 #ifndef CYGWIN /* present in headers but missing in shell32.a */
|
|
1231
|
|
1232 BOOL
|
|
1233 qxeSHGetSpecialFolderPath (HWND hwndOwner, Extbyte * lpszPath, int nFolder, BOOL fCreate)
|
|
1234 {
|
|
1235 #ifdef CYGWIN_HEADERS
|
|
1236 /* Cygwin mistakenly declares the second argument as LPSTR in both
|
|
1237 versions. */
|
|
1238 if (XEUNICODE_P)
|
|
1239 return SHGetSpecialFolderPathW (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1240 else
|
|
1241 return SHGetSpecialFolderPathA (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1242 #else
|
|
1243 if (XEUNICODE_P)
|
|
1244 return SHGetSpecialFolderPathW (hwndOwner, (LPWSTR) lpszPath, nFolder, fCreate);
|
|
1245 else
|
|
1246 return SHGetSpecialFolderPathA (hwndOwner, (LPSTR) lpszPath, nFolder, fCreate);
|
|
1247 #endif
|
|
1248 }
|
|
1249
|
|
1250 #endif /* not CYGWIN */
|
|
1251
|
2500
|
1252 /********************************************************************************/
|
|
1253 /* would be encapsulatable but for header changes in different versions of VC++ */
|
|
1254 /********************************************************************************/
|
|
1255
|
|
1256 #if MSC_VERSION >= 1300
|
|
1257
|
|
1258 BOOL
|
|
1259 qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROCW lpEnumFunc, LONG lParam)
|
|
1260 {
|
|
1261 if (XEUNICODE_P)
|
|
1262 return EnumResourceTypesW (hModule, lpEnumFunc, lParam);
|
|
1263 else
|
|
1264 return EnumResourceTypesA (hModule, (ENUMRESTYPEPROCA) lpEnumFunc, lParam);
|
|
1265 }
|
|
1266
|
|
1267 BOOL
|
|
1268 qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG lParam)
|
|
1269 {
|
|
1270 if (XEUNICODE_P)
|
|
1271 return EnumResourceNamesW (hModule, (LPCWSTR) lpType, lpEnumFunc, lParam);
|
|
1272 else
|
|
1273 return EnumResourceNamesA (hModule, (LPCSTR) lpType, (ENUMRESNAMEPROCA) lpEnumFunc, lParam);
|
|
1274 }
|
|
1275
|
|
1276 BOOL
|
|
1277 qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROCW lpEnumFunc, LONG lParam)
|
|
1278 {
|
|
1279 if (XEUNICODE_P)
|
|
1280 return EnumResourceLanguagesW (hModule, (LPCWSTR) lpType, (LPCWSTR) lpName, lpEnumFunc, lParam);
|
|
1281 else
|
|
1282 return EnumResourceLanguagesA (hModule, (LPCSTR) lpType, (LPCSTR) lpName, (ENUMRESLANGPROCA) lpEnumFunc, lParam);
|
|
1283 }
|
|
1284
|
|
1285 #else
|
|
1286
|
|
1287 BOOL
|
|
1288 qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROC lpEnumFunc, LONG lParam)
|
|
1289 {
|
|
1290 if (XEUNICODE_P)
|
|
1291 return EnumResourceTypesW (hModule, lpEnumFunc, lParam);
|
|
1292 else
|
|
1293 return EnumResourceTypesA (hModule, lpEnumFunc, lParam);
|
|
1294 }
|
|
1295
|
|
1296 BOOL
|
|
1297 qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROC lpEnumFunc, LONG lParam)
|
|
1298 {
|
|
1299 if (XEUNICODE_P)
|
|
1300 return EnumResourceNamesW (hModule, (LPCWSTR) lpType, lpEnumFunc, lParam);
|
|
1301 else
|
|
1302 return EnumResourceNamesA (hModule, (LPCSTR) lpType, lpEnumFunc, lParam);
|
|
1303 }
|
|
1304
|
|
1305 BOOL
|
|
1306 qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROC lpEnumFunc, LONG lParam)
|
|
1307 {
|
|
1308 if (XEUNICODE_P)
|
|
1309 return EnumResourceLanguagesW (hModule, (LPCWSTR) lpType, (LPCWSTR) lpName, lpEnumFunc, lParam);
|
|
1310 else
|
|
1311 return EnumResourceLanguagesA (hModule, (LPCSTR) lpType, (LPCSTR) lpName, lpEnumFunc, lParam);
|
|
1312 }
|
|
1313
|
|
1314 #endif /* MSC_VERSION >= 1300 */
|
771
|
1315
|
|
1316 /************************************************************************/
|
|
1317 /* files */
|
|
1318 /************************************************************************/
|
|
1319
|
|
1320 static void
|
|
1321 copy_win32_find_dataa_to_win32_find_dataw (const WIN32_FIND_DATAA *pa,
|
|
1322 WIN32_FIND_DATAW *pw)
|
|
1323 {
|
|
1324 /* the layout of WIN32_FIND_DATA is
|
|
1325
|
|
1326 non-split fields;
|
|
1327 TCHAR cFileName[...];
|
|
1328 TCHAR cAlternateFileName[...];
|
|
1329 */
|
|
1330
|
|
1331 xzero (*pw);
|
|
1332 memcpy (pw, pa, offsetof (WIN32_FIND_DATAA, cFileName));
|
|
1333 memcpy (pw->cFileName, pa->cFileName, sizeof (pa->cFileName));
|
|
1334 memcpy (pw->cAlternateFileName, pa->cAlternateFileName,
|
|
1335 sizeof (pa->cAlternateFileName));
|
|
1336 }
|
|
1337
|
|
1338 HANDLE
|
|
1339 qxeFindFirstFile (const Extbyte *lpFileName,
|
|
1340 WIN32_FIND_DATAW *lpFindFileData)
|
|
1341 {
|
|
1342 if (XEUNICODE_P)
|
|
1343 return FindFirstFileW ((LPCWSTR) lpFileName, lpFindFileData);
|
|
1344 else
|
|
1345 {
|
|
1346 WIN32_FIND_DATAA ansidat;
|
|
1347 HANDLE retval;
|
|
1348
|
|
1349 retval = FindFirstFileA ((LPCSTR) lpFileName, &ansidat);
|
|
1350 if (retval != INVALID_HANDLE_VALUE)
|
|
1351 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, lpFindFileData);
|
|
1352 return retval;
|
|
1353 }
|
|
1354 }
|
|
1355
|
|
1356 BOOL
|
|
1357 qxeFindNextFile (HANDLE hFindFile, WIN32_FIND_DATAW *lpFindFileData)
|
|
1358 {
|
|
1359 if (XEUNICODE_P)
|
|
1360 return FindNextFileW (hFindFile, lpFindFileData);
|
|
1361 else
|
|
1362 {
|
|
1363 WIN32_FIND_DATAA ansidat;
|
|
1364 BOOL retval;
|
|
1365
|
|
1366 retval = FindNextFileA (hFindFile, &ansidat);
|
|
1367 if (retval)
|
|
1368 copy_win32_find_dataa_to_win32_find_dataw (&ansidat, lpFindFileData);
|
|
1369 return retval;
|
|
1370 }
|
|
1371 }
|
|
1372
|
|
1373
|
|
1374 /************************************************************************/
|
|
1375 /* shell */
|
|
1376 /************************************************************************/
|
|
1377
|
|
1378 static void
|
|
1379 copy_shfileinfoa_to_shfileinfow (const SHFILEINFOA *pa,
|
778
|
1380 SHFILEINFOW *pw, UINT sz)
|
771
|
1381 {
|
|
1382 /* the layout of SHFILEINFO is
|
|
1383
|
|
1384 non-split fields;
|
|
1385 TCHAR szDisplayName[...];
|
|
1386 TCHAR szTypeName[...];
|
|
1387 */
|
|
1388
|
778
|
1389 assert (sz >= sizeof (SHFILEINFOW));
|
771
|
1390 xzero (*pw);
|
|
1391 memcpy (pw, pa, offsetof (SHFILEINFOA, szDisplayName));
|
|
1392 memcpy (pw->szDisplayName, pa->szDisplayName, sizeof (pa->szDisplayName));
|
|
1393 memcpy (pw->szTypeName, pa->szTypeName, sizeof (pa->szTypeName));
|
|
1394 }
|
|
1395
|
|
1396 DWORD
|
|
1397 qxeSHGetFileInfo (const Extbyte *pszPath, DWORD dwFileAttributes,
|
|
1398 SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags)
|
|
1399 {
|
|
1400 if (XEUNICODE_P)
|
|
1401 return SHGetFileInfoW ((LPCWSTR) pszPath, dwFileAttributes,
|
|
1402 psfi, cbFileInfo, uFlags);
|
|
1403 else
|
|
1404 {
|
|
1405 SHFILEINFOA ansidat;
|
|
1406 BOOL retval;
|
|
1407
|
|
1408 retval = SHGetFileInfoA ((LPCSTR) pszPath, dwFileAttributes,
|
778
|
1409 (SHFILEINFOA FAR *) &ansidat,
|
|
1410 cbFileInfo ? sizeof (ansidat) : 0, uFlags);
|
|
1411 if (retval && cbFileInfo)
|
|
1412 copy_shfileinfoa_to_shfileinfow (&ansidat, psfi, cbFileInfo);
|
771
|
1413 return retval;
|
|
1414 }
|
|
1415 }
|
|
1416
|
|
1417 struct intercepted_SHBrowseForFolder
|
|
1418 {
|
|
1419 BFFCALLBACK lpfn;
|
|
1420 LPARAM lParam;
|
|
1421 HWND hwnd;
|
|
1422 struct intercepted_SHBrowseForFolder *next;
|
|
1423 };
|
|
1424
|
|
1425 static struct intercepted_SHBrowseForFolder *SHBrowseForFolder_list;
|
|
1426
|
|
1427 static int
|
|
1428 CALLBACK intercepted_SHBrowseForFolder_proc (HWND hwnd, UINT msg,
|
|
1429 LPARAM lParam, LPARAM lpData)
|
|
1430 {
|
|
1431 struct intercepted_SHBrowseForFolder *s =
|
|
1432 (struct intercepted_SHBrowseForFolder *) lpData;
|
|
1433
|
|
1434 if (s->hwnd == 0)
|
|
1435 s->hwnd = hwnd;
|
|
1436 if (s->lpfn)
|
|
1437 {
|
|
1438 /* see below */
|
|
1439 if (XEUNICODE_P && msg == BFFM_VALIDATEFAILEDW)
|
|
1440 msg = BFFM_VALIDATEFAILEDA;
|
|
1441 else if (!XEUNICODE_P && msg == BFFM_VALIDATEFAILEDA)
|
|
1442 msg = BFFM_VALIDATEFAILEDW;
|
|
1443 return (s->lpfn) (hwnd, msg, lParam, s->lParam);
|
|
1444 }
|
|
1445 else
|
|
1446 return 0;
|
|
1447 }
|
|
1448
|
1204
|
1449 #ifdef HAVE_MS_WINDOWS
|
|
1450
|
771
|
1451 static int
|
|
1452 is_SHBrowseForFolder (HWND hwnd)
|
|
1453 {
|
|
1454 struct intercepted_SHBrowseForFolder *s;
|
|
1455
|
|
1456 for (s = SHBrowseForFolder_list; s; s = s->next)
|
|
1457 if (s->hwnd == hwnd)
|
|
1458 return 1;
|
|
1459 return 0;
|
|
1460 }
|
|
1461
|
1204
|
1462 #endif /* HAVE_MS_WINDOWS */
|
|
1463
|
771
|
1464 LPITEMIDLIST
|
|
1465 qxeSHBrowseForFolder (LPBROWSEINFOW lpbi)
|
|
1466 {
|
|
1467 struct intercepted_SHBrowseForFolder s;
|
|
1468 LPITEMIDLIST retval;
|
|
1469
|
|
1470 /* There are two outgoing Unicode-split messages:
|
|
1471
|
|
1472 BFFM_SETSELECTION
|
|
1473 BFFM_SETSTATUSTEXT
|
|
1474
|
|
1475 and one incoming:
|
|
1476
|
|
1477 BFFM_VALIDATEFAILED
|
|
1478
|
|
1479 To handle this, we need to intercept the callback. We handle the
|
|
1480 incoming message in the callback, and record the window; when
|
|
1481 qxeSendMessage() is called, we handle the outgoing messages. None of
|
|
1482 the messages have split-sized structures so we don't need to do
|
|
1483 anything complicated there. */
|
|
1484
|
|
1485 s.lParam = lpbi->lParam;
|
|
1486 s.lpfn = lpbi->lpfn;
|
|
1487 s.next = SHBrowseForFolder_list;
|
|
1488 s.hwnd = 0;
|
|
1489 SHBrowseForFolder_list = &s;
|
|
1490
|
|
1491 lpbi->lpfn = intercepted_SHBrowseForFolder_proc;
|
|
1492 lpbi->lParam = (LPARAM) &s;
|
|
1493
|
|
1494 if (XEUNICODE_P)
|
|
1495 retval = SHBrowseForFolderW (lpbi);
|
|
1496 else
|
|
1497 retval = SHBrowseForFolderA ((LPBROWSEINFOA) lpbi);
|
|
1498 SHBrowseForFolder_list = SHBrowseForFolder_list->next;
|
|
1499 return retval;
|
|
1500 }
|
|
1501
|
|
1502 VOID
|
|
1503 qxeSHAddToRecentDocs (UINT uFlags, LPCVOID pv)
|
|
1504 {
|
|
1505 /* pv can be a string pointer; this is handled by Unicode-splitting the
|
|
1506 flag SHARD_PATH rather than the function itself. Fix up the flag to
|
|
1507 be correct. We write it symmetrically so it doesn't matter whether
|
|
1508 UNICODE is defined. */
|
|
1509 if (XEUNICODE_P)
|
|
1510 {
|
|
1511 if (uFlags & SHARD_PATHA)
|
|
1512 {
|
|
1513 uFlags |= SHARD_PATHW;
|
|
1514 uFlags &= ~SHARD_PATHA;
|
|
1515 }
|
|
1516 }
|
|
1517 else
|
|
1518 {
|
|
1519 if (uFlags & SHARD_PATHW)
|
|
1520 {
|
|
1521 uFlags |= SHARD_PATHA;
|
|
1522 uFlags &= ~SHARD_PATHW;
|
|
1523 }
|
|
1524 }
|
|
1525 SHAddToRecentDocs (uFlags, pv);
|
|
1526 }
|
|
1527
|
|
1528 VOID
|
|
1529 qxeSHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1,
|
|
1530 LPCVOID dwItem2)
|
|
1531 {
|
|
1532 /* works like SHAddToRecentDocs */
|
|
1533 if (XEUNICODE_P)
|
|
1534 {
|
|
1535 if (uFlags & SHCNF_PATHA)
|
|
1536 {
|
|
1537 uFlags |= SHCNF_PATHW;
|
|
1538 uFlags &= ~SHCNF_PATHA;
|
|
1539 }
|
|
1540 if (uFlags & SHCNF_PRINTERA)
|
|
1541 {
|
|
1542 uFlags |= SHCNF_PRINTERW;
|
|
1543 uFlags &= ~SHCNF_PRINTERA;
|
|
1544 }
|
|
1545 }
|
|
1546 else
|
|
1547 {
|
|
1548 if (uFlags & SHCNF_PATHW)
|
|
1549 {
|
|
1550 uFlags |= SHCNF_PATHA;
|
|
1551 uFlags &= ~SHCNF_PATHW;
|
|
1552 }
|
|
1553 if (uFlags & SHCNF_PRINTERW)
|
|
1554 {
|
|
1555 uFlags |= SHCNF_PRINTERA;
|
|
1556 uFlags &= ~SHCNF_PRINTERW;
|
|
1557 }
|
|
1558 }
|
|
1559 SHChangeNotify (wEventId, uFlags, dwItem1, dwItem2);
|
|
1560 }
|
|
1561
|
|
1562 #ifndef CYGWIN /* present in headers but missing in shell32.a */
|
|
1563
|
|
1564 HRESULT
|
|
1565 qxeSHGetDataFromIDList (IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat,
|
|
1566 PVOID pv, int cb)
|
|
1567 {
|
|
1568 if (XEUNICODE_P)
|
|
1569 return SHGetDataFromIDListW (psf, pidl, nFormat, pv, cb);
|
|
1570 else if (nFormat == SHGDFIL_FINDDATA)
|
|
1571 {
|
|
1572 WIN32_FIND_DATAA ansidat;
|
|
1573 BOOL retval;
|
|
1574
|
|
1575 retval = SHGetDataFromIDListA (psf, pidl, nFormat, &ansidat, cb);
|
|
1576 if (retval == NOERROR)
|
1204
|
1577 copy_win32_find_dataa_to_win32_find_dataw (&ansidat,
|
|
1578 (WIN32_FIND_DATAW *) pv);
|
771
|
1579 return retval;
|
|
1580 }
|
|
1581 else
|
|
1582 /* nFormat == SHGDFIL_NETRESOURCE, and pv is split-simple NETRESOURCE
|
|
1583 structure, but we don't need to worry about that currently since we
|
|
1584 don't translate strings */
|
|
1585 return SHGetDataFromIDListA (psf, pidl, nFormat, pv, cb);
|
|
1586 }
|
|
1587
|
|
1588 #endif /* not CYGWIN */
|
|
1589
|
|
1590
|
|
1591
|
|
1592 #ifdef HAVE_MS_WINDOWS
|
|
1593
|
|
1594 /************************************************************************/
|
|
1595 /* devmode */
|
|
1596 /************************************************************************/
|
|
1597
|
|
1598 /* These functions return globally allocated blocks because some
|
|
1599 callers (e.g. qxePrintDlg) want this. */
|
|
1600
|
|
1601 static HGLOBAL
|
|
1602 copy_devmodew_to_devmodea (const DEVMODEW *src, DEVMODEA *dst)
|
|
1603 {
|
|
1604 /* the layout of DEVMODE is
|
|
1605
|
|
1606 TCHAR dmDeviceName[...];
|
|
1607 non-split fields, including dmSize (size of structure; differs between
|
|
1608 Unicode and ANSI) and dmDriverExtra;
|
|
1609 TCHAR dmFormName[...];
|
|
1610 non-split fields;
|
|
1611 extra data, of size DEVMODE->dmDriverExtra
|
|
1612 */
|
|
1613 HGLOBAL hdst = NULL;
|
|
1614
|
|
1615 if (!dst)
|
|
1616 {
|
|
1617 hdst = GlobalAlloc (GHND, src->dmSize + src->dmDriverExtra -
|
|
1618 (sizeof (DEVMODEW) - sizeof (DEVMODEA)));
|
|
1619 dst = (DEVMODEA *) GlobalLock (hdst);
|
|
1620 }
|
|
1621
|
|
1622 memcpy (dst->dmDeviceName, src->dmDeviceName, sizeof (dst->dmDeviceName));
|
|
1623 memcpy ((char *) dst + sizeof (dst->dmDeviceName),
|
|
1624 (char *) src + sizeof (src->dmDeviceName),
|
|
1625 offsetof (DEVMODEA, dmFormName) - sizeof (dst->dmDeviceName));
|
|
1626 dst->dmSize -= sizeof (DEVMODEW) - sizeof (DEVMODEA);
|
|
1627 memcpy (dst->dmFormName, src->dmFormName, sizeof (dst->dmFormName));
|
|
1628 memcpy ((char *) dst + offsetof (DEVMODEA, dmFormName) +
|
|
1629 sizeof (dst->dmFormName),
|
|
1630 (char *) src + offsetof (DEVMODEW, dmFormName) +
|
|
1631 sizeof (src->dmFormName),
|
|
1632 dst->dmSize + dst->dmDriverExtra -
|
|
1633 (offsetof (DEVMODEA, dmFormName) + sizeof (dst->dmFormName)));
|
|
1634
|
|
1635 if (hdst)
|
|
1636 GlobalUnlock (hdst);
|
|
1637 return hdst;
|
|
1638 }
|
|
1639
|
|
1640 static HGLOBAL
|
|
1641 copy_devmodea_to_devmodew (const DEVMODEA *src, DEVMODEW *dst)
|
|
1642 {
|
|
1643 HGLOBAL hdst = NULL;
|
|
1644
|
|
1645 if (!dst)
|
|
1646 {
|
|
1647 hdst = GlobalAlloc (GHND, src->dmSize + src->dmDriverExtra +
|
|
1648 (sizeof (DEVMODEW) - sizeof (DEVMODEA)));
|
|
1649 dst = (DEVMODEW *) GlobalLock (hdst);
|
|
1650 }
|
|
1651
|
|
1652 memcpy (dst->dmDeviceName, src->dmDeviceName, sizeof (src->dmDeviceName));
|
|
1653 memcpy ((char *) dst + sizeof (dst->dmDeviceName),
|
|
1654 (char *) src + sizeof (src->dmDeviceName),
|
|
1655 offsetof (DEVMODEA, dmFormName) - sizeof (src->dmDeviceName));
|
|
1656 dst->dmSize += sizeof (DEVMODEW) - sizeof (DEVMODEA);
|
|
1657 memcpy (dst->dmFormName, src->dmFormName, sizeof (src->dmFormName));
|
|
1658 memcpy ((char *) dst + offsetof (DEVMODEW, dmFormName) +
|
|
1659 sizeof (dst->dmFormName),
|
|
1660 (char *) src + offsetof (DEVMODEA, dmFormName) +
|
|
1661 sizeof (src->dmFormName),
|
|
1662 src->dmSize + src->dmDriverExtra -
|
|
1663 (offsetof (DEVMODEA, dmFormName) + sizeof (src->dmFormName)));
|
|
1664
|
|
1665 if (hdst)
|
|
1666 GlobalUnlock (hdst);
|
|
1667 return hdst;
|
|
1668 }
|
|
1669
|
|
1670 HDC
|
|
1671 qxeCreateDC (const Extbyte *lpszDriver, const Extbyte *lpszDevice,
|
|
1672 const Extbyte *lpszOutput, CONST DEVMODEW *lpInitData)
|
|
1673 {
|
|
1674 if (XEUNICODE_P)
|
|
1675 return CreateDCW ((LPCWSTR) lpszDriver, (LPCWSTR) lpszDevice,
|
|
1676 (LPCWSTR) lpszOutput, lpInitData);
|
|
1677 else
|
|
1678 {
|
|
1679 HGLOBAL hInitData = NULL;
|
|
1680 DEVMODEA *lpInitDataa = NULL;
|
|
1681 HDC retval;
|
|
1682
|
|
1683 if (lpInitData)
|
|
1684 {
|
|
1685 hInitData = copy_devmodew_to_devmodea (lpInitData, NULL);
|
|
1686 lpInitDataa = (DEVMODEA *) GlobalLock (hInitData);
|
|
1687 }
|
|
1688 retval = CreateDCA ((LPCSTR) lpszDriver, (LPCSTR) lpszDevice,
|
|
1689 (LPCSTR) lpszOutput, lpInitDataa);
|
|
1690
|
|
1691 if (hInitData)
|
|
1692 {
|
|
1693 GlobalUnlock (hInitData);
|
|
1694 GlobalFree (hInitData);
|
|
1695 }
|
|
1696
|
|
1697 return retval;
|
|
1698 }
|
|
1699 }
|
|
1700
|
|
1701 HDC
|
|
1702 qxeResetDC (HDC hdc, CONST DEVMODEW *lpInitData)
|
|
1703 {
|
|
1704 if (XEUNICODE_P)
|
|
1705 return ResetDCW (hdc, lpInitData);
|
|
1706 else
|
|
1707 {
|
|
1708 HGLOBAL hInitData = NULL;
|
|
1709 DEVMODEA *lpInitDataa = NULL;
|
|
1710 HDC retval;
|
|
1711
|
|
1712 if (lpInitData)
|
|
1713 {
|
|
1714 hInitData = copy_devmodew_to_devmodea (lpInitData, NULL);
|
|
1715 lpInitDataa = (DEVMODEA *) GlobalLock (hInitData);
|
|
1716 }
|
|
1717 retval = ResetDCA (hdc, lpInitDataa);
|
|
1718
|
|
1719 if (hInitData)
|
|
1720 {
|
|
1721 GlobalUnlock (hInitData);
|
|
1722 GlobalFree (hInitData);
|
|
1723 }
|
|
1724
|
|
1725 return retval;
|
|
1726 }
|
|
1727 }
|
|
1728
|
|
1729 DWORD
|
|
1730 qxeOpenPrinter (Extbyte *pPrinterName, LPHANDLE phPrinter,
|
|
1731 LPPRINTER_DEFAULTSW pDefaultconst)
|
|
1732 {
|
|
1733 assert (!pDefaultconst); /* we don't split it, so let's make sure we
|
|
1734 don't try. */
|
|
1735 if (XEUNICODE_P)
|
|
1736 return OpenPrinterW ((LPWSTR) pPrinterName, phPrinter,
|
|
1737 pDefaultconst);
|
|
1738 else
|
|
1739 return OpenPrinterA ((LPSTR) pPrinterName, phPrinter,
|
|
1740 (LPPRINTER_DEFAULTSA) pDefaultconst);
|
|
1741 }
|
|
1742
|
|
1743 LONG
|
|
1744 qxeDocumentProperties (HWND hWnd, HANDLE hPrinter, Extbyte *pDeviceName,
|
|
1745 DEVMODEW *pDevModeOutput, DEVMODEW *pDevModeInput,
|
|
1746 DWORD fMode)
|
|
1747 {
|
|
1748 if (XEUNICODE_P)
|
2262
|
1749 #if defined (CYGWIN_HEADERS) && W32API_INSTALLED_VER < W32API_VER(3,1)
|
|
1750 /* Cygwin used to mistakenly declare the fourth and fifth arguments as
|
771
|
1751 PDEVMODEA. */
|
|
1752 return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName,
|
|
1753 (DEVMODEA *) pDevModeOutput,
|
|
1754 (DEVMODEA *) pDevModeInput, fMode);
|
|
1755 #else
|
|
1756 return DocumentPropertiesW (hWnd, hPrinter, (LPWSTR) pDeviceName,
|
|
1757 pDevModeOutput, pDevModeInput, fMode);
|
|
1758 #endif /* CYGWIN_HEADERS */
|
|
1759 else
|
|
1760 {
|
|
1761 HGLOBAL hDevModeInput = NULL;
|
|
1762 DEVMODEA *pDevModeInputa = NULL;
|
|
1763 LONG retval;
|
|
1764
|
|
1765 if (pDevModeInput)
|
|
1766 {
|
|
1767 hDevModeInput = copy_devmodew_to_devmodea (pDevModeInput, NULL);
|
|
1768 pDevModeInputa = (DEVMODEA *) GlobalLock (hDevModeInput);
|
|
1769 }
|
|
1770
|
|
1771 /* Here we cheat a bit to avoid a problem: If the output
|
|
1772 structure is given but not the input one, how do we know how
|
|
1773 big to allocate our shadow output structure? Since the
|
|
1774 shadow structure is ANSI and the original Unicode, we know
|
|
1775 the shadow structure is smaller than what's given, so we just
|
|
1776 write into the given structure and then fix. */
|
|
1777 retval = DocumentPropertiesA (hWnd, hPrinter, (LPSTR) pDeviceName,
|
|
1778 pDevModeOutput ?
|
|
1779 (DEVMODEA *) pDevModeOutput : 0,
|
|
1780 pDevModeInput ? pDevModeInputa : 0,
|
|
1781 fMode);
|
|
1782
|
|
1783 if (hDevModeInput)
|
|
1784 {
|
|
1785 GlobalUnlock (hDevModeInput);
|
|
1786 GlobalFree (hDevModeInput);
|
|
1787 }
|
|
1788
|
|
1789 if (retval >= 0 && pDevModeOutput)
|
|
1790 {
|
|
1791 /* copy the shadow structure out of the way and then put the
|
|
1792 right contents back. */
|
|
1793 DEVMODEA *shadow = (DEVMODEA *) pDevModeOutput;
|
|
1794 DEVMODEA *newshadow = alloca_array (DEVMODEA, shadow->dmSize +
|
|
1795 shadow->dmDriverExtra);
|
|
1796
|
|
1797 memcpy (newshadow, shadow, shadow->dmSize + shadow->dmDriverExtra);
|
|
1798 copy_devmodea_to_devmodew (newshadow, pDevModeOutput);
|
|
1799 }
|
|
1800
|
|
1801 if (fMode == 0)
|
|
1802 retval += (sizeof (DEVMODEW) - sizeof (DEVMODEA));
|
|
1803 return retval;
|
|
1804 }
|
|
1805 }
|
|
1806
|
|
1807 static BOOL
|
|
1808 ansi_printer_dialog_1 (void *strucked, HGLOBAL *devmode_inout, int do_PrintDlg)
|
|
1809 {
|
|
1810 HGLOBAL hdma = NULL;
|
|
1811 HGLOBAL hdmw = *devmode_inout;
|
|
1812 DEVMODEW *dmw = NULL;
|
|
1813 BOOL retval;
|
|
1814
|
|
1815 if (hdmw != NULL)
|
|
1816 {
|
|
1817 /* copy to shadow in structure if needed */
|
|
1818 dmw = (DEVMODEW *) GlobalLock (hdmw);
|
|
1819 hdma = copy_devmodew_to_devmodea (dmw, NULL);
|
|
1820 *devmode_inout = hdma;
|
|
1821 }
|
|
1822
|
|
1823 if (do_PrintDlg)
|
|
1824 retval = PrintDlgA ((PRINTDLGA *) strucked);
|
|
1825 else
|
|
1826 retval = PageSetupDlgA ((PAGESETUPDLGA *) strucked);
|
|
1827
|
|
1828 if (retval)
|
|
1829 {
|
|
1830 /* copy the shadow output structure back to original, or
|
|
1831 allocate new one. */
|
|
1832 if (*devmode_inout)
|
|
1833 {
|
|
1834 DEVMODEA *newdma = (DEVMODEA *) GlobalLock (*devmode_inout);
|
|
1835 if (dmw)
|
|
1836 {
|
|
1837 copy_devmodea_to_devmodew (newdma, dmw);
|
|
1838 GlobalUnlock (hdmw);
|
|
1839 }
|
|
1840 else
|
|
1841 hdmw = copy_devmodea_to_devmodew (newdma, NULL);
|
|
1842 GlobalUnlock (*devmode_inout);
|
|
1843 GlobalFree (*devmode_inout);
|
|
1844 *devmode_inout = hdmw;
|
|
1845 }
|
|
1846 else if (hdma)
|
|
1847 /* #### can this happen? */
|
|
1848 GlobalFree (hdma);
|
|
1849 }
|
|
1850
|
|
1851 return retval;
|
|
1852 }
|
|
1853
|
|
1854 BOOL
|
|
1855 qxePrintDlg (PRINTDLGW *lppd)
|
|
1856 {
|
|
1857 if (XEUNICODE_P)
|
|
1858 return PrintDlgW (lppd);
|
|
1859 else
|
|
1860 return ansi_printer_dialog_1 (lppd, &lppd->hDevMode, 1);
|
|
1861 }
|
|
1862
|
|
1863 BOOL
|
|
1864 qxePageSetupDlg (PAGESETUPDLGW *lppd)
|
|
1865 {
|
|
1866 if (XEUNICODE_P)
|
|
1867 return PageSetupDlgW (lppd);
|
|
1868 else
|
|
1869 return ansi_printer_dialog_1 (lppd, &lppd->hDevMode, 0);
|
|
1870 }
|
|
1871
|
|
1872
|
|
1873 /************************************************************************/
|
|
1874 /* fonts */
|
|
1875 /************************************************************************/
|
|
1876
|
|
1877 static void
|
|
1878 copy_logfonta_to_logfontw (const LOGFONTA *src, LOGFONTW *dst)
|
|
1879 {
|
|
1880 /* the layout of LOGFONT is
|
|
1881
|
|
1882 non-split fields;
|
|
1883 TCHAR lfFaceName[...];
|
|
1884 */
|
|
1885 memcpy (dst, src, sizeof (LOGFONTA));
|
|
1886 }
|
|
1887
|
|
1888 static void
|
|
1889 copy_logfontw_to_logfonta (const LOGFONTW *src, LOGFONTA *dst)
|
|
1890 {
|
|
1891 memcpy (dst, src, sizeof (LOGFONTA));
|
|
1892 }
|
|
1893
|
872
|
1894 #if 0 /* unused */
|
|
1895
|
771
|
1896 static void
|
|
1897 copy_enumlogfonta_to_enumlogfontw (const ENUMLOGFONTA *src, ENUMLOGFONTW *dst)
|
|
1898 {
|
|
1899 /* the layout of ENUMLOGFONT is
|
|
1900
|
|
1901 LOGFONT elfLogFont;
|
|
1902 TCHAR elfFullName[...];
|
|
1903 TCHAR elfStyle[...];
|
|
1904 */
|
|
1905 xzero (*dst);
|
|
1906 copy_logfonta_to_logfontw (&src->elfLogFont, &dst->elfLogFont);
|
|
1907 memcpy (dst->elfFullName, src->elfFullName, sizeof (src->elfFullName));
|
|
1908 memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle));
|
|
1909 }
|
|
1910
|
872
|
1911 #endif /* 0 */
|
|
1912
|
771
|
1913 static void
|
|
1914 copy_enumlogfontexa_to_enumlogfontexw (const ENUMLOGFONTEXA *src,
|
|
1915 ENUMLOGFONTEXW *dst)
|
|
1916 {
|
|
1917 /* the layout of ENUMLOGFONT is
|
|
1918
|
|
1919 LOGFONT elfLogFont;
|
|
1920 TCHAR elfFullName[...];
|
|
1921 TCHAR elfStyle[...];
|
|
1922 TCHAR elfScript[...];
|
|
1923 */
|
|
1924 xzero (*dst);
|
|
1925 copy_logfonta_to_logfontw (&src->elfLogFont, &dst->elfLogFont);
|
|
1926 memcpy (dst->elfFullName, src->elfFullName, sizeof (src->elfFullName));
|
|
1927 memcpy (dst->elfStyle, src->elfStyle, sizeof (src->elfStyle));
|
|
1928 memcpy (dst->elfScript, src->elfScript, sizeof (src->elfScript));
|
|
1929 }
|
|
1930
|
|
1931 static void
|
|
1932 copy_newtextmetrica_to_newtextmetricw (const NEWTEXTMETRICA *src,
|
|
1933 NEWTEXTMETRICW *dst)
|
|
1934 {
|
|
1935 /* the layout of NEWTEXTMETRIC is
|
|
1936
|
|
1937 non-split fields;
|
|
1938 WCHAR/BYTE tmFirstChar;
|
|
1939 WCHAR/BYTE tmLastChar;
|
|
1940 WCHAR/BYTE tmDefaultChar;
|
|
1941 WCHAR/BYTE tmBreakChar;
|
|
1942 BYTE tmItalic;
|
|
1943 non-split fields;
|
|
1944 */
|
|
1945 xzero (*dst);
|
|
1946 memcpy ((char *) dst, (char *) src,
|
|
1947 offsetof (NEWTEXTMETRICA, tmFirstChar));
|
|
1948 memcpy ((char *) dst + offsetof (NEWTEXTMETRICW, tmItalic),
|
|
1949 (char *) src + offsetof (NEWTEXTMETRICA, tmItalic),
|
|
1950 sizeof (NEWTEXTMETRICA) - offsetof (NEWTEXTMETRICA, tmItalic));
|
|
1951 dst->tmFirstChar = (WCHAR) src->tmFirstChar;
|
|
1952 dst->tmLastChar = (WCHAR) src->tmLastChar;
|
|
1953 dst->tmDefaultChar = (WCHAR) src->tmDefaultChar;
|
|
1954 dst->tmBreakChar = (WCHAR) src->tmBreakChar;
|
|
1955 }
|
|
1956
|
|
1957 static void
|
|
1958 copy_newtextmetricexa_to_newtextmetricexw (const NEWTEXTMETRICEXA *src,
|
|
1959 NEWTEXTMETRICEXW *dst)
|
|
1960 {
|
|
1961 /* the layout of NEWTEXTMETRICEX is
|
|
1962
|
|
1963 NEWTEXTMETRICA/W ntmTm;
|
|
1964 FONTSIGNATURE ntmFontSig;
|
|
1965 */
|
|
1966 copy_newtextmetrica_to_newtextmetricw (&src->ntmTm, &dst->ntmTm);
|
|
1967 dst->ntmFontSig = src->ntmFontSig;
|
|
1968 }
|
|
1969
|
872
|
1970 #if 0 /* unused */
|
|
1971
|
771
|
1972 static void
|
|
1973 copy_textmetricw_to_textmetrica (const TEXTMETRICW *src,
|
|
1974 TEXTMETRICA *dst)
|
|
1975 {
|
|
1976 /* the layout of TEXTMETRIC is like NEWTEXTMETRIC; see above. */
|
|
1977 xzero (*dst);
|
|
1978 memcpy ((char *) dst, (char *) src,
|
|
1979 offsetof (TEXTMETRICA, tmFirstChar));
|
|
1980 memcpy ((char *) dst + offsetof (TEXTMETRICA, tmItalic),
|
|
1981 (char *) src + offsetof (TEXTMETRICW, tmItalic),
|
|
1982 sizeof (TEXTMETRICA) - offsetof (TEXTMETRICA, tmItalic));
|
|
1983 dst->tmFirstChar = (BYTE) src->tmFirstChar;
|
|
1984 dst->tmLastChar = (BYTE) src->tmLastChar;
|
|
1985 dst->tmDefaultChar = (BYTE) src->tmDefaultChar;
|
|
1986 dst->tmBreakChar = (BYTE) src->tmBreakChar;
|
|
1987 }
|
|
1988
|
872
|
1989 #endif /* 0 */
|
|
1990
|
771
|
1991 static void
|
|
1992 copy_textmetrica_to_textmetricw (const TEXTMETRICA *src,
|
|
1993 TEXTMETRICW *dst)
|
|
1994 {
|
|
1995 /* the layout of TEXTMETRIC is like NEWTEXTMETRIC; see above. */
|
|
1996 xzero (*dst);
|
|
1997 memcpy ((char *) dst, (char *) src,
|
|
1998 offsetof (TEXTMETRICA, tmFirstChar));
|
|
1999 memcpy ((char *) dst + offsetof (TEXTMETRICW, tmItalic),
|
|
2000 (char *) src + offsetof (TEXTMETRICA, tmItalic),
|
|
2001 sizeof (TEXTMETRICA) - offsetof (TEXTMETRICA, tmItalic));
|
|
2002 dst->tmFirstChar = (WCHAR) src->tmFirstChar;
|
|
2003 dst->tmLastChar = (WCHAR) src->tmLastChar;
|
|
2004 dst->tmDefaultChar = (WCHAR) src->tmDefaultChar;
|
|
2005 dst->tmBreakChar = (WCHAR) src->tmBreakChar;
|
|
2006 }
|
|
2007
|
|
2008 typedef int (CALLBACK *qxeEnumFontFamExProcW) (ENUMLOGFONTEXW *lpelfe,
|
|
2009 NEWTEXTMETRICEXW *lpntme,
|
|
2010 DWORD FontType,
|
|
2011 LPARAM lParam);
|
|
2012
|
|
2013 struct qxeEnumFontFamExProcA_wrapper_t
|
|
2014 {
|
|
2015 qxeEnumFontFamExProcW orig_proc;
|
|
2016 LPARAM orig_lparam;
|
|
2017 };
|
|
2018
|
|
2019 static int CALLBACK
|
|
2020 qxeEnumFontFamExProcA_wrapper (ENUMLOGFONTEXA *lpelfe,
|
|
2021 NEWTEXTMETRICEXA *lpntme,
|
|
2022 DWORD fontType,
|
|
2023 struct qxeEnumFontFamExProcA_wrapper_t
|
|
2024 *closure)
|
|
2025 {
|
|
2026 ENUMLOGFONTEXW lpelfew;
|
|
2027 NEWTEXTMETRICEXW lpntmew;
|
|
2028
|
|
2029 /* #### if we're on Windows 2000 or above, lpelfe is actually an
|
|
2030 ENUMLOGFONTEXDV structure, and lpntme is an ENUMTEXTMETRIC structure
|
|
2031 when TRUETYPE_FONTTYPE. both are split-sized and need their own copy
|
|
2032 functions. need to handle. */
|
|
2033 copy_enumlogfontexa_to_enumlogfontexw (lpelfe, &lpelfew);
|
|
2034 if (fontType & TRUETYPE_FONTTYPE)
|
|
2035 copy_newtextmetricexa_to_newtextmetricexw (lpntme, &lpntmew);
|
|
2036 else
|
|
2037 {
|
|
2038 /* see docs of EnumFontFamExProc */
|
|
2039 xzero (lpntmew);
|
|
2040 copy_textmetrica_to_textmetricw ((TEXTMETRICA *) lpntme,
|
|
2041 (TEXTMETRICW *) &lpntmew);
|
|
2042 }
|
|
2043 return (closure->orig_proc) (&lpelfew, &lpntmew, fontType,
|
|
2044 closure->orig_lparam);
|
|
2045 }
|
|
2046
|
|
2047 int
|
|
2048 qxeEnumFontFamiliesEx (HDC hdc, LOGFONTW *lpLogfont,
|
|
2049 FONTENUMPROCW lpEnumFontFamProc, LPARAM lParam,
|
|
2050 DWORD dwFlags)
|
|
2051 {
|
|
2052 if (XEUNICODE_P)
|
|
2053 return EnumFontFamiliesExW (hdc, lpLogfont, lpEnumFontFamProc, lParam,
|
|
2054 dwFlags);
|
|
2055 else
|
|
2056 {
|
|
2057 struct qxeEnumFontFamExProcA_wrapper_t closure;
|
|
2058 LOGFONTA lfa;
|
|
2059
|
|
2060 closure.orig_proc = (qxeEnumFontFamExProcW) lpEnumFontFamProc;
|
|
2061 closure.orig_lparam = lParam;
|
|
2062 copy_logfontw_to_logfonta (lpLogfont, &lfa);
|
|
2063 return EnumFontFamiliesExA (hdc, &lfa,
|
|
2064 (FONTENUMPROCA)
|
|
2065 qxeEnumFontFamExProcA_wrapper,
|
|
2066 (LPARAM) &closure, dwFlags);
|
|
2067 }
|
|
2068 }
|
|
2069
|
|
2070 HFONT
|
|
2071 qxeCreateFontIndirect (CONST LOGFONTW *lplf)
|
|
2072 {
|
|
2073 if (XEUNICODE_P)
|
|
2074 return CreateFontIndirectW (lplf);
|
|
2075 else
|
|
2076 {
|
|
2077 LOGFONTA lfa;
|
|
2078
|
|
2079 copy_logfontw_to_logfonta (lplf, &lfa);
|
|
2080 return CreateFontIndirectA (&lfa);
|
|
2081 }
|
|
2082 }
|
|
2083
|
|
2084 BOOL
|
|
2085 qxeImmSetCompositionFont (HIMC imc, LOGFONTW *lplf)
|
|
2086 {
|
|
2087 if (XEUNICODE_P)
|
|
2088 return ImmSetCompositionFontW (imc, lplf);
|
|
2089 else
|
|
2090 {
|
|
2091 LOGFONTA lfa;
|
|
2092
|
|
2093 copy_logfontw_to_logfonta (lplf, &lfa);
|
|
2094 return ImmSetCompositionFontA (imc, &lfa);
|
|
2095 }
|
|
2096 }
|
|
2097
|
|
2098 BOOL
|
|
2099 qxeImmGetCompositionFont (HIMC imc, LOGFONTW *lplf)
|
|
2100 {
|
|
2101 if (XEUNICODE_P)
|
|
2102 return ImmGetCompositionFontW (imc, lplf);
|
|
2103 else
|
|
2104 {
|
|
2105 LOGFONTA lfa;
|
|
2106 BOOL retval = ImmGetCompositionFontA (imc, &lfa);
|
|
2107
|
|
2108 if (retval)
|
|
2109 copy_logfonta_to_logfontw (&lfa, lplf);
|
|
2110 return retval;
|
|
2111 }
|
|
2112 }
|
2500
|
2113
|
|
2114 #if MSC_VERSION >= 1300
|
|
2115
|
|
2116 BOOL
|
|
2117 qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPVOID lpComp, DWORD arg4, LPVOID lpRead, DWORD arg6)
|
|
2118 {
|
|
2119 if (XEUNICODE_P)
|
|
2120 return ImmSetCompositionStringW (arg1, dwIndex, lpComp, arg4, lpRead, arg6);
|
|
2121 else
|
|
2122 return ImmSetCompositionStringA (arg1, dwIndex, lpComp, arg4, lpRead, arg6);
|
|
2123 }
|
|
2124
|
|
2125 #else
|
|
2126
|
|
2127 BOOL
|
|
2128 qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPCVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6)
|
|
2129 {
|
|
2130 if (XEUNICODE_P)
|
|
2131 return ImmSetCompositionStringW (arg1, dwIndex, lpComp, arg4, lpRead, arg6);
|
|
2132 else
|
|
2133 return ImmSetCompositionStringA (arg1, dwIndex, lpComp, arg4, lpRead, arg6);
|
|
2134 }
|
|
2135
|
|
2136 #endif /* MSC_VERSION >= 1300 */
|
|
2137
|
771
|
2138 int
|
|
2139 qxeGetObject (HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject)
|
|
2140 {
|
|
2141 if (XEUNICODE_P)
|
|
2142 return GetObjectW (hgdiobj, cbBuffer, lpvObject);
|
|
2143 else
|
|
2144 {
|
|
2145 if (cbBuffer == sizeof (LOGFONTW))
|
|
2146 {
|
|
2147 LOGFONTA lfa;
|
|
2148 int retval = GetObjectA (hgdiobj, sizeof (LOGFONTA), &lfa);
|
|
2149
|
|
2150 if (!retval)
|
|
2151 return retval;
|
|
2152 copy_logfonta_to_logfontw (&lfa, (LOGFONTW *) lpvObject);
|
|
2153 return retval;
|
|
2154 }
|
|
2155 else
|
|
2156 return GetObjectA (hgdiobj, cbBuffer, lpvObject);
|
|
2157 }
|
|
2158 }
|
|
2159
|
|
2160 BOOL
|
|
2161 qxeGetTextMetrics (HDC hdc, LPTEXTMETRICW lptm)
|
|
2162 {
|
|
2163 if (XEUNICODE_P)
|
|
2164 return GetTextMetricsW (hdc, lptm);
|
|
2165 else
|
|
2166 {
|
|
2167 TEXTMETRICA tma;
|
|
2168 BOOL retval = GetTextMetricsA (hdc, &tma);
|
|
2169
|
|
2170 if (retval)
|
|
2171 copy_textmetrica_to_textmetricw (&tma, lptm);
|
|
2172 return retval;
|
|
2173 }
|
|
2174 }
|
|
2175
|
|
2176
|
|
2177 /************************************************************************/
|
|
2178 /* windows */
|
|
2179 /************************************************************************/
|
|
2180
|
|
2181 typedef struct Intercepted_wnd_proc
|
|
2182 {
|
|
2183 WNDPROC proc;
|
|
2184 Extbyte *name;
|
|
2185 int is_ansi;
|
|
2186 } Intercepted_wnd_proc;
|
|
2187
|
|
2188 typedef struct
|
|
2189 {
|
|
2190 Dynarr_declare (Intercepted_wnd_proc);
|
|
2191 } Intercepted_wnd_proc_dynarr;
|
|
2192
|
|
2193 static Intercepted_wnd_proc_dynarr *intercepted_wnd_procs;
|
|
2194
|
|
2195 static Intercepted_wnd_proc *
|
|
2196 find_window_class (const Extbyte *name, int is_ansi)
|
|
2197 {
|
|
2198 int i;
|
|
2199
|
|
2200 if (!intercepted_wnd_procs)
|
|
2201 intercepted_wnd_procs = Dynarr_new (Intercepted_wnd_proc);
|
|
2202
|
|
2203 for (i = 0; i < Dynarr_length (intercepted_wnd_procs); i++)
|
|
2204 {
|
|
2205 Intercepted_wnd_proc *s = Dynarr_atp (intercepted_wnd_procs, i);
|
|
2206
|
|
2207 if (s->is_ansi == is_ansi && (is_ansi ? !strcmp (s->name, name) :
|
|
2208 !wcscmp ((wchar_t *) s->name,
|
|
2209 (wchar_t *) name)))
|
|
2210 return s;
|
|
2211 }
|
|
2212
|
|
2213 return 0;
|
|
2214 }
|
|
2215
|
|
2216 /* ####
|
|
2217
|
|
2218 check problem with cutting and pasting in my current mule -- if i cut,
|
|
2219 then go to another application, then switch back to this one and
|
|
2220 paste, it seems to get confused -- loses the size or something?
|
|
2221
|
|
2222 other things: split flags on CreateProcess and DDE stuff should be
|
|
2223 handled by us.
|
|
2224 */
|
|
2225
|
|
2226 static LRESULT WINAPI
|
|
2227 intercepted_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
|
|
2228 {
|
|
2229 Intercepted_wnd_proc *s;
|
|
2230 int is_ansi = XEUNICODE_P ? !IsWindowUnicode (hwnd) : 1;
|
|
2231 Extbyte *classname;
|
|
2232 int size = 100;
|
|
2233
|
|
2234 /* Just in case XEUNICODE_P changes during the execution of the program
|
|
2235 (admittedly, unlikely), check whether the window is Unicode and keep
|
|
2236 track of this in the list of classes. */
|
|
2237 while (1)
|
|
2238 {
|
|
2239 classname = alloca_extbytes (size * XETCHAR_SIZE);
|
|
2240 if ((is_ansi ? GetClassNameA (hwnd, (LPSTR) classname, size) :
|
|
2241 GetClassNameW (hwnd, (LPWSTR) classname, size)) < size - 1)
|
|
2242 break;
|
|
2243 size *= 2;
|
|
2244 }
|
|
2245
|
|
2246 s = find_window_class (classname, is_ansi);
|
|
2247
|
|
2248 assert (s);
|
|
2249
|
|
2250 if (message_ == WM_NOTIFY)
|
|
2251 {
|
|
2252 LPNMHDR nmhdr = (LPNMHDR) lParam;
|
|
2253 int putback = nmhdr->code;
|
|
2254 int do_putback = 0;
|
|
2255
|
|
2256 #define FROB(msg) \
|
|
2257 case msg##W: \
|
|
2258 /* split structures are the same size, so no conversion necessary */ \
|
|
2259 nmhdr->code = (UINT) msg##A; \
|
|
2260 do_putback = 1; \
|
|
2261 break;
|
|
2262 switch (nmhdr->code)
|
|
2263 {
|
|
2264 /* NMHEADER */
|
|
2265 FROB (HDN_ITEMCHANGING);
|
|
2266 FROB (HDN_ITEMCHANGED);
|
|
2267 FROB (HDN_ITEMCLICK);
|
|
2268 FROB (HDN_ITEMDBLCLICK);
|
|
2269 FROB (HDN_DIVIDERDBLCLICK);
|
|
2270 FROB (HDN_BEGINTRACK);
|
|
2271 FROB (HDN_ENDTRACK);
|
|
2272 FROB (HDN_TRACK);
|
|
2273 /* NMDISPINFO */
|
|
2274 FROB (HDN_GETDISPINFO);
|
|
2275 /* NMTBGETINFOTIP */
|
|
2276 FROB (TBN_GETINFOTIP);
|
|
2277 /* NMTBDISPINFO */
|
|
2278 FROB (TBN_GETDISPINFO);
|
|
2279 /* NMTOOLBAR */
|
|
2280 FROB (TBN_GETBUTTONINFO);
|
|
2281
|
|
2282 /* split-sized NMTTDISPINFO */
|
|
2283 FROB (TTN_GETDISPINFO); /* handle the ...W case; then handle the
|
|
2284 ...A case specially, since we need to
|
|
2285 mess with the structure */
|
|
2286 case TTN_GETDISPINFOA: /* same as TTN_NEEDTEXTA */
|
|
2287 {
|
|
2288 NMTTDISPINFOW *nmw = alloca_new (NMTTDISPINFOW);
|
|
2289 NMTTDISPINFOA *nma = (NMTTDISPINFOA *) lParam;
|
|
2290 LRESULT retval;
|
|
2291 /* the layout of NMTTDISPINFO is
|
|
2292
|
|
2293 non-split fields;
|
|
2294 TCHAR szText[...];
|
|
2295 non-split fields;
|
|
2296 */
|
|
2297
|
|
2298 xzero (*nmw);
|
|
2299 /* copy to ...W struct for Unicode code */
|
|
2300 memcpy ((char *) nmw, (char *) nma,
|
|
2301 offsetof (NMTTDISPINFOA, szText));
|
|
2302 memcpy ((char *) nmw + offsetof (NMTTDISPINFOW, szText) +
|
|
2303 sizeof (nmw->szText),
|
|
2304 (char *) nma + offsetof (NMTTDISPINFOA, szText) +
|
|
2305 sizeof (nma->szText),
|
|
2306 sizeof (NMTTDISPINFOA) -
|
|
2307 (offsetof (NMTTDISPINFOA, szText) + sizeof (nma->szText)));
|
|
2308 memcpy (nmw->szText, nma->szText, sizeof (nma->szText));
|
|
2309 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2310 /* copy back to ...A struct */
|
|
2311 xzero (*nma);
|
|
2312 memcpy ((char *) nma, (char *) nmw,
|
|
2313 offsetof (NMTTDISPINFOA, szText));
|
|
2314 memcpy ((char *) nma + offsetof (NMTTDISPINFOA, szText) +
|
|
2315 sizeof (nma->szText),
|
|
2316 (char *) nmw + offsetof (NMTTDISPINFOW, szText) +
|
|
2317 sizeof (nmw->szText),
|
|
2318 sizeof (NMTTDISPINFOA) -
|
|
2319 (offsetof (NMTTDISPINFOA, szText) + sizeof (nma->szText)));
|
|
2320 memcpy (nma->szText, nmw->szText, sizeof (nma->szText));
|
|
2321 return retval;
|
|
2322 }
|
|
2323
|
|
2324 /* NMLVFINDITEM */
|
|
2325 FROB (LVN_ODFINDITEM);
|
|
2326 /* NMLVDISPINFO */
|
|
2327 FROB (LVN_BEGINLABELEDIT);
|
|
2328 FROB (LVN_ENDLABELEDIT);
|
|
2329 FROB (LVN_GETDISPINFO);
|
|
2330 FROB (LVN_SETDISPINFO);
|
|
2331 /* NMLVGETINFOTIP */
|
|
2332 FROB (LVN_GETINFOTIP);
|
|
2333 /* NMTREEVIEW */
|
|
2334 FROB (TVN_SELCHANGING);
|
|
2335 FROB (TVN_SELCHANGED);
|
|
2336 FROB (TVN_ITEMEXPANDING);
|
|
2337 FROB (TVN_ITEMEXPANDED);
|
|
2338 FROB (TVN_BEGINDRAG);
|
|
2339 FROB (TVN_BEGINRDRAG);
|
|
2340 FROB (TVN_DELETEITEM);
|
|
2341 /* NMTVDISPINFO */
|
|
2342 FROB (TVN_GETDISPINFO);
|
|
2343 FROB (TVN_SETDISPINFO);
|
|
2344 FROB (TVN_BEGINLABELEDIT);
|
|
2345 FROB (TVN_ENDLABELEDIT);
|
|
2346 /* NMTVGETINFOTIP */
|
|
2347 FROB (TVN_GETINFOTIP);
|
|
2348 /* NMCOMBOBOXEX */
|
|
2349 FROB (CBEN_GETDISPINFO);
|
|
2350
|
|
2351 /* split-sized NMCBEDRAGBEGIN */
|
|
2352 FROB (CBEN_DRAGBEGIN); /* handle the ...W case; then handle the
|
|
2353 ...A case specially, since we need to
|
|
2354 mess with the structure */
|
|
2355 {
|
|
2356 NMCBEDRAGBEGINW *nmw = alloca_new (NMCBEDRAGBEGINW);
|
|
2357 NMCBEDRAGBEGINA *nma = (NMCBEDRAGBEGINA *) lParam;
|
|
2358 LRESULT retval;
|
|
2359 /* the layout of NNMCBEDRAGBEGIN is
|
|
2360
|
|
2361 non-split fields;
|
|
2362 TCHAR szText[...];
|
|
2363 */
|
|
2364
|
|
2365 xzero (*nmw);
|
|
2366 /* copy to ...W struct for Unicode code */
|
|
2367 memcpy ((char *) nmw, (char *) nma,
|
|
2368 sizeof (*nma));
|
|
2369 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2370 /* copy back to ...A struct */
|
|
2371 xzero (*nma);
|
|
2372 memcpy ((char *) nma, (char *) nmw,
|
|
2373 sizeof (*nma));
|
|
2374 return retval;
|
|
2375 }
|
|
2376
|
|
2377 /* split-sized NMCBEENDEDIT */
|
|
2378 FROB (CBEN_ENDEDIT); /* handle the ...W case; then handle the
|
|
2379 ...A case specially, since we need to
|
|
2380 mess with the structure */
|
|
2381 {
|
|
2382 NMCBEENDEDITW *nmw = alloca_new (NMCBEENDEDITW);
|
|
2383 NMCBEENDEDITA *nma = (NMCBEENDEDITA *) lParam;
|
|
2384 LRESULT retval;
|
|
2385 /* the layout of NMCBEENDEDIT is
|
|
2386
|
|
2387 non-split fields;
|
|
2388 TCHAR szText[...];
|
|
2389 non-split fields;
|
|
2390 */
|
|
2391
|
|
2392 xzero (*nmw);
|
|
2393 /* copy to ...W struct for Unicode code */
|
|
2394 memcpy ((char *) nmw, (char *) nma,
|
|
2395 offsetof (NMCBEENDEDITA, szText));
|
|
2396 memcpy ((char *) nmw + offsetof (NMCBEENDEDITW, szText) +
|
|
2397 sizeof (nmw->szText),
|
|
2398 (char *) nma + offsetof (NMCBEENDEDITA, szText) +
|
|
2399 sizeof (nma->szText),
|
|
2400 sizeof (NMCBEENDEDITA) -
|
|
2401 (offsetof (NMCBEENDEDITA, szText) + sizeof (nma->szText)));
|
|
2402 memcpy (nmw->szText, nma->szText, sizeof (nma->szText));
|
|
2403 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2404 /* copy back to ...A struct */
|
|
2405 xzero (*nma);
|
|
2406 memcpy ((char *) nma, (char *) nmw,
|
|
2407 offsetof (NMCBEENDEDITA, szText));
|
|
2408 memcpy ((char *) nma + offsetof (NMCBEENDEDITA, szText) +
|
|
2409 sizeof (nma->szText),
|
|
2410 (char *) nmw + offsetof (NMCBEENDEDITW, szText) +
|
|
2411 sizeof (nmw->szText),
|
|
2412 sizeof (NMCBEENDEDITA) -
|
|
2413 (offsetof (NMCBEENDEDITA, szText) + sizeof (nma->szText)));
|
|
2414 memcpy (nma->szText, nmw->szText, sizeof (nma->szText));
|
|
2415 return retval;
|
|
2416 }
|
|
2417
|
|
2418 /* NMDATETIMESTRING */
|
|
2419 FROB (DTN_USERSTRING);
|
|
2420 /* NMDATETIMEWMKEYDOWN */
|
|
2421 FROB (DTN_WMKEYDOWN);
|
|
2422
|
|
2423 /* split-sized NMDATETIMEFORMAT */
|
|
2424 FROB (DTN_FORMAT); /* handle the ...W case; then handle the
|
|
2425 ...A case specially, since we need to
|
|
2426 mess with the structure */
|
|
2427 {
|
|
2428 NMDATETIMEFORMATW *nmw = alloca_new (NMDATETIMEFORMATW);
|
|
2429 NMDATETIMEFORMATA *nma = (NMDATETIMEFORMATA *) lParam;
|
|
2430 LRESULT retval;
|
|
2431 /* the layout of NMDATETIMEFORMAT is
|
|
2432
|
|
2433 non-split fields;
|
|
2434 TCHAR szText[...];
|
|
2435 */
|
|
2436
|
|
2437 xzero (*nmw);
|
|
2438 /* copy to ...W struct for Unicode code */
|
|
2439 memcpy ((char *) nmw, (char *) nma,
|
|
2440 sizeof (*nma));
|
|
2441 retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2442 /* copy back to ...A struct */
|
|
2443 xzero (*nma);
|
|
2444 memcpy ((char *) nma, (char *) nmw,
|
|
2445 sizeof (*nma));
|
|
2446 return retval;
|
|
2447 }
|
|
2448
|
|
2449 /* NMDATETIMEFORMATQUERY */
|
|
2450 FROB (DTN_FORMATQUERY);
|
|
2451 default: break;
|
|
2452 }
|
|
2453 #undef FROB
|
|
2454 if (do_putback)
|
|
2455 {
|
|
2456 LRESULT retval = (s->proc) (hwnd, message_, wParam, lParam);
|
|
2457 ((LPNMHDR) lParam)->code = putback;
|
|
2458 return retval;
|
|
2459 }
|
|
2460 }
|
|
2461
|
|
2462 return (s->proc) (hwnd, message_, wParam, lParam);
|
|
2463 }
|
|
2464
|
|
2465 ATOM
|
|
2466 qxeRegisterClass (CONST WNDCLASSW * lpWndClass)
|
|
2467 {
|
|
2468 Intercepted_wnd_proc *s =
|
|
2469 find_window_class ((Extbyte *) lpWndClass->lpszClassName, !XEUNICODE_P);
|
|
2470 WNDCLASSW classnew;
|
|
2471
|
|
2472 if (s)
|
|
2473 {
|
|
2474 s->proc = lpWndClass->lpfnWndProc;
|
|
2475 s->name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2476 s->is_ansi = !XEUNICODE_P;
|
|
2477 }
|
|
2478 else
|
|
2479 {
|
|
2480 Intercepted_wnd_proc news;
|
|
2481 news.proc = lpWndClass->lpfnWndProc;
|
|
2482 news.name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2483 news.is_ansi = !XEUNICODE_P;
|
|
2484 Dynarr_add (intercepted_wnd_procs, news);
|
|
2485 }
|
|
2486 classnew = *lpWndClass;
|
|
2487 classnew.lpfnWndProc = intercepted_wnd_proc;
|
|
2488 if (XEUNICODE_P)
|
|
2489 return RegisterClassW (&classnew);
|
|
2490 else
|
2367
|
2491 /* The intermediate cast fools gcc into not outputting strict-aliasing
|
|
2492 complaints */
|
|
2493 return RegisterClassA ((CONST WNDCLASSA *) (void *) &classnew);
|
771
|
2494 }
|
|
2495
|
|
2496 BOOL
|
|
2497 qxeUnregisterClass (const Extbyte * lpClassName, HINSTANCE hInstance)
|
|
2498 {
|
|
2499 Intercepted_wnd_proc *s =
|
|
2500 find_window_class (lpClassName, !XEUNICODE_P);
|
|
2501
|
|
2502 if (s)
|
|
2503 Dynarr_delete_by_pointer (intercepted_wnd_procs, s);
|
|
2504 if (XEUNICODE_P)
|
|
2505 return UnregisterClassW ((LPCWSTR) lpClassName, hInstance);
|
|
2506 else
|
|
2507 return UnregisterClassA ((LPCSTR) lpClassName, hInstance);
|
|
2508 }
|
|
2509
|
|
2510 /* NOTE: NT 4.0+ only */
|
|
2511 ATOM
|
|
2512 qxeRegisterClassEx (CONST WNDCLASSEXW *lpWndClass)
|
|
2513 {
|
|
2514 Intercepted_wnd_proc *s =
|
|
2515 find_window_class ((Extbyte *) lpWndClass->lpszClassName, !XEUNICODE_P);
|
|
2516 WNDCLASSEXW classnew;
|
|
2517
|
|
2518 if (s)
|
|
2519 {
|
|
2520 s->proc = lpWndClass->lpfnWndProc;
|
|
2521 s->name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2522 s->is_ansi = !XEUNICODE_P;
|
|
2523 }
|
|
2524 else
|
|
2525 {
|
|
2526 Intercepted_wnd_proc news;
|
|
2527 news.proc = lpWndClass->lpfnWndProc;
|
|
2528 news.name = (Extbyte *) lpWndClass->lpszClassName;
|
|
2529 news.is_ansi = !XEUNICODE_P;
|
|
2530 Dynarr_add (intercepted_wnd_procs, news);
|
|
2531 }
|
|
2532 classnew = *lpWndClass;
|
|
2533 classnew.lpfnWndProc = intercepted_wnd_proc;
|
|
2534 if (XEUNICODE_P)
|
|
2535 return RegisterClassExW (&classnew);
|
|
2536 else
|
2367
|
2537 /* The intermediate cast fools gcc into not outputting strict-aliasing
|
|
2538 complaints */
|
|
2539 return RegisterClassExA ((CONST WNDCLASSEXA *) (void *) &classnew);
|
771
|
2540 }
|
|
2541
|
|
2542
|
|
2543 /************************************************************************/
|
|
2544 /* COMMCTRL.H */
|
|
2545 /************************************************************************/
|
|
2546
|
|
2547 /* there are only four structures in commctrl.h that cannot be cast
|
|
2548 between Unicode/ANSI versions:
|
|
2549
|
|
2550 NMTTDISPINFO aka TOOLTIPTEXT
|
|
2551 NMCBEDRAGBEGIN
|
|
2552 NMCBEENDEDIT
|
|
2553 NMDATETIMEFORMAT
|
|
2554
|
|
2555 these are all notify structures, and we handle them above in
|
|
2556 intercepted_wnd_proc().
|
|
2557
|
|
2558 in addition, this constant is weird, being a struct size of one of these:
|
|
2559
|
|
2560 NMTTDISPINFO_V1_SIZE
|
|
2561 */
|
|
2562
|
|
2563 /*
|
|
2564 split class names:
|
|
2565
|
|
2566 WC_HEADER
|
|
2567 TOOLBARCLASSNAME
|
|
2568 REBARCLASSNAME
|
|
2569 TOOLTIPS_CLASS
|
|
2570 STATUSCLASSNAME
|
|
2571 TRACKBAR_CLASS
|
|
2572 UPDOWN_CLASS
|
|
2573 PROGRESS_CLASS
|
|
2574 HOTKEY_CLASS
|
|
2575 WC_LISTVIEW
|
|
2576 WC_TREEVIEW
|
|
2577 WC_COMBOBOXEX
|
|
2578 WC_TABCONTROL
|
|
2579 ANIMATE_CLASS
|
|
2580 MONTHCAL_CLASS
|
|
2581 DATETIMEPICK_CLASS
|
|
2582 WC_IPADDRESS
|
|
2583 WC_PAGESCROLLER
|
|
2584 WC_NATIVEFONTCTL
|
|
2585 */
|
|
2586
|
|
2587 /*
|
|
2588 SendMessage split messages:
|
|
2589
|
|
2590 HDM_INSERTITEM
|
|
2591 HDM_GETITEM
|
|
2592 HDM_SETITEM
|
|
2593 TB_GETBUTTONTEXT
|
|
2594 TB_SAVERESTORE
|
|
2595 TB_ADDSTRING
|
|
2596 TB_GETBUTTONINFO
|
|
2597 TB_SETBUTTONINFO
|
|
2598 TB_INSERTBUTTON
|
|
2599 TB_ADDBUTTONS
|
|
2600 RB_INSERTBAND
|
|
2601 RB_SETBANDINFO
|
|
2602 RB_GETBANDINFO
|
|
2603 TTM_ADDTOOL
|
|
2604 TTM_DELTOOL
|
|
2605 TTM_NEWTOOLRECT
|
|
2606 TTM_GETTOOLINFO
|
|
2607 TTM_SETTOOLINFO
|
|
2608 TTM_HITTEST
|
|
2609 TTM_GETTEXT
|
|
2610 TTM_UPDATETIPTEXT
|
|
2611 TTM_ENUMTOOLS
|
|
2612 TTM_GETCURRENTTOOL
|
|
2613 SB_GETTEXT
|
|
2614 SB_SETTEXT
|
|
2615 SB_GETTEXTLENGTH
|
|
2616 SB_SETTIPTEXT
|
|
2617 SB_GETTIPTEXT
|
|
2618 LVM_GETITEM
|
|
2619 LVM_SETITEM
|
|
2620 LVM_INSERTITEM
|
|
2621 LVM_FINDITEM
|
|
2622 LVM_GETSTRINGWIDTH
|
|
2623 LVM_EDITLABEL
|
|
2624 LVM_GETCOLUMN
|
|
2625 LVM_SETCOLUMN
|
|
2626 LVM_GETITEMTEXT
|
|
2627 LVM_SETITEMTEXT
|
|
2628 LVM_GETISEARCHSTRING
|
|
2629 LVM_SETBKIMAGE
|
|
2630 LVM_GETBKIMAGE
|
|
2631 TVM_INSERTITEM
|
|
2632 TVM_GETITEM
|
|
2633 TVM_SETITEM
|
|
2634 TVM_EDITLABEL
|
|
2635 TVM_GETISEARCHSTRING
|
|
2636 CBEM_INSERTITEM
|
|
2637 CBEM_SETITEM
|
|
2638 CBEM_GETITEM
|
|
2639 TCM_GETITEM
|
|
2640 TCM_SETITEM
|
|
2641 TCM_INSERTITEM
|
|
2642 ACM_OPEN
|
|
2643 DTM_SETFORMAT
|
|
2644 BFFM_SETSTATUSTEXT
|
|
2645 BFFM_SETSELECTION
|
|
2646 */
|
|
2647
|
|
2648 /*
|
|
2649 split notify messages:
|
|
2650
|
|
2651 HDN_ITEMCHANGING
|
|
2652 HDN_ITEMCHANGED
|
|
2653 HDN_ITEMCLICK
|
|
2654 HDN_ITEMDBLCLICK
|
|
2655 HDN_DIVIDERDBLCLICK
|
|
2656 HDN_BEGINTRACK
|
|
2657 HDN_ENDTRACK
|
|
2658 HDN_TRACK
|
|
2659 HDN_GETDISPINFO
|
|
2660 TBN_GETINFOTIP
|
|
2661 TBN_GETDISPINFO
|
|
2662 TBN_GETBUTTONINFO
|
|
2663 TTN_GETDISPINFO
|
|
2664 TTN_NEEDTEXTW
|
|
2665 LVN_ODFINDITEM
|
|
2666 LVN_BEGINLABELEDIT
|
|
2667 LVN_ENDLABELEDIT
|
|
2668 LVN_GETDISPINFO
|
|
2669 LVN_SETDISPINFO
|
|
2670 LVN_GETINFOTIP
|
|
2671 TVN_SELCHANGING
|
|
2672 TVN_SELCHANGED
|
|
2673 TVN_GETDISPINFO
|
|
2674 TVN_SETDISPINFO
|
|
2675 TVN_ITEMEXPANDING
|
|
2676 TVN_ITEMEXPANDED
|
|
2677 TVN_BEGINDRAG
|
|
2678 TVN_BEGINRDRAG
|
|
2679 TVN_DELETEITEM
|
|
2680 TVN_BEGINLABELEDIT
|
|
2681 TVN_ENDLABELEDIT
|
|
2682 TVN_GETINFOTIP
|
|
2683 CBEN_GETDISPINFO
|
|
2684 CBEN_DRAGBEGIN
|
|
2685 CBEN_ENDEDIT
|
|
2686 DTN_USERSTRING
|
|
2687 DTN_WMKEYDOWN
|
|
2688 DTN_FORMAT
|
|
2689 DTN_FORMATQUERY
|
|
2690 BFFM_VALIDATEFAILED (send to SHBrowseForFolder procedure)
|
|
2691 */
|
|
2692
|
|
2693 /*
|
|
2694 split structures:
|
|
2695
|
|
2696 TV_INSERTSTRUCT (simple-split, though -- just cast)
|
|
2697 TC_ITEM (simple-split, though -- just cast)
|
|
2698
|
|
2699 ####
|
|
2700 */
|
|
2701
|
|
2702 /*
|
|
2703 split macros or macros needing splitting:
|
|
2704
|
|
2705 ####
|
|
2706 */
|
|
2707
|
|
2708 LRESULT
|
|
2709 qxeSendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
2710 {
|
|
2711 #define FROB(msg) \
|
|
2712 case msg##A: \
|
|
2713 /* split structures are the same size, so no conversion necessary */ \
|
|
2714 Msg = msg##W; \
|
|
2715 break;
|
|
2716
|
|
2717 if (XEUNICODE_P)
|
|
2718 {
|
|
2719 WCHAR classname[100];
|
|
2720 /* the name for SHBrowseForFolder windows is non-obvious so we have
|
|
2721 to intercept the callback */
|
|
2722 if (is_SHBrowseForFolder (hWnd))
|
|
2723 {
|
|
2724 switch (Msg)
|
|
2725 {
|
|
2726 FROB (BFFM_SETSELECTION);
|
|
2727 FROB (BFFM_SETSTATUSTEXT);
|
|
2728 default: break;
|
|
2729 }
|
|
2730 }
|
|
2731 else if (!GetClassNameW (hWnd, classname, 100))
|
|
2732 ;
|
|
2733 /* luckily, subclassing leaves the name alone, so we can still
|
|
2734 determine fairly easily the correct class to switch on */
|
|
2735 else if (!wcscmp (classname, WC_HEADERW))
|
|
2736 {
|
|
2737 switch (Msg)
|
|
2738 {
|
|
2739 FROB (HDM_INSERTITEM);
|
|
2740 FROB (HDM_GETITEM);
|
|
2741 FROB (HDM_SETITEM);
|
|
2742 default: break;
|
|
2743 }
|
|
2744 }
|
|
2745 else if (!wcscmp (classname, TOOLBARCLASSNAMEW))
|
|
2746 {
|
|
2747 switch (Msg)
|
|
2748 {
|
|
2749 FROB (TB_GETBUTTONTEXT);
|
|
2750 FROB (TB_SAVERESTORE);
|
|
2751 FROB (TB_ADDSTRING);
|
|
2752 FROB (TB_GETBUTTONINFO);
|
|
2753 FROB (TB_SETBUTTONINFO);
|
|
2754 FROB (TB_INSERTBUTTON);
|
|
2755 FROB (TB_ADDBUTTONS);
|
|
2756 default: break;
|
|
2757 }
|
|
2758 }
|
|
2759 else if (!wcscmp (classname, REBARCLASSNAMEW))
|
|
2760 {
|
|
2761 switch (Msg)
|
|
2762 {
|
|
2763 FROB (RB_INSERTBAND);
|
|
2764 FROB (RB_SETBANDINFO);
|
|
2765 FROB (RB_GETBANDINFO);
|
|
2766 default: break;
|
|
2767 }
|
|
2768 }
|
|
2769 else if (!wcscmp (classname, TOOLTIPS_CLASSW))
|
|
2770 {
|
|
2771 switch (Msg)
|
|
2772 {
|
|
2773 FROB (TTM_ADDTOOL);
|
|
2774 FROB (TTM_DELTOOL);
|
|
2775 FROB (TTM_NEWTOOLRECT);
|
|
2776 FROB (TTM_GETTOOLINFO);
|
|
2777 FROB (TTM_SETTOOLINFO);
|
|
2778 FROB (TTM_HITTEST);
|
|
2779 FROB (TTM_GETTEXT);
|
|
2780 FROB (TTM_UPDATETIPTEXT);
|
|
2781 FROB (TTM_ENUMTOOLS);
|
|
2782 FROB (TTM_GETCURRENTTOOL);
|
|
2783 default: break;
|
|
2784 }
|
|
2785 }
|
|
2786 else if (!wcscmp (classname, STATUSCLASSNAMEW))
|
|
2787 {
|
|
2788 switch (Msg)
|
|
2789 {
|
|
2790 FROB (SB_GETTEXT);
|
|
2791 FROB (SB_SETTEXT);
|
|
2792 FROB (SB_GETTEXTLENGTH);
|
|
2793 FROB (SB_SETTIPTEXT);
|
|
2794 FROB (SB_GETTIPTEXT);
|
|
2795 default: break;
|
|
2796 }
|
|
2797 }
|
|
2798 else if (!wcscmp (classname, WC_LISTVIEWW))
|
|
2799 {
|
|
2800 switch (Msg)
|
|
2801 {
|
|
2802 FROB (LVM_GETITEM);
|
|
2803 FROB (LVM_SETITEM);
|
|
2804 FROB (LVM_INSERTITEM);
|
|
2805 FROB (LVM_FINDITEM);
|
|
2806 FROB (LVM_GETSTRINGWIDTH);
|
|
2807 FROB (LVM_EDITLABEL);
|
|
2808 FROB (LVM_GETCOLUMN);
|
|
2809 FROB (LVM_SETCOLUMN);
|
|
2810 FROB (LVM_GETITEMTEXT);
|
|
2811 FROB (LVM_SETITEMTEXT);
|
|
2812 FROB (LVM_GETISEARCHSTRING);
|
|
2813 FROB (LVM_SETBKIMAGE);
|
|
2814 FROB (LVM_GETBKIMAGE);
|
|
2815 default: break;
|
|
2816 }
|
|
2817 }
|
|
2818 else if (!wcscmp (classname, WC_TREEVIEWW))
|
|
2819 {
|
|
2820 switch (Msg)
|
|
2821 {
|
|
2822 FROB (TVM_INSERTITEM); /* no need to split TV_INSERTSTRUCT */
|
|
2823 FROB (TVM_GETITEM);
|
|
2824 FROB (TVM_SETITEM);
|
|
2825 FROB (TVM_EDITLABEL);
|
|
2826 FROB (TVM_GETISEARCHSTRING);
|
|
2827 default: break;
|
|
2828 }
|
|
2829 }
|
|
2830 else if (!wcscmp (classname, WC_COMBOBOXEXW))
|
|
2831 {
|
|
2832 switch (Msg)
|
|
2833 {
|
|
2834 FROB (CBEM_INSERTITEM);
|
|
2835 FROB (CBEM_SETITEM);
|
|
2836 FROB (CBEM_GETITEM);
|
|
2837 default: break;
|
|
2838 }
|
|
2839 }
|
|
2840 else if (!wcscmp (classname, WC_TABCONTROLW))
|
|
2841 {
|
|
2842 switch (Msg)
|
|
2843 {
|
|
2844 FROB (TCM_GETITEM);
|
|
2845 FROB (TCM_SETITEM);
|
|
2846 FROB (TCM_INSERTITEM); /* no need to split TC_ITEM */
|
|
2847 default: break;
|
|
2848 }
|
|
2849 }
|
|
2850 else if (!wcscmp (classname, ANIMATE_CLASSW))
|
|
2851 {
|
|
2852 switch (Msg)
|
|
2853 {
|
|
2854 FROB (ACM_OPEN);
|
|
2855 default: break;
|
|
2856 }
|
|
2857 }
|
|
2858 else if (!wcscmp (classname, DATETIMEPICK_CLASSW))
|
|
2859 {
|
|
2860 switch (Msg)
|
|
2861 {
|
|
2862 FROB (DTM_SETFORMAT);
|
|
2863 default: break;
|
|
2864 }
|
|
2865 }
|
|
2866 }
|
|
2867
|
|
2868 if (XEUNICODE_P)
|
|
2869 return SendMessageW (hWnd, Msg, wParam, lParam);
|
|
2870 else
|
|
2871 return SendMessageA (hWnd, Msg, wParam, lParam);
|
|
2872
|
|
2873 #undef FROB
|
|
2874 }
|
|
2875
|
|
2876 #endif /* HAVE_MS_WINDOWS */
|
|
2877
|
|
2878
|