~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to packages/extra/winunits/jwawownt32.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ 32 bit Generic Thunks API interface Unit for Object Pascal                   }
 
4
{                                                                              }
 
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
 
6
{ Corporation. All Rights Reserved.                                            }
 
7
{                                                                              }
 
8
{ The original file is: wownt32.h, released June 2000. The original Pascal     }
 
9
{ code is: WowNT32.pas, released December 2000. The initial developer of the   }
 
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
 
11
{                                                                              }
 
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
 
13
{ Marcel van Brakel. All Rights Reserved.                                      }
 
14
{                                                                              }
 
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
 
16
{                                                                              }
 
17
{ You may retrieve the latest version of this file at the Project JEDI         }
 
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
 
19
{                                                                              }
 
20
{ The contents of this file are used with permission, subject to the Mozilla   }
 
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
 
22
{ in compliance with the License. You may obtain a copy of the License at      }
 
23
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
 
24
{                                                                              }
 
25
{ Software distributed under the License is distributed on an "AS IS" basis,   }
 
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
 
27
{ the specific language governing rights and limitations under the License.    }
 
28
{                                                                              }
 
29
{ Alternatively, the contents of this file may be used under the terms of the  }
 
30
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
 
31
{ provisions of the LGPL License are applicable instead of those above.        }
 
32
{ If you wish to allow use of your version of this file only under the terms   }
 
33
{ of the LGPL License and not to allow others to use your version of this file }
 
34
{ under the MPL, indicate your decision by deleting  the provisions above and  }
 
35
{ replace  them with the notice and other provisions required by the LGPL      }
 
36
{ License.  If you do not delete the provisions above, a recipient may use     }
 
37
{ your version of this file under either the MPL or the LGPL License.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
// $Id: jwawownt32.pas,v 1.1 2005/04/04 07:56:11 marco Exp $
 
44
 
 
45
unit JwaWowNT32;
 
46
 
 
47
{$WEAKPACKAGEUNIT}
 
48
 
 
49
{$HPPEMIT ''}
 
50
{$HPPEMIT '#include "wownt32.h"'}
 
51
{$HPPEMIT ''}
 
52
 
 
53
{$I jediapilib.inc}
 
54
 
 
55
interface
 
56
 
 
57
uses
 
58
  JwaWinType;
 
59
 
 
60
//
 
61
// 16:16 -> 0:32 Pointer translation.
 
62
//
 
63
// WOWGetVDMPointer will convert the passed in 16-bit address
 
64
// to the equivalent 32-bit flat pointer.  If fProtectedMode
 
65
// is TRUE, the function treats the upper 16 bits as a selector
 
66
// in the local descriptor table.  If fProtectedMode is FALSE,
 
67
// the upper 16 bits are treated as a real-mode segment value.
 
68
// In either case the lower 16 bits are treated as the offset.
 
69
//
 
70
// The return value is NULL if the selector is invalid.
 
71
//
 
72
// NOTE:  Limit checking is not performed in the retail build
 
73
// of Windows NT.  It is performed in the checked (debug) build
 
74
// of WOW32.DLL, which will cause NULL to be returned when the
 
75
// limit is exceeded by the supplied offset.
 
76
//
 
77
 
 
78
function WOWGetVDMPointer(vp, dwBytes: DWORD; fProtectedMode: BOOL): LPVOID; stdcall;
 
79
{$EXTERNALSYM WOWGetVDMPointer}
 
80
 
 
81
//
 
82
// The following two functions are here for compatibility with
 
83
// Windows 95.  On Win95, the global heap can be rearranged,
 
84
// invalidating flat pointers returned by WOWGetVDMPointer, while
 
85
// a thunk is executing.  On Windows NT, the 16-bit VDM is completely
 
86
// halted while a thunk executes, so the only way the heap will
 
87
// be rearranged is if a callback is made to Win16 code.
 
88
//
 
89
// The Win95 versions of these functions call GlobalFix to
 
90
// lock down a segment's flat address, and GlobalUnfix to
 
91
// release the segment.
 
92
//
 
93
// The Windows NT implementations of these functions do *not*
 
94
// call GlobalFix/GlobalUnfix on the segment, because there
 
95
// will not be any heap motion unless a callback occurs.
 
96
// If your thunk does callback to the 16-bit side, be sure
 
97
// to discard flat pointers and call WOWGetVDMPointer again
 
98
// to be sure the flat address is correct.
 
99
//
 
100
 
 
101
function WOWGetVDMPointerFix(vp, dwBytes: DWORD; fProtectedMode: BOOL): LPVOID; stdcall;
 
102
{$EXTERNALSYM WOWGetVDMPointerFix}
 
103
procedure WOWGetVDMPointerUnfix(vp: DWORD); stdcall;
 
104
{$EXTERNALSYM WOWGetVDMPointerUnfix}
 
105
 
 
106
//
 
107
// Win16 memory management.
 
108
//
 
109
// These functions can be used to manage memory in the Win16
 
110
// heap.  The following four functions are identical to their
 
111
// Win16 counterparts, except that they are called from Win32
 
112
// code.
 
113
//
 
114
 
 
115
function WOWGlobalAlloc16(wFlags: WORD; cb: DWORD): WORD; stdcall;
 
116
{$EXTERNALSYM WOWGlobalAlloc16}
 
117
function WOWGlobalFree16(hMem: WORD): WORD; stdcall;
 
118
{$EXTERNALSYM WOWGlobalFree16}
 
119
function WOWGlobalLock16(hMem: WORD): DWORD; stdcall;
 
120
{$EXTERNALSYM WOWGlobalLock16}
 
121
function WOWGlobalUnlock16(hMem: WORD): BOOL; stdcall;
 
122
{$EXTERNALSYM WOWGlobalUnlock16}
 
123
 
 
124
//
 
125
// The following three functions combine two common operations in
 
126
// one switch to 16-bit mode.
 
127
//
 
128
 
 
129
function WOWGlobalAllocLock16(wFlags: WORD; cb: DWORD; var phMem: WORD): DWORD; stdcall;
 
130
{$EXTERNALSYM WOWGlobalAllocLock16}
 
131
function WOWGlobalUnlockFree16(vpMem: DWORD): WORD; stdcall;
 
132
{$EXTERNALSYM WOWGlobalUnlockFree16}
 
133
function WOWGlobalLockSize16(hMem: WORD; pcb: PDWORD): DWORD; stdcall;
 
134
{$EXTERNALSYM WOWGlobalLockSize16}
 
135
 
 
136
//
 
137
// Yielding the Win16 nonpreemptive scheduler
 
138
//
 
139
// The following two functions are provided for Win32 code called
 
140
// via Generic Thunks which needs to yield the Win16 scheduler so
 
141
// that tasks in that VDM can execute while the thunk waits for
 
142
// something to complete.  These two functions are functionally
 
143
// identical to calling back to 16-bit code which calls Yield or
 
144
// DirectedYield.
 
145
//
 
146
 
 
147
procedure WOWYield16; stdcall;
 
148
{$EXTERNALSYM WOWYield16}
 
149
procedure WOWDirectedYield16(htask16: WORD); stdcall;
 
150
{$EXTERNALSYM WOWDirectedYield16}
 
151
 
 
152
//
 
153
// 16 <--> 32 Handle mapping functions.
 
154
//
 
155
// NOTE:  While some of these functions perform trivial
 
156
// conversions, these functions must be used to maintain
 
157
// compatibility with future versions of Windows NT which
 
158
// may require different handle mapping.
 
159
//
 
160
 
 
161
type
 
162
  _WOW_HANDLE_TYPE = (
 
163
    WOW_TYPE_HWND,
 
164
    WOW_TYPE_HMENU,
 
165
    WOW_TYPE_HDWP,
 
166
    WOW_TYPE_HDROP,
 
167
    WOW_TYPE_HDC,
 
168
    WOW_TYPE_HFONT,
 
169
    WOW_TYPE_HMETAFILE,
 
170
    WOW_TYPE_HRGN,
 
171
    WOW_TYPE_HBITMAP,
 
172
    WOW_TYPE_HBRUSH,
 
173
    WOW_TYPE_HPALETTE,
 
174
    WOW_TYPE_HPEN,
 
175
    WOW_TYPE_HACCEL,
 
176
    WOW_TYPE_HTASK,
 
177
    WOW_TYPE_FULLHWND);
 
178
  {$EXTERNALSYM _WOW_HANDLE_TYPE}
 
179
  WOW_HANDLE_TYPE = _WOW_HANDLE_TYPE;
 
180
  {$EXTERNALSYM WOW_HANDLE_TYPE}
 
181
  TWowHandleType = WOW_HANDLE_TYPE;
 
182
 
 
183
function WOWHandle32(Handle: WORD; Type_: WOW_HANDLE_TYPE): HANDLE; stdcall;
 
184
{$EXTERNALSYM WOWHandle32}
 
185
function WOWHandle16(Handle: HANDLE; Type_: WOW_HANDLE_TYPE): WORD; stdcall;
 
186
{$EXTERNALSYM WOWHandle16}
 
187
 
 
188
function HWND_32(h16: WORD): HANDLE;
 
189
{$EXTERNALSYM HWND_32}
 
190
function HMENU_32(h16: WORD): HANDLE;
 
191
{$EXTERNALSYM HMENU_32}
 
192
function HDWP_32(h16: WORD): HANDLE;
 
193
{$EXTERNALSYM HDWP_32}
 
194
function HDROP_32(h16: WORD): HANDLE;
 
195
{$EXTERNALSYM HDROP_32}
 
196
function HDC_32(h16: WORD): HANDLE;
 
197
{$EXTERNALSYM HDC_32}
 
198
function HFONT_32(h16: WORD): HANDLE;
 
199
{$EXTERNALSYM HFONT_32}
 
200
function HMETAFILE_32(h16: WORD): HANDLE;
 
201
{$EXTERNALSYM HMETAFILE_32}
 
202
function HRGN_32(h16: WORD): HANDLE;
 
203
{$EXTERNALSYM HRGN_32}
 
204
function HBITMAP_32(h16: WORD): HANDLE;
 
205
{$EXTERNALSYM HBITMAP_32}
 
206
function HBRUSH_32(h16: WORD): HANDLE;
 
207
{$EXTERNALSYM HBRUSH_32}
 
208
function HPALETTE_32(h16: WORD): HANDLE;
 
209
{$EXTERNALSYM HPALETTE_32}
 
210
function HPEN_32(h16: WORD): HANDLE;
 
211
{$EXTERNALSYM HPEN_32}
 
212
function HACCEL_32(h16: WORD): HANDLE;
 
213
{$EXTERNALSYM HACCEL_32}
 
214
function HTASK_32(h16: WORD): HANDLE;
 
215
{$EXTERNALSYM HTASK_32}
 
216
function FULLHWND_32(h16: WORD): HANDLE;
 
217
{$EXTERNALSYM FULLHWND_32}
 
218
function HWND_16(h32: HANDLE): WORD;
 
219
{$EXTERNALSYM HWND_16}
 
220
function HMENU_16(h32: HANDLE): WORD;
 
221
{$EXTERNALSYM HMENU_16}
 
222
function HDWP_16(h32: HANDLE): WORD;
 
223
{$EXTERNALSYM HDWP_16}
 
224
function HDROP_16(h32: HANDLE): WORD;
 
225
{$EXTERNALSYM HDROP_16}
 
226
function HDC_16(h32: HANDLE): WORD;
 
227
{$EXTERNALSYM HDC_16}
 
228
function HFONT_16(h32: HANDLE): WORD;
 
229
{$EXTERNALSYM HFONT_16}
 
230
function HMETAFILE_16(h32: HANDLE): WORD;
 
231
{$EXTERNALSYM HMETAFILE_16}
 
232
function HRGN_16(h32: HANDLE): WORD;
 
233
{$EXTERNALSYM HRGN_16}
 
234
function HBITMAP_16(h32: HANDLE): WORD;
 
235
{$EXTERNALSYM HBITMAP_16}
 
236
function HBRUSH_16(h32: HANDLE): WORD;
 
237
{$EXTERNALSYM HBRUSH_16}
 
238
function HPALETTE_16(h32: HANDLE): WORD;
 
239
{$EXTERNALSYM HPALETTE_16}
 
240
function HPEN_16(h32: HANDLE): WORD;
 
241
{$EXTERNALSYM HPEN_16}
 
242
function HACCEL_16(h32: HANDLE): WORD;
 
243
{$EXTERNALSYM HACCEL_16}
 
244
function HTASK_16(h32: HANDLE): WORD;
 
245
{$EXTERNALSYM HTASK_16}
 
246
 
 
247
//
 
248
// Generic Callbacks.
 
249
//
 
250
// WOWCallback16 can be used in Win32 code called
 
251
// from 16-bit (such as by using Generic Thunks) to call back to
 
252
// the 16-bit side.  The function called must be declared similarly
 
253
// to the following:
 
254
//
 
255
// LONG FAR PASCAL CallbackRoutine(DWORD dwParam);
 
256
//
 
257
// If you are passing a pointer, declare the parameter as such:
 
258
//
 
259
// LONG FAR PASCAL CallbackRoutine(VOID FAR *vp);
 
260
//
 
261
// NOTE: If you are passing a pointer, you'll need to get the
 
262
// pointer using WOWGlobalAlloc16 or WOWGlobalAllocLock16
 
263
//
 
264
// If the function called returns a WORD instead of a DWORD, the
 
265
// upper 16 bits of the return value is undefined.  Similarly, if
 
266
// the function called has no return value, the entire return value
 
267
// is undefined.
 
268
//
 
269
// WOWCallback16Ex allows any combination of arguments up to
 
270
// WCB16_MAX_CBARGS bytes total to be passed to the 16-bit routine.
 
271
// cbArgs is used to properly clean up the 16-bit stack after calling
 
272
// the routine.  Regardless of the value of cbArgs, WCB16_MAX_CBARGS
 
273
// bytes will always be copied from pArgs to the 16-bit stack.  If
 
274
// pArgs is less than WCB16_MAX_CBARGS bytes from the end of a page,
 
275
// and the next page is inaccessible, WOWCallback16Ex will incur an
 
276
// access violation.
 
277
//
 
278
// If cbArgs is larger than the WCB16_MAX_ARGS which the running
 
279
// system supports, the function returns FALSE and GetLastError
 
280
// returns ERROR_INVALID_PARAMETER.  Otherwise the function
 
281
// returns TRUE and the DWORD pointed to by pdwRetCode contains
 
282
// the return code from the callback routine.  If the callback
 
283
// routine returns a WORD, the HIWORD of the return code is
 
284
// undefined and should be ignored using LOWORD(dwRetCode).
 
285
//
 
286
// WOWCallback16Ex can call routines using the PASCAL and CDECL
 
287
// calling conventions.  The default is to use the PASCAL
 
288
// calling convention.  To use CDECL, pass WCB16_CDECL in the
 
289
// dwFlags parameter.
 
290
//
 
291
// The arguments pointed to by pArgs must be in the correct
 
292
// order for the callback routine's calling convention.
 
293
// To call the PASCAL routine SetWindowText,
 
294
//
 
295
// LONG FAR PASCAL SetWindowText(HWND hwnd, LPCSTR lpsz);
 
296
//
 
297
// pArgs would point to an array of words:
 
298
//
 
299
// WORD SetWindowTextArgs[] = {OFFSETOF(lpsz), SELECTOROF(lpsz), hwnd};
 
300
//
 
301
// In other words, the arguments are placed in the array in reverse
 
302
// order with the least significant word first for DWORDs and offset
 
303
// first for FAR pointers.
 
304
//
 
305
// To call the CDECL routine wsprintf, for example
 
306
//
 
307
// LPSTR lpszFormat = "%d %s";
 
308
// int _cdecl wsprintf(lpsz, lpszFormat, nValue. lpszString);
 
309
//
 
310
// pArgs would point to the array:
 
311
//
 
312
// WORD wsprintfArgs[] = {OFFSETOF(lpsz), SELECTOROF(lpsz),
 
313
//                        OFFSETOF(lpszFormat), SELECTOROF(lpszFormat),
 
314
//                        nValue,
 
315
//                        OFFSETOF(lpszString), SELECTOROF(lpszString)};
 
316
//
 
317
// In other words, the arguments are placed in the array in the order
 
318
// listed in the function prototype with the least significant word
 
319
// first for DWORDs and offset first for FAR pointers.
 
320
//
 
321
 
 
322
function WOWCallback16(vpfn16: DWORD; dwParam: DWORD): DWORD; stdcall;
 
323
{$EXTERNALSYM WOWCallback16}
 
324
 
 
325
const
 
326
  WCB16_MAX_CBARGS = 16;
 
327
  {$EXTERNALSYM WCB16_MAX_CBARGS}
 
328
 
 
329
  WCB16_PASCAL     = $0;
 
330
  {$EXTERNALSYM WCB16_PASCAL}
 
331
  WCB16_CDECL      = $1;
 
332
  {$EXTERNALSYM WCB16_CDECL}
 
333
 
 
334
function WOWCallback16Ex(vpfn16, dwFlags, cbArgs: DWORD; pArgs: PVOID; pdwRetCode: PDWORD): BOOL; stdcall;
 
335
{$EXTERNALSYM WOWCallback16Ex}
 
336
 
 
337
implementation
 
338
 
 
339
const
 
340
  wow32lib = 'wow32.dll';
 
341
 
 
342
function HWND_32(h16: WORD): HANDLE;
 
343
begin
 
344
  Result := WOWHandle32(h16, WOW_TYPE_HWND);
 
345
end;
 
346
 
 
347
function HMENU_32(h16: WORD): HANDLE;
 
348
begin
 
349
  Result := WOWHandle32(h16, WOW_TYPE_HMENU);
 
350
end;
 
351
 
 
352
function HDWP_32(h16: WORD): HANDLE;
 
353
begin
 
354
  Result := WOWHandle32(h16, WOW_TYPE_HDWP);
 
355
end;
 
356
 
 
357
function HDROP_32(h16: WORD): HANDLE;
 
358
begin
 
359
  Result := WOWHandle32(h16, WOW_TYPE_HDROP);
 
360
end;
 
361
 
 
362
function HDC_32(h16: WORD): HANDLE;
 
363
begin
 
364
  Result := WOWHandle32(h16, WOW_TYPE_HDC);
 
365
end;
 
366
 
 
367
function HFONT_32(h16: WORD): HANDLE;
 
368
begin
 
369
  Result := WOWHandle32(h16, WOW_TYPE_HFONT);
 
370
end;
 
371
 
 
372
function HMETAFILE_32(h16: WORD): HANDLE;
 
373
begin
 
374
  Result := WOWHandle32(h16, WOW_TYPE_HMETAFILE);
 
375
end;
 
376
 
 
377
function HRGN_32(h16: WORD): HANDLE;
 
378
begin
 
379
  Result := WOWHandle32(h16, WOW_TYPE_HRGN);
 
380
end;
 
381
 
 
382
function HBITMAP_32(h16: WORD): HANDLE;
 
383
begin
 
384
  Result := WOWHandle32(h16, WOW_TYPE_HBITMAP);
 
385
end;
 
386
 
 
387
function HBRUSH_32(h16: WORD): HANDLE;
 
388
begin
 
389
  Result := WOWHandle32(h16, WOW_TYPE_HBRUSH);
 
390
end;
 
391
 
 
392
function HPALETTE_32(h16: WORD): HANDLE;
 
393
begin
 
394
  Result := WOWHandle32(h16, WOW_TYPE_HPALETTE);
 
395
end;
 
396
 
 
397
function HPEN_32(h16: WORD): HANDLE;
 
398
begin
 
399
  Result := WOWHandle32(h16, WOW_TYPE_HPEN);
 
400
end;
 
401
 
 
402
function HACCEL_32(h16: WORD): HANDLE;
 
403
begin
 
404
  Result := WOWHandle32(h16, WOW_TYPE_HACCEL);
 
405
end;
 
406
 
 
407
function HTASK_32(h16: WORD): HANDLE;
 
408
begin
 
409
  Result := WOWHandle32(h16, WOW_TYPE_HTASK);
 
410
end;
 
411
 
 
412
function FULLHWND_32(h16: WORD): HANDLE;
 
413
begin
 
414
  Result := WOWHandle32(h16, WOW_TYPE_FULLHWND);
 
415
end;
 
416
 
 
417
function HWND_16(h32: HANDLE): WORD;
 
418
begin
 
419
  Result := WOWHandle16(h32, WOW_TYPE_HWND);
 
420
end;
 
421
 
 
422
function HMENU_16(h32: HANDLE): WORD;
 
423
begin
 
424
  Result := WOWHandle16(h32, WOW_TYPE_HMENU);
 
425
end;
 
426
 
 
427
function HDWP_16(h32: HANDLE): WORD;
 
428
begin
 
429
  Result := WOWHandle16(h32, WOW_TYPE_HDWP);
 
430
end;
 
431
 
 
432
function HDROP_16(h32: HANDLE): WORD;
 
433
begin
 
434
  Result := WOWHandle16(h32, WOW_TYPE_HDROP);
 
435
end;
 
436
 
 
437
function HDC_16(h32: HANDLE): WORD;
 
438
begin
 
439
  Result := WOWHandle16(h32, WOW_TYPE_HDC);
 
440
end;
 
441
 
 
442
function HFONT_16(h32: HANDLE): WORD;
 
443
begin
 
444
  Result := WOWHandle16(h32, WOW_TYPE_HFONT);
 
445
end;
 
446
 
 
447
function HMETAFILE_16(h32: HANDLE): WORD;
 
448
begin
 
449
  Result := WOWHandle16(h32, WOW_TYPE_HMETAFILE);
 
450
end;
 
451
 
 
452
function HRGN_16(h32: HANDLE): WORD;
 
453
begin
 
454
  Result := WOWHandle16(h32, WOW_TYPE_HRGN);
 
455
end;
 
456
 
 
457
function HBITMAP_16(h32: HANDLE): WORD;
 
458
begin
 
459
  Result := WOWHandle16(h32, WOW_TYPE_HBITMAP);
 
460
end;
 
461
 
 
462
function HBRUSH_16(h32: HANDLE): WORD;
 
463
begin
 
464
  Result := WOWHandle16(h32, WOW_TYPE_HBRUSH);
 
465
end;
 
466
 
 
467
function HPALETTE_16(h32: HANDLE): WORD;
 
468
begin
 
469
  Result := WOWHandle16(h32, WOW_TYPE_HPALETTE);
 
470
end;
 
471
 
 
472
function HPEN_16(h32: HANDLE): WORD;
 
473
begin
 
474
  Result := WOWHandle16(h32, WOW_TYPE_HPEN);
 
475
end;
 
476
 
 
477
function HACCEL_16(h32: HANDLE): WORD;
 
478
begin
 
479
  Result := WOWHandle16(h32, WOW_TYPE_HACCEL);
 
480
end;
 
481
 
 
482
function HTASK_16(h32: HANDLE): WORD;
 
483
begin
 
484
  Result := WOWHandle16(h32, WOW_TYPE_HTASK);
 
485
end;
 
486
 
 
487
{$IFDEF DYNAMIC_LINK}
 
488
 
 
489
var
 
490
  _WOWGetVDMPointer: Pointer;
 
491
 
 
492
function WOWGetVDMPointer;
 
493
begin
 
494
  GetProcedureAddress(_WOWGetVDMPointer, wow32lib, 'WOWGetVDMPointer');
 
495
  asm
 
496
        MOV     ESP, EBP
 
497
        POP     EBP
 
498
        JMP     [_WOWGetVDMPointer]
 
499
  end;
 
500
end;
 
501
 
 
502
var
 
503
  _WOWGetVDMPointerFix: Pointer;
 
504
 
 
505
function WOWGetVDMPointerFix;
 
506
begin
 
507
  GetProcedureAddress(_WOWGetVDMPointerFix, wow32lib, 'WOWGetVDMPointerFix');
 
508
  asm
 
509
        MOV     ESP, EBP
 
510
        POP     EBP
 
511
        JMP     [_WOWGetVDMPointerFix]
 
512
  end;
 
513
end;
 
514
 
 
515
var
 
516
  _WOWGetVDMPointerUnfix: Pointer;
 
517
 
 
518
procedure WOWGetVDMPointerUnfix;
 
519
begin
 
520
  GetProcedureAddress(_WOWGetVDMPointerUnfix, wow32lib, 'WOWGetVDMPointerUnfix');
 
521
  asm
 
522
        MOV     ESP, EBP
 
523
        POP     EBP
 
524
        JMP     [_WOWGetVDMPointerUnfix]
 
525
  end;
 
526
end;
 
527
 
 
528
var
 
529
  _WOWGlobalAlloc16: Pointer;
 
530
 
 
531
function WOWGlobalAlloc16;
 
532
begin
 
533
  GetProcedureAddress(_WOWGlobalAlloc16, wow32lib, 'WOWGlobalAlloc16');
 
534
  asm
 
535
        MOV     ESP, EBP
 
536
        POP     EBP
 
537
        JMP     [_WOWGlobalAlloc16]
 
538
  end;
 
539
end;
 
540
 
 
541
var
 
542
  _WOWGlobalFree16: Pointer;
 
543
 
 
544
function WOWGlobalFree16;
 
545
begin
 
546
  GetProcedureAddress(_WOWGlobalFree16, wow32lib, 'WOWGlobalFree16');
 
547
  asm
 
548
        MOV     ESP, EBP
 
549
        POP     EBP
 
550
        JMP     [_WOWGlobalFree16]
 
551
  end;
 
552
end;
 
553
 
 
554
var
 
555
  _WOWGlobalLock16: Pointer;
 
556
 
 
557
function WOWGlobalLock16;
 
558
begin
 
559
  GetProcedureAddress(_WOWGlobalLock16, wow32lib, 'WOWGlobalLock16');
 
560
  asm
 
561
        MOV     ESP, EBP
 
562
        POP     EBP
 
563
        JMP     [_WOWGlobalLock16]
 
564
  end;
 
565
end;
 
566
 
 
567
var
 
568
  _WOWGlobalUnlock16: Pointer;
 
569
 
 
570
function WOWGlobalUnlock16;
 
571
begin
 
572
  GetProcedureAddress(_WOWGlobalUnlock16, wow32lib, 'WOWGlobalUnlock16');
 
573
  asm
 
574
        MOV     ESP, EBP
 
575
        POP     EBP
 
576
        JMP     [_WOWGlobalUnlock16]
 
577
  end;
 
578
end;
 
579
 
 
580
var
 
581
  _WOWGlobalAllocLock16: Pointer;
 
582
 
 
583
function WOWGlobalAllocLock16;
 
584
begin
 
585
  GetProcedureAddress(_WOWGlobalAllocLock16, wow32lib, 'WOWGlobalAllocLock16');
 
586
  asm
 
587
        MOV     ESP, EBP
 
588
        POP     EBP
 
589
        JMP     [_WOWGlobalAllocLock16]
 
590
  end;
 
591
end;
 
592
 
 
593
var
 
594
  _WOWGlobalUnlockFree16: Pointer;
 
595
 
 
596
function WOWGlobalUnlockFree16;
 
597
begin
 
598
  GetProcedureAddress(_WOWGlobalUnlockFree16, wow32lib, 'WOWGlobalUnlockFree16');
 
599
  asm
 
600
        MOV     ESP, EBP
 
601
        POP     EBP
 
602
        JMP     [_WOWGlobalUnlockFree16]
 
603
  end;
 
604
end;
 
605
 
 
606
var
 
607
  _WOWGlobalLockSize16: Pointer;
 
608
 
 
609
function WOWGlobalLockSize16;
 
610
begin
 
611
  GetProcedureAddress(_WOWGlobalLockSize16, wow32lib, 'WOWGlobalLockSize16');
 
612
  asm
 
613
        MOV     ESP, EBP
 
614
        POP     EBP
 
615
        JMP     [_WOWGlobalLockSize16]
 
616
  end;
 
617
end;
 
618
 
 
619
var
 
620
  _WOWYield16: Pointer;
 
621
 
 
622
procedure WOWYield16;
 
623
begin
 
624
  GetProcedureAddress(_WOWYield16, wow32lib, 'WOWYield16');
 
625
  asm
 
626
        MOV     ESP, EBP
 
627
        POP     EBP
 
628
        JMP     [_WOWYield16]
 
629
  end;
 
630
end;
 
631
 
 
632
var
 
633
  _WOWDirectedYield16: Pointer;
 
634
 
 
635
procedure WOWDirectedYield16;
 
636
begin
 
637
  GetProcedureAddress(_WOWDirectedYield16, wow32lib, 'WOWDirectedYield16');
 
638
  asm
 
639
        MOV     ESP, EBP
 
640
        POP     EBP
 
641
        JMP     [_WOWDirectedYield16]
 
642
  end;
 
643
end;
 
644
 
 
645
var
 
646
  _WOWHandle32: Pointer;
 
647
 
 
648
function WOWHandle32;
 
649
begin
 
650
  GetProcedureAddress(_WOWHandle32, wow32lib, 'WOWHandle32');
 
651
  asm
 
652
        MOV     ESP, EBP
 
653
        POP     EBP
 
654
        JMP     [_WOWHandle32]
 
655
  end;
 
656
end;
 
657
 
 
658
var
 
659
  _WOWHandle16: Pointer;
 
660
 
 
661
function WOWHandle16;
 
662
begin
 
663
  GetProcedureAddress(_WOWHandle16, wow32lib, 'WOWHandle16');
 
664
  asm
 
665
        MOV     ESP, EBP
 
666
        POP     EBP
 
667
        JMP     [_WOWHandle16]
 
668
  end;
 
669
end;
 
670
 
 
671
var
 
672
  _WOWCallback16: Pointer;
 
673
 
 
674
function WOWCallback16;
 
675
begin
 
676
  GetProcedureAddress(_WOWCallback16, wow32lib, 'WOWCallback16');
 
677
  asm
 
678
        MOV     ESP, EBP
 
679
        POP     EBP
 
680
        JMP     [_WOWCallback16]
 
681
  end;
 
682
end;
 
683
 
 
684
var
 
685
  _WOWCallback16Ex: Pointer;
 
686
 
 
687
function WOWCallback16Ex;
 
688
begin
 
689
  GetProcedureAddress(_WOWCallback16Ex, wow32lib, 'WOWCallback16Ex');
 
690
  asm
 
691
        MOV     ESP, EBP
 
692
        POP     EBP
 
693
        JMP     [_WOWCallback16Ex]
 
694
  end;
 
695
end;
 
696
 
 
697
{$ELSE}
 
698
 
 
699
function WOWGetVDMPointer; external wow32lib name 'WOWGetVDMPointer';
 
700
function WOWGetVDMPointerFix; external wow32lib name 'WOWGetVDMPointerFix';
 
701
procedure WOWGetVDMPointerUnfix; external wow32lib name 'WOWGetVDMPointerUnfix';
 
702
function WOWGlobalAlloc16; external wow32lib name 'WOWGlobalAlloc16';
 
703
function WOWGlobalFree16; external wow32lib name 'WOWGlobalFree16';
 
704
function WOWGlobalLock16; external wow32lib name 'WOWGlobalLock16';
 
705
function WOWGlobalUnlock16; external wow32lib name 'WOWGlobalUnlock16';
 
706
function WOWGlobalAllocLock16; external wow32lib name 'WOWGlobalAllocLock16';
 
707
function WOWGlobalUnlockFree16; external wow32lib name 'WOWGlobalUnlockFree16';
 
708
function WOWGlobalLockSize16; external wow32lib name 'WOWGlobalLockSize16';
 
709
procedure WOWYield16; external wow32lib name 'WOWYield16';
 
710
procedure WOWDirectedYield16; external wow32lib name 'WOWDirectedYield16';
 
711
function WOWHandle32; external wow32lib name 'WOWHandle32';
 
712
function WOWHandle16; external wow32lib name 'WOWHandle16';
 
713
function WOWCallback16; external wow32lib name 'WOWCallback16';
 
714
function WOWCallback16Ex; external wow32lib name 'WOWCallback16Ex';
 
715
 
 
716
{$ENDIF DYNAMIC_LINK}
 
717
 
 
718
end.