Browse Source

--- Merging r15561 into '.':
U rtl/win/wininc/ascfun.inc
U rtl/win/wininc/unifun.inc
--- Merging r15630 into '.':
U rtl/win/wininc/func.inc
--- Merging r15674 into '.':
U packages/winceunits/src/sms.pp
--- Merging r15715 into '.':
U packages/winunits-base/src/activex.pp
--- Merging r15766 into '.':
U packages/winunits-base/fpmake.pp
U packages/winunits-base/Makefile.fpc
A packages/winunits-base/src/winspool.pp
U packages/winunits-base/src/buildwinutilsbase.pp
C packages/winunits-base/Makefile
--- Merging r15779 into '.':
U rtl/win/wininc/struct.inc
--- Merging r15783 into '.':
U rtl/wince/wininc/coredll.inc
--- Merging r15790 into '.':
U packages/winunits-base/src/winspool.pp
--- Merging r15795 into '.':
U packages/winunits-jedi/src/jwawingdi.pas
--- Merging r15810 into '.':
G packages/winunits-base/Makefile.fpc
A packages/winunits-base/src/imm.pas
G packages/winunits-base/src/buildwinutilsbase.pp
A packages/winunits-base/src/imm_dyn.pas
C packages/winunits-base/Makefile
--- Merging r15824 into '.':
U rtl/wince/wininc/messages.inc
U rtl/wince/wininc/base.inc
U rtl/wince/wininc/defines.inc
G rtl/wince/wininc/coredll.inc
U rtl/wince/wininc/struct.inc
U rtl/wince/wininc/redef.inc
G rtl/win/wininc/func.inc
U rtl/win/wininc/defines.inc
G rtl/win/wininc/struct.inc
U packages/winceunits/src/pimstore.pp
U packages/winceunits/src/aygshell.pp
--- Merging r15828 into '.':
G rtl/wince/wininc/defines.inc
--- Merging r15835 into '.':
U packages/winceunits/src/ril.pp
--- Merging r15912 into '.':
A packages/winceunits/src/storemgr.pas
A packages/winceunits/src/pnp.pas
U packages/winceunits/src/buildwinceunits.pp
--- Merging r15979 into '.':
U packages/winunits-base/src/shellapi.pp
--- Merging r16040 into '.':
A packages/winunits-base/src/Nb30.pp
--- Merging r16054 into '.':
U rtl/win/wininc/base.inc
--- Merging r16179 into '.':
G rtl/win/wininc/defines.inc
--- Merging r16358 into '.':
G rtl/win/wininc/defines.inc
Summary of conflicts:
Text conflicts: 2

# revisions: 15561,15630,15674,15715,15766,15779,15783,15790,15795,15810,15824,15828,15835,15912,15979,16040,16054,16179,16358
------------------------------------------------------------------------
r15561 | marco | 2010-07-13 05:44:04 +0200 (Tue, 13 Jul 2010) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/ascfun.inc
M /trunk/rtl/win/wininc/unifun.inc

* added cdecl to some overloaded wsprintfa/w variants. Mantis 16915

------------------------------------------------------------------------
------------------------------------------------------------------------
r15630 | marco | 2010-07-24 21:03:59 +0200 (Sat, 24 Jul 2010) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/func.inc

* fix for 17008, changed bytes component of mapviewoffile(ex) to size_t

------------------------------------------------------------------------
------------------------------------------------------------------------
r15674 | marco | 2010-07-31 09:43:34 +0200 (Sat, 31 Jul 2010) | 2 lines
Changed paths:
M /trunk/packages/winceunits/src/sms.pp

* SmsSendMessage's 2nd parameter changed to pointer, mantis 14605

------------------------------------------------------------------------
------------------------------------------------------------------------
r15715 | marco | 2010-08-06 05:12:52 +0200 (Fri, 06 Aug 2010) | 3 lines
Changed paths:
M /trunk/packages/winunits-base/src/activex.pp

* fix for mantis 17083, change funcdesc field to ptr to array of hresult
instead of just ptr to scode.

------------------------------------------------------------------------
------------------------------------------------------------------------
r15766 | florian | 2010-08-10 22:17:20 +0200 (Tue, 10 Aug 2010) | 2 lines
Changed paths:
M /trunk/packages/winunits-base/Makefile
M /trunk/packages/winunits-base/Makefile.fpc
M /trunk/packages/winunits-base/fpmake.pp
M /trunk/packages/winunits-base/src/buildwinutilsbase.pp
A /trunk/packages/winunits-base/src/winspool.pp

* converted winspool.h from MingW and added it as winspool.pp, resolves #17174

------------------------------------------------------------------------
------------------------------------------------------------------------
r15779 | marco | 2010-08-11 13:05:59 +0200 (Wed, 11 Aug 2010) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/struct.inc

* textmetricA variants, delphi compat.

------------------------------------------------------------------------
------------------------------------------------------------------------
r15783 | florian | 2010-08-11 22:31:04 +0200 (Wed, 11 Aug 2010) | 1 line
Changed paths:
M /trunk/rtl/wince/wininc/coredll.inc

+ add StopDeviceNotifications to WinCE Windows units, resolves #17095
------------------------------------------------------------------------
------------------------------------------------------------------------
r15790 | marco | 2010-08-12 21:54:10 +0200 (Thu, 12 Aug 2010) | 1 line
Changed paths:
M /trunk/packages/winunits-base/src/winspool.pp

* adding stdcall calling convention modifiers. bug #17159
------------------------------------------------------------------------
------------------------------------------------------------------------
r15795 | marco | 2010-08-13 12:39:38 +0200 (Fri, 13 Aug 2010) | 2 lines
Changed paths:
M /trunk/packages/winunits-jedi/src/jwawingdi.pas

* minor additional fix for bug #10619

------------------------------------------------------------------------
------------------------------------------------------------------------
r15810 | marco | 2010-08-14 16:59:04 +0200 (Sat, 14 Aug 2010) | 1 line
Changed paths:
M /trunk/packages/winunits-base/Makefile
M /trunk/packages/winunits-base/Makefile.fpc
M /trunk/packages/winunits-base/src/buildwinutilsbase.pp
A /trunk/packages/winunits-base/src/imm.pas
A /trunk/packages/winunits-base/src/imm_dyn.pas

* Patch from Dmitry. imm + a dynloaded variant to be used for w9x. Mantis 17167
------------------------------------------------------------------------
------------------------------------------------------------------------
r15824 | florian | 2010-08-15 21:39:31 +0200 (Sun, 15 Aug 2010) | 1 line
Changed paths:
M /trunk/packages/winceunits/src/aygshell.pp
M /trunk/packages/winceunits/src/pimstore.pp
M /trunk/rtl/win/wininc/defines.inc
M /trunk/rtl/win/wininc/func.inc
M /trunk/rtl/win/wininc/struct.inc
M /trunk/rtl/wince/wininc/base.inc
M /trunk/rtl/wince/wininc/coredll.inc
M /trunk/rtl/wince/wininc/defines.inc
M /trunk/rtl/wince/wininc/messages.inc
M /trunk/rtl/wince/wininc/redef.inc
M /trunk/rtl/wince/wininc/struct.inc

* patch by "Vasil" to fix various WinCE and Win32 API conversion issues
------------------------------------------------------------------------
------------------------------------------------------------------------
r15828 | sekelsenmat | 2010-08-16 11:38:31 +0200 (Mon, 16 Aug 2010) | 1 line
Changed paths:
M /trunk/rtl/wince/wininc/defines.inc

Removes non-working constant from wince rtl, see bug #15062
------------------------------------------------------------------------
------------------------------------------------------------------------
r15835 | florian | 2010-08-17 21:33:42 +0200 (Tue, 17 Aug 2010) | 1 line
Changed paths:
M /trunk/packages/winceunits/src/ril.pp

* patch by F@ntomas to amend the incorrect declarations of RILSUPSERVICEDATA and LPRILSUPSERVICEDATA in ril.pp (winceunits package)
------------------------------------------------------------------------
------------------------------------------------------------------------
r15912 | sekelsenmat | 2010-08-27 16:31:13 +0200 (Fri, 27 Aug 2010) | 1 line
Changed paths:
M /trunk/packages/winceunits/src/buildwinceunits.pp
A /trunk/packages/winceunits/src/pnp.pas
A /trunk/packages/winceunits/src/storemgr.pas

Patches from Drigus, adds new wince units. bug #17096 and bug #17097
------------------------------------------------------------------------
------------------------------------------------------------------------
r15979 | marco | 2010-09-14 08:36:50 +0200 (Tue, 14 Sep 2010) | 3 lines
Changed paths:
M /trunk/packages/winunits-base/src/shellapi.pp

* very minor compatibility fix. Delphi exports name of the dll as
"shell32"

------------------------------------------------------------------------
------------------------------------------------------------------------
r16040 | marco | 2010-09-25 14:48:11 +0200 (Sat, 25 Sep 2010) | 1 line
Changed paths:
A /trunk/packages/winunits-base/src/Nb30.pp

* first draft of nb30.
------------------------------------------------------------------------
------------------------------------------------------------------------
r16054 | florian | 2010-09-27 20:51:10 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/base.inc

* inline original windows macros

------------------------------------------------------------------------
------------------------------------------------------------------------
r16179 | marco | 2010-10-17 21:58:49 +0200 (Sun, 17 Oct 2010) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/defines.inc

* adds gwlp and gclp constants, mantis 17656 and 17655

------------------------------------------------------------------------
------------------------------------------------------------------------
r16358 | paul | 2010-11-18 05:06:49 +0100 (Thu, 18 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/win/wininc/defines.inc

rtl: add IO_REPARSE_TAG constants
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@16377 -

marco 14 years ago
parent
commit
f270e5254e

+ 6 - 0
.gitattributes

@@ -5156,6 +5156,7 @@ packages/winceunits/src/oleauto.pp svneol=native#text/plain
 packages/winceunits/src/phone.pp svneol=native#text/plain
 packages/winceunits/src/phone.pp svneol=native#text/plain
 packages/winceunits/src/pimstore.pp svneol=native#text/plain
 packages/winceunits/src/pimstore.pp svneol=native#text/plain
 packages/winceunits/src/pm.pp svneol=native#text/plain
 packages/winceunits/src/pm.pp svneol=native#text/plain
+packages/winceunits/src/pnp.pas svneol=native#text/plain
 packages/winceunits/src/power.pp svneol=native#text/plain
 packages/winceunits/src/power.pp svneol=native#text/plain
 packages/winceunits/src/projects.pp svneol=native#text/plain
 packages/winceunits/src/projects.pp svneol=native#text/plain
 packages/winceunits/src/rapi.pp svneol=native#text/plain
 packages/winceunits/src/rapi.pp svneol=native#text/plain
@@ -5169,6 +5170,7 @@ packages/winceunits/src/simmgr.pp svneol=native#text/plain
 packages/winceunits/src/sip.pp svneol=native#text/plain
 packages/winceunits/src/sip.pp svneol=native#text/plain
 packages/winceunits/src/sipapi.pp svneol=native#text/plain
 packages/winceunits/src/sipapi.pp svneol=native#text/plain
 packages/winceunits/src/sms.pp svneol=native#text/plain
 packages/winceunits/src/sms.pp svneol=native#text/plain
+packages/winceunits/src/storemgr.pas svneol=native#text/plain
 packages/winceunits/src/tapi.pp svneol=native#text/plain
 packages/winceunits/src/tapi.pp svneol=native#text/plain
 packages/winceunits/src/todaycmn.pp svneol=native#text/plain
 packages/winceunits/src/todaycmn.pp svneol=native#text/plain
 packages/winceunits/src/tsp.pp svneol=native#text/plain
 packages/winceunits/src/tsp.pp svneol=native#text/plain
@@ -5181,6 +5183,7 @@ packages/winceunits/src/ws2bth.pp svneol=native#text/plain
 packages/winunits-base/Makefile svneol=native#text/plain
 packages/winunits-base/Makefile svneol=native#text/plain
 packages/winunits-base/Makefile.fpc svneol=native#text/plain
 packages/winunits-base/Makefile.fpc svneol=native#text/plain
 packages/winunits-base/fpmake.pp svneol=native#text/plain
 packages/winunits-base/fpmake.pp svneol=native#text/plain
+packages/winunits-base/src/Nb30.pp svneol=native#text/plain
 packages/winunits-base/src/activex.pp svneol=native#text/plain
 packages/winunits-base/src/activex.pp svneol=native#text/plain
 packages/winunits-base/src/buildwinutilsbase.pp svneol=native#text/plain
 packages/winunits-base/src/buildwinutilsbase.pp svneol=native#text/plain
 packages/winunits-base/src/comconst.pp svneol=native#text/plain
 packages/winunits-base/src/comconst.pp svneol=native#text/plain
@@ -5192,6 +5195,8 @@ packages/winunits-base/src/dwmapi.pp svneol=native#text/plain
 packages/winunits-base/src/flatsb.pp svneol=native#text/plain
 packages/winunits-base/src/flatsb.pp svneol=native#text/plain
 packages/winunits-base/src/htmlhelp.pp svneol=native#text/plain
 packages/winunits-base/src/htmlhelp.pp svneol=native#text/plain
 packages/winunits-base/src/imagehlp.pp svneol=native#text/plain
 packages/winunits-base/src/imagehlp.pp svneol=native#text/plain
+packages/winunits-base/src/imm.pas svneol=native#text/plain
+packages/winunits-base/src/imm_dyn.pas svneol=native#text/plain
 packages/winunits-base/src/mmsystem.pp svneol=native#text/plain
 packages/winunits-base/src/mmsystem.pp svneol=native#text/plain
 packages/winunits-base/src/multimon.pp svneol=native#text/plain
 packages/winunits-base/src/multimon.pp svneol=native#text/plain
 packages/winunits-base/src/ole2.pp svneol=native#text/plain
 packages/winunits-base/src/ole2.pp svneol=native#text/plain
@@ -5203,6 +5208,7 @@ packages/winunits-base/src/shlobj.pp svneol=native#text/plain
 packages/winunits-base/src/tmschema.inc svneol=native#text/plain
 packages/winunits-base/src/tmschema.inc svneol=native#text/plain
 packages/winunits-base/src/uxtheme.pp svneol=native#text/plain
 packages/winunits-base/src/uxtheme.pp svneol=native#text/plain
 packages/winunits-base/src/wininet.pp svneol=native#text/plain
 packages/winunits-base/src/wininet.pp svneol=native#text/plain
+packages/winunits-base/src/winspool.pp svneol=native#text/pascal
 packages/winunits-base/src/winutils.pp svneol=native#text/pascal
 packages/winunits-base/src/winutils.pp svneol=native#text/pascal
 packages/winunits-base/src/winver.pp svneol=native#text/plain
 packages/winunits-base/src/winver.pp svneol=native#text/plain
 packages/winunits-base/tests/OOHelper.pp svneol=native#text/plain
 packages/winunits-base/tests/OOHelper.pp svneol=native#text/plain

+ 541 - 16
packages/winceunits/src/aygshell.pp

@@ -80,9 +80,6 @@
            288    SHBorderRectangle
            288    SHBorderRectangle
            104    SHBox
            104    SHBox
            103    SHBoxEx
            103    SHBoxEx
-           114    SHChangeNotifyDeregister
-           115    SHChangeNotifyFree
-           113    SHChangeNotifyRegister
             48    SHCheckForContextMenu
             48    SHCheckForContextMenu
             86    SHClearStartedBit
             86    SHClearStartedBit
             55    SHColorDisplay
             55    SHColorDisplay
@@ -95,7 +92,6 @@
             41    SHCreateContextMenu
             41    SHCreateContextMenu
             43    SHCreateMainWindow
             43    SHCreateMainWindow
             74    SHCreateMenuBarInternal
             74    SHCreateMenuBarInternal
-           108    SHCreateNewItem
             53    SHCreateSystemFont
             53    SHCreateSystemFont
             35    SHCreateWorkerWindow
             35    SHCreateWorkerWindow
            329    SHDeleteTodayWallpaper
            329    SHDeleteTodayWallpaper
@@ -127,7 +123,6 @@
             72    SHFontMgrManageFonts
             72    SHFontMgrManageFonts
             33    SHForceBaseState
             33    SHForceBaseState
             99    SHForceBaseStateEx
             99    SHForceBaseStateEx
-           102    SHFreeContextMenuExtensions
            120    SHFreeScanners
            120    SHFreeScanners
            213    SHGetActiveDialog
            213    SHGetActiveDialog
            292    SHGetBitmapDimensions
            292    SHGetBitmapDimensions
@@ -136,9 +131,7 @@
            224    SHGetCarrierBrandingFlag
            224    SHGetCarrierBrandingFlag
             96    SHGetDeviceFeatureLevel
             96    SHGetDeviceFeatureLevel
            299    SHGetDisplayRotation
            299    SHGetDisplayRotation
-           128    SHGetEmergencyCallList
            218    SHGetFontHeight
            218    SHGetFontHeight
-           232    SHGetInputContext
            133    SHGetKOBits
            133    SHGetKOBits
            305    SHGetLandscapeRotationSettings
            305    SHGetLandscapeRotationSettings
            345    SHGetLegacySupportWindow
            345    SHGetLegacySupportWindow
@@ -168,11 +161,9 @@
            149    SHInitPresetMessages
            149    SHInitPresetMessages
            181    SHInsertPresetMessage
            181    SHInsertPresetMessage
            129    SHInvalidateScreen
            129    SHInvalidateScreen
-           101    SHInvokeContextMenuCommand
            123    SHIsLocked
            123    SHIsLocked
            295    SHIsPreOzoneUpdate
            295    SHIsPreOzoneUpdate
             94    SHIsPreRapierApp
             94    SHIsPreRapierApp
-           100    SHLoadContextMenuExtensions
            230    SHLoadFileContextMenuExtensions
            230    SHLoadFileContextMenuExtensions
            313    SHLoadFontFromResource
            313    SHLoadFontFromResource
             91    SHLoadMenuPopup
             91    SHLoadMenuPopup
@@ -182,10 +173,6 @@
            235    SHMakeValidFilename
            235    SHMakeValidFilename
             32    SHMessageBox
             32    SHMessageBox
             80    SHNewProfileObj
             80    SHNewProfileObj
-           155    SHNotificationAdd
-           173    SHNotificationGetData
-           157    SHNotificationRemove
-           156    SHNotificationUpdate
            208    SHNotifyAppsOnCallConnect
            208    SHNotifyAppsOnCallConnect
            210    SHNotifyAppsOnCarkit
            210    SHNotifyAppsOnCarkit
            165    SHNotifyAppsOnDock
            165    SHNotifyAppsOnDock
@@ -220,11 +207,9 @@
            119    SHScanFile
            119    SHScanFile
             97    SHSendBackToFocusWindow
             97    SHSendBackToFocusWindow
            169    SHSetAsWatermark
            169    SHSetAsWatermark
-           184    SHSetBack
            161    SHSetBubbleRegion
            161    SHSetBubbleRegion
            298    SHSetDisplayRotation
            298    SHSetDisplayRotation
            131    SHSetForegroundLastActivePopup
            131    SHSetForegroundLastActivePopup
-           231    SHSetInputContext
            134    SHSetKOBits
            134    SHSetKOBits
            154    SHSetPresetMessage
            154    SHSetPresetMessage
            170    SHSetSimToolkitMenu
            170    SHSetSimToolkitMenu
@@ -284,6 +269,8 @@ unit aygshell;
 
 
 interface
 interface
 
 
+{$MODE OBJFPC}
+
 uses windows;
 uses windows;
 
 
 {$calling cdecl}
 {$calling cdecl}
@@ -481,6 +468,140 @@ type
   PSHCAMERACAPTURE=^TSHCAMERACAPTURE;
   PSHCAMERACAPTURE=^TSHCAMERACAPTURE;
 
 
 
 
+
+//====== File System Notification APIs ===============================
+//
+//
+//  File System Notification flags
+//
+const
+      SHCNE_RENAME              = $00000001;   // GOING AWAY
+      SHCNE_RENAMEITEM          = $00000001;
+      SHCNE_CREATE              = $00000002;
+      SHCNE_DELETE              = $00000004;
+      SHCNE_MKDIR               = $00000008;
+      SHCNE_RMDIR               = $00000010;
+      SHCNE_MEDIAINSERTED       = $00000020;
+      SHCNE_MEDIAREMOVED        = $00000040;
+      SHCNE_DRIVEREMOVED        = $00000080;
+      SHCNE_DRIVEADD            = $00000100;
+      SHCNE_NETSHARE            = $00000200;
+      SHCNE_NETUNSHARE          = $00000400;
+      SHCNE_ATTRIBUTES          = $00000800;
+      SHCNE_UPDATEDIR           = $00001000;
+      SHCNE_UPDATEITEM          = $00002000;
+      SHCNE_SERVERDISCONNECT    = $00004000;
+      SHCNE_UPDATEIMAGE         = $00008000;
+      SHCNE_DRIVEADDGUI         = $00010000;
+      SHCNE_RENAMEFOLDER        = $00020000;
+
+      SHCNE_ASSOCCHANGED        = $08000000;
+
+      SHCNE_DISKEVENTS          = $0002381F;
+      SHCNE_GLOBALEVENTS        = $0C0181E0; // Events that dont match pidls first
+      SHCNE_ALLEVENTS           = $7FFFFFFF;
+      SHCNE_INTERRUPT           = $80000000; // The presence of this flag indicates
+                                             // that the event was generated by an
+                                             // interrupt.  It is stripped out before
+                                             // the clients of SHCNNotify_ see it.
+
+// Flags
+// uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
+      SHCNF_IDLIST      = $0000;  // LPITEMIDLIST
+      SHCNF_PATH        = $0001;  // path name
+      SHCNF_PRINTER     = $0002;  // printer friendly name
+      SHCNF_DWORD       = $0003;  // DWORD
+      SHCNF_TYPE        = $00FF;
+      SHCNF_FLUSH       = $1000;
+      SHCNF_FLUSHNOWAIT = $2000;
+
+const
+      WM_FILECHANGEINFO   = WM_APP + $0101;
+
+type
+     _FILECHANGEINFO = record
+       cbSize:DWORD;
+       wEventId:LONG;
+       uFlags:ULONG;
+       dwItem1:DWORD;
+       dwItem2:DWORD;
+       dwAttributes:DWORD;
+       ftModified:FILETIME;
+       nFileSize:ULONG;
+     end;
+     FILECHANGEINFO = _FILECHANGEINFO;
+     LPFILECHANGEINFO = ^_FILECHANGEINFO;
+     LPCFILECHANGEINFO = ^FILECHANGEINFO;
+
+     tagFILECHANGENOTIFY = record
+       dwRefCount:DWORD;
+       fci:FILECHANGEINFO;
+     end;
+     FILECHANGENOTIFY = tagFILECHANGENOTIFY;
+     LPFILECHANGENOTIFY = ^tagFILECHANGENOTIFY;
+
+     tagSHCHANGENOTIFYENTRY = record
+       dwEventMask:DWORD;    // Events to watch
+       pszWatchDir:LPTSTR;    // Directory or root for the events we want. NULL means all.
+       fRecursive:BOOL;     // Indicates whether look just for pszWatchDir or recursively.
+     end;
+     SHCHANGENOTIFYENTRY = tagSHCHANGENOTIFYENTRY;
+     LPSHCHANGENOTIFYENTRY = ^tagSHCHANGENOTIFYENTRY;
+
+     
+//////////////////////////////////////////////////////////////////////////////
+//
+// Input Context API
+//
+// These are definitions and APIs for the interacting with the input context
+// properties of individual windows
+//
+
+{$PUSH}
+{$PACKENUM 4}
+// Word correct Options
+type
+     SHIC_FEATURE = (SHIC_FEATURE_RESTOREDEFAULT := 0,
+                     SHIC_FEATURE_AUTOCORRECT    := $00000001,
+                     SHIC_FEATURE_AUTOSUGGEST    := $00000002,
+                     SHIC_FEATURE_HAVETRAILER    := $00000003,
+                     SHIC_FEATURE_CLASS          := $00000004);
+{$POP}
+
+const
+// Predefined input context classes
+      SHIC_CLASS_DEFAULT              = '';
+      SHIC_CLASS_EMAIL                = 'email';
+      SHIC_CLASS_URL                  = 'url';
+      SHIC_CLASS_PHONE                = 'phone';
+      SHIC_CLASS_NAME                 = 'name';
+      SHIC_CLASS_PHONE_AND_EMAIL      = 'phoneAndEmail';
+      SHIC_CLASS_MAXLEN               = MAX_PATH - 11;
+
+//@topic Input Context Features |
+// The input context API supports the following features and their corresponding values:
+//
+//@flag   SHIC_FEATURE_RESTOREDEFAULT   | Restore original input context state. (no corresponding value)
+//@flag   SHIC_FEATURE_AUTOCORRECT      | Turn auto-corrections on and off. (TRUE, FALSE)
+//@flag   SHIC_FEATURE_AUTOCOMPLETE     | Turn dictionary suggestions on and off. (TRUE, FALSE)
+//@flag   SHIC_FEATURE_HAVETRAILER      | Specify whether to append trailer characters after replacing words.
+//                                      (TRUE, FALSE)
+//@flag   SHIC_FEATURE_CLASS            | Make this control behave like a specific semantic type.
+//                                      (SHIC_CLASS_DEFAULT, SHIC_CLASS_EMAIL, SHIC_CLASS_URL,
+//                                      SHIC_CLASS_PHONE, SHIC_CLASS_NAME, SHIC_CLASS_PHONE_AND_EMAIL)
+//
+//@comm All SHIC_FEATUREs are inherited from parent if undefined. That is, if they are not defined in
+//      a window or the window's SHIC class, the API looks at the parent chain to find the setting
+//      that applies to the window.
+//
+//@xref <f SHSetInputContext> <f SHGetInputContext>
+//
+//
+// end Input Context API
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
 //*****************************************************************************
 //*****************************************************************************
 // functions
 // functions
 //*****************************************************************************
 //*****************************************************************************
@@ -489,17 +610,45 @@ function PathAddBackslash(lpszPath:LPTSTR):LPTSTR; external UserDLLAyg name 'Pat
 function PathCombine(lpszDest:LPTSTR; lpszDir:LPCTSTR; lpszFile:LPCTSTR):LPTSTR; external UserDLLAyg name 'PathCombine'; // index 26
 function PathCombine(lpszDest:LPTSTR; lpszDir:LPCTSTR; lpszFile:LPCTSTR):LPTSTR; external UserDLLAyg name 'PathCombine'; // index 26
 
 
 function ExitWindowsEx(uFlags:UINT; dwReserved:DWORD):WINBOOL; external UserDLLAyg name 'ExitWindowsEx';
 function ExitWindowsEx(uFlags:UINT; dwReserved:DWORD):WINBOOL; external UserDLLAyg name 'ExitWindowsEx';
+
+function SHChangeNotifyDeregister(_hwnd:HWND):BOOL; external UserDLLAyg name 'SHChangeNotifyDeregister'; // index 114
+procedure SHChangeNotifyFree(pfcn:LPFILECHANGENOTIFY); external UserDLLAyg name 'SHChangeNotifyFree'; // index 115
+function SHChangeNotifyRegister(_hwnd:HWND; pshcne:LPSHCHANGENOTIFYENTRY):BOOL; external UserDLLAyg name 'SHChangeNotifyRegister'; // index 113
 function SHCloseApps( dwMemSought : DWORD ): WINBOOL; external UserDLLAyg name 'SHCloseApps';
 function SHCloseApps( dwMemSought : DWORD ): WINBOOL; external UserDLLAyg name 'SHCloseApps';
 function SHCreateMenuBar(pmbi : PSHMENUBARINFO ): WINBOOL; external UserDLLAyg name 'SHCreateMenuBar';
 function SHCreateMenuBar(pmbi : PSHMENUBARINFO ): WINBOOL; external UserDLLAyg name 'SHCreateMenuBar';
+
+// SHCreateNewItem
+//    Creates a New item, as if an item were chosen from the
+//    global New menu dropdown.
+function SHCreateNewItem(hwndOwner:HWND; clsid:PCLSID{REFCLSID}):HRESULT; external UserDLLAyg name 'SHCreateNewItem'; // index 108
+
 function SHDoneButton(hwndRequester: HWND ; dwState : DWORD ): WINBOOL; external UserDLLAyg name 'SHDoneButton';
 function SHDoneButton(hwndRequester: HWND ; dwState : DWORD ): WINBOOL; external UserDLLAyg name 'SHDoneButton';
 function SHFindMenuBar(hwnd:HWND) : HWND; external UserDLLAyg name 'SHFindMenuBar';
 function SHFindMenuBar(hwnd:HWND) : HWND; external UserDLLAyg name 'SHFindMenuBar';
+function SHFreeContextMenuExtensions(hCMExtensions:HANDLE):BOOL; external UserDLLAyg name 'SHFreeContextMenuExtensions'; // index 102
 function SHFullScreen(hwmdRequester: hWnd; dwState: DWord): WINBOOL; external UserDLLAyg name 'SHFullScreen';  {Pocket PC  special controls}
 function SHFullScreen(hwmdRequester: hWnd; dwState: DWord): WINBOOL; external UserDLLAyg name 'SHFullScreen';  {Pocket PC  special controls}
-function SHGetAutoRunPath( pAutoRunPath : LPTSTR ): WINBOOL; external UserDLLAyg name 'SHGetAutoRunPath';  
+function SHGetAutoRunPath( pAutoRunPath : LPTSTR ): WINBOOL; external UserDLLAyg name 'SHGetAutoRunPath';
+
+//  SHGetEmergencyCallList
+//       Gets a list of emergency calls
+function SHGetEmergencyCallList(pwszBuffer:PTCHAR; uLenBuf:UINT):HRESULT; external UserDLLAyg name 'SHGetEmergencyCallList'; // index 128    
+
 function SHHandleWMActivate(hwnd:HWND; wParam:WPARAM; lParam:LPARAM; psai: PSHACTIVATEINFO; dwFlags:DWORD  ): WINBOOL; external UserDLLAyg index 84;
 function SHHandleWMActivate(hwnd:HWND; wParam:WPARAM; lParam:LPARAM; psai: PSHACTIVATEINFO; dwFlags:DWORD  ): WINBOOL; external UserDLLAyg index 84;
 function SHHandleWMSettingChange(hwnd:HWND; wParam:WPARAM; lParam:LPARAM; psai: PSHACTIVATEINFO): WINBOOL; external UserDLLAyg index 83;
 function SHHandleWMSettingChange(hwnd:HWND; wParam:WPARAM; lParam:LPARAM; psai: PSHACTIVATEINFO): WINBOOL; external UserDLLAyg index 83;
 function SHInitDialog(pshidi: PSHINITDLGINFO): WINBOOL; external UserDLLAyg name 'SHInitDialog';
 function SHInitDialog(pshidi: PSHINITDLGINFO): WINBOOL; external UserDLLAyg name 'SHInitDialog';
 function SHInitExtraControls: WINBOOL; external UserDLLAyg name 'SHInitExtraControls';
 function SHInitExtraControls: WINBOOL; external UserDLLAyg name 'SHInitExtraControls';
 procedure SHInputDialog(hwnd : HWND; uMsg : UINT; wParam: WPARAM ); external UserDLLAyg name 'SHInputDialog';
 procedure SHInputDialog(hwnd : HWND; uMsg : UINT; wParam: WPARAM ); external UserDLLAyg name 'SHInputDialog';
+
+//    Invokes a command from a context menu.  Issues the command in the
+//    extension that added it to the menu.
+function SHInvokeContextMenuCommand(hwndOwner:HWND; idCmd:UINT; hCMExtensions:HANDLE):BOOL; external UserDLLAyg name 'SHInvokeContextMenuCommand'; // index 101
+
+function SHLoadContextMenuExtensions(punkOwner:IUnknown;
+                                     pszContext:LPCTSTR;
+                                     pszClass:LPCTSTR;
+                                     _hmenu:HMENU;
+                                     idCmdFirst:UINT;
+                                     idCmdLast:UINT;
+                                     phCMExtensions:LPHANDLE):BOOL; external UserDLLAyg name 'SHLoadContextMenuExtensions'; // index 100
 function SHGetAppKeyAssoc( ptszApp: LPCTSTR ): Byte; external UserDLLAyg name 'SHGetAppKeyAssoc';
 function SHGetAppKeyAssoc( ptszApp: LPCTSTR ): Byte; external UserDLLAyg name 'SHGetAppKeyAssoc';
 function SHSetAppKeyWndAssoc( bVk: BYTE ; hwnd : HWND ): WINBOOL; external UserDLLAyg name 'SHSetAppKeyWndAssoc';
 function SHSetAppKeyWndAssoc( bVk: BYTE ; hwnd : HWND ): WINBOOL; external UserDLLAyg name 'SHSetAppKeyWndAssoc';
 function SHSetNavBarText(hwndRequester : HWND; pszText : LPCTSTR): WINBOOL; external UserDLLAyg name 'SHSetNavBarText';
 function SHSetNavBarText(hwndRequester : HWND; pszText : LPCTSTR): WINBOOL; external UserDLLAyg name 'SHSetNavBarText';
@@ -511,6 +660,382 @@ function SHSipPreference(hwnd: HWND ; st : SIPSTATE ) : WINBOOL; external UserDL
 function SHRecognizeGesture(var shrg : SHRGINFO): DWORD; external UserDLLAyg name 'SHRecognizeGesture';
 function SHRecognizeGesture(var shrg : SHRGINFO): DWORD; external UserDLLAyg name 'SHRecognizeGesture';
 function SHCameraCapture(var shcc: TSHCAMERACAPTURE): HRESULT; external UserDLLAyg name 'SHCameraCapture';
 function SHCameraCapture(var shcc: TSHCAMERACAPTURE): HRESULT; external UserDLLAyg name 'SHCameraCapture';
 
 
+//////////////////////////////////////////////////////////////////////////////
+//
+// Input Context API
+//
+// These are definitions and APIs for the interacting with the input context
+// properties of individual windows
+//
+
+//++++++
+//
+//@func HRESULT | SHSetInputContext | Changes the state of an input context feature
+//
+//@parm HWND            | hwnd      | IN - Window whose context will be set
+//@parm DWORD           | dwFeature | IN - Input context feature to change
+//@parm const LPVOID    | lpValue   | IN - New value assigned to feature
+//
+//@rdesc Returns one of the following values:
+//@flag S_OK                    | If everything went well
+//@flag ERROR_INVALID_PARAMETER | if hwnd was NULL or lpValue was NULL for a feature
+//                                that does not support it, such as SHIC_FEATURE_AUTOCORRECT,
+//                                SHIC_FEATURE_AUTOCOMPLETE and SHIC_FEATURE_HAVETRAILER.
+//@flag ERROR_NOT_SUPPORTED     | If the feature specified was invalid
+//@flag ERROR_INVALID_DATA      | If the specified value is not a legal option
+//
+//@xref <l Input_Context_Features> <f SHGetInputContext>
+//
+function SHSetInputContext(_hwnd:HWND; dwFeature:DWORD; lpValue:LPVOID):HRESULT; external UserDLLAyg name 'SHSetInputContext'; // index 231
+
+//++++++
+//
+//@func HRESULT | SHGetInputContext | Retrieves current state of an input context feature
+//
+//@parm HWND    | hwnd      | IN - Window whose context will be retrieved
+//@parm DWORD   | dwFeature | IN - Input context feature to retrieve
+//@parm LPVOID  | lpValue   | OUT - Buffer to hold current value of feature
+//@parm LPDWORD | pdwSize   | IN/OUT - size of the buffer passed in to retrieve the value
+//
+//@rdesc Returns one of the following values:
+//@flag S_OK                        | If everything went well
+//@flag ERROR_INVALID_PARAMETER     | If hwnd or lpdwSize passed were NULL
+//@flag ERROR_NOT_SUPPORTED         | If the feature specified was invalid
+//@flag ERROR_INSUFFICIENT_BUFFER   | If buffer passed is too small
+//
+//@comm Retrieves the current state/value of the specified
+//      input context feature. If the value is not explicitly set, it
+//      looks at the features set by the context class. If no class was
+//      set explicitly, or the class didn't set that value, it returns
+//      the default value for that feature, which would be the
+//      currently active one.
+//      If lpValue is NULL and lpdwSize is not NULL, it returns the
+//      size of the buffer needed in lpdwSize.
+//
+//@xref <l Input_Context_Features> <f SHSetInputContext>
+//
+function SHGetInputContext(_hwnd:HWND; dwFeature:DWORD; lpValue:LPVOID; lpdwSize:LPDWORD):HRESULT; external UserDLLAyg name 'SHGetInputContext'; // index 232
+//
+// end Input Context API
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// SHNAPI - Shell Notification API
+//
+// These are definitions and APIs for the Shell Notifications system
+//
+// {
+
+// notification priority
+
+type
+     _SHNP = (SHNP_INFORM := $01B1,      // bubble shown for duration, then goes away
+              SHNP_ICONIC                // no bubble, icon shown for duration then goes away
+             );
+     SHNP = _SHNP;
+
+const
+// notification update mask
+      SHNUM_PRIORITY     = $0001;
+      SHNUM_DURATION     = $0002;
+      SHNUM_ICON         = $0004;
+      SHNUM_HTML         = $0008;
+      SHNUM_TITLE        = $0010;
+      SHNUM_SOFTKEYS     = $0020;
+      SHNUM_TODAYKEY     = $0040;
+      SHNUM_TODAYEXEC    = $0080;
+      SHNUM_SOFTKEYCMDS  = $0100;
+      SHNUM_FLAGS        = $0200;
+
+
+// notification data
+
+// Softkey Flags for use with SFTKEYNOTIFY structure
+
+      NOTIF_SOFTKEY_FLAGS_DISMISS       = $0000;  // Remove the notification when the softkey is pressed
+      NOTIF_SOFTKEY_FLAGS_HIDE          = $0001;  // Hide the notification when the softkey is pressed (but do not dismiss)
+      NOTIF_SOFTKEY_FLAGS_STAYOPEN      = $0002;  // Do not dismiss or hide the notification when the softkey is pressed
+      NOTIF_SOFTKEY_FLAGS_SUBMIT_FORM   = $0004;  // Submit the HTML form in the associated notification instead of sending WM_COMMAND to the sink
+      NOTIF_SOFTKEY_FLAGS_DISABLED      = $0008;  // This softkey is disabled
+
+// Structure used to associate a command id from a notification's softkey bar
+// with a particular behaviour.
+
+type
+     SOFTKEYCMD = record
+       wpCmd:WPARAM;                   // command to send with WM_COMMAND when pressed.
+       grfFlags:DWORD;                 // define special behaviour for this softkey as
+                                       // per  NOTIF_SOFTKEY_FLAGS
+     end;
+     LPSOFTKEYCMD = ^SOFTKEYCMD;
+
+
+// structure to define a single softkey for use in SHNOTIFICATIONDATA
+type
+     _SOFTKEYNOTIFY = record
+       pszTitle:LPCTSTR;        // Title to use on the softkey
+       skc:SOFTKEYCMD;          // Behaviour flags
+     end;
+     SOFTKEYNOTIFY = _SOFTKEYNOTIFY;
+     LPSOFTKEYNOTIFY = ^_SOFTKEYNOTIFY;
+
+// structure to define a menu for use in SHNOTIFICATIONDATA
+type
+     _SOFTKEYMENU = record
+       hMenu:HMENU;
+       prgskc:LPSOFTKEYCMD;    // optional array of SOFTKEYCMD values
+       cskc:UINT;          // number of members of pskCmd
+     end;
+     SOFTKEYMENU = _SOFTKEYMENU;
+     LPSOFTKEYMENU = ^_SOFTKEYMENU;
+
+
+const
+// number of soft keys on the notification soft key bar.
+      NOTIF_NUM_SOFTKEYS = 2;
+
+
+type
+     _SHNOTIFICATIONDATA =record
+       cbStruct:DWORD;     // for verification and versioning
+       dwID:DWORD;         // identifier for this particular notification
+       npPriority:SHNP;   // priority
+       csDuration:DWORD;   // duration of the notification (usage depends on prio)
+       hicon:HICON;        // the icon for the notification
+       grfFlags:DWORD;     // flags - see SHNF_ flags below
+       clsid:CLSID;        // unique identifier for the notification class
+       hwndSink:HWND;     // window to receive command choices, dismiss, etc.
+       pszHTML:LPCTSTR;      // HTML content for the bubble
+       pszTitle:LPCTSTR;     // Optional title for bubble
+       lParam:LPARAM;       // User-defined parameter
+       case longint of    // Defines the softkey bar for the notification
+         0: (skm:SOFTKEYMENU;        // Either pass an HMENU in skn (and set SHNF_HASMENU)
+             pszTodaySK:LPCTSTR;  // Text to put on SK2 on the Today screen. If NULL, will default to "Notification"
+             pszTodayExec:LPCTSTR    // What to execute when SK2 is pressed. If NULL, the toast will be displayed.
+            );
+         1: (rgskn:array[0..NOTIF_NUM_SOFTKEYS-1] of SOFTKEYNOTIFY;  // or two softkeys in rgskn.
+             pszTodaySK1:LPCTSTR;  // Text to put on SK2 on the Today screen. If NULL, will default to "Notification"
+             pszTodayExec1:LPCTSTR    // What to execute when SK2 is pressed. If NULL, the toast will be displayed.
+            );
+     end;
+     SHNOTIFICATIONDATA = _SHNOTIFICATIONDATA;
+     LPSHNOTIFICATIONDATA = ^_SHNOTIFICATIONDATA;
+
+
+// Flags
+const
+// For SHNP_INFORM priority and above, don't display the notification bubble
+// when it's initially added; the icon will display for the duration then it
+// will go straight into the tray.  The user can view the icon / see the
+// bubble by opening the tray.
+      SHNF_STRAIGHTTOTRAY  = $00000001;
+
+// Critical information - highlights the border and title of the bubble.
+      SHNF_CRITICAL        = $00000002;
+
+// Force the message (bubble) to display even if settings says not to.
+      SHNF_FORCEMESSAGE    = $00000008;
+
+// Force the display to turn on for notification.
+      SHNF_DISPLAYON       = $00000010;
+
+// Force the notification to be silent and not vibrate, regardless of Settings
+      SHNF_SILENT          = $00000020;
+
+// Softkey bar is created from an HMENU passed in skm structure
+      SHNF_HASMENU         = $00000040;
+
+// Draw the current time with the title
+      SHNF_TITLETIME       = $00000080;
+
+// A notification with "stack" support
+      SHNF_SPINNERS        = $00000100;
+
+// RE-play physical alerts on an update
+      SHNF_ALERTONUPDATE   = $00000200;
+
+//Capture the VK_TTALK button and forward it to the notification's sink window
+      SHNF_WANTVKTTALK     = $00000400;
+
+// notification message and codes for window-based notification
+// the notification's dwID is in hdr.idFrom
+
+type
+     _NMSHN = record
+       hdr:NMHDR;
+       lParam:LPARAM;
+       dwReturn:DWORD;
+       case longint of
+         0: (pszLink:LPCTSTR);
+         1: (fTimeout:BOOL);
+         2: (pt:POINT);
+     end;
+     NMSHN = _NMSHN;
+     LPNMSHN = ^_NMSHN;
+
+//#define SHN_FIRST               (0U-1000U)       // Shell reserved
+const    
+      SHNN_FIRST              = UINT(0)-UINT(1000);        // Shell Notifications
+      SHNN_LAST               = UINT(0)-UINT(1020);        // Shell Notifications
+//#define SHN_LAST                (0U-11000U)
+
+const
+      SHNN_LINKSEL            = SHNN_FIRST - 0;
+// nmshn.pszLink contains the link text of the choice that was selected
+
+      SHNN_DISMISS            = SHNN_FIRST - 1;
+// nmshn.fTimeout is TRUE if duration expired, FALSE if user tapped away
+
+      SHNN_SHOW               = SHNN_FIRST - 2;
+// nmshn.pt contains the point to which the bubble points
+
+      SHNN_NAVPREV            = SHNN_FIRST - 3;
+// Toast stack left spinner clicked / DPAD LEFT
+
+      SHNN_NAVNEXT            = SHNN_FIRST - 4;
+// Toast stack right spinner clicked / DPAD RIGHT
+
+      SHNN_ACTIVATE           = SHNN_FIRST - 5;
+// Toast DPAD Action
+
+      SHNN_ICONCLICKED        = SHNN_FIRST - 6;
+// nmshn.pt contains the point where the user clicked
+
+      SHNN_HOTKEY             = SHNN_FIRST - 7;
+// A hotkey has been pressed - modifiers are in the loword of the nmshn.lParam,
+// the virtual key code is in the hiword.
+// If the sink window returns 0 in response to this notification, then
+// the notification toast will be hidden and VK_TTALK key default behavior
+// will be performed.
+
+//===========================================================================
+//
+// Interface: IShellNotificationCallback
+//
+//  The IShellNotificationCallback interface is used by the Shell to advise
+// the notification owner of actions taken on the notification.
+//
+// [Member functions]
+//
+// IShellNotificationCallback::OnShow
+//
+//  Reserved.  Return E_NOTIMPL.
+//
+// IShellNotificationCallback::OnCommandSelected
+//
+//  This member function is called when the user selects a link of the form
+// <A HREF="cmd:#">link</A>.
+//
+//  Parameters:
+//   dwID       -- the identifier of the notification
+//   wCmdID     -- this is the # in the link
+//
+// IShellNotificationCallback::OnLinkSelected
+//
+//  This member function is called when the user selects one of the action
+// choice links in the notification bubble window.
+//
+//  Parameters:
+//   dwID       -- the identifier of the notification
+//   pszLink    -- the link content that was selected
+//   lParam     -- the lParam of the notification
+//
+// IShellNotificationCallback::OnDismiss
+//
+//  This member function is called when the user taps away from the bubble
+// window or if a SHNP_INFORM priority notification's duration expires.
+//
+//  Parameters:
+//   dwID       -- the identifier of the notification
+//   fTimeout   -- the notification timed out (SHNP_INFORM only)
+//   lParam     -- the lParam of the notification
+//   
+//===========================================================================
+
+const
+      IID_IShellNotificationCallback:TIID = '{000214C0-0000-0000-C000-000000000046}';
+
+type
+     IShellNotificationCallback = interface(IUnknown)
+      ['{000214C0-0000-0000-C000-000000000046}']
+       function OnShow(dwID:DWORD; pt:POINT; lParam:LPARAM):HRESULT; stdcall;
+       function OnCommandSelected(dwID:DWORD; wCmdID:word):HRESULT; stdcall;
+       function OnLinkSelected(dwID:DWORD; pszLink:LPCTSTR; lParam:LPARAM):HRESULT; stdcall;
+       function OnDismiss(dwID:DWORD; fTimeout:BOOL; lParam:LPARAM):HRESULT; stdcall;
+     end;
+
+//++++++
+//
+// SHNotificationAdd
+//
+//   Add a notification.
+
+function SHNotificationAdd(pndAdd:LPSHNOTIFICATIONDATA):LRESULT; external UserDLLAyg name 'SHNotificationAdd'; // index 155
+
+//
+// End SHNotificationAdd
+//
+//------
+
+
+//++++++
+//
+// SHNotificationUpdate
+//
+//   Update aspects of a pending notification.
+
+function SHNotificationUpdate(grnumUpdateMask:DWORD; pndNew:LPSHNOTIFICATIONDATA):LRESULT; external UserDLLAyg name 'SHNotificationUpdate'; // index 156
+
+//
+// End SHNotificationUpdate
+//
+//------
+
+//++++++
+//
+// SHNotificationRemove
+//
+//   Remove a notification.  This is usually in reponse to some
+//   action taken on the data outside of the notification system - for example
+//   if a message is read or deleted.
+
+function SHNotificationRemove(pclsid:LPCLSID; dwID:DWORD):LRESULT; external UserDLLAyg name 'SHNotificationRemove'; // index 157
+
+//
+// End SHNotificationRemove
+//
+//------
+
+
+//++++++
+//
+// SHNotificationGetData
+//
+//   Get the data for a notification.  Used by a handler to get information
+//   stored in the notification by the poster.
+
+function SHNotificationGetData(pclsid:LPCLSID; dwID:DWORD; pndBuffer:LPSHNOTIFICATIONDATA):LRESULT; external UserDLLAyg name 'SHNotificationGetData'; // index 173
+
+//
+// End SHNotificationGetData
+//
+//------
+
+
+// }
+//
+// end SHNAPI
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+// This function is not implemented.
+// It is provided as a stub in the operating system (OS) for application compatibility.
+procedure SHSetBack(eOp:longint; _hwnd:HWND); external UserDLLAyg name 'SHSetBack'; // index 184    
+
 implementation
 implementation
 
 
 end.
 end.

+ 4 - 3
packages/winceunits/src/buildwinceunits.pp

@@ -21,11 +21,12 @@ unit buildwinceunits;
 interface
 interface
 
 
 uses
 uses
-  aygshell,commctrl,commdlg,iphlpapi,notify,oleauto,power,shellapi,simmgr,tapi,
-  gpsapi,todaycmn,windbase,cesync,gx,winioctl,msgqueue,pm,service,htmlctrl,
+  aygshell, commctrl, commdlg, iphlpapi, notify, oleauto, power, shellapi, simmgr, tapi,
+  gpsapi, todaycmn, windbase, cesync, gx, winioctl, msgqueue, pm, service, htmlctrl,
   sipapi, cpl, bt_api, bt_sdp, bthapi, bthutil, pimstore, ril, sms, ws2bth,
   sipapi, cpl, bt_api, bt_sdp, bthapi, bthutil, pimstore, ril, sms, ws2bth,
   keybd, nled, phone, connmgr, devload, devmgmt, mmreg, mmsystem, msacm,
   keybd, nled, phone, connmgr, devload, devmgmt, mmreg, mmsystem, msacm,
-  wininet, ras, raserror, sip, projects, wap, tsp, extapi, imm, rapitypes;
+  wininet, ras, raserror, sip, projects, wap, tsp, extapi, imm, rapitypes,
+  storemgr, pnp;
 
 
 implementation
 implementation
 
 

+ 1 - 1
packages/winceunits/src/pimstore.pp

@@ -799,7 +799,7 @@ function ChooseContact(lpcc:LPCHOOSECONTACT):HRESULT; cdecl; external PIMStoreDL
 
 
 
 
 // Returns a Contact object of the first closest match
 // Returns a Contact object of the first closest match
-function FindMatchingContact(pPOOM:IPOutlookApp; pszFind:LPCWSTR; dwFlags:DWORD; out ppContact:IItem; ppropid:CEPROPID):HRESULT; cdecl; external PIMStoreDLL name 'FindMatchingContact';
+function FindMatchingContact(pPOOM:IPOutlookApp; pszFind:LPCWSTR; dwFlags:DWORD; out ppContact:IItem; ppropid:PCEPROPID):HRESULT; cdecl; external PIMStoreDLL name 'FindMatchingContact';
 
 
 // Flags for FindMatchingContact
 // Flags for FindMatchingContact
 const
 const

+ 56 - 0
packages/winceunits/src/pnp.pas

@@ -0,0 +1,56 @@
+unit PnP;
+
+{$mode objfpc}
+
+(*
+
+  (pnp.h)
+
+*)
+
+//
+// Copyright (c) Microsoft Corporation.  All rights reserved.
+//
+//
+// Use of this source code is subject to the terms of the Microsoft end-user
+// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
+// If you did not accept the terms of the EULA, you are not authorized to use
+// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
+// install media.
+//
+// --------------------------------------------------------------------------
+
+interface
+
+uses
+  Windows;
+
+const
+  // Maximum size of a device interface name. The choice of value is arbitrary
+  // but necessary for componenents that want to browse available interfaces
+  // so that they can set up their message queues. This value does not include
+  // the (required) terminating zero - that's already counted in DEVDETAIL.
+  MAX_DEVCLASS_NAMELEN       = 64;
+
+  // Indicates an ordinary "stream" interface: open/read/write/iocontrol/close.
+  // Devices that do not specify anything else and which expose a "ABCN:"
+  // type of name automatically generate a notification with this GUID and
+  // and a name equal to the device name (e.g., "FOO2:").
+  DEVCLASS_STREAM_STRING     = '{f8a6ba98-087a-43ac-a9d8-b7f13c5bae31}';
+  DEVCLASS_STREAM_GUID: GUID = '{f8a6ba98-087a-43ac-a9d8-b7f13c5bae31}';
+
+type
+  DEVDETAIL = record
+    guidDevClass: GUID;          // the device interface id for this notification
+    dwReserved: DWORD;           // do not use this
+    fAttached: BOOL;             // true if the di is present, false otherwise
+    cbName: LongInt;             // byte count of the interface's name
+    szName: TCHAR;               // beginning of the interface's name
+  end;
+  TDEVDETAIL = DEVDETAIL;
+  PDEVDETAIL = ^DEVDETAIL;
+
+implementation
+
+end.
+

+ 2 - 2
packages/winceunits/src/ril.pp

@@ -5531,8 +5531,8 @@ type
        dwStatus:DWORD;                     // @field additional status for message
        dwStatus:DWORD;                     // @field additional status for message
        pbData:array[0..0] of byte;                      // @field message itself
        pbData:array[0..0] of byte;                      // @field message itself
      end;
      end;
-     RILSUPSERVICEDATA = rilmsgstorageinfo_tag;
-     LPRILSUPSERVICEDATA = ^rilmsgstorageinfo_tag;
+     RILSUPSERVICEDATA = rilsupservicedata_tag;
+     LPRILSUPSERVICEDATA = ^rilsupservicedata_tag;
 //#pragma warning(default : 4200)
 //#pragma warning(default : 4200)
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------

+ 1 - 1
packages/winceunits/src/sms.pp

@@ -527,7 +527,7 @@ function SmsClose(smshHandle:SMS_HANDLE):HRESULT; external SmsDLL name 'SmsClose
 // Send an SMS message
 // Send an SMS message
 function SmsSendMessage(smshHandle:SMS_HANDLE;
 function SmsSendMessage(smshHandle:SMS_HANDLE;
                         psmsaSMSCAddress:LPSMS_ADDRESS;
                         psmsaSMSCAddress:LPSMS_ADDRESS;
-                        psmsaDestinationAddress:SMS_ADDRESS;
+                        psmsaDestinationAddress:LPSMS_ADDRESS;
                         pstValidityPeriod:LPSYSTEMTIME;  // (Values in this structure are expressed relative to the current time)
                         pstValidityPeriod:LPSYSTEMTIME;  // (Values in this structure are expressed relative to the current time)
                         pbData:LPBYTE;
                         pbData:LPBYTE;
                         dwDataSize:DWORD;
                         dwDataSize:DWORD;

+ 246 - 0
packages/winceunits/src/storemgr.pas

@@ -0,0 +1,246 @@
+unit StoreMgr;
+
+{$PACKSET 1}
+{$mode objfpc}
+
+(*
+
+  Store Manager API
+  (storemgr.h)
+
+*)
+
+//
+// Copyright (c) Microsoft Corporation.  All rights reserved.
+//
+//
+// Use of this sample source code is subject to the terms of the Microsoft
+// license agreement under which you licensed this sample source code. If
+// you did not accept the terms of the license agreement, you are not
+// authorized to use this sample source code. For the terms of the license,
+// please see the license agreement between you and Microsoft or, if applicable,
+// see the LICENSE.RTF on your install media or the root of your tools installation.
+// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
+//
+
+interface
+
+uses
+  Windows;
+
+const
+  BLOCK_DRIVER_GUID: GUID                    = '{A4E7EDDA-E575-4252-9D6B-4195D48BB865}';
+  STORE_MOUNT_GUID: GUID                     = '{C1115848-46FD-4976-BDE9-D79448457004}';
+  FATFS_MOUNT_GUID: GUID                     = '{169E1941-04CE-4690-97AC-776187EB67CC}';
+  CDFS_MOUNT_GUID: GUID                      = '{72D75746-D54A-4487-B7A1-940C9A3F259A}';
+  UDFS_MOUNT_GUID: GUID                      = '{462FEDA9-D478-4b00-86BB-51A8E3D10890}';
+  CDDA_MOUNT_GUID: GUID                      = '{BA6B1343-7980-4d0c-9290-762D527B33AB}';
+  FSD_MOUNT_GUID: GUID                       = '{8C77EDE8-47B9-45ae-8BC9-86E7B8D00EDD}';
+  BOOTFS_MOUNT_GUID: GUID                    = '{9A1E75E9-B24A-4838-B448-C026CA01323C}';
+  ROOTFS_MOUNT_GUID: GUID                    = '{0473DD50-D4CA-4ae2-BF5C-F09FD611C1CF}';
+  ROMFS_MOUNT_GUID: GUID                     = '{945E7231-17C0-4753-AD4E-BEFCA2FA6AE2}';
+  STORAGE_MEDIA_GUID: GUID                   = '{54CA35ED-CAF3-4b34-BC6B-6DFC7F22E6A9}';
+
+  BLOCK_DRIVER_GUID_STRING                   = '{A4E7EDDA-E575-4252-9D6B-4195D48BB865}';
+  STORE_MOUNT_GUID_STRING                    = '{C1115848-46FD-4976-BDE9-D79448457004}';
+  FATFS_MOUNT_GUID_STRING                    = '{169E1941-04CE-4690-97AC-776187EB67CC}';
+  CDFS_MOUNT_GUID_STRING                     = '{72D75746-D54A-4487-B7A1-940C9A3F259A}';
+  UDFS_MOUNT_GUID_STRING                     = '{462FEDA9-D478-4b00-86BB-51A8E3D10890}';
+  CDDA_MOUNT_GUID_STRING                     = '{BA6B1343-7980-4d0c-9290-762D527B33AB}';
+  FSD_MOUNT_GUID_STRING                      = '{8C77EDE8-47B9-45ae-8BC9-86E7B8D00EDD}';
+  BOOTFS_MOUNT_GUID_STRING                   = '{9A1E75E9-B24A-4838-B448-C026CA01323C}';
+  ROOTFS_MOUNT_GUID_STRING                   = '{0473DD50-D4CA-4ae2-BF5C-F09FD611C1CF}';
+  ROMFS_MOUNT_GUID_STRING                    = '{945E7231-17C0-4753-AD4E-BEFCA2FA6AE2}';
+
+  STOREMGR_DRIVER_GUID: GUID                 = '{14ACDEE6-5CF3-496b-B39D-8954C96DF002}';
+  STOREMGR_DRIVER_GUID_STRING                = '{14ACDEE6-5CF3-496b-B39D-8954C96DF002}';
+
+  //*****************************************************************************/
+  //* attributes of a store */
+  STORE_ATTRIBUTE_READONLY                   = $00000001;
+  STORE_ATTRIBUTE_REMOVABLE                  = $00000002;
+  STORE_ATTRIBUTE_UNFORMATTED                = $00000004;
+  STORE_ATTRIBUTE_AUTOFORMAT                 = $00000008;
+  STORE_ATTRIBUTE_AUTOPART                   = $00000010;
+  STORE_ATTRIBUTE_AUTOMOUNT                  = $00000020;
+
+  //* attributes for a partition */
+  PARTITION_ATTRIBUTE_EXPENDABLE             = $00000001;  // partition may be trashed
+  PARTITION_ATTRIBUTE_READONLY               = $00000002;  // partition is read-only
+  PARTITION_ATTRIBUTE_AUTOFORMAT             = $00000004;
+  PARTITION_ATTRIBUTE_ACTIVE                 = $00000008;
+  PARTITION_ATTRIBUTE_BOOT                   = $00000008;  // Active(DOS) == Boot(CE)
+  PARTITION_ATTRIBUTE_MOUNTED                = $00000010;
+
+  //* some basic constants */
+  DEVICENAMESIZE                             = 8;
+  STORENAMESIZE                              = 32;
+  FILESYSNAMESIZE                            = 32;
+  FORMATNAMESIZE                             = 32;
+  PARTITIONNAMESIZE                          = 32;
+  PROFILENAMESIZE                            = 32;
+  FOLDERNAMESIZE                             = 32;
+  VOLUMENAMESIZE                             = 64;
+  FSDDESCSIZE                                = 32;
+
+  STORAGE_DEVICE_CLASS_BLOCK                 = $1;
+  STORAGE_DEVICE_CLASS_MULTIMEDIA            = $2;
+
+  STORAGE_DEVICE_TYPE_PCIIDE                 = (1 shl 0);
+  STORAGE_DEVICE_TYPE_FLASH                  = (1 shl 1);
+  STORAGE_DEVICE_TYPE_ATA                    = (1 shl 2);
+  STORAGE_DEVICE_TYPE_ATAPI                  = (1 shl 4);
+  STORAGE_DEVICE_TYPE_PCCARD                 = (1 shl 5);
+  STORAGE_DEVICE_TYPE_CFCARD                 = (1 shl 6);
+  STORAGE_DEVICE_TYPE_SRAM                   = (1 shl 7);
+  STORAGE_DEVICE_TYPE_DVD                    = (1 shl 8);
+  STORAGE_DEVICE_TYPE_CDROM                  = (1 shl 9);
+  STORAGE_DEVICE_TYPE_USB                    = (1 shl 10);
+  STORAGE_DEVICE_TYPE_1394                   = (1 shl 11);
+  STORAGE_DEVICE_TYPE_DOC                    = (1 shl 12);
+  STORAGE_DEVICE_TYPE_UNKNOWN                = (1 shl 29);
+  STORAGE_DEVICE_TYPE_REMOVABLE_DRIVE        = (1 shl 30); // Drive itself is removable
+  STORAGE_DEVICE_TYPE_REMOVABLE_MEDIA        = (1 shl 31); // Just the media is removable ex. CDROM, FLOPPY
+
+  STORAGE_DEVICE_FLAG_READWRITE              = (1 shl 0);
+  STORAGE_DEVICE_FLAG_READONLY               = (1 shl 1);
+  STORAGE_DEVICE_FLAG_TRANSACTED             = (1 shl 2);
+  STORAGE_DEVICE_FLAG_MEDIASENSE             = (1 shl 3);  // Device requires media sense calls
+  STORAGE_DEVICE_FLAG_XIP                    = (1 shl 4);
+
+  CE_VOLUME_ATTRIBUTE_READONLY               = $1;
+  CE_VOLUME_ATTRIBUTE_HIDDEN                 = $2;
+  CE_VOLUME_ATTRIBUTE_REMOVABLE              = $4;
+  CE_VOLUME_ATTRIBUTE_SYSTEM                 = $8;
+  CE_VOLUME_ATTRIBUTE_BOOT                   = $10;
+
+  CE_VOLUME_TRANSACTION_SAFE                 = $1;     // Performs transaction safe operations
+  CE_VOLUME_FLAG_TRANSACT_WRITE              = $2;
+  CE_VOLUME_FLAG_WFSC_SUPPORTED              = $4;
+  CE_VOLUME_FLAG_LOCKFILE_SUPPORTED          = $8;
+  CE_VOLUME_FLAG_NETWORK                     = $10;
+  CE_VOLUME_FLAG_STORE                       = $20;
+  CE_VOLUME_FLAG_RAMFS                       = $40;
+  CE_VOLUME_FLAG_FILE_SECURITY_SUPPORTED     = $80;    // Persistent file and directory security descriptors
+  CE_VOLUME_FLAG_64BIT_FILES_SUPPORTED       = $100;   // 64-bit file sizes and offsets
+
+  STOREAPIDLL                                = 'coredll';
+
+type
+  SECTORNUM = ULONGLONG;
+
+  //****************************************************************************
+
+  STORAGEDEVICEINFO = record
+      cbSize: DWORD;
+      szProfile: array[0..PROFILENAMESIZE-1] of TCHAR;
+      dwDeviceClass: DWORD;
+      dwDeviceType: DWORD;
+      dwDeviceFlags: DWORD;
+  end;
+  tagSTORAGEDEVICEINFO = STORAGEDEVICEINFO;
+  TSTORAGEDEVICEINFO = STORAGEDEVICEINFO;
+  PSTORAGEDEVICEINFO = ^STORAGEDEVICEINFO;
+
+  //*****************************************************************************/
+  // information about a store */
+  STOREINFO = record
+      cbSize: DWORD;                                       // sizeof(PD_STOREINFO)
+      szDeviceName: array[0..DEVICENAMESIZE-1] of TCHAR;
+      szStoreName: array[0..STORENAMESIZE-1] of TCHAR;
+      dwDeviceClass: DWORD;
+      dwDeviceType: DWORD;
+      sdi: STORAGEDEVICEINFO;
+      dwDeviceFlags: DWORD;
+      snNumSectors: SECTORNUM;                             // number of sectors on store
+      dwBytesPerSector: DWORD;                             // number of bytes per sector
+      snFreeSectors: SECTORNUM;                            // number of unallocated sectors
+      snBiggestPartCreatable: SECTORNUM;                   // biggest partition currently creatable
+      ftCreated: FILETIME;                                 // last time store was formatted
+      ftLastModified: FILETIME;                            // last time partition table was modified
+      dwAttributes: DWORD;                                 // store attributes, see below
+      dwPartitionCount: DWORD;                             // Number of Partitions
+      dwMountCount: DWORD;                                 // Number of partitions that have been mounted
+  end;
+  tagSTOREINFO = STOREINFO;
+  TSTOREINFO = STOREINFO;
+  PSTOREINFO = ^STOREINFO;
+
+  //***************************************************************************
+  // information about a partition
+  PARTINFO = record
+    cbSize: DWORD;                                        // sizeof(PD_PARTINFO)
+    szPartition: array[0..PARTITIONNAMESIZE-1] of TCHAR;  // name of partition
+    szFileSys: array[0..FILESYSNAMESIZE-1] of TCHAR;
+    szVolumeName: array[0..VOLUMENAMESIZE-1] of TCHAR;
+    snNumSectors: SECTORNUM;                              // number of sectors in partition
+    ftCreated: FILETIME;                                  // creation time of partition
+    ftLastModified: FILETIME;                             // last time partition was modified
+    dwAttributes: DWORD;                                  // partition attributes, see below
+    bPartType: BYTE;
+  end;
+  tagPARTINFO = PARTINFO;
+  TPARTINFO = PARTINFO;
+  PPARTINFO = ^PARTINFO;
+
+  //****************************************************************************/
+
+  STORAGECONTEXT = record
+      cbSize: DWORD;
+      StoreInfo: STOREINFO;
+      PartInfo: PARTINFO;
+      dwFlags: DWORD;
+  end;
+  tagSTORAGECONTEXT = STORAGECONTEXT;
+  TSTORAGECONTEXT = STORAGECONTEXT;
+  PSTORAGECONTEXT = ^STORAGECONTEXT;
+
+  CE_VOLUME_INFO = record
+      cbSize: DWORD;
+      dwAttributes: DWORD;
+      dwFlags: DWORD;
+      dwBlockSize: DWORD;
+      szStoreName: array[0..STORENAMESIZE-1] of TCHAR;
+      szPartitionName: array[0..PARTITIONNAMESIZE-1] of TCHAR;
+  end;
+  _CE_VOLUME_INFO = CE_VOLUME_INFO;
+  PCE_VOLUME_INFO = ^CE_VOLUME_INFO;
+  LPCE_VOLUME_INFO = ^CE_VOLUME_INFO;
+
+  CE_VOLUME_INFO_LEVEL = (CeVolumeInfoLevelStandard);
+  _CE_VOLUME_INFO_LEVEL = CE_VOLUME_INFO_LEVEL;
+
+function  IsStorageManagerRunning: BOOL; cdecl; external STOREAPIDLL name 'IsStorageManagerRunning';
+// Storage Management API's
+function  OpenStore(szDeviceName: LPCTSTR): HANDLE; cdecl; external STOREAPIDLL name 'OpenStore';
+function  DismountStore(hStore: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'DismountStore';
+function  FormatStore(hStore: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'FormatStore';
+function  FindFirstStore(pStoreInfo: PSTOREINFO): HANDLE; cdecl; external STOREAPIDLL name 'FindFirstStore';
+function  FindNextStore(hSearch: HANDLE; pStoreInfo: PSTOREINFO): BOOL; cdecl; external STOREAPIDLL name 'FindNextStore';
+function  FindCloseStore(hSearch: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'FindCloseStore';
+function  GetStoreInfo(hStore: HANDLE; pStoreInfo: PSTOREINFO): BOOL; cdecl; external STOREAPIDLL name 'GetStoreInfo';
+// Partition Management API's
+function  CreatePartition(hStore: HANDLE; szPartitionName: LPCTSTR; snNumSectors: SECTORNUM): BOOL; cdecl; external STOREAPIDLL name 'CreatePartition';
+function  CreatePartitionEx(hStore: HANDLE; szPartitionName: LPCTSTR; bPartType: BYTE; snNumSectors: SECTORNUM): BOOL; cdecl; external STOREAPIDLL name 'CreatePartitionEx';
+function  DeletePartition(hStore: HANDLE; szPartitionName: LPCTSTR): BOOL; cdecl; external STOREAPIDLL name 'DeletePartition';
+function  OpenPartition(hStore: HANDLE; szPartitionName: LPCTSTR): HANDLE; cdecl; external STOREAPIDLL name 'OpenPartition';
+function  MountPartition(hPartition: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'MountPartition';
+function  DismountPartition(hPartition: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'DismountPartition';
+function  RenamePartition(hPartition: HANDLE; szNewName: LPCTSTR): BOOL; cdecl; external STOREAPIDLL name 'RenamePartition';
+function  SetPartitionAttributes(hPartition: HANDLE; dwAttrs: DWORD): BOOL; cdecl; external STOREAPIDLL name 'SetPartitionAttributes';
+function  GetPartitionInfo(hPartition: HANDLE; pPartInfo: PPARTINFO): BOOL; cdecl; external STOREAPIDLL name 'GetPartitionInfo';
+function  FormatPartition(hPartition: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'FormatPartition';
+function  FormatPartitionEx(hPartition: HANDLE; bPartType: BYTE; bAuto: BOOL): BOOL; cdecl; external STOREAPIDLL name 'FormatPartitionEx';
+function  FindFirstPartition(hStore: HANDLE; pPartInfo: PPARTINFO): HANDLE; cdecl; external STOREAPIDLL name 'FindFirstPartition';
+function  FindNextPartition(hSearch: HANDLE; pPartInfo: PPARTINFO): BOOL; cdecl; external STOREAPIDLL name 'FindNextPartition';
+function  FindClosePartition(hSearch: HANDLE): BOOL; cdecl; external STOREAPIDLL name 'FindClosePartition';
+
+function  CeGetVolumeInfoW(pszRootPath: LPCWSTR; InfoLevel: CE_VOLUME_INFO_LEVEL;
+  lpVolumeInfo: LPCE_VOLUME_INFO): BOOL; cdecl; external STOREAPIDLL name 'CeGetVolumeInfoW';
+function  CeGetVolumeInfo(pszRootPath: LPCWSTR; InfoLevel: CE_VOLUME_INFO_LEVEL;
+  lpVolumeInfo: LPCE_VOLUME_INFO): BOOL; cdecl; external STOREAPIDLL name 'CeGetVolumeInfoW';
+
+implementation
+
+end.
+

+ 89 - 61
packages/winunits-base/Makefile

@@ -2,7 +2,7 @@
 # Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/08/25]
 # Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/08/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku
 UNIXs = linux $(BSDs) solaris qnx haiku
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -326,6 +326,9 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_UNITS+=buildwinutilsbase
 override TARGET_UNITS+=buildwinutilsbase
 endif
 endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_UNITS+=buildwinutilsbase
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=buildwinutilsbase
 override TARGET_UNITS+=buildwinutilsbase
 endif
 endif
@@ -447,184 +450,187 @@ ifeq ($(FULL_TARGET),mipsel-linux)
 override TARGET_UNITS+=buildwinutilsbase
 override TARGET_UNITS+=buildwinutilsbase
 endif
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+override TARGET_IMPLICITUNITS+=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 endif
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=jwawintype comconst
 override TARGET_RSTS+=jwawintype comconst
@@ -686,6 +692,9 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_RSTS+=jwawintype comconst
 override TARGET_RSTS+=jwawintype comconst
 endif
 endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_RSTS+=jwawintype comconst
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_RSTS+=jwawintype comconst
 override TARGET_RSTS+=jwawintype comconst
 endif
 endif
@@ -866,6 +875,9 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_EXAMPLES+=examples
 override TARGET_EXAMPLES+=examples
 endif
 endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_EXAMPLES+=examples
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_EXAMPLES+=examples
 override TARGET_EXAMPLES+=examples
 endif
 endif
@@ -1048,6 +1060,9 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
 override COMPILER_OPTIONS+=-Ur
 override COMPILER_OPTIONS+=-Ur
 endif
 endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override COMPILER_OPTIONS+=-Ur
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_OPTIONS+=-Ur
 override COMPILER_OPTIONS+=-Ur
 endif
 endif
@@ -1228,6 +1243,9 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
 override COMPILER_SOURCEDIR+=src
 override COMPILER_SOURCEDIR+=src
 endif
 endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override COMPILER_SOURCEDIR+=src
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=src
 override COMPILER_SOURCEDIR+=src
 endif
 endif
@@ -1721,6 +1739,10 @@ ifeq ($(OS_TARGET),symbian)
 SHAREDLIBEXT=.dll
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=symbian
 SHORTSUFFIX=symbian
 endif
 endif
+ifeq ($(OS_TARGET),NativeNT)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=nativent
+endif
 else
 else
 ifeq ($(OS_TARGET),go32v1)
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
 PPUEXT=.pp1
@@ -2272,6 +2294,12 @@ REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-REGISTRY=1
 REQUIRE_PACKAGES_FCL-REGISTRY=1
 endif
 endif
+ifeq ($(FULL_TARGET),i386-nativent)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-XML=1
+REQUIRE_PACKAGES_FCL-REGISTRY=1
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1

+ 1 - 1
packages/winunits-base/Makefile.fpc

@@ -12,7 +12,7 @@ packages=fcl-registry fcl-base
 [target]
 [target]
 units=buildwinutilsbase
 units=buildwinutilsbase
 implicitunits=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver \
 implicitunits=flatsb winver mmsystem comobj comconst commdlg commctrl ole2 activex shellapi shlobj oleserver \
-	shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv
+	shfolder richedit imagehlp wininet uxtheme dwmapi multimon htmlhelp winutils comserv winspool imm imm_dyn
 
 
 examples=examples
 examples=examples
 
 

+ 3 - 1
packages/winunits-base/fpmake.pp

@@ -47,11 +47,12 @@ begin
           AddUnit('shfolder');
           AddUnit('shfolder');
           AddUnit('richedit');
           AddUnit('richedit');
 	  AddUnit('wininet');
 	  AddUnit('wininet');
-          AddUnit('uxtheme');  
+          AddUnit('uxtheme');
           AddInclude('tmschema.inc');
           AddInclude('tmschema.inc');
           AddUnit('dwmapi');
           AddUnit('dwmapi');
           AddUnit('multimon');
           AddUnit('multimon');
           AddUnit('htmlhelp');
           AddUnit('htmlhelp');
+          AddUnit('winspool');
         end;
         end;
     T:=P.Targets.AddImplicitUnit('activex.pp');
     T:=P.Targets.AddImplicitUnit('activex.pp');
     T:=P.Targets.AddImplicitUnit('comconst.pp');
     T:=P.Targets.AddImplicitUnit('comconst.pp');
@@ -75,6 +76,7 @@ begin
     T:=P.Targets.AddImplicitUnit('multimon.pp');
     T:=P.Targets.AddImplicitUnit('multimon.pp');
     T:=P.Targets.AddImplicitUnit('dwmapi.pp');
     T:=P.Targets.AddImplicitUnit('dwmapi.pp');
     T:=P.Targets.AddImplicitUnit('htmlhelp.pp');
     T:=P.Targets.AddImplicitUnit('htmlhelp.pp');
+    T:=P.Targets.AddImplicitUnit('winspool.pp');
     T.Dependencies.AddInclude('tmschema.inc');
     T.Dependencies.AddInclude('tmschema.inc');
     P.ExamplePath.Add('tests/');
     P.ExamplePath.Add('tests/');
     P.Targets.AddExampleProgram('testcom1.pp');
     P.Targets.AddExampleProgram('testcom1.pp');

+ 301 - 0
packages/winunits-base/src/Nb30.pp

@@ -0,0 +1,301 @@
+unit nb30;
+//  This module contains the definitions for portable NetBIOS 3.0
+//  support.
+interface
+
+uses windows;
+{***************************************************************
+ *                                                              *
+ *              Data structure templates                        *
+ *                                                              *
+ ***************************************************************}
+
+
+const
+  nbdllname     = 'netapi32.dll';
+  NCBNAMSZ      =  16;    { absolute length of a net name           }
+  MAX_LANA      = 254;    { lana's in range 0 to MAX_LANA inclusive }
+
+{
+ * Network Control Block
+}
+
+Type
+ PNCB = ^_NCB;
+ NCB_post_type = procedure (p: PNCB); stdcall;
+ _NCB = packed record
+    ncb_command     : UCHAR;              { command code                   }
+    ncb_retcode     : UCHAR;              { return code                    }
+    ncb_lsn         : UCHAR;              { local session number           }
+    ncb_num         : UCHAR;              { number of our network name     }
+    ncb_buffer      : PUCHAR;             { address of message buffer      }
+    ncb_length      : WORD;             { size of message buffer           }
+    ncb_callname    : array [0..NCBNAMSZ-1] of UCHAR; { blank-padded name of remote    }
+    ncb_name        : array [0..NCBNAMSZ-1] of UCHAR; { our blank-padded netname       }
+    ncb_rto         : UCHAR;              { rcv timeout/retry count        }
+    ncb_sto         : UCHAR;              { send timeout/sys timeout       }
+    ncb_post        : ncb_post_type;      { POST routine address        }
+    ncb_lana_num    : UCHAR;              { lana (adapter) number          }
+    ncb_cmd_cplt    : UCHAR;              { $ff => commmand pending       }
+{$ifdef _WIN64}
+    ncb_reserve     : array[0..17] of UCHAR; { reserved, used by BIOS         }
+{$else}
+    ncb_reserve     : array[0..9] of UCHAR;  { reserved, used by BIOS         }
+{$endif}
+    ncb_event       : THandle;            { HANDLE to Win32 event which    }
+                                          { will be set to the signalled   }
+                                          { state when an ASYNCH command   }
+                                          { completes                      }
+   end;
+   NCB = _NCB;
+
+{
+ *  Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed
+ *  by an array of NAME_BUFFER structures.
+ }
+
+ ADAPTER_STATUS  = packed record
+   adapter_address             : Array [0..5] of UCHAR;
+   rev_major                   : UCHAR;
+   reserved0                   : UCHAR;
+   adapter_type                : UCHAR;
+   rev_minor                   : UCHAR;
+   duration                    : WORD;
+   frmr_recv                   : WORD;
+   frmr_xmit                   : WORD;
+
+   iframe_recv_err             : WORD;
+
+   xmit_aborts                 : WORD;
+   xmit_success                : DWORD;
+   recv_success                : DWORD;
+
+   iframe_xmit_err             : WORD;
+
+   recv_buff_unavail           : WORD;
+   t1_timeouts                 : WORD;
+   ti_timeouts                 : WORD;
+   reserved1                   : DWORD;
+   free_ncbs                   : WORD;
+   max_cfg_ncbs                : WORD;
+   max_ncbs                    : WORD;
+   xmit_buf_unavail            : WORD;
+   max_dgram_size              : WORD;
+   pending_sess                : WORD;
+   max_cfg_sess                : WORD;
+   max_sess                    : WORD;
+   max_sess_pkt_size           : WORD;
+   name_count                  : WORD;
+   end;
+  TADAPTER_STATUS = ADAPTER_STATUS;
+  PADAPTER_STATUS = ^TADAPTER_STATUS;
+
+ NAME_BUFFER = packed record
+    name      : array [0..NCBNAMSZ-1] of UCHAR;
+    name_num  : UCHAR;
+    name_flags: UCHAR;
+	end;
+ TNAME_BUFFER = NAME_BUFFER;
+ PNAME_BUFFER = ^NAME_BUFFER;
+
+//  values for name_flags bits.
+Const
+       NAME_FLAGS_MASK = $87;
+
+       GROUP_NAME      = $80;
+       UNIQUE_NAME     = $00;
+
+       REGISTERING     = $00;
+       REGISTERED      = $04;
+       DEREGISTERED    = $05;
+       DUPLICATE       = $06;
+       DUPLICATE_DEREG = $07;
+
+Type
+{
+ *  Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed
+ *  by an array of SESSION_BUFFER structures. If the NCB_NAME starts with an
+ *  asterisk then an array of these structures is returned containing the
+ *  status for all names.
+ }
+
+ PSESSION_HEADER = ^TSESSION_HEADER;
+ TSESSION_HEADER = packed record
+        sess_name : UCHAR;
+        num_sess  : UCHAR;
+        rcv_dg_outstanding  : UCHAR;
+        rcv_any_outstanding : UCHAR;
+      end;
+
+ PSESSION_BUFFER = ^TSESSION_BUFFER;
+ TSESSION_BUFFER = packed record
+        lsn   : UCHAR;
+        state : UCHAR;
+        local_name : array[0..(NCBNAMSZ)-1] of UCHAR;
+        remote_name : array[0..(NCBNAMSZ)-1] of UCHAR;
+        rcvs_outstanding  : UCHAR;
+        sends_outstanding : UCHAR;
+      end;
+
+//  Values for state
+
+Const
+       LISTEN_OUTSTANDING      = $01;
+       CALL_PENDING            = $02;
+       SESSION_ESTABLISHED     = $03;
+       HANGUP_PENDING          = $04;
+       HANGUP_COMPLETE         = $05;
+       SESSION_ABORTED         = $06;
+
+{
+ *  Structure returned to the NCB command NCBENUM.
+ *
+ *  On a system containing lana's 0, 2 and 3, a structure with
+ *  length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned.
+ }
+Type
+  PLANA_ENUM = ^TLANA_ENUM;
+  TLANA_ENUM = packed record
+        length : UCHAR;     //  Number of valid entries in lana[]
+        lana   : array[0..(MAX_LANA+1)-1] of UCHAR;
+      end;
+
+{
+ *  Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
+ *  by an array of FIND_NAME_BUFFER structures.
+ }
+
+  PFIND_NAME_HEADER = ^TFIND_NAME_HEADER;
+  TFIND_NAME_HEADER = packed record
+        node_count : WORD;
+        reserved   : UCHAR;
+        unique_group : UCHAR;
+      end;
+
+  PFIND_NAME_BUFFER = ^TFIND_NAME_BUFFER;
+  TFIND_NAME_BUFFER = packed record
+        length         : UCHAR;
+        access_control : UCHAR;
+        frame_control  : UCHAR;
+        destination_addr : array[0..5] of UCHAR;
+        source_addr      : array[0..5] of UCHAR;
+        routing_info     : array[0..17] of UCHAR;
+      end;
+
+{
+ *  Structure provided with NCBACTION. The purpose of NCBACTION is to provide
+ *  transport specific extensions to netbios.
+ }
+
+  PACTION_HEADER = ^TACTION_HEADER;
+  TACTION_HEADER = packed record
+        transport_id : ULONG;
+        action_code  : USHORT;
+        reserved     : USHORT;
+      end;
+
+//  Values for transport_id
+
+const
+       ALL_TRANSPORTS  = 'M'#0#0#0;
+       MS_NBF          = 'MNBF'#0;
+
+
+{***************************************************************
+ *                                                              *
+ *              Special values and constants                    *
+ *                                                              *
+ ***************************************************************}
+
+Const
+{
+ *      NCB Command codes
+ }
+
+       NCBCALL         = $10;            { NCB CALL                           }
+       NCBLISTEN       = $11;            { NCB LISTEN                         }
+       NCBHANGUP       = $12;            { NCB HANG UP                        }
+       NCBSEND         = $14;            { NCB SEND                           }
+       NCBRECV         = $15;            { NCB RECEIVE                        }
+       NCBRECVANY      = $16;            { NCB RECEIVE ANY                    }
+       NCBCHAINSEND    = $17;            { NCB CHAIN SEND                     }
+       NCBDGSEND       = $20;            { NCB SEND DATAGRAM                  }
+       NCBDGRECV       = $21;            { NCB RECEIVE DATAGRAM               }
+       NCBDGSENDBC     = $22;            { NCB SEND BROADCAST DATAGRAM        }
+       NCBDGRECVBC     = $23;            { NCB RECEIVE BROADCAST DATAGRAM     }
+       NCBADDNAME      = $30;            { NCB ADD NAME                       }
+       NCBDELNAME      = $31;            { NCB DELETE NAME                    }
+       NCBRESET        = $32;            { NCB RESET                          }
+       NCBASTAT        = $33;            { NCB ADAPTER STATUS                 }
+       NCBSSTAT        = $34;            { NCB SESSION STATUS                 }
+       NCBCANCEL       = $35;            { NCB CANCEL                         }
+       NCBADDGRNAME    = $36;            { NCB ADD GROUP NAME                 }
+       NCBENUM         = $37;            { NCB ENUMERATE LANA NUMBERS         }
+       NCBUNLINK       = $70;            { NCB UNLINK                         }
+       NCBSENDNA       = $71;            { NCB SEND NO ACK                    }
+       NCBCHAINSENDNA  = $72;            { NCB CHAIN SEND NO ACK              }
+       NCBLANSTALERT   = $73;            { NCB LAN STATUS ALERT               }
+       NCBACTION       = $77;            { NCB ACTION                         }
+       NCBFINDNAME     = $78;            { NCB FIND NAME                      }
+       NCBTRACE        = $79;            { NCB TRACE                          }
+
+
+       ASYNCH          = $80;            { high bit set == asynchronous       }
+
+{
+ *      NCB Return codes
+ }
+
+       NRC_GOODRET     = $00;    { good return                                }
+                                { also returned when ASYNCH request accepted }
+       NRC_BUFLEN      = $01;    { illegal buffer length                      }
+       NRC_ILLCMD      = $03;    { illegal command                            }
+       NRC_CMDTMO      = $05;    { command timed out                          }
+       NRC_INCOMP      = $06;    { message incomplete, issue another command  }
+       NRC_BADDR       = $07;    { illegal buffer address                     }
+       NRC_SNUMOUT     = $08;    { session number out of range                }
+       NRC_NORES       = $09;    { no resource available                      }
+       NRC_SCLOSED     = $0a;    { session closed                             }
+       NRC_CMDCAN      = $0b;    { command cancelled                          }
+       NRC_DUPNAME     = $0d;    { duplicate name                             }
+       NRC_NAMTFUL     = $0e;    { name table full                            }
+       NRC_ACTSES      = $0f;    { no deletions, name has active sessions     }
+       NRC_LOCTFUL     = $11;    { local session table full                   }
+       NRC_REMTFUL     = $12;    { remote session table full                  }
+       NRC_ILLNN       = $13;    { illegal name number                        }
+       NRC_NOCALL      = $14;    { no callname                                }
+       NRC_NOWILD      = $15;    { cannot put * in NCB_NAME                   }
+       NRC_INUSE       = $16;    { name in use on remote adapter              }
+       NRC_NAMERR      = $17;    { name deleted                               }
+       NRC_SABORT      = $18;    { session ended abnormally                   }
+       NRC_NAMCONF     = $19;    { name conflict detected                     }
+       NRC_IFBUSY      = $21;    { interface busy, IRET before retrying       }
+       NRC_TOOMANY     = $22;    { too many commands outstanding, retry later }
+       NRC_BRIDGE      = $23;    { ncb_lana_num field invalid                 }
+       NRC_CANOCCR     = $24;    { command completed while cancel occurring   }
+       NRC_CANCEL      = $26;    { command not valid to cancel                }
+       NRC_DUPENV      = $30;    { name defined by anther local process       }
+       NRC_ENVNOTDEF   = $34;    { environment undefined. RESET required      }
+       NRC_OSRESNOTAV  = $35;    { required OS resources exhausted            }
+       NRC_MAXAPPS     = $36;    { max number of applications exceeded        }
+       NRC_NOSAPS      = $37;    { no saps available for netbios              }
+       NRC_NORESOURCES = $38;    { requested resources are not available      }
+       NRC_INVADDRESS  = $39;    { invalid ncb address or length > segment    }
+       NRC_INVDDID     = $3B;    { invalid NCB DDID                           }
+       NRC_LOCKFAIL    = $3C;    { lock of user area failed                   }
+       NRC_OPENERR     = $3f;    { NETBIOS not loaded                         }
+       NRC_SYSTEM      = $40;    { system error                               }
+
+       NRC_PENDING     = $ff;    { asynchronous command is not yet finished   }
+
+{***************************************************************
+ *                                                              *
+ *              main user entry point for NetBIOS 3.0           *
+ *                                                              *
+ * Usage: result = Netbios( pncb );                             *
+ ***************************************************************}
+
+function Netbios(pncb : PNCB):UCHAR; stdcall; external nbdllname name 'Netbios';
+
+implementation
+end.

+ 3 - 1
packages/winunits-base/src/activex.pp

@@ -813,6 +813,8 @@ TYPE
     lpDISPID            = ^DISPID;
     lpDISPID            = ^DISPID;
     MEMBERID            = DispId;
     MEMBERID            = DispId;
     HREFTYPE            = DWord;
     HREFTYPE            = DWord;
+    TResultList		= array[0..high(integer) div 4-50] of HResult;
+    PResultList         = ^TResultList;
 
 
     PSYSINT = ^SYSINT;
     PSYSINT = ^SYSINT;
     SYSINT = LongInt;
     SYSINT = LongInt;
@@ -1597,7 +1599,7 @@ TYPE
 
 
   tagFUNCDESC                    = Record
   tagFUNCDESC                    = Record
                                      memid             : MEMBERID;
                                      memid             : MEMBERID;
-                                     lprgscode         : pSCODE;
+                                     lprgscode         : PResultList;
                                      lprgelemdescParam : lpELEMDESC;    // array of param types
                                      lprgelemdescParam : lpELEMDESC;    // array of param types
                                      FUNCKIND          : funckind;
                                      FUNCKIND          : funckind;
                                      invkind           : INVOKEKIND;
                                      invkind           : INVOKEKIND;

+ 2 - 1
packages/winunits-base/src/buildwinutilsbase.pp

@@ -23,7 +23,8 @@ interface
 uses
 uses
     flatsb, winver, mmsystem, comconst, commctrl, comobj, commdlg,
     flatsb, winver, mmsystem, comconst, commctrl, comobj, commdlg,
     ole2, activex, shellapi, shlobj, oleserver,  shfolder, richedit,
     ole2, activex, shellapi, shlobj, oleserver,  shfolder, richedit,
-    imagehlp, wininet, uxtheme, dwmapi, multimon, htmlhelp, winutils,comserv;
+    imagehlp, wininet, uxtheme, dwmapi, multimon, htmlhelp, winutils,
+    comserv, winspool, imm, imm_dyn;
 
 
 implementation
 implementation
 
 

+ 652 - 0
packages/winunits-base/src/imm.pas

@@ -0,0 +1,652 @@
+(********************************************************************* *)
+(*      imm.h - Input Method Manager definitions                       *)
+(*                                                                     *)
+(*      Copyright (c) Microsoft Corporation. All rights reserved.      *)
+(*                                                                     *)
+(* Converted to pascal by Dmitry Boyarintsev, using Chelper.           *)
+(*                                                                     *)
+(********************************************************************* *)
+
+unit
+  imm;
+
+{$mode delphi}
+
+interface
+
+uses
+  Windows;
+
+{$PACKRECORDS C}
+
+// IME_Codes
+// bit field for conversion mode
+const
+  IME_CMODE_ALPHANUMERIC          = $0000;
+  IME_CMODE_NATIVE                = $0001;
+  IME_CMODE_CHINESE               = IME_CMODE_NATIVE;
+  IME_CMODE_HANGUL                = IME_CMODE_NATIVE;
+  IME_CMODE_JAPANESE              = IME_CMODE_NATIVE;
+  IME_CMODE_KATAKANA              = $0002;  // only effect under IME_CMODE_NATIVE
+  IME_CMODE_LANGUAGE              = $0003;
+  IME_CMODE_FULLSHAPE             = $0008;
+  IME_CMODE_ROMAN                 = $0010;
+  IME_CMODE_CHARCODE              = $0020;
+  IME_CMODE_HANJACONVERT          = $0040;
+
+type
+  HIMC = DWORD;
+  HIMCC = DWORD;
+
+type
+  PHKL  = ^HKL;
+  LPHKL = PHKL;
+
+type
+  LPUINT = PUINT;
+
+// declared at rtl\win\wininc\struct.inc
+{type
+  PtagCOMPOSITIONFORM = ^tagCOMPOSITIONFORM;
+  tagCOMPOSITIONFORM = record
+    dwStyle       : DWORD;
+    ptCurrentPos  : POINT;
+    rcArea        : RECT;
+  end;
+  COMPOSITIONFORM = tagCOMPOSITIONFORM;
+  PCOMPOSITIONFORM = PtagCOMPOSITIONFORM;
+  NPCOMPOSITIONFORM = PtagCOMPOSITIONFORM;
+  LPCOMPOSITIONFORM = PtagCOMPOSITIONFORM;}
+
+// declared at rtl\win\wininc\struct.inc
+{type
+  PtagCANDIDATEFORM = ^tagCANDIDATEFORM;
+  tagCANDIDATEFORM = packed record
+    dwIndex      : DWORD;
+    dwStyle      : DWORD;
+    ptCurrentPos : POINT;
+    rcArea       : RECT;
+  end;
+  CANDIDATEFORM = tagCANDIDATEFORM;
+  PCANDIDATEFORM = PtagCANDIDATEFORM;
+  NPCANDIDATEFORM = PtagCANDIDATEFORM;
+  LPCANDIDATEFORM = PtagCANDIDATEFORM;}
+
+
+// declared at rtl\win\wininc\struct.inc
+{type
+  PtagCANDIDATELIST = ^tagCANDIDATELIST;
+  tagCANDIDATELIST = packed record
+    dwSize : DWORD;
+    dwStyle : DWORD;
+    dwCount : DWORD;
+    dwSelection : DWORD;
+    dwPageStart : DWORD;
+    dwPageSize : DWORD;
+    dwOffset : array [0..0] of DWORD;
+  end;
+  CANDIDATELIST = tagCANDIDATELIST;
+  PCANDIDATELIST = PtagCANDIDATELIST;
+  NPCANDIDATELIST = PtagCANDIDATELIST;
+  LPCANDIDATELIST = PtagCANDIDATELIST;}
+
+
+type
+  PtagREGISTERWORDA = ^tagREGISTERWORDA;
+  tagREGISTERWORDA = packed record
+    lpReading : LPSTR;
+    lpWord : LPSTR;
+  end;
+  REGISTERWORDA = tagREGISTERWORDA;
+  TREGISTERWORDA = REGISTERWORDA;
+  PREGISTERWORDA = PtagREGISTERWORDA;
+  NPREGISTERWORDA = PtagREGISTERWORDA;
+  LPREGISTERWORDA = PtagREGISTERWORDA;
+
+type
+  PtagREGISTERWORDW = ^tagREGISTERWORDW;
+  tagREGISTERWORDW = packed record
+    lpReading : LPWSTR;
+    lpWord : LPWSTR;
+  end;
+  REGISTERWORDW = tagREGISTERWORDW;
+  TREGISTERWORDW = REGISTERWORDW;
+  PREGISTERWORDW = PtagREGISTERWORDW;
+  NPREGISTERWORDW = PtagREGISTERWORDW;
+  LPREGISTERWORDW = PtagREGISTERWORDW;
+
+type
+  PtagRECONVERTSTRING = ^tagRECONVERTSTRING;
+  tagRECONVERTSTRING = packed record
+    dwSize : DWORD;
+    dwVersion : DWORD;
+    dwStrLen : DWORD;
+    dwStrOffset : DWORD;
+    dwCompStrLen : DWORD;
+    dwCompStrOffset : DWORD;
+    dwTargetStrLen : DWORD;
+    dwTargetStrOffset : DWORD;
+  end;
+  RECONVERTSTRING = tagRECONVERTSTRING;
+  TRECONVERTSTRING = RECONVERTSTRING;
+  PRECONVERTSTRING = PtagRECONVERTSTRING;
+  NPRECONVERTSTRING = PtagRECONVERTSTRING;
+  LPRECONVERTSTRING = PtagRECONVERTSTRING;
+
+const
+  STYLE_DESCRIPTION_SIZE = 32;
+
+type
+  PtagSTYLEBUFA = ^tagSTYLEBUFA;
+  tagSTYLEBUFA = packed record
+    dwStyle : DWORD;
+    szDescription : array [0..STYLE_DESCRIPTION_SIZE-1] of AnsiChar;
+  end;
+  STYLEBUFA = tagSTYLEBUFA;
+  TSTYLEBUFA = STYLEBUFA;
+  PSTYLEBUFA = PtagSTYLEBUFA;
+  NPSTYLEBUFA = PtagSTYLEBUFA;
+  LPSTYLEBUFA = PtagSTYLEBUFA;
+
+type
+  PtagSTYLEBUFW = ^tagSTYLEBUFW;
+  tagSTYLEBUFW = packed record
+    dwStyle : DWORD;
+    szDescription : array [0..STYLE_DESCRIPTION_SIZE-1] of WCHAR;
+  end;
+  STYLEBUFW = tagSTYLEBUFW;
+  TSTYLEBUFW = STYLEBUFW;
+  PSTYLEBUFW = PtagSTYLEBUFW;
+  NPSTYLEBUFW = PtagSTYLEBUFW;
+  LPSTYLEBUFW = PtagSTYLEBUFW;
+
+const
+  IMEMENUITEM_STRING_SIZE = 80;
+
+type
+  PtagIMEMENUITEMINFOA = ^tagIMEMENUITEMINFOA;
+  tagIMEMENUITEMINFOA = packed record
+    cbSize : UINT;
+    fType : UINT;
+    fState : UINT;
+    wID : UINT;
+    hbmpChecked : HBITMAP;
+    hbmpUnchecked : HBITMAP;
+    dwItemData : DWORD;
+    szString : array [0..IMEMENUITEM_STRING_SIZE-1] of AnsiChar;
+    hbmpItem : HBITMAP;
+  end;
+  IMEMENUITEMINFOA = tagIMEMENUITEMINFOA;
+  TIMEMENUITEMINFOA = IMEMENUITEMINFOA;
+  PIMEMENUITEMINFOA = PtagIMEMENUITEMINFOA;
+  NPIMEMENUITEMINFOA = PtagIMEMENUITEMINFOA;
+  LPIMEMENUITEMINFOA = PtagIMEMENUITEMINFOA;
+
+type
+  PtagIMEMENUITEMINFOW = ^tagIMEMENUITEMINFOW;
+  tagIMEMENUITEMINFOW = packed record
+    cbSize : UINT;
+    fType : UINT;
+    fState : UINT;
+    wID : UINT;
+    hbmpChecked : HBITMAP;
+    hbmpUnchecked : HBITMAP;
+    dwItemData : DWORD;
+    szString : array [0..IMEMENUITEM_STRING_SIZE-1] of WCHAR;
+    hbmpItem : HBITMAP;
+  end;
+  IMEMENUITEMINFOW = tagIMEMENUITEMINFOW;
+  TIMEMENUITEMINFOW = IMEMENUITEMINFOW;
+  PIMEMENUITEMINFOW = PtagIMEMENUITEMINFOW;
+  NPIMEMENUITEMINFOW = PtagIMEMENUITEMINFOW;
+  LPIMEMENUITEMINFOW = PtagIMEMENUITEMINFOW;
+
+type
+  PtagIMECHARPOSITION = ^tagIMECHARPOSITION;
+  tagIMECHARPOSITION = packed record
+    dwSize : DWORD;
+    dwCharPos : DWORD;
+    pt : POINT;
+    cLineHeight : UINT;
+    rcDocument : RECT;
+  end;
+  IMECHARPOSITION = tagIMECHARPOSITION;
+  TIMECHARPOSITION = IMECHARPOSITION;
+  PIMECHARPOSITION = PtagIMECHARPOSITION;
+  NPIMECHARPOSITION = PtagIMECHARPOSITION;
+  LPIMECHARPOSITION = PtagIMECHARPOSITION;
+
+type
+  IMCENUMPROC = function(par0: HIMC; par1: LPARAM): LongBool; stdcall;
+  TIMCENUMPROC = IMCENUMPROC;
+
+// prototype of IMM API
+
+const
+  Imm = 'imm32';
+
+function ImmInstallIMEA(lpszIMEFileName, lpszLayoutText: LPCSTR): HKL; stdcall; external Imm name 'ImmInstallIMEA';
+function ImmInstallIMEW(lpszIMEFileName, lpszLayoutText: LPCWSTR): HKL; stdcall; external Imm name 'ImmInstallIMEW';
+function ImmGetDefaultIMEWnd(wnd: HWND): HWND; stdcall; external Imm name 'ImmGetDefaultIMEWnd';
+function ImmGetDescriptionA(kl: HKL; lpszDescription: LPSTR; uBufLen: UINT): UINT; stdcall; external Imm name 'ImmGetDescriptionA';
+function ImmGetDescriptionW(kl: HKL; lpszDescription: LPWSTR; uBufLen: UINT): UINT; stdcall; external Imm name 'ImmGetDescriptionW';
+
+function ImmGetIMEFileNameA(kl: HKL; lpszFileName: LPSTR; uBufLen: UINT): UINT; stdcall; external Imm name 'ImmGetIMEFileNameA';
+function ImmGetIMEFileNameW(kl: HKL; lpszFileName: LPWSTR; uBufLen: UINT): UINT; stdcall; external Imm name 'ImmGetIMEFileNameW';
+
+function ImmGetProperty (kl: HKL; fdwIndex: DWORD): DWORD; stdcall; external Imm name 'ImmGetProperty';
+function ImmIsIME(kl: HKL): LongBool; stdcall; external Imm name 'ImmIsIME';
+function ImmSimulateHotKey(wnd: HWND; dwHotKeyID: DWORD): LongBool; stdcall; external Imm name 'ImmSimulateHotKey';
+
+function ImmCreateContext: HIMC; stdcall; external Imm name 'ImmCreateContext';
+function ImmDestroyContext(imc: HIMC): LongBool; stdcall; external Imm name 'ImmDestroyContext';
+function ImmGetContext(wnd: HWND): HIMC; stdcall; external Imm name 'ImmGetContext';
+
+function ImmReleaseContext(wnd: HWND; imc: HIMC): LongBool; stdcall; external Imm name 'ImmReleaseContext';
+function ImmAssociateContext(wnd: HWND; imc: HIMC): HIMC; stdcall; external Imm name 'ImmAssociateContext';
+
+function ImmAssociateContextEx(wnd: HWND; imc: HIMC; dwFlags: DWORD): LongBool; stdcall; external Imm name 'ImmAssociateContextEx';
+function ImmGetCompositionStringA(imc: HIMC; dwIndex: DWORD;
+    lpBuf: LPVOID; dwBufLen: DWORD): Longword; stdcall; external Imm name 'ImmGetCompositionStringA';
+function ImmGetCompositionStringW(imc: HIMC; dwIndex: DWORD;
+    lpBuf: LPVOID; dwBufLen: DWORD): Longword; stdcall; external Imm name 'ImmGetCompositionStringW';
+
+function ImmSetCompositionStringA(imc: HIMC; dwIndex: DWORD; lpComp: LPVOID;
+    dwCompLen: DWORD; lpRead: LPVOID; dwReadLen: DWORD): LongBool; stdcall; external Imm name 'ImmSetCompositionStringA';
+function ImmSetCompositionStringW(imc: HIMC; dwIndex: DWORD; lpComp: LPVOID;
+    dwCompLen: DWORD; lpRead: LPVOID; dwReadLen: DWORD): LongBool; stdcall; external Imm name 'ImmSetCompositionStringW';
+
+function ImmGetCandidateListCountA(imc: HIMC; lpdwListCount: LPDWORD): DWORD; stdcall; external Imm name 'ImmGetCandidateListCountA';
+function ImmGetCandidateListCountW(imc: HIMC; lpdwListCount: LPDWORD): DWORD; stdcall; external Imm name 'ImmGetCandidateListCountW';
+
+function ImmGetCandidateListA(imc: HIMC; deIndex: DWORD;
+    lpCandList: LPCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall; external Imm name 'ImmGetCandidateListA';
+function ImmGetCandidateListW(imc: HIMC; deIndex: DWORD;
+    lpCandList: LPCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall; external Imm name 'ImmGetCandidateListW';
+
+function ImmGetGuideLineA(imc: HIMC; dwIndex: DWORD; lpBuf: LPSTR;
+    dwBufLen: DWORD): DWORD; stdcall ; external Imm name 'ImmGetGuideLineA';
+function ImmGetGuideLineW(imc: HIMC; dwIndex: DWORD; lpBuf: LPWSTR;
+    dwBufLen: DWORD): DWORD; stdcall ; external Imm name 'ImmGetGuideLineW';
+
+function ImmGetConversionStatus(imc: HIMC; lpfdwConversion, lpfdwSentence: LPDWORD): LongBool; stdcall ; external Imm name 'ImmGetConversionStatus';
+function ImmSetConversionStatus(imc: HIMC; fdwConversion, fdwSentence: DWORD): LongBool; stdcall ; external Imm name 'ImmSetConversionStatus';
+function ImmGetOpenStatus(imc: HIMC): LongBool; stdcall ; external Imm name 'ImmGetOpenStatus';
+function ImmSetOpenStatus(imc: HIMC; par1: LongBool): LongBool; stdcall ; external Imm name 'ImmSetOpenStatus';
+
+function ImmGetCompositionFontA(imc: HIMC; lplf: PLOGFONTA): LongBool; stdcall ; external Imm name 'ImmGetCompositionFontA';
+function ImmGetCompositionFontW(imc: HIMC; lplf: PLOGFONTW): LongBool; stdcall ; external Imm name 'ImmGetCompositionFontW';
+
+function ImmSetCompositionFontA(imc: HIMC; lplf: PLOGFONTA): LongBool; stdcall ; external Imm name 'ImmSetCompositionFontA';
+function ImmSetCompositionFontW(imc: HIMC; lplf: PLOGFONTW): LongBool; stdcall ; external Imm name 'ImmSetCompositionFontW';
+
+function ImmConfigureIMEA(kl: HKL; wnd: HWND; dwMode: DWORD; lpData: LPVOID): LongBool; stdcall ; external Imm name 'ImmConfigureIMEA';
+function ImmConfigureIMEW(kl: HKL; wnd: HWND; dwMode: DWORD; lpData: LPVOID): LongBool; stdcall ; external Imm name 'ImmConfigureIMEW';
+
+function ImmEscapeA(kl: HKL; imc: HIMC; uEscape: UINT; lpData: LPVOID): LRESULT; stdcall ; external Imm name 'ImmEscapeA';
+function ImmEscapeW(kl: HKL; imc: HIMC; uEscape: UINT; lpData: LPVOID): LRESULT; stdcall ; external Imm name 'ImmEscapeW';
+
+function ImmGetConversionListA(kl: HKL; imc: HIMC; lpSrc: LPCSTR;
+    lpDst: LPCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT): DWORD; stdcall ; external Imm name 'ImmGetConversionListA';
+function ImmGetConversionListW(kl: HKL; imc: HIMC; lpSrc: LPCWSTR;
+    lpDst: LPCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT): DWORD; stdcall ; external Imm name 'ImmGetConversionListW';
+
+function ImmNotifyIME(imc: HIMC; dwAction, dwIndex, dwValue: DWORD): LongBool; stdcall ; external Imm name 'ImmNotifyIME';
+function ImmGetStatusWindowPos(imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall ; external Imm name 'ImmGetStatusWindowPos';
+function ImmSetStatusWindowPos(imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall ; external Imm name 'ImmSetStatusWindowPos';
+function ImmGetCompositionWindow(imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall ; external Imm name 'ImmGetCompositionWindow';
+function ImmSetCompositionWindow(imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall ; external Imm name 'ImmSetCompositionWindow';
+function ImmGetCandidateWindow(imc: HIMC; par1: DWORD; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall ; external Imm name 'ImmGetCandidateWindow(';
+function ImmSetCandidateWindow(imc: HIMC; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall ; external Imm name 'ImmSetCandidateWindow';
+
+function ImmIsUIMessageA(wnd: HWND; msg: UINT; wPar: WPARAM; lPar: LPARAM): LongBool; stdcall ; external Imm name 'ImmIsUIMessageA';
+function ImmIsUIMessageW(wnd: HWND; msg: UINT; wPar: WPARAM; lPar: LPARAM): LongBool; stdcall ; external Imm name 'ImmIsUIMessageW';
+
+function ImmGetVirtualKey(wnd: HWND): UINT; stdcall ; external Imm name 'ImmGetVirtualKey';
+
+type
+  REGISTERWORDENUMPROCA = function(lpszReading: LPCSTR; par1: DWORD;
+    lpszString: LPCSTR; par3: LPVOID): Integer; stdcall;
+  TREGISTERWORDENUMPROCA = REGISTERWORDENUMPROCA;
+
+  REGISTERWORDENUMPROCW = function(lpszReading: LPCWSTR; par1: DWORD;
+    lpszString: LPCWSTR; par3: LPVOID): Integer; stdcall;
+  TREGISTERWORDENUMPROCW = REGISTERWORDENUMPROCW;
+
+function ImmRegisterWordA(kl: HKL; lpszReading: LPCSTR; dwStyle: DWORD; lpszRegister: LPCSTR): LongBool; stdcall ; external Imm name 'ImmRegisterWordA';
+function ImmRegisterWordW(kl: HKL; lpszReading: LPCWSTR; dwStyle: DWORD; lpszRegister: LPCWSTR): LongBool; stdcall ; external Imm name 'ImmRegisterWordW';
+
+function ImmUnregisterWordA(kl: HKL; lpszReading: LPCSTR; dwStyle: DWORD; lpszUnregister: LPCSTR): LongBool; stdcall ; external Imm name 'ImmUnregisterWordA';
+function ImmUnregisterWordW(kl: HKL; lpszReading: LPCWSTR; dwStyle: DWORD; lpszUnregister: LPCWSTR): LongBool; stdcall ; external Imm name 'ImmUnregisterWordW';
+
+function ImmGetRegisterWordStyleA(kl: HKL; nItem: UINT; lpStyleBuf: LPSTYLEBUFA): UINT; stdcall ; external Imm name 'ImmGetRegisterWordStyleA';
+function ImmGetRegisterWordStyleW(kl: HKL; nItem: UINT; lpStyleBuf: LPSTYLEBUFW): UINT; stdcall ; external Imm name 'ImmGetRegisterWordStyleW';
+
+function ImmEnumRegisterWordA(kl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA;
+    lpszReading: LPCSTR; dwStyle: DWORD; lpszRegister: LPCSTR; lpData: LPVOID): UINT; stdcall ; external Imm name 'ImmEnumRegisterWordA';
+function ImmEnumRegisterWordW(kl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW;
+    lpszReading: LPCWSTR; dwStyle: DWORD; lpszRegister: LPCWSTR; lpData: LPVOID): UINT; stdcall ; external Imm name 'ImmEnumRegisterWordW';
+
+function ImmDisableIME(idThread: DWORD): LongBool; stdcall  ; external Imm name 'ImmDisableIME';
+function ImmEnumInputContext(idThread: DWORD; lpfn: IMCENUMPROC; lParam: LPARAM): LongBool; stdcall ; external Imm name 'ImmEnumInputContext';
+function ImmGetImeMenuItemsA(imc: HIMC; dwFlags, dwType: DWORD;
+    lpImeParentMenu, lpImeMenu: LPIMEMENUITEMINFOA; dwSize: DWORD): DWORD; stdcall ; external Imm name 'ImmGetImeMenuItemsA';
+function ImmGetImeMenuItemsW(par0: HIMC; dwFlags, dwType: DWORD;
+    lpImeParentMenu, lpImeMenu: LPIMEMENUITEMINFOW; dwSize: DWORD): DWORD; stdcall ; external Imm name 'ImmGetImeMenuItemsW';
+
+function ImmDisableTextFrameService(idThread: DWORD): LongBool; stdcall ; external Imm name 'ImmDisableTextFrameService';
+
+// wParam for WM_IME_CONTROL
+const
+  IMC_GETCANDIDATEPOS      = $0007;
+  IMC_SETCANDIDATEPOS      = $0008;
+  IMC_GETCOMPOSITIONFONT   = $0009;
+  IMC_SETCOMPOSITIONFONT   = $000A;
+  IMC_GETCOMPOSITIONWINDOW = $000B;
+  IMC_SETCOMPOSITIONWINDOW = $000C;
+  IMC_GETSTATUSWINDOWPOS   = $000F;
+  IMC_SETSTATUSWINDOWPOS   = $0010;
+  IMC_CLOSESTATUSWINDOW    = $0021;
+  IMC_OPENSTATUSWINDOW     = $0022;
+
+  // dwAction for ImmNotifyIME
+  NI_OPENCANDIDATE            = $0010;
+  NI_CLOSECANDIDATE           = $0011;
+  NI_SELECTCANDIDATESTR       = $0012;
+  NI_CHANGECANDIDATELIST      = $0013;
+  NI_FINALIZECONVERSIONRESULT = $0014;
+  NI_COMPOSITIONSTR           = $0015;
+  NI_SETCANDIDATE_PAGESTART   = $0016;
+  NI_SETCANDIDATE_PAGESIZE    = $0017;
+  NI_IMEMENUSELECTED          = $0018;
+
+  // lParam for WM_IME_SETCONTEXT
+  ISC_SHOWUICANDIDATEWINDOW    = $00000001;
+  ISC_SHOWUICOMPOSITIONWINDOW  = $80000000;
+  ISC_SHOWUIGUIDELINE          = $40000000;
+  ISC_SHOWUIALLCANDIDATEWINDOW = $0000000F;
+  ISC_SHOWUIALL                = $C000000F;
+
+  // dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR
+  CPS_COMPLETE  = $0001;
+  CPS_CONVERT   = $0002;
+  CPS_REVERT    = $0003;
+  CPS_CANCEL    = $0004;
+
+  // the modifiers of hot key
+  MOD_ALT      = $0001;
+  MOD_CONTROL  = $0002;
+  MOD_SHIFT    = $0004;
+  MOD_LEFT     = $8000;
+  MOD_RIGHT    = $4000;
+  MOD_ON_KEYUP = $0800;
+  MOD_IGNORE_ALL_MODIFIER = $0400;
+
+  // Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F
+  IME_CHOTKEY_IME_NONIME_TOGGLE = $10;
+  IME_CHOTKEY_SHAPE_TOGGLE      = $11;
+  IME_CHOTKEY_SYMBOL_TOGGLE     = $12;
+
+  // Windows for Japanese Edition hot key ID from 0x30 - 0x4F
+  IME_JHOTKEY_CLOSE_OPEN    = $30;
+
+  // Windows for Korean Edition hot key ID from 0x50 - 0x6F
+  IME_KHOTKEY_SHAPE_TOGGLE  = $50;
+  IME_KHOTKEY_HANJACONVERT  = $51;
+  IME_KHOTKEY_ENGLISH       = $52;
+
+  // Windows for Traditional Chinese Edition hot key ID from 0x70 - 0x8F
+  IME_THOTKEY_IME_NONIME_TOGGLE = $70;
+  IME_THOTKEY_SHAPE_TOGGLE      = $71;
+  IME_THOTKEY_SYMBOL_TOGGLE     = $72;
+
+  // direct switch hot key ID from 0x100 - 0x11F
+  IME_HOTKEY_DSWITCH_FIRST  = $100;
+  IME_HOTKEY_DSWITCH_LAST   = $11F;
+
+  // IME private hot key from 0x200 - 0x21F
+  IME_HOTKEY_PRIVATE_FIRST          = $200;
+  IME_ITHOTKEY_RESEND_RESULTSTR     = $200;
+  IME_ITHOTKEY_PREVIOUS_COMPOSITION = $201;
+  IME_ITHOTKEY_UISTYLE_TOGGLE       = $202;
+  IME_ITHOTKEY_RECONVERTSTRING      = $203;
+  IME_HOTKEY_PRIVATE_LAST           = $21F;
+
+  // parameter of ImmGetCompositionString
+  GCS_COMPREADSTR       = $0001;
+  GCS_COMPREADATTR      = $0002;
+  GCS_COMPREADCLAUSE    = $0004;
+  GCS_COMPSTR           = $0008;
+  GCS_COMPATTR          = $0010;
+  GCS_COMPCLAUSE        = $0020;
+  GCS_CURSORPOS         = $0080;
+  GCS_DELTASTART        = $0100;
+  GCS_RESULTREADSTR     = $0200;
+  GCS_RESULTREADCLAUSE  = $0400;
+  GCS_RESULTSTR         = $0800;
+  GCS_RESULTCLAUSE      = $1000;
+
+  // style bit flags for WM_IME_COMPOSITION
+  CS_INSERTCHAR   = $2000;
+  CS_NOMOVECARET  = $4000;
+
+  // IME version constants
+  IMEVER_0310 = $0003000A;
+  IMEVER_0400 = $00040000;
+
+
+  // IME property bits
+  IME_PROP_AT_CARET              = $00010000;
+  IME_PROP_SPECIAL_UI            = $00020000;
+  IME_PROP_CANDLIST_START_FROM_1 = $00040000;
+  IME_PROP_UNICODE               = $00080000;
+  IME_PROP_COMPLETE_ON_UNSELECT  = $00100000;
+
+  // IME UICapability bits
+  UI_CAP_2700   = $00000001;
+  UI_CAP_ROT90  = $00000002;
+  UI_CAP_ROTANY = $00000004;
+
+  // ImmSetCompositionString Capability bits
+  SCS_CAP_COMPSTR            = $00000001;
+  SCS_CAP_MAKEREAD           = $00000002;
+  SCS_CAP_SETRECONVERTSTRING = $00000004;
+
+  // IME WM_IME_SELECT inheritance Capability bits
+  SELECT_CAP_CONVERSION = $00000001;
+  SELECT_CAP_SENTENCE   = $00000002;
+
+  // ID for deIndex of ImmGetGuideLine
+  GGL_LEVEL   = $00000001;
+  GGL_INDEX   = $00000002;
+  GGL_STRING  = $00000003;
+  GGL_PRIVATE = $00000004;
+
+  // ID for dwLevel of GUIDELINE Structure
+  GL_LEVEL_NOGUIDELINE = $00000000;
+  GL_LEVEL_FATAL       = $00000001;
+  GL_LEVEL_ERROR       = $00000002;
+  GL_LEVEL_WARNING     = $00000003;
+  GL_LEVEL_INFORMATION = $00000004;
+
+  // ID for dwIndex of GUIDELINE Structure
+  GL_ID_UNKNOWN           = $00000000;
+  GL_ID_NOMODULE          = $00000001;
+  GL_ID_NODICTIONARY      = $00000010;
+  GL_ID_CANNOTSAVE        = $00000011;
+  GL_ID_NOCONVERT         = $00000020;
+  GL_ID_TYPINGERROR       = $00000021;
+  GL_ID_TOOMANYSTROKE     = $00000022;
+  GL_ID_READINGCONFLICT   = $00000023;
+  GL_ID_INPUTREADING      = $00000024;
+  GL_ID_INPUTRADICAL      = $00000025;
+  GL_ID_INPUTCODE         = $00000026;
+  GL_ID_INPUTSYMBOL       = $00000027;
+  GL_ID_CHOOSECANDIDATE   = $00000028;
+  GL_ID_REVERSECONVERSION = $00000029;
+  GL_ID_PRIVATE_FIRST     = $00008000;
+  GL_ID_PRIVATE_LAST      = $0000FFFF;
+
+  // ID for dwIndex of ImmGetProperty
+  IGP_GETIMEVERSION = -4;
+  IGP_PROPERTY      = $00000004;
+  IGP_CONVERSION    = $00000008;
+  IGP_SENTENCE      = $0000000c;
+  IGP_UI            = $00000010;
+  IGP_SETCOMPSTR    = $00000014;
+  IGP_SELECT        = $00000018;
+
+  // dwIndex for ImmSetCompositionString API
+  SCS_SETSTR               = (GCS_COMPREADSTR or GCS_COMPSTR);
+  SCS_CHANGEATTR           = (GCS_COMPREADATTR or GCS_COMPATTR);
+  SCS_CHANGECLAUSE         = (GCS_COMPREADCLAUSE or GCS_COMPCLAUSE);
+  SCS_SETRECONVERTSTRING   = $00010000;
+  SCS_QUERYRECONVERTSTRING = $00020000;
+
+  // attribute for COMPOSITIONSTRING Structure
+  ATTR_INPUT               = $00;
+  ATTR_TARGET_CONVERTED    = $01;
+  ATTR_CONVERTED           = $02;
+  ATTR_TARGET_NOTCONVERTED = $03;
+  ATTR_INPUT_ERROR         = $04;
+  ATTR_FIXEDCONVERTED      = $05;
+
+  // bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW
+  CFS_DEFAULT        = $0000;
+  CFS_RECT           = $0001;
+  CFS_POINT          = $0002;
+  CFS_FORCE_POSITION = $0020;
+  CFS_CANDIDATEPOS   = $0040;
+  CFS_EXCLUDE        = $0080;
+
+  // conversion direction for ImmGetConversionList
+  GCL_CONVERSION        = $0001;
+  GCL_REVERSECONVERSION = $0002;
+  GCL_REVERSE_LENGTH    = $0003;
+
+  // bit field for conversion mode
+  // IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually.
+  IME_CMODE_HANGEUL      = IME_CMODE_NATIVE;
+  IME_CMODE_SOFTKBD      = $0080;
+  IME_CMODE_NOCONVERSION = $0100;
+  IME_CMODE_EUDC         = $0200;
+  IME_CMODE_SYMBOL       = $0400;
+  IME_CMODE_FIXED        = $0800;
+  IME_CMODE_RESERVED     = $F0000000;
+
+  // bit field for sentence mode
+  IME_SMODE_NONE          = $0000;
+  IME_SMODE_PLAURALCLAUSE = $0001;
+  IME_SMODE_SINGLECONVERT = $0002;
+  IME_SMODE_AUTOMATIC     = $0004;
+  IME_SMODE_PHRASEPREDICT = $0008;
+  IME_SMODE_CONVERSATION  = $0010;
+  IME_SMODE_RESERVED      = $0000F000;
+
+  // style of candidate
+  IME_CAND_UNKNOWN = $0000;
+  IME_CAND_READ    = $0001;
+  IME_CAND_CODE    = $0002;
+  IME_CAND_MEANING = $0003;
+  IME_CAND_RADICAL = $0004;
+  IME_CAND_STROKE  = $0005;
+
+  // wParam of report message WM_IME_NOTIFY
+  IMN_CLOSESTATUSWINDOW    = $0001;
+  IMN_OPENSTATUSWINDOW     = $0002;
+  IMN_CHANGECANDIDATE      = $0003;
+  IMN_CLOSECANDIDATE       = $0004;
+  IMN_OPENCANDIDATE        = $0005;
+  IMN_SETCONVERSIONMODE    = $0006;
+  IMN_SETSENTENCEMODE      = $0007;
+  IMN_SETOPENSTATUS        = $0008;
+  IMN_SETCANDIDATEPOS      = $0009;
+  IMN_SETCOMPOSITIONFONT   = $000A;
+  IMN_SETCOMPOSITIONWINDOW = $000B;
+  IMN_SETSTATUSWINDOWPOS   = $000C;
+  IMN_GUIDELINE            = $000D;
+  IMN_PRIVATE              = $000E;
+
+  // wParam of report message WM_IME_REQUEST
+  IMR_COMPOSITIONWINDOW      = $0001;
+  IMR_CANDIDATEWINDOW        = $0002;
+  IMR_COMPOSITIONFONT        = $0003;
+  IMR_RECONVERTSTRING        = $0004;
+  IMR_CONFIRMRECONVERTSTRING = $0005;
+  IMR_QUERYCHARPOSITION      = $0006;
+  IMR_DOCUMENTFEED           = $0007;
+
+  // error code of ImmGetCompositionString
+  IMM_ERROR_NODATA  = -1;
+  IMM_ERROR_GENERAL = -2;
+
+  // dialog mode of ImmConfigureIME
+  IME_CONFIG_GENERAL          = 1;
+  IME_CONFIG_REGISTERWORD     = 2;
+  IME_CONFIG_SELECTDICTIONARY = 3;
+
+  // flags for ImmEscape
+  IME_ESC_QUERY_SUPPORT        = $0003;
+  IME_ESC_RESERVED_FIRST       = $0004;
+  IME_ESC_RESERVED_LAST        = $07FF;
+  IME_ESC_PRIVATE_FIRST        = $0800;
+  IME_ESC_PRIVATE_LAST         = $0FFF;
+  IME_ESC_SEQUENCE_TO_INTERNAL = $1001;
+  IME_ESC_GET_EUDC_DICTIONARY  = $1003;
+  IME_ESC_SET_EUDC_DICTIONARY  = $1004;
+  IME_ESC_MAX_KEY              = $1005;
+  IME_ESC_IME_NAME             = $1006;
+  IME_ESC_SYNC_HOTKEY          = $1007;
+  IME_ESC_HANJA_MODE           = $1008;
+  IME_ESC_AUTOMATA             = $1009;
+  IME_ESC_PRIVATE_HOTKEY       = $100a;
+  IME_ESC_GETHELPFILENAME      = $100b;
+
+  // style of word registration
+  IME_REGWORD_STYLE_EUDC       = $00000001;
+  IME_REGWORD_STYLE_USER_FIRST = $80000000;
+  IME_REGWORD_STYLE_USER_LAST  = $FFFFFFFF;
+
+  // dwFlags for ImmAssociateContextEx
+  IACE_CHILDREN        = $0001;
+  IACE_DEFAULT         = $0010;
+  IACE_IGNORENOCONTEXT = $0020;
+
+  // dwFlags for ImmGetImeMenuItems
+  IGIMIF_RIGHTMENU = $0001;
+
+  // dwType for ImmGetImeMenuItems
+  IGIMII_CMODE      = $0001;
+  IGIMII_SMODE      = $0002;
+  IGIMII_CONFIGURE  = $0004;
+  IGIMII_TOOLS      = $0008;
+  IGIMII_HELP       = $0010;
+  IGIMII_OTHER      = $0020;
+  IGIMII_INPUTTOOLS = $0040;
+
+  // fType of IMEMENUITEMINFO structure
+  IMFT_RADIOCHECK = $00001;
+  IMFT_SEPARATOR  = $00002;
+  IMFT_SUBMENU    = $00004;
+
+  // fState of IMEMENUITEMINFO structure
+  IMFS_GRAYED    = MFS_GRAYED;
+  IMFS_DISABLED  = MFS_DISABLED;
+  IMFS_CHECKED   = MFS_CHECKED;
+  IMFS_HILITE    = MFS_HILITE;
+  IMFS_ENABLED   = MFS_ENABLED;
+  IMFS_UNCHECKED = MFS_UNCHECKED;
+  IMFS_UNHILITE  = MFS_UNHILITE;
+  IMFS_DEFAULT   = MFS_DEFAULT;
+
+  // type of soft keyboard
+  // for Windows Tranditional Chinese Edition
+  SOFTKEYBOARD_TYPE_T1 = $0001;
+
+  // for Windows Simplified Chinese Edition
+  SOFTKEYBOARD_TYPE_C1 = $0002;
+
+implementation
+
+
+end.

+ 224 - 0
packages/winunits-base/src/imm_dyn.pas

@@ -0,0 +1,224 @@
+(********************************************************************* *)
+(*      imm.h - Input Method Manager definitions                       *)
+(*                                                                     *)
+(*      Copyright (c) Microsoft Corporation. All rights reserved.      *)
+(*                                                                     *)
+(* Converted to pascal by Dmitry Boyarintsev, using Chelper.           *)
+(*                                                                     *)
+(*   The dynamic interface is used to load function dynamicly.         *)
+(* It's users responsibility to check functions have been loaded       *)
+(* successfully.                                                       *)
+(*   imm_dyn and imm function names match. In oreder to be sure that   *)
+(* dynamicly loaded functions are used, always add imm_dyn to the uses *)
+(* section after imm unit.                                             *)
+(*                                                                     *)
+(********************************************************************* *)
+unit imm_dyn;
+
+{$mode delphi}
+
+interface
+
+uses
+  Windows, imm;
+
+var
+  ImmInstallIMEA : function (lpszIMEFileName, lpszLayoutText: LPCSTR): HKL; stdcall = nil;
+  ImmInstallIMEW : function (lpszIMEFileName, lpszLayoutText: LPCWSTR): HKL; stdcall = nil;
+  ImmGetDefaultIMEWnd : function (wnd: HWND): HWND; stdcall = nil;
+  ImmGetDescriptionA : function (kl: HKL; lpszDescription: LPSTR; uBufLen: UINT): UINT; stdcall = nil;
+  ImmGetDescriptionW : function (kl: HKL; lpszDescription: LPWSTR; uBufLen: UINT): UINT; stdcall = nil;
+
+  ImmGetIMEFileNameA : function (kl: HKL; lpszFileName: LPSTR; uBufLen: UINT): UINT; stdcall = nil;
+  ImmGetIMEFileNameW : function (kl: HKL; lpszFileName: LPWSTR; uBufLen: UINT): UINT; stdcall = nil;
+
+  ImmGetProperty : function (kl: HKL; fdwIndex: DWORD): DWORD; stdcall = nil;
+  ImmIsIME : function (kl: HKL): LongBool; stdcall = nil;
+  ImmSimulateHotKey : function (wnd: HWND; dwHotKeyID: DWORD): LongBool; stdcall = nil;
+
+  ImmCreateContext: function : HIMC; stdcall = nil;
+  ImmDestroyContext: function (imc: HIMC): LongBool; stdcall = nil;
+  ImmGetContext: function (wnd: HWND): HIMC; stdcall = nil;
+
+  ImmReleaseContext: function (wnd: HWND; imc: HIMC): LongBool; stdcall = nil;
+  ImmAssociateContext: function (wnd: HWND; imc: HIMC): HIMC; stdcall = nil;
+
+  ImmAssociateContextEx: function (wnd: HWND; imc: HIMC; dwFlags: DWORD): LongBool; stdcall = nil;
+  ImmGetCompositionStringA: function (imc: HIMC; dwIndex: DWORD;
+    lpBuf: LPVOID; dwBufLen: DWORD): Longword; stdcall = nil;
+  ImmGetCompositionStringW: function (imc: HIMC; dwIndex: DWORD;
+    lpBuf: LPVOID; dwBufLen: DWORD): Longword; stdcall = nil;
+
+  ImmSetCompositionStringA: function (imc: HIMC; dwIndex: DWORD; lpComp: LPVOID;
+    dwCompLen: DWORD; lpRead: LPVOID; dwReadLen: DWORD): LongBool; stdcall = nil;
+  ImmSetCompositionStringW: function (imc: HIMC; dwIndex: DWORD; lpComp: LPVOID;
+    dwCompLen: DWORD; lpRead: LPVOID; dwReadLen: DWORD): LongBool; stdcall = nil;
+
+  ImmGetCandidateListCountA: function (imc: HIMC; lpdwListCount: LPDWORD): DWORD; stdcall = nil;
+  ImmGetCandidateListCountW: function (imc: HIMC; lpdwListCount: LPDWORD): DWORD; stdcall = nil;
+
+  ImmGetCandidateListA: function (imc: HIMC; deIndex: DWORD;
+    lpCandList: LPCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall = nil;
+  ImmGetCandidateListW: function (imc: HIMC; deIndex: DWORD;
+    lpCandList: LPCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall = nil;
+
+  ImmGetGuideLineA: function (imc: HIMC; dwIndex: DWORD; lpBuf: LPSTR;
+    dwBufLen: DWORD): DWORD; stdcall = nil;
+  ImmGetGuideLineW: function (imc: HIMC; dwIndex: DWORD; lpBuf: LPWSTR;
+    dwBufLen: DWORD): DWORD; stdcall = nil;
+
+  ImmGetConversionStatus: function (imc: HIMC; lpfdwConversion, lpfdwSentence: LPDWORD): LongBool; stdcall = nil;
+  ImmSetConversionStatus: function (imc: HIMC; fdwConversion, fdwSentence: DWORD): LongBool; stdcall = nil;
+  ImmGetOpenStatus: function (imc: HIMC): LongBool; stdcall = nil;
+  ImmSetOpenStatus: function (imc: HIMC; par1: LongBool): LongBool; stdcall = nil;
+
+  ImmGetCompositionFontA: function (imc: HIMC; lplf: PLOGFONTA): LongBool; stdcall = nil;
+  ImmGetCompositionFontW: function (imc: HIMC; lplf: PLOGFONTW): LongBool; stdcall = nil;
+
+  ImmSetCompositionFontA: function (imc: HIMC; lplf: PLOGFONTA): LongBool; stdcall = nil;
+  ImmSetCompositionFontW: function (imc: HIMC; lplf: PLOGFONTW): LongBool; stdcall = nil;
+
+  ImmConfigureIMEA: function (kl: HKL; wnd: HWND; dwMode: DWORD; lpData: LPVOID): LongBool; stdcall = nil;
+  ImmConfigureIMEW: function (kl: HKL; wnd: HWND; dwMode: DWORD; lpData: LPVOID): LongBool; stdcall = nil;
+
+  ImmEscapeA: function (kl: HKL; imc: HIMC; uEscape: UINT; lpData: LPVOID): LRESULT; stdcall = nil;
+  ImmEscapeW: function (kl: HKL; imc: HIMC; uEscape: UINT; lpData: LPVOID): LRESULT; stdcall = nil;
+
+  ImmGetConversionListA: function (kl: HKL; imc: HIMC; lpSrc: LPCSTR;
+    lpDst: LPCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT): DWORD; stdcall = nil;
+  ImmGetConversionListW: function (kl: HKL; imc: HIMC; lpSrc: LPCWSTR;
+    lpDst: LPCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT): DWORD; stdcall = nil;
+
+  ImmNotifyIME: function (imc: HIMC; dwAction, dwIndex, dwValue: DWORD): LongBool; stdcall = nil;
+  ImmGetStatusWindowPos: function (imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall = nil;
+  ImmSetStatusWindowPos: function (imc: HIMC; lpptPos: LPPOINT): LongBool; stdcall = nil;
+  ImmGetCompositionWindow: function (imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall = nil;
+  ImmSetCompositionWindow: function (imc: HIMC; lpCompForm: LPCOMPOSITIONFORM): LongBool; stdcall = nil;
+  ImmGetCandidateWindow: function (imc: HIMC; par1: DWORD; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall = nil;
+  ImmSetCandidateWindow: function (imc: HIMC; lpCandidate: LPCANDIDATEFORM): LongBool; stdcall = nil;
+
+  ImmIsUIMessageA: function (wnd: HWND; msg: UINT; wPar: WPARAM; lPar: LPARAM): LongBool; stdcall = nil;
+  ImmIsUIMessageW: function (wnd: HWND; msg: UINT; wPar: WPARAM; lPar: LPARAM): LongBool; stdcall = nil;
+
+  ImmGetVirtualKey: function (wnd: HWND): UINT; stdcall = nil;
+
+  ImmRegisterWordA: function (kl: HKL; lpszReading: LPCSTR; dwStyle: DWORD; lpszRegister: LPCSTR): LongBool; stdcall = nil;
+  ImmRegisterWordW: function (kl: HKL; lpszReading: LPCWSTR; dwStyle: DWORD; lpszRegister: LPCWSTR): LongBool; stdcall = nil;
+
+  ImmUnregisterWordA: function (kl: HKL; lpszReading: LPCSTR; dwStyle: DWORD; lpszUnregister: LPCSTR): LongBool; stdcall = nil;
+
+  ImmUnregisterWordW: function (kl: HKL; lpszReading: LPCWSTR; dwStyle: DWORD; lpszUnregister: LPCWSTR): LongBool; stdcall = nil;
+
+  ImmGetRegisterWordStyleA: function (kl: HKL; nItem: UINT; lpStyleBuf: LPSTYLEBUFA): UINT; stdcall = nil;
+  ImmGetRegisterWordStyleW: function (kl: HKL; nItem: UINT; lpStyleBuf: LPSTYLEBUFW): UINT; stdcall = nil;
+
+  ImmEnumRegisterWordA: function (kl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA;
+    lpszReading: LPCSTR; dwStyle: DWORD; lpszRegister: LPCSTR; lpData: LPVOID): UINT; stdcall = nil;
+  ImmEnumRegisterWordW: function (kl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW;
+    lpszReading: LPCWSTR; dwStyle: DWORD; lpszRegister: LPCWSTR; lpData: LPVOID): UINT; stdcall = nil;
+
+  ImmDisableIME: function (idThread: DWORD): LongBool; stdcall  = nil;
+  ImmEnumInputContext: function (idThread: DWORD; lpfn: IMCENUMPROC; lParam: LPARAM)
+    : LongBool; stdcall = nil;
+  ImmGetImeMenuItemsA: function (imc: HIMC; dwFlags, dwType: DWORD;
+    lpImeParentMenu, lpImeMenu: LPIMEMENUITEMINFOA; dwSize: DWORD): DWORD; stdcall = nil;
+  ImmGetImeMenuItemsW: function (par0: HIMC; dwFlags, dwType: DWORD;
+    lpImeParentMenu, lpImeMenu: LPIMEMENUITEMINFOW; dwSize: DWORD): DWORD; stdcall = nil;
+
+  ImmDisableTextFrameService: function (idThread: DWORD): LongBool; stdcall = nil;
+
+implementation
+
+var
+  lib : THandle=0;
+
+procedure InitImm;
+begin
+  lib:=LoadLibraryA('Imm32.dll');
+  if lib=0 then Exit;
+  ImmInstallIMEA              := GetProcAddress(lib,'ImmInstallIMEA');
+  ImmInstallIMEW              := GetProcAddress(lib,'ImmInstallIMEW');
+  ImmGetDefaultIMEWnd         := GetProcAddress(lib,'ImmGetDefaultIMEWnd');
+  ImmGetDescriptionA          := GetProcAddress(lib,'ImmGetDescriptionA');
+  ImmGetDescriptionW          := GetProcAddress(lib,'ImmGetDescriptionW');
+
+  ImmGetIMEFileNameA          := GetProcAddress(lib,'ImmGetIMEFileNameA');
+  ImmGetIMEFileNameW          := GetProcAddress(lib,'ImmGetIMEFileNameW');
+
+  ImmGetProperty              := GetProcAddress(lib,'ImmGetProperty');
+  ImmIsIME                    := GetProcAddress(lib,'ImmIsIME');
+  ImmSimulateHotKey           := GetProcAddress(lib,'ImmSimulateHotKey');
+
+  ImmCreateContext            := GetProcAddress(lib,'ImmCreateContext');
+  ImmDestroyContext           := GetProcAddress(lib,'ImmDestroyContext');
+  ImmGetContext               := GetProcAddress(lib,'ImmGetContext');
+
+  ImmReleaseContext           := GetProcAddress(lib,'ImmReleaseContext');
+  ImmAssociateContext         := GetProcAddress(lib,'ImmAssociateContext');
+
+  ImmAssociateContextEx       := GetProcAddress(lib,'ImmAssociateContextEx');
+  ImmGetCompositionStringA    := GetProcAddress(lib,'ImmGetCompositionStringA');
+  ImmGetCompositionStringW    := GetProcAddress(lib,'ImmGetCompositionStringW');
+
+  ImmSetCompositionStringA    := GetProcAddress(lib,'ImmSetCompositionStringA');
+  ImmSetCompositionStringW    := GetProcAddress(lib,'ImmSetCompositionStringW');
+  ImmGetCandidateListCountA   := GetProcAddress(lib,'ImmGetCandidateListCountA');
+  ImmGetCandidateListCountW   := GetProcAddress(lib,'ImmGetCandidateListCountW');
+  ImmGetCandidateListA        := GetProcAddress(lib,'ImmGetCandidateListA');
+  ImmGetCandidateListW        := GetProcAddress(lib,'ImmGetCandidateListW');
+  ImmGetGuideLineA            := GetProcAddress(lib,'ImmGetGuideLineA');
+  ImmGetGuideLineW            := GetProcAddress(lib,'ImmGetGuideLineW');
+  ImmGetConversionStatus      := GetProcAddress(lib,'ImmGetConversionStatus');
+  ImmSetConversionStatus      := GetProcAddress(lib,'ImmSetConversionStatus');
+  ImmGetOpenStatus            := GetProcAddress(lib,'ImmGetOpenStatus');
+  ImmSetOpenStatus            := GetProcAddress(lib,'ImmSetOpenStatus');
+  ImmGetCompositionFontA      := GetProcAddress(lib,'ImmGetCompositionFontA');
+  ImmGetCompositionFontW      := GetProcAddress(lib,'ImmGetCompositionFontW');
+  ImmSetCompositionFontA      := GetProcAddress(lib,'ImmSetCompositionFontA');
+  ImmSetCompositionFontW      := GetProcAddress(lib,'ImmSetCompositionFontW');
+  ImmConfigureIMEA            := GetProcAddress(lib,'ImmConfigureIMEA');
+  ImmConfigureIMEW            := GetProcAddress(lib,'ImmConfigureIMEW');
+  ImmEscapeA                  := GetProcAddress(lib,'ImmEscapeA');
+  ImmEscapeW                  := GetProcAddress(lib,'ImmEscapeW');
+  ImmGetConversionListA       := GetProcAddress(lib,'ImmGetConversionListA');
+  ImmGetConversionListW       := GetProcAddress(lib,'ImmGetConversionListW');
+
+  ImmNotifyIME                := GetProcAddress(lib,'ImmNotifyIME');
+  ImmGetStatusWindowPos       := GetProcAddress(lib,'ImmGetStatusWindowPos');
+  ImmSetStatusWindowPos       := GetProcAddress(lib,'ImmSetStatusWindowPos');
+  ImmGetCompositionWindow     := GetProcAddress(lib,'ImmGetCompositionWindow');
+  ImmSetCompositionWindow     := GetProcAddress(lib,'ImmSetCompositionWindow');
+  ImmGetCandidateWindow       := GetProcAddress(lib,'ImmGetCandidateWindow');
+  ImmSetCandidateWindow       := GetProcAddress(lib,'ImmSetCandidateWindow');
+  ImmIsUIMessageA             := GetProcAddress(lib,'ImmIsUIMessageA');
+  ImmIsUIMessageW             := GetProcAddress(lib,'ImmIsUIMessageW');
+  ImmGetVirtualKey            := GetProcAddress(lib,'ImmGetVirtualKey');
+  ImmRegisterWordA            := GetProcAddress(lib,'ImmRegisterWordA');
+  ImmRegisterWordW            := GetProcAddress(lib,'ImmRegisterWordW');
+
+  ImmUnregisterWordA          := GetProcAddress(lib,'ImmUnregisterWordA');
+  ImmUnregisterWordW          := GetProcAddress(lib,'ImmUnregisterWordW');
+
+  ImmGetRegisterWordStyleA    := GetProcAddress(lib,'ImmGetRegisterWordStyleA');
+  ImmGetRegisterWordStyleW    := GetProcAddress(lib,'ImmGetRegisterWordStyleW');
+
+  ImmEnumRegisterWordA        := GetProcAddress(lib,'ImmEnumRegisterWordA');
+  ImmEnumRegisterWordW        := GetProcAddress(lib,'ImmEnumRegisterWordW');
+
+  ImmDisableIME               := GetProcAddress(lib,'ImmDisableIME');
+  ImmEnumInputContext         := GetProcAddress(lib,'ImmEnumInputContext');
+  ImmGetImeMenuItemsA         := GetProcAddress(lib,'ImmGetImeMenuItemsA');
+  ImmGetImeMenuItemsW         := GetProcAddress(lib,'ImmGetImeMenuItemsW');
+
+  ImmDisableTextFrameService  := GetProcAddress(lib,'ImmDisableTextFrameService');
+end;
+
+initialization
+  InitImm;
+
+finalization
+  if lib<>0 then FreeLibrary(lib);
+
+
+end.
+

+ 108 - 105
packages/winunits-base/src/shellapi.pp

@@ -44,6 +44,9 @@ Uses Windows, ActiveX;
     shellapi.h -  SHELL.DLL functions, types, and definitions
     shellapi.h -  SHELL.DLL functions, types, and definitions
     Copyright (c) Microsoft Corporation. All rights reserved.             }
     Copyright (c) Microsoft Corporation. All rights reserved.             }
 
 
+const
+   shell32 =  'shell32.dll';
+
 Const 
 Const 
     SHGDN_NORMAL             = $0000;  // default (display purpose)
     SHGDN_NORMAL             = $0000;  // default (display purpose)
     SHGDN_INFOLDER           = $0001;  // displayed under a folder (relative)
     SHGDN_INFOLDER           = $0001;  // displayed under a folder (relative)
@@ -1057,44 +1060,44 @@ Type
 
 
 
 
 {unicode}
 {unicode}
-Function DragQueryFileA(arg1 : HDROP; arg2 : UINT;arg3 : LPSTR ; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileA';
-Function DragQueryFileW(arg1 : HDROP; arg2 : UINT;arg3 : LPWSTR; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileW';
-Function DragQueryFile(arg1 : HDROP; arg2 : UINT;arg3 : LPSTR ; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileA';
-Function DragQueryFile(arg1 : HDROP; arg2 : UINT;arg3 : LPWSTR; arg4 : UINT):UINT;external 'shell32.dll' name 'DragQueryFileW';
+Function DragQueryFileA(arg1 : HDROP; arg2 : UINT;arg3 : LPSTR ; arg4 : UINT):UINT;external shell32 name 'DragQueryFileA';
+Function DragQueryFileW(arg1 : HDROP; arg2 : UINT;arg3 : LPWSTR; arg4 : UINT):UINT;external shell32 name 'DragQueryFileW';
+Function DragQueryFile(arg1 : HDROP; arg2 : UINT;arg3 : LPSTR ; arg4 : UINT):UINT;external shell32 name 'DragQueryFileA';
+Function DragQueryFile(arg1 : HDROP; arg2 : UINT;arg3 : LPWSTR; arg4 : UINT):UINT;external shell32 name 'DragQueryFileW';
 
 
-Function DragQueryPoint(arg1 : HDROP; arg2 :LPPOINT):BOOL; external 'shell32.dll' name 'DragQueryPoint';
-Procedure DragFinish(arg1 : HDROP);                     external 'shell32.dll' name 'DragFinish';
-Procedure DragAcceptFiles(hwnd : HWND;arg2: BOOL);      external 'shell32.dll' name 'DragAcceptFiles';
+Function DragQueryPoint(arg1 : HDROP; arg2 :LPPOINT):BOOL; external shell32 name 'DragQueryPoint';
+Procedure DragFinish(arg1 : HDROP);                     external shell32 name 'DragFinish';
+Procedure DragAcceptFiles(hwnd : HWND;arg2: BOOL);      external shell32 name 'DragAcceptFiles';
 
 
-Function ShellExecuteA(HWND: hwnd;lpOperation : LPCSTR ; lpFile : LPCSTR ; lpParameters : LPCSTR; lpDirectory:  LPCSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteA';
-Function ShellExecuteW(hwnd: HWND;lpOperation : LPCWSTR ; lpFile : LPCWSTR ; lpParameters : LPCWSTR; lpDirectory:  LPCWSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteW';
-Function ShellExecute(HWND: hwnd;lpOperation : LPCSTR ; lpFile : LPCSTR ; lpParameters : LPCSTR; lpDirectory:  LPCSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteA';
-Function ShellExecute(hwnd: HWND;lpOperation : LPCWSTR ; lpFile : LPCWSTR ; lpParameters : LPCWSTR; lpDirectory:  LPCWSTR; nShowCmd:LONGINT):HInst; external 'shell32.dll' name 'ShellExecuteW';
+Function ShellExecuteA(HWND: hwnd;lpOperation : LPCSTR ; lpFile : LPCSTR ; lpParameters : LPCSTR; lpDirectory:  LPCSTR; nShowCmd:LONGINT):HInst; external shell32 name 'ShellExecuteA';
+Function ShellExecuteW(hwnd: HWND;lpOperation : LPCWSTR ; lpFile : LPCWSTR ; lpParameters : LPCWSTR; lpDirectory:  LPCWSTR; nShowCmd:LONGINT):HInst; external shell32 name 'ShellExecuteW';
+Function ShellExecute(HWND: hwnd;lpOperation : LPCSTR ; lpFile : LPCSTR ; lpParameters : LPCSTR; lpDirectory:  LPCSTR; nShowCmd:LONGINT):HInst; external shell32 name 'ShellExecuteA';
+Function ShellExecute(hwnd: HWND;lpOperation : LPCWSTR ; lpFile : LPCWSTR ; lpParameters : LPCWSTR; lpDirectory:  LPCWSTR; nShowCmd:LONGINT):HInst; external shell32 name 'ShellExecuteW';
 
 
-Function FindExecutableA(lpFile : LPCSTR ;lpDirectory : LPCSTR ; lpResult : LPSTR):HInst;external 'shell32.dll' name 'FindExecutableA';
-Function FindExecutableW(lpFile : LPCWSTR;lpDirectory : LPCWSTR; lpResult : LPWSTR):HInst;external 'shell32.dll' name 'FindExecutableW';
-Function FindExecutable(lpFile : LPCSTR ;lpDirectory : LPCSTR ; lpResult : LPSTR):HInst;external 'shell32.dll' name 'FindExecutableA';
-Function FindExecutable(lpFile : LPCWSTR;lpDirectory : LPCWSTR; lpResult : LPWSTR):HInst;external 'shell32.dll' name 'FindExecutableW';
+Function FindExecutableA(lpFile : LPCSTR ;lpDirectory : LPCSTR ; lpResult : LPSTR):HInst;external shell32 name 'FindExecutableA';
+Function FindExecutableW(lpFile : LPCWSTR;lpDirectory : LPCWSTR; lpResult : LPWSTR):HInst;external shell32 name 'FindExecutableW';
+Function FindExecutable(lpFile : LPCSTR ;lpDirectory : LPCSTR ; lpResult : LPSTR):HInst;external shell32 name 'FindExecutableA';
+Function FindExecutable(lpFile : LPCWSTR;lpDirectory : LPCWSTR; lpResult : LPWSTR):HInst;external shell32 name 'FindExecutableW';
 
 
-Function CommandLineToArgvW(lpCmdLine : LPCWSTR;pNumArgs : plongint):pLPWSTR;external 'shell32.dll' name 'CommandLineToArgvW';
+Function CommandLineToArgvW(lpCmdLine : LPCWSTR;pNumArgs : plongint):pLPWSTR;external shell32 name 'CommandLineToArgvW';
 
 
-Function ShellAboutA(HWND: hWnd; szApp : LPCSTR; szOtherStuff : LPCSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutA';
-Function ShellAboutW(HWND: hWnd; szApp : LPCWSTR; szOtherStuff : LPCWSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutW';
-Function ShellAbout(HWND: hWnd; szApp : LPCSTR; szOtherStuff : LPCSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutA';
-Function ShellAbout(HWND: hWnd; szApp : LPCWSTR; szOtherStuff : LPCWSTR; HICON : hIcon):Longint; external 'shell32.dll' name 'ShellAboutW';
+Function ShellAboutA(HWND: hWnd; szApp : LPCSTR; szOtherStuff : LPCSTR; HICON : hIcon):Longint; external shell32 name 'ShellAboutA';
+Function ShellAboutW(HWND: hWnd; szApp : LPCWSTR; szOtherStuff : LPCWSTR; HICON : hIcon):Longint; external shell32 name 'ShellAboutW';
+Function ShellAbout(HWND: hWnd; szApp : LPCSTR; szOtherStuff : LPCSTR; HICON : hIcon):Longint; external shell32 name 'ShellAboutA';
+Function ShellAbout(HWND: hWnd; szApp : LPCWSTR; szOtherStuff : LPCWSTR; HICON : hIcon):Longint; external shell32 name 'ShellAboutW';
 
 
-Function DuplicateIcon(hinst : HINST; HICON: hIcon):HIcon; external 'shell32.dll' name 'DuplicateIcon';
+Function DuplicateIcon(hinst : HINST; HICON: hIcon):HIcon; external shell32 name 'DuplicateIcon';
 
 
-Function  ExtractAssociatedIconA(hInst : HINST; lpIconPath : LPSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconA';
-Function  ExtractAssociatedIconW(hInst : HINST; lpIconPath : LPWSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconW';
-Function  ExtractAssociatedIcon(hInst : HINST; lpIconPath : LPSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconA';
-Function  ExtractAssociatedIcon(hInst : HINST; lpIconPath : LPWSTR; lpiIcon : LPWORD):HICON;external 'shell32.dll' name 'ExtractAssociatedIconW';
+Function  ExtractAssociatedIconA(hInst : HINST; lpIconPath : LPSTR; lpiIcon : LPWORD):HICON;external shell32 name 'ExtractAssociatedIconA';
+Function  ExtractAssociatedIconW(hInst : HINST; lpIconPath : LPWSTR; lpiIcon : LPWORD):HICON;external shell32 name 'ExtractAssociatedIconW';
+Function  ExtractAssociatedIcon(hInst : HINST; lpIconPath : LPSTR; lpiIcon : LPWORD):HICON;external shell32 name 'ExtractAssociatedIconA';
+Function  ExtractAssociatedIcon(hInst : HINST; lpIconPath : LPWSTR; lpiIcon : LPWORD):HICON;external shell32 name 'ExtractAssociatedIconW';
 
 
-Function ExtractIconA(hInst: HINST; lpszExeFileName :LPCSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconA';
-Function ExtractIconW(hInst: HINST; lpszExeFileName :LPCWSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconW';
+Function ExtractIconA(hInst: HINST; lpszExeFileName :LPCSTR ; nIconIndex : UINT):HICON;external shell32 name 'ExtractIconA';
+Function ExtractIconW(hInst: HINST; lpszExeFileName :LPCWSTR ; nIconIndex : UINT):HICON;external shell32 name 'ExtractIconW';
 
 
-Function ExtractIcon(hInst: HINST; lpszExeFileName :LPCSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconA';
-Function ExtractIcon(hInst: HINST; lpszExeFileName :LPCWSTR ; nIconIndex : UINT):HICON;external 'shell32.dll' name 'ExtractIconW';
+Function ExtractIcon(hInst: HINST; lpszExeFileName :LPCSTR ; nIconIndex : UINT):HICON;external shell32 name 'ExtractIconA';
+Function ExtractIcon(hInst: HINST; lpszExeFileName :LPCWSTR ; nIconIndex : UINT):HICON;external shell32 name 'ExtractIconW';
 
 
 // if(WINVER >= 0x0400)
 // if(WINVER >= 0x0400)
 
 
@@ -1178,29 +1181,29 @@ Type
        PAPPBARDATA        = ^_AppBarData;
        PAPPBARDATA        = ^_AppBarData;
 
 
 
 
-Function SHAppBarMessage(dwMessage : DWORD; pData : pAPPBARDATA):UINT_PTR;external 'shell32.dll' name 'SHAppBarMessage';
+Function SHAppBarMessage(dwMessage : DWORD; pData : pAPPBARDATA):UINT_PTR;external shell32 name 'SHAppBarMessage';
 
 
     //
     //
     //  EndAppBar
     //  EndAppBar
     //
     //
 
 
-Function   DoEnvironmentSubstA(szString: LPSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstA';
-Function   DoEnvironmentSubstW(szString: LPWSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstW';
-Function   DoEnvironmentSubst(szString: LPSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstA';
-Function   DoEnvironmentSubst(szString: LPWSTR; cchString:UINT):DWORD;external 'shell32.dll' name 'DoEnvironmentSubstW';
+Function   DoEnvironmentSubstA(szString: LPSTR; cchString:UINT):DWORD;external shell32 name 'DoEnvironmentSubstA';
+Function   DoEnvironmentSubstW(szString: LPWSTR; cchString:UINT):DWORD;external shell32 name 'DoEnvironmentSubstW';
+Function   DoEnvironmentSubst(szString: LPSTR; cchString:UINT):DWORD;external shell32 name 'DoEnvironmentSubstA';
+Function   DoEnvironmentSubst(szString: LPWSTR; cchString:UINT):DWORD;external shell32 name 'DoEnvironmentSubstW';
 
 
 {Macro}
 {Macro}
 function EIRESID(x : longint) : longint;
 function EIRESID(x : longint) : longint;
 
 
-Function ExtractIconExA(lpszFile : LPCSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT;   external 'shell32.dll' name 'ExtractIconExA';
-Function ExtractIconExW(lpszFile : LPCWSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT;  external 'shell32.dll' name 'ExtractIconExW';
-Function ExtractIconExA(lpszFile : LPCSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT;   external 'shell32.dll' name 'ExtractIconExA';
-Function ExtractIconExW(lpszFile : LPCWSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT;  external 'shell32.dll' name 'ExtractIconExW';
+Function ExtractIconExA(lpszFile : LPCSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT;   external shell32 name 'ExtractIconExA';
+Function ExtractIconExW(lpszFile : LPCWSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT;  external shell32 name 'ExtractIconExW';
+Function ExtractIconExA(lpszFile : LPCSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT;   external shell32 name 'ExtractIconExA';
+Function ExtractIconExW(lpszFile : LPCWSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT;  external shell32 name 'ExtractIconExW';
 
 
-Function ExtractIconEx (lpszFile : LPCSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExA';
-Function ExtractIconEx (lpszFile : LPCWSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExW';
-Function ExtractIconEx (lpszFile : LPCSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExA';
-Function ExtractIconEx (lpszFile : LPCWSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external 'shell32.dll' name 'ExtractIconExW';
+Function ExtractIconEx (lpszFile : LPCSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external shell32 name 'ExtractIconExA';
+Function ExtractIconEx (lpszFile : LPCWSTR; nIconIndex:Longint; phiconLarge:pHICON; phiconSmall:pHIcon; nIcons:UINT):UINT; external shell32 name 'ExtractIconExW';
+Function ExtractIconEx (lpszFile : LPCSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external shell32 name 'ExtractIconExA';
+Function ExtractIconEx (lpszFile : LPCWSTR; nIconIndex:Longint; var phiconLarge:HICON;var phiconSmall:HIcon; nIcons:UINT):UINT; external shell32 name 'ExtractIconExW';
 
 
 //
 //
 // Shell File Operations
 // Shell File Operations
@@ -1306,15 +1309,15 @@ Type
        LPSHFILEOPSTRUCT         = LPSHFILEOPSTRUCTA;
        LPSHFILEOPSTRUCT         = LPSHFILEOPSTRUCTA;
 {$endif}
 {$endif}
 
 
-Function SHFileOperationA(lpFileOp:LPSHFILEOPSTRUCTA ):Longint;external 'shell32.dll' name 'SHFileOperationA';
+Function SHFileOperationA(lpFileOp:LPSHFILEOPSTRUCTA ):Longint;external shell32 name 'SHFileOperationA';
 
 
-Function SHFileOperationW(lpFileOp:LPSHFILEOPSTRUCTW ):Longint;external 'shell32.dll' name 'SHFileOperationW';
+Function SHFileOperationW(lpFileOp:LPSHFILEOPSTRUCTW ):Longint;external shell32 name 'SHFileOperationW';
 
 
-Function SHFileOperation(lpFileOp:LPSHFILEOPSTRUCTA ):Longint;external 'shell32.dll' name 'SHFileOperationA';
-Function SHFileOperation(var lpFileOp:SHFILEOPSTRUCTA ):Longint;external 'shell32.dll' name 'SHFileOperationA';
-Function SHFileOperation(lpFileOp:LPSHFILEOPSTRUCTW ):Longint;external 'shell32.dll' name 'SHFileOperationW';
+Function SHFileOperation(lpFileOp:LPSHFILEOPSTRUCTA ):Longint;external shell32 name 'SHFileOperationA';
+Function SHFileOperation(var lpFileOp:SHFILEOPSTRUCTA ):Longint;external shell32 name 'SHFileOperationA';
+Function SHFileOperation(lpFileOp:LPSHFILEOPSTRUCTW ):Longint;external shell32 name 'SHFileOperationW';
 
 
-Procedure SHFreeNameMappings(hNameMappings : THandle);external 'shell32.dll' name 'SHFreeNameMappings';
+Procedure SHFreeNameMappings(hNameMappings : THandle);external shell32 name 'SHFreeNameMappings';
 
 
 Type
 Type
 
 
@@ -1469,15 +1472,15 @@ Type
        LPSHELLEXECUTEINFO       = LPSHELLEXECUTEINFOA;
        LPSHELLEXECUTEINFO       = LPSHELLEXECUTEINFOA;
 {$endif}
 {$endif}
 
 
-Function ShellExecuteExA(lpExecInfo: LPSHELLEXECUTEINFOA):Bool;external 'shell32.dll' name 'ShellExecuteExA';
-Function ShellExecuteExW(lpExecInfo: LPSHELLEXECUTEINFOW):Bool;external 'shell32.dll' name 'ShellExecuteExW';
-Function ShellExecuteEx(lpExecInfo: LPSHELLEXECUTEINFOA):Bool;external 'shell32.dll' name 'ShellExecuteExA';
-Function ShellExecuteEx(lpExecInfo: LPSHELLEXECUTEINFOW):Bool;external 'shell32.dll' name 'ShellExecuteExW';
+Function ShellExecuteExA(lpExecInfo: LPSHELLEXECUTEINFOA):Bool;external shell32 name 'ShellExecuteExA';
+Function ShellExecuteExW(lpExecInfo: LPSHELLEXECUTEINFOW):Bool;external shell32 name 'ShellExecuteExW';
+Function ShellExecuteEx(lpExecInfo: LPSHELLEXECUTEINFOA):Bool;external shell32 name 'ShellExecuteExA';
+Function ShellExecuteEx(lpExecInfo: LPSHELLEXECUTEINFOW):Bool;external shell32 name 'ShellExecuteExW';
 
 
-Procedure WinExecErrorA(HWND : hwnd; error : Longint;lpstrFileName:LPCSTR; lpstrTitle:LPCSTR);   external 'shell32.dll' name 'WinExecErrorA';
-Procedure WinExecErrorW(HWND : hwnd; error : Longint;lpstrFileName:LPCWSTR; lpstrTitle:LPCWSTR); external 'shell32.dll' name 'WinExecErrorW';
-Procedure WinExecError(HWND : hwnd; error : Longint;lpstrFileName:LPCSTR; lpstrTitle:LPCSTR); external 'shell32.dll' name 'WinExecErrorA';
-Procedure WinExecError(HWND : hwnd; error : Longint;lpstrFileName:LPCWSTR; lpstrTitle:LPCWSTR); external 'shell32.dll' name 'WinExecErrorW';
+Procedure WinExecErrorA(HWND : hwnd; error : Longint;lpstrFileName:LPCSTR; lpstrTitle:LPCSTR);   external shell32 name 'WinExecErrorA';
+Procedure WinExecErrorW(HWND : hwnd; error : Longint;lpstrFileName:LPCWSTR; lpstrTitle:LPCWSTR); external shell32 name 'WinExecErrorW';
+Procedure WinExecError(HWND : hwnd; error : Longint;lpstrFileName:LPCSTR; lpstrTitle:LPCSTR); external shell32 name 'WinExecErrorA';
+Procedure WinExecError(HWND : hwnd; error : Longint;lpstrFileName:LPCWSTR; lpstrTitle:LPCWSTR); external shell32 name 'WinExecErrorW';
 
 
 type
 type
 
 
@@ -1500,7 +1503,7 @@ type
      TSHCREATEPROCESSINFOW      = _SHCREATEPROCESSINFOW;
      TSHCREATEPROCESSINFOW      = _SHCREATEPROCESSINFOW;
      PSHCREATEPROCESSINFOW      = ^_SHCREATEPROCESSINFOW;
      PSHCREATEPROCESSINFOW      = ^_SHCREATEPROCESSINFOW;
 
 
-Function SHCreateProcessAsUserW(pscpi : PSHCREATEPROCESSINFOW):Bool;external 'shell32.dll' name 'SHCreateProcessAsUserW';
+Function SHCreateProcessAsUserW(pscpi : PSHCREATEPROCESSINFOW):Bool;external shell32 name 'SHCreateProcessAsUserW';
 
 
     //
     //
     //  End ShellExecuteEx and family }
     //  End ShellExecuteEx and family }
@@ -1529,15 +1532,15 @@ const
        SHERB_NOPROGRESSUI       = $00000002;
        SHERB_NOPROGRESSUI       = $00000002;
        SHERB_NOSOUND            = $00000004;
        SHERB_NOSOUND            = $00000004;
 
 
-function SHQueryRecycleBinA(pszRootPath:LPCSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinA';
-function SHQueryRecycleBinW(pszRootPath:LPCWSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinW';
-function SHQueryRecycleBin(pszRootPath:LPCSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinA';
-function SHQueryRecycleBin(pszRootPath:LPCWSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external 'shell32.dll' name 'SHQueryRecycleBinW';
+function SHQueryRecycleBinA(pszRootPath:LPCSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external shell32 name 'SHQueryRecycleBinA';
+function SHQueryRecycleBinW(pszRootPath:LPCWSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external shell32 name 'SHQueryRecycleBinW';
+function SHQueryRecycleBin(pszRootPath:LPCSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external shell32 name 'SHQueryRecycleBinA';
+function SHQueryRecycleBin(pszRootPath:LPCWSTR; pSHQueryRBInfo:LPSHQUERYRBINFO):HRESULT;external shell32 name 'SHQueryRecycleBinW';
 
 
-function SHEmptyRecycleBinA(hwnd:HWND; pszRootPath:LPCSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinA';
-function SHEmptyRecycleBinW(hwnd:HWND; pszRootPath:LPCWSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinW';
-function SHEmptyRecycleBin(hwnd:HWND; pszRootPath:LPCSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinA';
-function SHEmptyRecycleBin(hwnd:HWND; pszRootPath:LPCWSTR; dwFlags:DWORD):HRESULT;external 'shell32.dll' name 'SHEmptyRecycleBinW';
+function SHEmptyRecycleBinA(hwnd:HWND; pszRootPath:LPCSTR; dwFlags:DWORD):HRESULT;external shell32 name 'SHEmptyRecycleBinA';
+function SHEmptyRecycleBinW(hwnd:HWND; pszRootPath:LPCWSTR; dwFlags:DWORD):HRESULT;external shell32 name 'SHEmptyRecycleBinW';
+function SHEmptyRecycleBin(hwnd:HWND; pszRootPath:LPCSTR; dwFlags:DWORD):HRESULT;external shell32 name 'SHEmptyRecycleBinA';
+function SHEmptyRecycleBin(hwnd:HWND; pszRootPath:LPCWSTR; dwFlags:DWORD):HRESULT;external shell32 name 'SHEmptyRecycleBinW';
 
 
 //
 //
 // end of RecycleBin
 // end of RecycleBin
@@ -1689,11 +1692,11 @@ Type
 
 
        NIIF_NOSOUND             = $00000010;
        NIIF_NOSOUND             = $00000010;
 
 
-Function Shell_NotifyIconA( dwMessage: Dword;lpData: PNOTIFYICONDATAA):Bool;external 'shell32.dll' name 'Shell_NotifyIconA';
-Function Shell_NotifyIconW( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;external 'shell32.dll' name 'Shell_NotifyIconW';
+Function Shell_NotifyIconA( dwMessage: Dword;lpData: PNOTIFYICONDATAA):Bool;external shell32 name 'Shell_NotifyIconA';
+Function Shell_NotifyIconW( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;external shell32 name 'Shell_NotifyIconW';
 
 
-Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAA):Bool;external 'shell32.dll' name 'Shell_NotifyIconA';
-Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;external 'shell32.dll' name 'Shell_NotifyIconW';
+Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAA):Bool;external shell32 name 'Shell_NotifyIconA';
+Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;external shell32 name 'Shell_NotifyIconW';
 //
 //
 // End Tray Notification Icons
 // End Tray Notification Icons
 //
 //
@@ -1778,27 +1781,27 @@ Function Shell_NotifyIcon( dwMessage: Dword;lpData: PNOTIFYICONDATAW):Bool;exter
        SHGFI_ADDOVERLAYS        = $000000020;    { apply the appropriate overlays }
        SHGFI_ADDOVERLAYS        = $000000020;    { apply the appropriate overlays }
        SHGFI_OVERLAYINDEX       = $000000040;    { Get the index of the overlay }
        SHGFI_OVERLAYINDEX       = $000000040;    { Get the index of the overlay }
                                                  { in the upper 8 bits of the iIcon  }
                                                  { in the upper 8 bits of the iIcon  }
-Function SHGetFileInfoA(pszPath: LPCSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
-Function SHGetFileInfoW(pszPath: LPCWSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoW';
-Function SHGetFileInfo(pszPath: LPCSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
+Function SHGetFileInfoA(pszPath: LPCSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoA';
+Function SHGetFileInfoW(pszPath: LPCWSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoW';
+Function SHGetFileInfo(pszPath: LPCSTR; dwFileAttributes : DWORD; psfi: pSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoA';
 
 
-Function SHGetFileInfoA(pszPath: LPCSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
-Function SHGetFileInfoW(pszPath: LPCWSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoW';
-Function SHGetFileInfo(pszPath: LPCSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoA';
-Function SHGetFileInfo(pszPath: LPCWSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external 'shell32.dll' name 'SHGetFileInfoW';
+Function SHGetFileInfoA(pszPath: LPCSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoA';
+Function SHGetFileInfoW(pszPath: LPCWSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoW';
+Function SHGetFileInfo(pszPath: LPCSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOA; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoA';
+Function SHGetFileInfo(pszPath: LPCWSTR; dwFileAttributes : DWORD; var psfi: TSHFILEINFOW; cbFileInfo,UFlags: UINT):DWORD;external shell32 name 'SHGetFileInfoW';
 
 
-Function SHGetDiskFreeSpaceExA( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExA';
-Function SHGetDiskFreeSpaceExW( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExW';
-Function SHGetDiskFreeSpaceEx( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExA';
-Function SHGetDiskFreeSpace( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExA';
-Function SHGetDiskFreeSpaceEx( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExW';
-Function SHGetDiskFreeSpace( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external 'shell32.dll' name 'SHGetDiskFreeSpaceExW';
+Function SHGetDiskFreeSpaceExA( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external shell32 name 'SHGetDiskFreeSpaceExA';
+Function SHGetDiskFreeSpaceExW( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external shell32 name 'SHGetDiskFreeSpaceExW';
+Function SHGetDiskFreeSpaceEx( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external shell32 name 'SHGetDiskFreeSpaceExA';
+Function SHGetDiskFreeSpace( pszDirectoryName : LPCSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external shell32 name 'SHGetDiskFreeSpaceExA';
+Function SHGetDiskFreeSpaceEx( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external shell32 name 'SHGetDiskFreeSpaceExW';
+Function SHGetDiskFreeSpace( pszDirectoryName : LPCWSTR; pulFreeBytesAvailableToCaller : pULARGE_INTEGER; pulTotalNumberOfBytes : pULARGE_INTEGER;pulTotalNumberOfFreeBytes: pULARGE_INTEGER):Bool;external shell32 name 'SHGetDiskFreeSpaceExW';
 
 
-Function SHGetNewLinkInfoA(pszLinkTo:LPCSTR;pszDir:LPCSTR; pszName:LPSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoA';
-Function SHGetNewLinkInfoW(pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoW';
+Function SHGetNewLinkInfoA(pszLinkTo:LPCSTR;pszDir:LPCSTR; pszName:LPSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external shell32 name 'SHGetNewLinkInfoA';
+Function SHGetNewLinkInfoW(pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external shell32 name 'SHGetNewLinkInfoW';
 
 
-Function SHGetNewLinkInfo (pszLinkTo:LPCSTR;pszDir:LPCSTR; pszName:LPSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoA';
-Function SHGetNewLinkInfo (pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external 'shell32.dll' name 'SHGetNewLinkInfoW';
+Function SHGetNewLinkInfo (pszLinkTo:LPCSTR;pszDir:LPCSTR; pszName:LPSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external shell32 name 'SHGetNewLinkInfoA';
+Function SHGetNewLinkInfo (pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfMustCopy: pBool; uFlags:UINT):Bool;external shell32 name 'SHGetNewLinkInfoW';
 
 
     const
     const
        SHGNLI_PIDL              = $000000001;    { pszLinkTo is a pidl }
        SHGNLI_PIDL              = $000000001;    { pszLinkTo is a pidl }
@@ -1824,10 +1827,10 @@ Function SHGetNewLinkInfo (pszLinkTo:LPCWSTR;pszDir:LPCWSTR; pszName:LPWSTR; pfM
        PRINTACTION_SERVERPROPERTIES = 7;
        PRINTACTION_SERVERPROPERTIES = 7;
 {$endif}
 {$endif}
 
 
-Function SHInvokePrinterCommandA(HWND: hwnd; uAction:UINT; lpBuf1: LPCSTR; lpBuf2: LPCSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandA';
-Function SHInvokePrinterCommandW(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf2: LPCWSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandW';
-Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCSTR; lpBuf2: LPCSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandA';
-Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf2: LPCWSTR; fModal:Bool):Bool;external 'shell32.dll' name 'SHInvokePrinterCommandW';
+Function SHInvokePrinterCommandA(HWND: hwnd; uAction:UINT; lpBuf1: LPCSTR; lpBuf2: LPCSTR; fModal:Bool):Bool;external shell32 name 'SHInvokePrinterCommandA';
+Function SHInvokePrinterCommandW(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf2: LPCWSTR; fModal:Bool):Bool;external shell32 name 'SHInvokePrinterCommandW';
+Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCSTR; lpBuf2: LPCSTR; fModal:Bool):Bool;external shell32 name 'SHInvokePrinterCommandA';
+Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf2: LPCWSTR; fModal:Bool):Bool;external shell32 name 'SHInvokePrinterCommandW';
 
 
 // WINVER >= 0x0400
 // WINVER >= 0x0400
 //if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
 //if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
@@ -1844,7 +1847,7 @@ Function SHInvokePrinterCommand(HWND: hwnd; uAction:UINT; lpBuf1: LPCWSTR; lpBuf
     //      S_OK
     //      S_OK
     //
     //
 
 
-function SHLoadNonloadedIconOverlayIdentifiers:HResult; external 'shell32.dll' name 'SHInvokePrinterCommandW';
+function SHLoadNonloadedIconOverlayIdentifiers:HResult; external shell32 name 'SHInvokePrinterCommandW';
 
 
     //
     //
     // The SHIsFileAvailableOffline API determines whether a file
     // The SHIsFileAvailableOffline API determines whether a file
@@ -1865,7 +1868,7 @@ function SHLoadNonloadedIconOverlayIdentifiers:HResult; external 'shell32.dll' n
     //     Both OFFLINE_STATUS_LOCAL and OFFLINE_STATUS_REMOTE may be returned,
     //     Both OFFLINE_STATUS_LOCAL and OFFLINE_STATUS_REMOTE may be returned,
     //     indicating "open in both places." This is common when the server is online.
     //     indicating "open in both places." This is common when the server is online.
     //
     //
-function SHIsFileAvailableOffline(pwszPath:LPCWSTR; pdwStatus:LPDWORD):HRESULT; external 'shell32.dll' name 'SHIsFileAvailableOffline';
+function SHIsFileAvailableOffline(pwszPath:LPCWSTR; pdwStatus:LPDWORD):HRESULT; external shell32 name 'SHIsFileAvailableOffline';
 
 
 const
 const
        OFFLINE_STATUS_LOCAL         = $0001;    { If open, it's open locally }
        OFFLINE_STATUS_LOCAL         = $0001;    { If open, it's open locally }
@@ -1876,29 +1879,29 @@ const
     {  sets the specified path to use the string resource }
     {  sets the specified path to use the string resource }
     {  as the UI instead of the file system name }
     {  as the UI instead of the file system name }
 
 
-function SHSetLocalizedName(pszPath:LPWSTR; pszResModule:LPCWSTR; idsRes:longint):HRESULT;external 'shell32.dll' name 'SHSetLocalizedName';
+function SHSetLocalizedName(pszPath:LPWSTR; pszResModule:LPCWSTR; idsRes:longint):HRESULT;external shell32 name 'SHSetLocalizedName';
 
 
 //if         _WIN32_IE >= 0x0600}
 //if         _WIN32_IE >= 0x0600}
 
 
-function SHEnumerateUnreadMailAccountsA(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPSTR; cchMailAddress:longint):HRESULT;external 'shell32.dll' name 'SHEnumerateUnreadMailAccountsA';
-function SHEnumerateUnreadMailAccountsW(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPWSTR; cchMailAddress:longint):HRESULT;external 'shell32.dll' name 'SHEnumerateUnreadMailAccountsW';
+function SHEnumerateUnreadMailAccountsA(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPSTR; cchMailAddress:longint):HRESULT;external shell32 name 'SHEnumerateUnreadMailAccountsA';
+function SHEnumerateUnreadMailAccountsW(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPWSTR; cchMailAddress:longint):HRESULT;external shell32 name 'SHEnumerateUnreadMailAccountsW';
 
 
-function SHEnumerateUnreadMailAccounts(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPWSTR; cchMailAddress:longint):HRESULT;external 'shell32.dll' name 'SHEnumerateUnreadMailAccountsW';
+function SHEnumerateUnreadMailAccounts(hKeyUser:HKEY; dwIndex:DWORD; pszMailAddress:LPWSTR; cchMailAddress:longint):HRESULT;external shell32 name 'SHEnumerateUnreadMailAccountsW';
 
 
-function SHGetUnreadMailCountA(hKeyUser:HKEY; pszMailAddress:LPCSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountA';
-function SHGetUnreadMailCountW(hKeyUser:HKEY; pszMailAddress:LPCWSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPWSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountW';
-function SHGetUnreadMailCount(hKeyUser:HKEY; pszMailAddress:LPCSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountA';
-function SHGetUnreadMailCount(hKeyUser:HKEY; pszMailAddress:LPCWSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPWSTR;cchShellExecuteCommand:longint):HRESULT;external 'shell32.dll' name 'SHGetUnreadMailCountW';
+function SHGetUnreadMailCountA(hKeyUser:HKEY; pszMailAddress:LPCSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPSTR;cchShellExecuteCommand:longint):HRESULT;external shell32 name 'SHGetUnreadMailCountA';
+function SHGetUnreadMailCountW(hKeyUser:HKEY; pszMailAddress:LPCWSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPWSTR;cchShellExecuteCommand:longint):HRESULT;external shell32 name 'SHGetUnreadMailCountW';
+function SHGetUnreadMailCount(hKeyUser:HKEY; pszMailAddress:LPCSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPSTR;cchShellExecuteCommand:longint):HRESULT;external shell32 name 'SHGetUnreadMailCountA';
+function SHGetUnreadMailCount(hKeyUser:HKEY; pszMailAddress:LPCWSTR; pdwCount:PDWORD; pFileTime:PFILETIME; pszShellExecuteCommand:LPWSTR;cchShellExecuteCommand:longint):HRESULT;external shell32 name 'SHGetUnreadMailCountW';
 
 
-function SHSetUnreadMailCountA(pszMailAddress:LPCSTR; dwCount:DWORD; pszShellExecuteCommand:LPCSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountA';
-function SHSetUnreadMailCountW(pszMailAddress:LPCWSTR; dwCount:DWORD; pszShellExecuteCommand:LPCWSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountW';
-function SHSetUnreadMailCount(pszMailAddress:LPCSTR; dwCount:DWORD; pszShellExecuteCommand:LPCSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountA';
-function SHSetUnreadMailCount(pszMailAddress:LPCWSTR; dwCount:DWORD; pszShellExecuteCommand:LPCWSTR):HRESULT;external 'shell32.dll' name 'SHSetUnreadMailCountW';
+function SHSetUnreadMailCountA(pszMailAddress:LPCSTR; dwCount:DWORD; pszShellExecuteCommand:LPCSTR):HRESULT;external shell32 name 'SHSetUnreadMailCountA';
+function SHSetUnreadMailCountW(pszMailAddress:LPCWSTR; dwCount:DWORD; pszShellExecuteCommand:LPCWSTR):HRESULT;external shell32 name 'SHSetUnreadMailCountW';
+function SHSetUnreadMailCount(pszMailAddress:LPCSTR; dwCount:DWORD; pszShellExecuteCommand:LPCSTR):HRESULT;external shell32 name 'SHSetUnreadMailCountA';
+function SHSetUnreadMailCount(pszMailAddress:LPCWSTR; dwCount:DWORD; pszShellExecuteCommand:LPCWSTR):HRESULT;external shell32 name 'SHSetUnreadMailCountW';
 
 
 //  _WIN32_IE >= 0x0600      }
 //  _WIN32_IE >= 0x0600      }
 //  if         _WIN32_IE >= 0x0600}
 //  if         _WIN32_IE >= 0x0600}
 
 
-function SHGetImageList(iImageList:longint;CONST riid:TIID; ppvObj:Ppointer):HRESULT;external 'shell32.dll' name 'SHGetImageList';
+function SHGetImageList(iImageList:longint;CONST riid:TIID; ppvObj:Ppointer):HRESULT;external shell32 name 'SHGetImageList';
 
 
 Const
 Const
        SHIL_LARGE                   = 0;    { normally 32x32 }
        SHIL_LARGE                   = 0;    { normally 32x32 }

+ 1532 - 0
packages/winunits-base/src/winspool.pp

@@ -0,0 +1,1532 @@
+unit winspool;
+
+interface
+
+{$PACKRECORDS C}
+
+{$ifndef NO_SMART_LINK}
+{$smartlink on}
+{$endif}
+
+  uses
+    ctypes,windows;
+{
+  Automatically converted by H2Pas 1.0.0 from winspool.h
+  The following command line parameters were used:
+    winspool.h
+    -D
+    -w
+}
+
+  const
+    External_library='winspool.drv';
+
+  type
+    PPVOID = ppointer;
+
+  const
+     DI_CHANNEL = 1;
+     DI_CHANNEL_WRITE = 2;
+     DI_READ_SPOOL_JOB = 3;
+     DI_MEMORYMAP_WRITE = $1;
+     FORM_USER = $0;
+     FORM_BUILTIN = $1;
+     FORM_PRINTER = $2;
+     DRIVER_KERNELMODE = $00000001;
+     DRIVER_USERMODE = $00000002;
+     DSPRINT_PUBLISH = $00000001;
+     DSPRINT_UPDATE = $00000002;
+     DSPRINT_UNPUBLISH = $00000004;
+     DSPRINT_REPUBLISH = $00000008;
+     DSPRINT_PENDING = $80000000;
+     JOB_CONTROL_PAUSE = 1;
+     JOB_CONTROL_RESUME = 2;
+     JOB_CONTROL_CANCEL = 3;
+     JOB_CONTROL_RESTART = 4;
+     JOB_CONTROL_DELETE = 5;
+     JOB_CONTROL_SENT_TO_PRINTER = 6;
+     JOB_CONTROL_LAST_PAGE_EJECTED = 7;
+     JOB_STATUS_PAUSED = $1;
+     JOB_STATUS_ERROR = $2;
+     JOB_STATUS_DELETING = $4;
+     JOB_STATUS_SPOOLING = $8;
+     JOB_STATUS_PRINTING = $10;
+     JOB_STATUS_OFFLINE = $20;
+     JOB_STATUS_PAPEROUT = $40;
+     JOB_STATUS_PRINTED = $80;
+     JOB_STATUS_DELETED = $100;
+     JOB_STATUS_BLOCKED_DEVQ = $200;
+     JOB_STATUS_USER_INTERVENTION = $400;
+     JOB_STATUS_RESTART = $800;
+     JOB_STATUS_COMPLETE = $1000;
+     JOB_POSITION_UNSPECIFIED = 0;
+     JOB_NOTIFY_TYPE = 1;
+     JOB_NOTIFY_FIELD_PRINTER_NAME = 0;
+     JOB_NOTIFY_FIELD_MACHINE_NAME = 1;
+     JOB_NOTIFY_FIELD_PORT_NAME = 2;
+     JOB_NOTIFY_FIELD_USER_NAME = 3;
+     JOB_NOTIFY_FIELD_NOTIFY_NAME = 4;
+     JOB_NOTIFY_FIELD_DATATYPE = 5;
+     JOB_NOTIFY_FIELD_PRINT_PROCESSOR = 6;
+     JOB_NOTIFY_FIELD_PARAMETERS = 7;
+     JOB_NOTIFY_FIELD_DRIVER_NAME = 8;
+     JOB_NOTIFY_FIELD_DEVMODE = 9;
+     JOB_NOTIFY_FIELD_STATUS = 10;
+     JOB_NOTIFY_FIELD_STATUS_STRING = 11;
+     JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR = 12;
+     JOB_NOTIFY_FIELD_DOCUMENT = 13;
+     JOB_NOTIFY_FIELD_PRIORITY = 14;
+     JOB_NOTIFY_FIELD_POSITION = 15;
+     JOB_NOTIFY_FIELD_SUBMITTED = 16;
+     JOB_NOTIFY_FIELD_START_TIME = 17;
+     JOB_NOTIFY_FIELD_UNTIL_TIME = 18;
+     JOB_NOTIFY_FIELD_TIME = 19;
+     JOB_NOTIFY_FIELD_TOTAL_PAGES = 20;
+     JOB_NOTIFY_FIELD_PAGES_PRINTED = 21;
+     JOB_NOTIFY_FIELD_TOTAL_BYTES = 22;
+     JOB_NOTIFY_FIELD_BYTES_PRINTED = 23;
+     JOB_ACCESS_ADMINISTER = 16;
+     JOB_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or JOB_ACCESS_ADMINISTER;
+     JOB_READ = STANDARD_RIGHTS_READ or JOB_ACCESS_ADMINISTER;
+     JOB_WRITE = STANDARD_RIGHTS_WRITE or JOB_ACCESS_ADMINISTER;
+     JOB_EXECUTE = STANDARD_RIGHTS_EXECUTE or JOB_ACCESS_ADMINISTER;
+     PRINTER_NOTIFY_OPTIONS_REFRESH = 1;
+     PRINTER_ACCESS_ADMINISTER = 4;
+     PRINTER_ACCESS_USE = 8;
+     PRINTER_ERROR_INFORMATION = $80000000;
+     PRINTER_ERROR_WARNING = $40000000;
+     PRINTER_ERROR_SEVERE = $20000000;
+     PRINTER_ERROR_OUTOFPAPER = 1;
+     PRINTER_ERROR_JAM = 2;
+     PRINTER_ERROR_OUTOFTONER = 4;
+     PRINTER_CONTROL_PAUSE = 1;
+     PRINTER_CONTROL_RESUME = 2;
+     PRINTER_CONTROL_PURGE = 3;
+     PRINTER_CONTROL_SET_STATUS = 4;
+     PRINTER_STATUS_PAUSED = 1;
+     PRINTER_STATUS_ERROR = 2;
+     PRINTER_STATUS_PENDING_DELETION = 4;
+     PRINTER_STATUS_PAPER_JAM = 8;
+     PRINTER_STATUS_PAPER_OUT = $10;
+     PRINTER_STATUS_MANUAL_FEED = $20;
+     PRINTER_STATUS_PAPER_PROBLEM = $40;
+     PRINTER_STATUS_OFFLINE = $80;
+     PRINTER_STATUS_IO_ACTIVE = $100;
+     PRINTER_STATUS_BUSY = $200;
+     PRINTER_STATUS_PRINTING = $400;
+     PRINTER_STATUS_OUTPUT_BIN_FULL = $800;
+     PRINTER_STATUS_NOT_AVAILABLE = $1000;
+     PRINTER_STATUS_WAITING = $2000;
+     PRINTER_STATUS_PROCESSING = $4000;
+     PRINTER_STATUS_INITIALIZING = $8000;
+     PRINTER_STATUS_WARMING_UP = $10000;
+     PRINTER_STATUS_TONER_LOW = $20000;
+     PRINTER_STATUS_NO_TONER = $40000;
+     PRINTER_STATUS_PAGE_PUNT = $80000;
+     PRINTER_STATUS_USER_INTERVENTION = $100000;
+     PRINTER_STATUS_OUT_OF_MEMORY = $200000;
+     PRINTER_STATUS_DOOR_OPEN = $400000;
+     PRINTER_STATUS_SERVER_UNKNOWN = $800000;
+     PRINTER_STATUS_POWER_SAVE = $1000000;
+     PRINTER_ATTRIBUTE_QUEUED = 1;
+     PRINTER_ATTRIBUTE_DIRECT = 2;
+     PRINTER_ATTRIBUTE_DEFAULT = 4;
+     PRINTER_ATTRIBUTE_SHARED = 8;
+     PRINTER_ATTRIBUTE_NETWORK = $10;
+     PRINTER_ATTRIBUTE_HIDDEN = $20;
+     PRINTER_ATTRIBUTE_LOCAL = $40;
+     PRINTER_ATTRIBUTE_ENABLE_DEVQ = $80;
+     PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS = $100;
+     PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST = $200;
+     PRINTER_ATTRIBUTE_WORK_OFFLINE = $400;
+     PRINTER_ATTRIBUTE_ENABLE_BIDI = $800;
+     PRINTER_ATTRIBUTE_RAW_ONLY = $1000;
+     PRINTER_ATTRIBUTE_PUBLISHED = $2000;
+     PRINTER_ENUM_DEFAULT = 1;
+     PRINTER_ENUM_LOCAL = 2;
+     PRINTER_ENUM_CONNECTIONS = 4;
+     PRINTER_ENUM_FAVORITE = 4;
+     PRINTER_ENUM_NAME = 8;
+     PRINTER_ENUM_REMOTE = 16;
+     PRINTER_ENUM_SHARED = 32;
+     PRINTER_ENUM_NETWORK = $40;
+     PRINTER_ENUM_EXPAND = $4000;
+     PRINTER_ENUM_CONTAINER = $8000;
+     PRINTER_ENUM_ICONMASK = $ff0000;
+     PRINTER_ENUM_ICON1 = $10000;
+     PRINTER_ENUM_ICON2 = $20000;
+     PRINTER_ENUM_ICON3 = $40000;
+     PRINTER_ENUM_ICON4 = $80000;
+     PRINTER_ENUM_ICON5 = $100000;
+     PRINTER_ENUM_ICON6 = $200000;
+     PRINTER_ENUM_ICON7 = $400000;
+     PRINTER_ENUM_ICON8 = $800000;
+     PRINTER_NOTIFY_TYPE = 0;
+     PRINTER_NOTIFY_FIELD_SERVER_NAME = 0;
+     PRINTER_NOTIFY_FIELD_PRINTER_NAME = 1;
+     PRINTER_NOTIFY_FIELD_SHARE_NAME = 2;
+     PRINTER_NOTIFY_FIELD_PORT_NAME = 3;
+     PRINTER_NOTIFY_FIELD_DRIVER_NAME = 4;
+     PRINTER_NOTIFY_FIELD_COMMENT = 5;
+     PRINTER_NOTIFY_FIELD_LOCATION = 6;
+     PRINTER_NOTIFY_FIELD_DEVMODE = 7;
+     PRINTER_NOTIFY_FIELD_SEPFILE = 8;
+     PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR = 9;
+     PRINTER_NOTIFY_FIELD_PARAMETERS = 10;
+     PRINTER_NOTIFY_FIELD_DATATYPE = 11;
+     PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR = 12;
+     PRINTER_NOTIFY_FIELD_ATTRIBUTES = 13;
+     PRINTER_NOTIFY_FIELD_PRIORITY = 14;
+     PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY = 15;
+     PRINTER_NOTIFY_FIELD_START_TIME = 16;
+     PRINTER_NOTIFY_FIELD_UNTIL_TIME = 17;
+     PRINTER_NOTIFY_FIELD_STATUS = 18;
+     PRINTER_NOTIFY_FIELD_STATUS_STRING = 19;
+     PRINTER_NOTIFY_FIELD_CJOBS = 20;
+     PRINTER_NOTIFY_FIELD_AVERAGE_PPM = 21;
+     PRINTER_NOTIFY_FIELD_TOTAL_PAGES = 22;
+     PRINTER_NOTIFY_FIELD_PAGES_PRINTED = 23;
+     PRINTER_NOTIFY_FIELD_TOTAL_BYTES = 24;
+     PRINTER_NOTIFY_FIELD_BYTES_PRINTED = 25;
+     PRINTER_CHANGE_ADD_PRINTER = 1;
+     PRINTER_CHANGE_SET_PRINTER = 2;
+     PRINTER_CHANGE_DELETE_PRINTER = 4;
+     PRINTER_CHANGE_FAILED_CONNECTION_PRINTER = 8;
+     PRINTER_CHANGE_PRINTER = $FF;
+     PRINTER_CHANGE_ADD_JOB = $100;
+     PRINTER_CHANGE_SET_JOB = $200;
+     PRINTER_CHANGE_DELETE_JOB = $400;
+     PRINTER_CHANGE_WRITE_JOB = $800;
+     PRINTER_CHANGE_JOB = $FF00;
+     PRINTER_CHANGE_ADD_FORM = $10000;
+     PRINTER_CHANGE_SET_FORM = $20000;
+     PRINTER_CHANGE_DELETE_FORM = $40000;
+     PRINTER_CHANGE_FORM = $70000;
+     PRINTER_CHANGE_ADD_PORT = $100000;
+     PRINTER_CHANGE_CONFIGURE_PORT = $200000;
+     PRINTER_CHANGE_DELETE_PORT = $400000;
+     PRINTER_CHANGE_PORT = $700000;
+     PRINTER_CHANGE_ADD_PRINT_PROCESSOR = $1000000;
+     PRINTER_CHANGE_DELETE_PRINT_PROCESSOR = $4000000;
+     PRINTER_CHANGE_PRINT_PROCESSOR = $7000000;
+     PRINTER_CHANGE_ADD_PRINTER_DRIVER = $10000000;
+     PRINTER_CHANGE_SET_PRINTER_DRIVER = $20000000;
+     PRINTER_CHANGE_DELETE_PRINTER_DRIVER = $40000000;
+     PRINTER_CHANGE_PRINTER_DRIVER = $70000000;
+     PRINTER_CHANGE_TIMEOUT = $80000000;
+     PRINTER_CHANGE_ALL = $7777FFFF;
+     PRINTER_NOTIFY_INFO_DISCARDED = 1;
+     PRINTER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or PRINTER_ACCESS_ADMINISTER) or PRINTER_ACCESS_USE;
+     PRINTER_READ = STANDARD_RIGHTS_READ or PRINTER_ACCESS_USE;
+     PRINTER_WRITE = STANDARD_RIGHTS_WRITE or PRINTER_ACCESS_USE;
+     PRINTER_EXECUTE = STANDARD_RIGHTS_EXECUTE or PRINTER_ACCESS_USE;
+     NO_PRIORITY = 0;
+     MAX_PRIORITY = 99;
+     MIN_PRIORITY = 1;
+     DEF_PRIORITY = 1;
+     PORT_TYPE_WRITE = 1;
+     PORT_TYPE_READ = 2;
+     PORT_TYPE_REDIRECTED = 4;
+     PORT_TYPE_NET_ATTACHED = 8;
+     SERVER_ACCESS_ADMINISTER = 1;
+     SERVER_ACCESS_ENUMERATE = 2;
+     SERVER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SERVER_ACCESS_ADMINISTER) or SERVER_ACCESS_ENUMERATE;
+     SERVER_READ = STANDARD_RIGHTS_READ or SERVER_ACCESS_ENUMERATE;
+     SERVER_WRITE = (STANDARD_RIGHTS_WRITE or SERVER_ACCESS_ADMINISTER) or SERVER_ACCESS_ENUMERATE;
+     SERVER_EXECUTE = STANDARD_RIGHTS_EXECUTE or SERVER_ACCESS_ENUMERATE;
+     PORT_STATUS_TYPE_ERROR = 1;
+     PORT_STATUS_TYPE_WARNING = 2;
+     PORT_STATUS_TYPE_INFO = 3;
+     PORT_STATUS_OFFLINE = 1;
+     PORT_STATUS_PAPER_JAM = 2;
+     PORT_STATUS_PAPER_OUT = 3;
+     PORT_STATUS_OUTPUT_BIN_FULL = 4;
+     PORT_STATUS_PAPER_PROBLEM = 5;
+     PORT_STATUS_NO_TONER = 6;
+     PORT_STATUS_DOOR_OPEN = 7;
+     PORT_STATUS_USER_INTERVENTION = 8;
+     PORT_STATUS_OUT_OF_MEMORY = 9;
+     PORT_STATUS_TONER_LOW = 10;
+     PORT_STATUS_WARMING_UP = 11;
+     PORT_STATUS_POWER_SAVE = 12;
+
+  type
+
+     _ADDJOB_INFO_1A = record
+          Path : LPSTR;
+          JobId : DWORD;
+       end;
+     ADDJOB_INFO_1A = _ADDJOB_INFO_1A;
+     PADDJOB_INFO_1A = ^_ADDJOB_INFO_1A;
+     LPADDJOB_INFO_1A = ^_ADDJOB_INFO_1A;
+
+     _ADDJOB_INFO_1W = record
+          Path : LPWSTR;
+          JobId : DWORD;
+       end;
+     ADDJOB_INFO_1W = _ADDJOB_INFO_1W;
+     PADDJOB_INFO_1W = ^_ADDJOB_INFO_1W;
+     LPADDJOB_INFO_1W = ^_ADDJOB_INFO_1W;
+
+     _DATATYPES_INFO_1A = record
+          pName : LPSTR;
+       end;
+     DATATYPES_INFO_1A = _DATATYPES_INFO_1A;
+     PDATATYPES_INFO_1A = ^_DATATYPES_INFO_1A;
+     LPDATATYPES_INFO_1A = ^_DATATYPES_INFO_1A;
+
+     _DATATYPES_INFO_1W = record
+          pName : LPWSTR;
+       end;
+     DATATYPES_INFO_1W = _DATATYPES_INFO_1W;
+     PDATATYPES_INFO_1W = ^_DATATYPES_INFO_1W;
+     LPDATATYPES_INFO_1W = ^_DATATYPES_INFO_1W;
+
+     _JOB_INFO_1A = record
+          JobId : DWORD;
+          pPrinterName : LPSTR;
+          pMachineName : LPSTR;
+          pUserName : LPSTR;
+          pDocument : LPSTR;
+          pDatatype : LPSTR;
+          pStatus : LPSTR;
+          Status : DWORD;
+          Priority : DWORD;
+          Position : DWORD;
+          TotalPages : DWORD;
+          PagesPrinted : DWORD;
+          Submitted : SYSTEMTIME;
+       end;
+     JOB_INFO_1A = _JOB_INFO_1A;
+     PJOB_INFO_1A = ^_JOB_INFO_1A;
+     LPJOB_INFO_1A = ^_JOB_INFO_1A;
+
+     _JOB_INFO_1W = record
+          JobId : DWORD;
+          pPrinterName : LPWSTR;
+          pMachineName : LPWSTR;
+          pUserName : LPWSTR;
+          pDocument : LPWSTR;
+          pDatatype : LPWSTR;
+          pStatus : LPWSTR;
+          Status : DWORD;
+          Priority : DWORD;
+          Position : DWORD;
+          TotalPages : DWORD;
+          PagesPrinted : DWORD;
+          Submitted : SYSTEMTIME;
+       end;
+     JOB_INFO_1W = _JOB_INFO_1W;
+     PJOB_INFO_1W = ^_JOB_INFO_1W;
+     LPJOB_INFO_1W = ^_JOB_INFO_1W;
+
+     _JOB_INFO_2A = record
+          JobId : DWORD;
+          pPrinterName : LPSTR;
+          pMachineName : LPSTR;
+          pUserName : LPSTR;
+          pDocument : LPSTR;
+          pNotifyName : LPSTR;
+          pDatatype : LPSTR;
+          pPrintProcessor : LPSTR;
+          pParameters : LPSTR;
+          pDriverName : LPSTR;
+          pDevMode : LPDEVMODE;
+          pStatus : LPSTR;
+          pSecurityDescriptor : PSECURITY_DESCRIPTOR;
+          Status : DWORD;
+          Priority : DWORD;
+          Position : DWORD;
+          StartTime : DWORD;
+          UntilTime : DWORD;
+          TotalPages : DWORD;
+          Size : DWORD;
+          Submitted : SYSTEMTIME;
+          Time : DWORD;
+          PagesPrinted : DWORD;
+       end;
+     JOB_INFO_2A = _JOB_INFO_2A;
+     PJOB_INFO_2A = ^_JOB_INFO_2A;
+     LPJOB_INFO_2A = ^_JOB_INFO_2A;
+
+     _JOB_INFO_2W = record
+          JobId : DWORD;
+          pPrinterName : LPWSTR;
+          pMachineName : LPWSTR;
+          pUserName : LPWSTR;
+          pDocument : LPWSTR;
+          pNotifyName : LPWSTR;
+          pDatatype : LPWSTR;
+          pPrintProcessor : LPWSTR;
+          pParameters : LPWSTR;
+          pDriverName : LPWSTR;
+          pDevMode : LPDEVMODEW;
+          pStatus : LPWSTR;
+          pSecurityDescriptor : PSECURITY_DESCRIPTOR;
+          Status : DWORD;
+          Priority : DWORD;
+          Position : DWORD;
+          StartTime : DWORD;
+          UntilTime : DWORD;
+          TotalPages : DWORD;
+          Size : DWORD;
+          Submitted : SYSTEMTIME;
+          Time : DWORD;
+          PagesPrinted : DWORD;
+       end;
+     JOB_INFO_2W = _JOB_INFO_2W;
+     PJOB_INFO_2W = ^_JOB_INFO_2W;
+     LPJOB_INFO_2W = ^_JOB_INFO_2W;
+
+     _JOB_INFO_3 = record
+          JobId : DWORD;
+          NextJobId : DWORD;
+          Reserved : DWORD;
+       end;
+     JOB_INFO_3 = _JOB_INFO_3;
+     PJOB_INFO_3 = ^_JOB_INFO_3;
+     LPJOB_INFO_3 = ^_JOB_INFO_3;
+
+     _DOC_INFO_1A = record
+          pDocName : LPSTR;
+          pOutputFile : LPSTR;
+          pDatatype : LPSTR;
+       end;
+     DOC_INFO_1A = _DOC_INFO_1A;
+     PDOC_INFO_1A = ^_DOC_INFO_1A;
+     LPDOC_INFO_1A = ^_DOC_INFO_1A;
+
+     _DOC_INFO_1W = record
+          pDocName : LPWSTR;
+          pOutputFile : LPWSTR;
+          pDatatype : LPWSTR;
+       end;
+     DOC_INFO_1W = _DOC_INFO_1W;
+     PDOC_INFO_1W = ^_DOC_INFO_1W;
+     LPDOC_INFO_1W = ^_DOC_INFO_1W;
+
+     _DOC_INFO_2A = record
+          pDocName : LPSTR;
+          pOutputFile : LPSTR;
+          pDatatype : LPSTR;
+          dwMode : DWORD;
+          JobId : DWORD;
+       end;
+     DOC_INFO_2A = _DOC_INFO_2A;
+     PDOC_INFO_2A = ^_DOC_INFO_2A;
+     LPDOC_INFO_2A = ^_DOC_INFO_2A;
+
+     _DOC_INFO_2W = record
+          pDocName : LPWSTR;
+          pOutputFile : LPWSTR;
+          pDatatype : LPWSTR;
+          dwMode : DWORD;
+          JobId : DWORD;
+       end;
+     DOC_INFO_2W = _DOC_INFO_2W;
+     PDOC_INFO_2W = ^_DOC_INFO_2W;
+     LPDOC_INFO_2W = ^_DOC_INFO_2W;
+
+     _DRIVER_INFO_1A = record
+          pName : LPSTR;
+       end;
+     DRIVER_INFO_1A = _DRIVER_INFO_1A;
+     PDRIVER_INFO_1A = ^_DRIVER_INFO_1A;
+     LPDRIVER_INFO_1A = ^_DRIVER_INFO_1A;
+
+     _DRIVER_INFO_1W = record
+          pName : LPWSTR;
+       end;
+     DRIVER_INFO_1W = _DRIVER_INFO_1W;
+     PDRIVER_INFO_1W = ^_DRIVER_INFO_1W;
+     LPDRIVER_INFO_1W = ^_DRIVER_INFO_1W;
+
+     _DRIVER_INFO_2A = record
+          cVersion : DWORD;
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDriverPath : LPSTR;
+          pDataFile : LPSTR;
+          pConfigFile : LPSTR;
+       end;
+     DRIVER_INFO_2A = _DRIVER_INFO_2A;
+     PDRIVER_INFO_2A = ^_DRIVER_INFO_2A;
+     LPDRIVER_INFO_2A = ^_DRIVER_INFO_2A;
+
+     _DRIVER_INFO_2W = record
+          cVersion : DWORD;
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDriverPath : LPWSTR;
+          pDataFile : LPWSTR;
+          pConfigFile : LPWSTR;
+       end;
+     DRIVER_INFO_2W = _DRIVER_INFO_2W;
+     PDRIVER_INFO_2W = ^_DRIVER_INFO_2W;
+     LPDRIVER_INFO_2W = ^_DRIVER_INFO_2W;
+
+     _DRIVER_INFO_3A = record
+          cVersion : DWORD;
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDriverPath : LPSTR;
+          pDataFile : LPSTR;
+          pConfigFile : LPSTR;
+          pHelpFile : LPSTR;
+          pDependentFiles : LPSTR;
+          pMonitorName : LPSTR;
+          pDefaultDataType : LPSTR;
+       end;
+     DRIVER_INFO_3A = _DRIVER_INFO_3A;
+     PDRIVER_INFO_3A = ^_DRIVER_INFO_3A;
+     LPDRIVER_INFO_3A = ^_DRIVER_INFO_3A;
+
+     _DRIVER_INFO_3W = record
+          cVersion : DWORD;
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDriverPath : LPWSTR;
+          pDataFile : LPWSTR;
+          pConfigFile : LPWSTR;
+          pHelpFile : LPWSTR;
+          pDependentFiles : LPWSTR;
+          pMonitorName : LPWSTR;
+          pDefaultDataType : LPWSTR;
+       end;
+     DRIVER_INFO_3W = _DRIVER_INFO_3W;
+     PDRIVER_INFO_3W = ^_DRIVER_INFO_3W;
+     LPDRIVER_INFO_3W = ^_DRIVER_INFO_3W;
+
+     _DRIVER_INFO_4A = record
+          cVersion : DWORD;
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDriverPath : LPSTR;
+          pDataFile : LPSTR;
+          pConfigFile : LPSTR;
+          pHelpFile : LPSTR;
+          pDependentFiles : LPSTR;
+          pMonitorName : LPSTR;
+          pDefaultDataType : LPSTR;
+          pszzPreviousNames : LPSTR;
+       end;
+     DRIVER_INFO_4A = _DRIVER_INFO_4A;
+     PDRIVER_INFO_4A = ^_DRIVER_INFO_4A;
+     LPDRIVER_INFO_4A = ^_DRIVER_INFO_4A;
+
+     _DRIVER_INFO_4W = record
+          cVersion : DWORD;
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDriverPath : LPWSTR;
+          pDataFile : LPWSTR;
+          pConfigFile : LPWSTR;
+          pHelpFile : LPWSTR;
+          pDependentFiles : LPWSTR;
+          pMonitorName : LPWSTR;
+          pDefaultDataType : LPWSTR;
+          pszzPreviousNames : LPWSTR;
+       end;
+     DRIVER_INFO_4W = _DRIVER_INFO_4W;
+     PDRIVER_INFO_4W = ^_DRIVER_INFO_4W;
+     LPDRIVER_INFO_4W = ^_DRIVER_INFO_4W;
+
+     _DRIVER_INFO_5A = record
+          cVersion : DWORD;
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDriverPath : LPSTR;
+          pDataFile : LPSTR;
+          pConfigFile : LPSTR;
+          dwDriverAttributes : DWORD;
+          dwConfigVersion : DWORD;
+          dwDriverVersion : DWORD;
+       end;
+     DRIVER_INFO_5A = _DRIVER_INFO_5A;
+     PDRIVER_INFO_5A = ^_DRIVER_INFO_5A;
+     LPDRIVER_INFO_5A = ^_DRIVER_INFO_5A;
+
+     _DRIVER_INFO_5W = record
+          cVersion : DWORD;
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDriverPath : LPWSTR;
+          pDataFile : LPWSTR;
+          pConfigFile : LPWSTR;
+          dwDriverAttributes : DWORD;
+          dwConfigVersion : DWORD;
+          dwDriverVersion : DWORD;
+       end;
+     DRIVER_INFO_5W = _DRIVER_INFO_5W;
+     PDRIVER_INFO_5W = ^_DRIVER_INFO_5W;
+     LPDRIVER_INFO_5W = ^_DRIVER_INFO_5W;
+
+     _DRIVER_INFO_6A = record
+          cVersion : DWORD;
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDriverPath : LPSTR;
+          pDataFile : LPSTR;
+          pConfigFile : LPSTR;
+          pHelpFile : LPSTR;
+          pDependentFiles : LPSTR;
+          pMonitorName : LPSTR;
+          pDefaultDataType : LPSTR;
+          pszzPreviousNames : LPSTR;
+          ftDriverDate : FILETIME;
+          dwlDriverVersion : DWORDLONG;
+          pszMfgName : LPSTR;
+          pszOEMUrl : LPSTR;
+          pszHardwareID : LPSTR;
+          pszProvider : LPSTR;
+       end;
+     DRIVER_INFO_6A = _DRIVER_INFO_6A;
+     PDRIVER_INFO_6A = ^_DRIVER_INFO_6A;
+     LPDRIVER_INFO_6A = ^_DRIVER_INFO_6A;
+
+     _DRIVER_INFO_6W = record
+          cVersion : DWORD;
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDriverPath : LPWSTR;
+          pDataFile : LPWSTR;
+          pConfigFile : LPWSTR;
+          pHelpFile : LPWSTR;
+          pDependentFiles : LPWSTR;
+          pMonitorName : LPWSTR;
+          pDefaultDataType : LPWSTR;
+          pszzPreviousNames : LPWSTR;
+          ftDriverDate : FILETIME;
+          dwlDriverVersion : DWORDLONG;
+          pszMfgName : LPWSTR;
+          pszOEMUrl : LPWSTR;
+          pszHardwareID : LPWSTR;
+          pszProvider : LPWSTR;
+       end;
+     DRIVER_INFO_6W = _DRIVER_INFO_6W;
+     PDRIVER_INFO_6W = ^_DRIVER_INFO_6W;
+     LPDRIVER_INFO_6W = ^_DRIVER_INFO_6W;
+
+     _MONITOR_INFO_1A = record
+          pName : LPSTR;
+       end;
+     MONITOR_INFO_1A = _MONITOR_INFO_1A;
+     PMONITOR_INFO_1A = ^_MONITOR_INFO_1A;
+     LPMONITOR_INFO_1A = ^_MONITOR_INFO_1A;
+
+     _MONITOR_INFO_1W = record
+          pName : LPWSTR;
+       end;
+     MONITOR_INFO_1W = _MONITOR_INFO_1W;
+     PMONITOR_INFO_1W = ^_MONITOR_INFO_1W;
+     LPMONITOR_INFO_1W = ^_MONITOR_INFO_1W;
+
+     _PORT_INFO_1A = record
+          pName : LPSTR;
+       end;
+     PORT_INFO_1A = _PORT_INFO_1A;
+     PPORT_INFO_1A = ^_PORT_INFO_1A;
+     LPPORT_INFO_1A = ^_PORT_INFO_1A;
+
+     _PORT_INFO_1W = record
+          pName : LPWSTR;
+       end;
+     PORT_INFO_1W = _PORT_INFO_1W;
+     PPORT_INFO_1W = ^_PORT_INFO_1W;
+     LPPORT_INFO_1W = ^_PORT_INFO_1W;
+
+     _MONITOR_INFO_2A = record
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDLLName : LPSTR;
+       end;
+     MONITOR_INFO_2A = _MONITOR_INFO_2A;
+     PMONITOR_INFO_2A = ^_MONITOR_INFO_2A;
+     LPMONITOR_INFO_2A = ^_MONITOR_INFO_2A;
+
+     _MONITOR_INFO_2W = record
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDLLName : LPWSTR;
+       end;
+     MONITOR_INFO_2W = _MONITOR_INFO_2W;
+     PMONITOR_INFO_2W = ^_MONITOR_INFO_2W;
+     LPMONITOR_INFO_2W = ^_MONITOR_INFO_2W;
+
+     _PORT_INFO_2A = record
+          pPortName : LPSTR;
+          pMonitorName : LPSTR;
+          pDescription : LPSTR;
+          fPortType : DWORD;
+          Reserved : DWORD;
+       end;
+     PORT_INFO_2A = _PORT_INFO_2A;
+     PPORT_INFO_2A = ^_PORT_INFO_2A;
+     LPPORT_INFO_2A = ^_PORT_INFO_2A;
+
+     _PORT_INFO_2W = record
+          pPortName : LPWSTR;
+          pMonitorName : LPWSTR;
+          pDescription : LPWSTR;
+          fPortType : DWORD;
+          Reserved : DWORD;
+       end;
+     PORT_INFO_2W = _PORT_INFO_2W;
+     PPORT_INFO_2W = ^_PORT_INFO_2W;
+     LPPORT_INFO_2W = ^_PORT_INFO_2W;
+
+     _PORT_INFO_3A = record
+          dwStatus : DWORD;
+          pszStatus : LPSTR;
+          dwSeverity : DWORD;
+       end;
+     PORT_INFO_3A = _PORT_INFO_3A;
+     PPORT_INFO_3A = ^_PORT_INFO_3A;
+     LPPORT_INFO_3A = ^_PORT_INFO_3A;
+
+     _PORT_INFO_3W = record
+          dwStatus : DWORD;
+          pszStatus : LPWSTR;
+          dwSeverity : DWORD;
+       end;
+     PORT_INFO_3W = _PORT_INFO_3W;
+     PPORT_INFO_3W = ^_PORT_INFO_3W;
+     LPPORT_INFO_3W = ^_PORT_INFO_3W;
+
+     _PRINTER_ENUM_VALUESA = record
+          pValueName : LPSTR;
+          cbValueName : DWORD;
+          dwType : DWORD;
+          pData : LPBYTE;
+          cbData : DWORD;
+       end;
+     PRINTER_ENUM_VALUESA = _PRINTER_ENUM_VALUESA;
+     PPRINTER_ENUM_VALUESA = ^_PRINTER_ENUM_VALUESA;
+     LPRINTER_ENUM_VALUESA = ^_PRINTER_ENUM_VALUESA;
+
+     _PRINTER_ENUM_VALUESW = record
+          pValueName : LPWSTR;
+          cbValueName : DWORD;
+          dwType : DWORD;
+          pData : LPBYTE;
+          cbData : DWORD;
+       end;
+     PRINTER_ENUM_VALUESW = _PRINTER_ENUM_VALUESW;
+     PPRINTER_ENUM_VALUESW = ^_PRINTER_ENUM_VALUESW;
+     LPRINTER_ENUM_VALUESW = ^_PRINTER_ENUM_VALUESW;
+
+     _PRINTER_INFO_1A = record
+          Flags : DWORD;
+          pDescription : LPSTR;
+          pName : LPSTR;
+          pComment : LPSTR;
+       end;
+     PRINTER_INFO_1A = _PRINTER_INFO_1A;
+     PPRINTER_INFO_1A = ^_PRINTER_INFO_1A;
+     LPPRINTER_INFO_1A = ^_PRINTER_INFO_1A;
+
+     _PRINTER_INFO_1W = record
+          Flags : DWORD;
+          pDescription : LPWSTR;
+          pName : LPWSTR;
+          pComment : LPWSTR;
+       end;
+     PRINTER_INFO_1W = _PRINTER_INFO_1W;
+     PPRINTER_INFO_1W = ^_PRINTER_INFO_1W;
+     LPPRINTER_INFO_1W = ^_PRINTER_INFO_1W;
+
+     _PRINTER_INFO_2A = record
+          pServerName : LPSTR;
+          pPrinterName : LPSTR;
+          pShareName : LPSTR;
+          pPortName : LPSTR;
+          pDriverName : LPSTR;
+          pComment : LPSTR;
+          pLocation : LPSTR;
+          pDevMode : LPDEVMODE;
+          pSepFile : LPSTR;
+          pPrintProcessor : LPSTR;
+          pDatatype : LPSTR;
+          pParameters : LPSTR;
+          pSecurityDescriptor : PSECURITY_DESCRIPTOR;
+          Attributes : DWORD;
+          Priority : DWORD;
+          DefaultPriority : DWORD;
+          StartTime : DWORD;
+          UntilTime : DWORD;
+          Status : DWORD;
+          cJobs : DWORD;
+          AveragePPM : DWORD;
+       end;
+     PRINTER_INFO_2A = _PRINTER_INFO_2A;
+     PPRINTER_INFO_2A = ^_PRINTER_INFO_2A;
+     LPPRINTER_INFO_2A = ^_PRINTER_INFO_2A;
+
+     _PRINTER_INFO_2W = record
+          pServerName : LPWSTR;
+          pPrinterName : LPWSTR;
+          pShareName : LPWSTR;
+          pPortName : LPWSTR;
+          pDriverName : LPWSTR;
+          pComment : LPWSTR;
+          pLocation : LPWSTR;
+          pDevMode : LPDEVMODEW;
+          pSepFile : LPWSTR;
+          pPrintProcessor : LPWSTR;
+          pDatatype : LPWSTR;
+          pParameters : LPWSTR;
+          pSecurityDescriptor : PSECURITY_DESCRIPTOR;
+          Attributes : DWORD;
+          Priority : DWORD;
+          DefaultPriority : DWORD;
+          StartTime : DWORD;
+          UntilTime : DWORD;
+          Status : DWORD;
+          cJobs : DWORD;
+          AveragePPM : DWORD;
+       end;
+     PRINTER_INFO_2W = _PRINTER_INFO_2W;
+     PPRINTER_INFO_2W = ^_PRINTER_INFO_2W;
+     LPPRINTER_INFO_2W = ^_PRINTER_INFO_2W;
+
+     _PRINTER_INFO_3 = record
+          pSecurityDescriptor : PSECURITY_DESCRIPTOR;
+       end;
+     PRINTER_INFO_3 = _PRINTER_INFO_3;
+     PPRINTER_INFO_3 = ^_PRINTER_INFO_3;
+     LPPRINTER_INFO_3 = ^_PRINTER_INFO_3;
+
+     _PRINTER_INFO_4A = record
+          pPrinterName : LPSTR;
+          pServerName : LPSTR;
+          Attributes : DWORD;
+       end;
+     PRINTER_INFO_4A = _PRINTER_INFO_4A;
+     PPRINTER_INFO_4A = ^_PRINTER_INFO_4A;
+     LPPRINTER_INFO_4A = ^_PRINTER_INFO_4A;
+
+     _PRINTER_INFO_4W = record
+          pPrinterName : LPWSTR;
+          pServerName : LPWSTR;
+          Attributes : DWORD;
+       end;
+     PRINTER_INFO_4W = _PRINTER_INFO_4W;
+     PPRINTER_INFO_4W = ^_PRINTER_INFO_4W;
+     LPPRINTER_INFO_4W = ^_PRINTER_INFO_4W;
+
+     _PRINTER_INFO_5A = record
+          pPrinterName : LPSTR;
+          pPortName : LPSTR;
+          Attributes : DWORD;
+          DeviceNotSelectedTimeout : DWORD;
+          TransmissionRetryTimeout : DWORD;
+       end;
+     PRINTER_INFO_5A = _PRINTER_INFO_5A;
+     PPRINTER_INFO_5A = ^_PRINTER_INFO_5A;
+     LPPRINTER_INFO_5A = ^_PRINTER_INFO_5A;
+
+     _PRINTER_INFO_5W = record
+          pPrinterName : LPWSTR;
+          pPortName : LPWSTR;
+          Attributes : DWORD;
+          DeviceNotSelectedTimeout : DWORD;
+          TransmissionRetryTimeout : DWORD;
+       end;
+     PRINTER_INFO_5W = _PRINTER_INFO_5W;
+     PPRINTER_INFO_5W = ^_PRINTER_INFO_5W;
+     LPPRINTER_INFO_5W = ^_PRINTER_INFO_5W;
+
+     _PRINTER_INFO_6 = record
+          dwStatus : DWORD;
+       end;
+     PRINTER_INFO_6 = _PRINTER_INFO_6;
+     PPRINTER_INFO_6 = ^_PRINTER_INFO_6;
+     LPPRINTER_INFO_6 = ^_PRINTER_INFO_6;
+
+     _PRINTER_INFO_7A = record
+          pszObjectGUID : LPWSTR;
+          dwAction : DWORD;
+       end;
+     PRINTER_INFO_7A = _PRINTER_INFO_7A;
+     PPRINTER_INFO_7A = ^_PRINTER_INFO_7A;
+     LPPRINTER_INFO_7A = ^_PRINTER_INFO_7A;
+
+     _PRINTER_INFO_7W = record
+          pszObjectGUID : LPWSTR;
+          dwAction : DWORD;
+       end;
+     PRINTER_INFO_7W = _PRINTER_INFO_7W;
+     PPRINTER_INFO_7W = ^_PRINTER_INFO_7W;
+     LPPRINTER_INFO_7W = ^_PRINTER_INFO_7W;
+
+     _PRINTER_INFO_8 = record
+          pDevMode : LPDEVMODE;
+       end;
+     PRINTER_INFO_8 = _PRINTER_INFO_8;
+     PPRINTER_INFO_8 = ^_PRINTER_INFO_8;
+     LPPRINTER_INFO_8 = ^_PRINTER_INFO_8;
+
+     _PRINTER_INFO_9 = record
+          pDevMode : LPDEVMODE;
+       end;
+     PRINTER_INFO_9 = _PRINTER_INFO_9;
+     PPRINTER_INFO_9 = ^_PRINTER_INFO_9;
+     LPPRINTER_INFO_9 = ^_PRINTER_INFO_9;
+
+     _PRINTPROCESSOR_INFO_1A = record
+          pName : LPSTR;
+       end;
+     PRINTPROCESSOR_INFO_1A = _PRINTPROCESSOR_INFO_1A;
+     PPRINTPROCESSOR_INFO_1A = ^_PRINTPROCESSOR_INFO_1A;
+     LPPRINTPROCESSOR_INFO_1A = ^_PRINTPROCESSOR_INFO_1A;
+
+     _PRINTPROCESSOR_INFO_1W = record
+          pName : LPWSTR;
+       end;
+     PRINTPROCESSOR_INFO_1W = _PRINTPROCESSOR_INFO_1W;
+     PPRINTPROCESSOR_INFO_1W = ^_PRINTPROCESSOR_INFO_1W;
+     LPPRINTPROCESSOR_INFO_1W = ^_PRINTPROCESSOR_INFO_1W;
+
+     _PRINTER_NOTIFY_INFO_DATA = record
+          _Type : WORD;
+          Field : WORD;
+          Reserved : DWORD;
+          Id : DWORD;
+          NotifyData : record
+              case longint of
+                 0 : ( adwData : array[0..1] of DWORD );
+                 1 : ( Data : record
+                      cbBuf : DWORD;
+                      pBuf : PVOID;
+                   end );
+              end;
+       end;
+     PRINTER_NOTIFY_INFO_DATA = _PRINTER_NOTIFY_INFO_DATA;
+     PPRINTER_NOTIFY_INFO_DATA = ^_PRINTER_NOTIFY_INFO_DATA;
+     LPPRINTER_NOTIFY_INFO_DATA = ^_PRINTER_NOTIFY_INFO_DATA;
+
+     _PRINTER_NOTIFY_INFO = record
+          Version : DWORD;
+          Flags : DWORD;
+          Count : DWORD;
+          aData : array[0..0] of PRINTER_NOTIFY_INFO_DATA;
+       end;
+     PRINTER_NOTIFY_INFO = _PRINTER_NOTIFY_INFO;
+     PPRINTER_NOTIFY_INFO = ^_PRINTER_NOTIFY_INFO;
+     LPPRINTER_NOTIFY_INFO = ^_PRINTER_NOTIFY_INFO;
+
+     _FORM_INFO_1A = record
+          Flags : DWORD;
+          pName : LPSTR;
+          Size : SIZEL;
+          ImageableArea : RECTL;
+       end;
+     FORM_INFO_1A = _FORM_INFO_1A;
+     PFORM_INFO_1A = ^_FORM_INFO_1A;
+     LPFORM_INFO_1A = ^_FORM_INFO_1A;
+
+     _FORM_INFO_1W = record
+          Flags : DWORD;
+          pName : LPWSTR;
+          Size : SIZEL;
+          ImageableArea : RECTL;
+       end;
+     FORM_INFO_1W = _FORM_INFO_1W;
+     PFORM_INFO_1W = ^_FORM_INFO_1W;
+     LPFORM_INFO_1W = ^_FORM_INFO_1W;
+
+     _PRINTER_DEFAULTSA = record
+          pDatatype : LPSTR;
+          pDevMode : LPDEVMODE;
+          DesiredAccess : ACCESS_MASK;
+       end;
+     PRINTER_DEFAULTSA = _PRINTER_DEFAULTSA;
+     PPRINTER_DEFAULTSA = ^_PRINTER_DEFAULTSA;
+     LPPRINTER_DEFAULTSA = ^_PRINTER_DEFAULTSA;
+
+     _PRINTER_DEFAULTSW = record
+          pDatatype : LPWSTR;
+          pDevMode : LPDEVMODE;
+          DesiredAccess : ACCESS_MASK;
+       end;
+     PRINTER_DEFAULTSW = _PRINTER_DEFAULTSW;
+     PPRINTER_DEFAULTSW = ^_PRINTER_DEFAULTSW;
+     LPPRINTER_DEFAULTSW = ^_PRINTER_DEFAULTSW;
+
+     _PRINTPROCESSOR_CAPS_1 = record
+          dwLevel : DWORD;
+          dwNupOptions : DWORD;
+          dwPageOrderFlags : DWORD;
+          dwNumberOfCopies : DWORD;
+       end;
+     PRINTPROCESSOR_CAPS_1 = _PRINTPROCESSOR_CAPS_1;
+     PPRINTPROCESSOR_CAPS_1 = ^_PRINTPROCESSOR_CAPS_1;
+     LPPRINTPROCESSOR_CAPS_1 = ^_PRINTPROCESSOR_CAPS_1;
+
+     _PROVIDOR_INFO_1A = record
+          pName : LPSTR;
+          pEnvironment : LPSTR;
+          pDLLName : LPSTR;
+       end;
+     PROVIDOR_INFO_1A = _PROVIDOR_INFO_1A;
+     PPROVIDOR_INFO_1A = ^_PROVIDOR_INFO_1A;
+     LPPROVIDOR_INFO_1A = ^_PROVIDOR_INFO_1A;
+
+     _PROVIDOR_INFO_1W = record
+          pName : LPWSTR;
+          pEnvironment : LPWSTR;
+          pDLLName : LPWSTR;
+       end;
+     PROVIDOR_INFO_1W = _PROVIDOR_INFO_1W;
+     PPROVIDOR_INFO_1W = ^_PROVIDOR_INFO_1W;
+     LPPROVIDOR_INFO_1W = ^_PROVIDOR_INFO_1W;
+
+     _PROVIDOR_INFO_2A = record
+          pOrder : LPSTR;
+       end;
+     PROVIDOR_INFO_2A = _PROVIDOR_INFO_2A;
+     PPROVIDOR_INFO_2A = ^_PROVIDOR_INFO_2A;
+     LPROVIDOR_INFO_2A = ^_PROVIDOR_INFO_2A;
+
+     _PROVIDOR_INFO_2W = record
+          pOrder : LPWSTR;
+       end;
+     PROVIDOR_INFO_2W = _PROVIDOR_INFO_2W;
+     PPROVIDOR_INFO_2W = ^_PROVIDOR_INFO_2W;
+     LPROVIDOR_INFO_2W = ^_PROVIDOR_INFO_2W;
+
+  function AbortPrinter(_para1:HANDLE):BOOL;stdcall; external External_library name 'AbortPrinter';
+
+  function AddForm(_para1:HANDLE; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddFormA';
+
+  function AddFormA(_para1:HANDLE; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddFormA';
+
+  function AddFormW(_para1:HANDLE; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddFormW';
+
+  function AddJob(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD):BOOL;stdcall; external External_library name 'AddJobA';
+
+  function AddJobA(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD):BOOL;stdcall; external External_library name 'AddJobA';
+
+  function AddJobW(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD):BOOL;stdcall; external External_library name 'AddJobW';
+
+  function AddMonitor(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddMonitorA';
+
+  function AddMonitorA(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddMonitorA';
+
+  function AddMonitorW(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddMonitorW';
+
+  function AddPort(_para1:LPSTR; _para2:HWND; _para3:LPSTR):BOOL;stdcall; external External_library name 'AddPortA';
+
+  function AddPortA(_para1:LPSTR; _para2:HWND; _para3:LPSTR):BOOL;stdcall; external External_library name 'AddPortA';
+
+  function AddPortW(_para1:LPWSTR; _para2:HWND; _para3:LPWSTR):BOOL;stdcall; external External_library name 'AddPortW';
+
+  function AddPrinter(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):HANDLE;stdcall; external External_library name 'AddPrinterA';
+
+  function AddPrinterA(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):HANDLE;stdcall; external External_library name 'AddPrinterA';
+
+  function AddPrinterW(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE):HANDLE;stdcall; external External_library name 'AddPrinterW';
+
+  function AddPrinterConnection(_para1:LPSTR):BOOL;stdcall; external External_library name 'AddPrinterConnectionA';
+
+  function AddPrinterConnectionA(_para1:LPSTR):BOOL;stdcall; external External_library name 'AddPrinterConnectionA';
+
+  function AddPrinterConnectionW(_para1:LPWSTR):BOOL;stdcall; external External_library name 'AddPrinterConnectionW';
+
+  function AddPrinterDriver(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddPrinterDriverA';
+
+  function AddPrinterDriverA(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddPrinterDriverA';
+
+  function AddPrinterDriverW(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddPrinterDriverW';
+
+  function AddPrintProcessor(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR; _para4:LPSTR):BOOL;stdcall; external External_library name 'AddPrintProcessorA';
+
+  function AddPrintProcessorA(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR; _para4:LPSTR):BOOL;stdcall; external External_library name 'AddPrintProcessorA';
+
+  function AddPrintProcessorW(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR; _para4:LPWSTR):BOOL;stdcall; external External_library name 'AddPrintProcessorW';
+
+  function AddPrintProvidor(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddPrintProvidorA';
+
+  function AddPrintProvidorA(_para1:LPSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddPrintProvidorA';
+
+  function AddPrintProvidorW(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE):BOOL;stdcall; external External_library name 'AddPrintProvidorW';
+
+  function AdvancedDocumentProperties(_para1:HWND; _para2:HANDLE; _para3:LPSTR; _para4:PDEVMODE; _para5:PDEVMODE):LONG;stdcall; external External_library name 'AdvancedDocumentPropertiesA';
+
+  function AdvancedDocumentPropertiesA(_para1:HWND; _para2:HANDLE; _para3:LPSTR; _para4:PDEVMODE; _para5:PDEVMODE):LONG;stdcall; external External_library name 'AdvancedDocumentPropertiesA';
+
+  function AdvancedDocumentProperties(_para1:HWND; _para2:HANDLE; _para3:LPWSTR; _para4:PDEVMODE; _para5:PDEVMODEW):LONG;stdcall; external External_library name 'AdvancedDocumentPropertiesW';
+
+  function AdvancedDocumentPropertiesW(_para1:HWND; _para2:HANDLE; _para3:LPWSTR; _para4:PDEVMODE; _para5:PDEVMODEW):LONG;stdcall; external External_library name 'AdvancedDocumentPropertiesW';
+
+  function ClosePrinter(_para1:HANDLE):BOOL;stdcall; external External_library name 'ClosePrinter';
+
+  function ConfigurePort(_para1:LPSTR; _para2:HWND; _para3:LPSTR):BOOL;stdcall; external External_library name 'ConfigurePortA';
+
+  function ConfigurePort(_para1:LPWSTR; _para2:HWND; _para3:LPWSTR):BOOL;stdcall; external External_library name 'ConfigurePortW';
+
+  function ConfigurePortA(_para1:LPSTR; _para2:HWND; _para3:LPSTR):BOOL;stdcall; external External_library name 'ConfigurePortA';
+
+  function ConfigurePortW(_para1:LPWSTR; _para2:HWND; _para3:LPWSTR):BOOL;stdcall; external External_library name 'ConfigurePortW';
+
+  function ConnectToPrinterDlg(_para1:HWND; _para2:DWORD):HANDLE;stdcall; external External_library name 'ConnectToPrinterDlg';
+
+  function DeleteForm(_para1:HANDLE; _para2:LPSTR):BOOL;stdcall; external External_library name 'DeleteFormA';
+
+  function DeleteForm(_para1:HANDLE; _para2:LPWSTR):BOOL;stdcall; external External_library name 'DeleteFormW';
+
+  function DeleteFormA(_para1:HANDLE; _para2:LPSTR):BOOL;stdcall; external External_library name 'DeleteFormA';
+
+  function DeleteFormW(_para1:HANDLE; _para2:LPWSTR):BOOL;stdcall; external External_library name 'DeleteFormW';
+
+  function DeleteMonitor(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeleteMonitorA';
+
+  function DeleteMonitor(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeleteMonitorW';
+
+  function DeleteMonitorA(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeleteMonitorA';
+
+  function DeleteMonitorW(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeleteMonitorW';
+
+  function DeletePort(_para1:LPSTR; _para2:HWND; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePortA';
+
+  function DeletePort(_para1:LPWSTR; _para2:HWND; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePortW';
+
+  function DeletePortA(_para1:LPSTR; _para2:HWND; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePortA';
+
+  function DeletePortW(_para1:LPWSTR; _para2:HWND; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePortW';
+
+  function DeletePrinter(_para1:HANDLE):BOOL;stdcall; external External_library name 'DeletePrinter';
+
+  function DeletePrinterConnection(_para1:LPSTR):BOOL;stdcall; external External_library name 'DeletePrinterConnectionA';
+
+  function DeletePrinterConnection(_para1:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrinterConnectionW';
+
+  function DeletePrinterConnectionA(_para1:LPSTR):BOOL;stdcall; external External_library name 'DeletePrinterConnectionA';
+
+  function DeletePrinterConnectionW(_para1:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrinterConnectionW';
+
+  function DeletePrinterData(_para1:HANDLE; _para2:LPSTR):DWORD;stdcall; external External_library name 'DeletePrinterDataA';
+
+  function DeletePrinterData(_para1:HANDLE; _para2:LPWSTR):DWORD;stdcall; external External_library name 'DeletePrinterDataW';
+
+  function DeletePrinterDataA(_para1:HANDLE; _para2:LPSTR):DWORD;stdcall; external External_library name 'DeletePrinterDataA';
+
+  function DeletePrinterDataW(_para1:HANDLE; _para2:LPWSTR):DWORD;stdcall; external External_library name 'DeletePrinterDataW';
+
+  function DeletePrinterDriver(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePrinterDriverA';
+
+  function DeletePrinterDriver(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrinterDriverW';
+
+  function DeletePrinterDriverA(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePrinterDriverA';
+
+  function DeletePrinterDriverW(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrinterDriverW';
+
+  function DeletePrintProcessor(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePrintProcessorA';
+
+  function DeletePrintProcessor(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrintProcessorW';
+
+  function DeletePrintProcessorA(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePrintProcessorA';
+
+  function DeletePrintProcessorW(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrintProcessorW';
+
+  function DeletePrintProvidor(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePrintProvidorA';
+
+  function DeletePrintProvidor(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrintProvidorW';
+
+  function DeletePrintProvidorA(_para1:LPSTR; _para2:LPSTR; _para3:LPSTR):BOOL;stdcall; external External_library name 'DeletePrintProvidorA';
+
+  function DeletePrintProvidorW(_para1:LPWSTR; _para2:LPWSTR; _para3:LPWSTR):BOOL;stdcall; external External_library name 'DeletePrintProvidorW';
+
+  function DocumentProperties(_para1:HWND; _para2:HANDLE; _para3:LPSTR; _para4:PDEVMODE; _para5:PDEVMODE;
+             _para6:DWORD):LONG;stdcall; external External_library name 'DocumentPropertiesA';
+
+  function DocumentProperties(_para1:HWND; _para2:HANDLE; _para3:LPWSTR; _para4:PDEVMODEW; _para5:PDEVMODEW;
+             _para6:DWORD):LONG;stdcall; external External_library name 'DocumentPropertiesW';
+
+  function DocumentPropertiesA(_para1:HWND; _para2:HANDLE; _para3:LPSTR; _para4:PDEVMODE; _para5:PDEVMODE;
+             _para6:DWORD):LONG;stdcall; external External_library name 'DocumentPropertiesA';
+
+  function DocumentPropertiesW(_para1:HWND; _para2:HANDLE; _para3:LPWSTR; _para4:PDEVMODEW; _para5:PDEVMODEW;
+             _para6:DWORD):LONG;stdcall; external External_library name 'DocumentPropertiesW';
+
+  function EndDocPrinter(_para1:HANDLE):BOOL;stdcall; external External_library name 'EndDocPrinter';
+
+  function EndPagePrinter(_para1:HANDLE):BOOL;stdcall; external External_library name 'EndPagePrinter';
+
+  function EnumForms(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumFormsA';
+
+  function EnumFormsA(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumFormsA';
+
+  function EnumFormsW(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumFormsW';
+
+  function EnumJobs(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:DWORD; _para5:PBYTE;
+             _para6:DWORD; _para7:PDWORD; _para8:PDWORD):BOOL;stdcall; external External_library name 'EnumJobsA';
+
+  function EnumJobsA(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:DWORD; _para5:PBYTE;
+             _para6:DWORD; _para7:PDWORD; _para8:PDWORD):BOOL;stdcall; external External_library name 'EnumJobsA';
+
+  function EnumJobsW(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:DWORD; _para5:PBYTE;
+             _para6:DWORD; _para7:PDWORD; _para8:PDWORD):BOOL;stdcall; external External_library name 'EnumJobsW';
+
+  function EnumMonitors(_para1:LPSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumMonitorsA';
+
+  function EnumMonitors(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumMonitorsW';
+
+  function EnumMonitorsA(_para1:LPSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumMonitorsA';
+
+  function EnumMonitorsW(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumMonitorsW';
+
+  function EnumPorts(_para1:LPSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumPortsA';
+
+  function EnumPortsA(_para1:LPSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumPortsA';
+
+  function EnumPortsW(_para1:LPWSTR; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'EnumPortsW';
+
+  function EnumPrinterData(_para1:HANDLE; _para2:DWORD; _para3:LPSTR; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD; _para7:PBYTE; _para8:DWORD; _para9:PDWORD):DWORD;stdcall; external External_library name 'EnumPrinterDataA';
+
+  function EnumPrinterDataA(_para1:HANDLE; _para2:DWORD; _para3:LPSTR; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD; _para7:PBYTE; _para8:DWORD; _para9:PDWORD):DWORD;stdcall; external External_library name 'EnumPrinterDataA';
+
+  function EnumPrinterDataW(_para1:HANDLE; _para2:DWORD; _para3:LPWSTR; _para4:DWORD; _para5:PDWORD;
+             _para6:PDWORD; _para7:PBYTE; _para8:DWORD; _para9:PDWORD):DWORD;stdcall; external External_library name 'EnumPrinterDataW';
+
+  function EnumPrinterDrivers(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrinterDriversA';
+
+  function EnumPrinterDrivers(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrinterDriversW';
+
+  function EnumPrinterDriversA(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrinterDriversA';
+
+  function EnumPrinterDriversW(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrinterDriversW';
+
+  function EnumPrinters(_para1:DWORD; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintersA';
+
+  function EnumPrinters(_para1:DWORD; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintersW';
+
+  function EnumPrintersA(_para1:DWORD; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintersA';
+
+  function EnumPrintersW(_para1:DWORD; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintersW';
+
+  function EnumPrintProcessorDatatypes(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorDatatypesA';
+
+  function EnumPrintProcessorDatatypes(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorDatatypesW';
+
+  function EnumPrintProcessorDatatypesA(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorDatatypesA';
+
+  function EnumPrintProcessorDatatypesW(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorDatatypesW';
+
+  function EnumPrintProcessorsA(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorsA';
+
+  function EnumPrintProcessorsW(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorsW';
+
+  function EnumPrintProcessors(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorsA';
+
+  function EnumPrintProcessors(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD; _para7:PDWORD):BOOL;stdcall; external External_library name 'EnumPrintProcessorsW';
+
+  function FindClosePrinterChangeNotification(_para1:HANDLE):BOOL;stdcall; external External_library name 'FindClosePrinterChangeNotification';
+
+  function FindFirstPrinterChangeNotification(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PVOID):HANDLE;stdcall; external External_library name 'FindFirstPrinterChangeNotification';
+
+  function FindNextPrinterChangeNotification(_para1:HANDLE; _para2:PDWORD; _para3:PVOID; _para4:PPVOID):HANDLE;stdcall; external External_library name 'FindNextPrinterChangeNotification';
+
+  function FreePrinterNotifyInfo(_para1:PPRINTER_NOTIFY_INFO):BOOL;stdcall; external External_library name 'FreePrinterNotifyInfo';
+
+  function GetDefaultPrinter(_para1:LPSTR; _para2:LPDWORD):BOOL;stdcall; external External_library name 'GetDefaultPrinterA';
+
+  function GetDefaultPrinter(_para1:LPWSTR; _para2:LPDWORD):BOOL;stdcall; external External_library name 'GetDefaultPrinterW';
+
+  function GetDefaultPrinterA(_para1:LPSTR; _para2:LPDWORD):BOOL;stdcall; external External_library name 'GetDefaultPrinterA';
+
+  function GetDefaultPrinterW(_para1:LPWSTR; _para2:LPDWORD):BOOL;stdcall; external External_library name 'GetDefaultPrinterW';
+
+  function GetForm(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetFormA';
+
+  function GetForm(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetFormW';
+
+  function GetFormA(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetFormA';
+
+  function GetFormW(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetFormW';
+
+  function GetJob(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetJobA';
+
+  function GetJobA(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetJobA';
+
+  function GetJobW(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):BOOL;stdcall; external External_library name 'GetJobW';
+
+  function GetPrinter(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD):BOOL;stdcall; external External_library name 'GetPrinterA';
+
+  function GetPrinterA(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD):BOOL;stdcall; external External_library name 'GetPrinterA';
+
+  function GetPrinterW(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD; _para5:PDWORD):BOOL;stdcall; external External_library name 'GetPrinterW';
+
+  function GetPrinterData(_para1:HANDLE; _para2:LPSTR; _para3:PDWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDataA';
+
+  function GetPrinterData(_para1:HANDLE; _para2:LPWSTR; _para3:PDWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDataW';
+
+  function GetPrinterDataA(_para1:HANDLE; _para2:LPSTR; _para3:PDWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDataA';
+
+  function GetPrinterDataW(_para1:HANDLE; _para2:LPWSTR; _para3:PDWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDataW';
+
+  function GetPrinterDriver(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverA';
+
+  function GetPrinterDriver(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverW';
+
+  function GetPrinterDriverA(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverA';
+
+  function GetPrinterDriverW(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverW';
+
+  function GetPrinterDriverDirectory(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverDirectoryA';
+
+  function GetPrinterDriverDirectory(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverDirectoryW';
+
+  function GetPrinterDriverDirectoryA(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverDirectoryA';
+
+  function GetPrinterDriverDirectoryW(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrinterDriverDirectoryW';
+
+  function GetPrintProcessorDirectory(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrintProcessorDirectoryA';
+
+  function GetPrintProcessorDirectory(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrintProcessorDirectoryW';
+
+  function GetPrintProcessorDirectoryA(_para1:LPSTR; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrintProcessorDirectoryA';
+
+  function GetPrintProcessorDirectoryW(_para1:LPWSTR; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD;
+             _para6:PDWORD):DWORD;stdcall; external External_library name 'GetPrintProcessorDirectoryW';
+
+  function OpenPrinter(_para1:LPSTR; _para2:PHANDLE; _para3:LPPRINTER_DEFAULTSA):BOOL;stdcall; external External_library name 'OpenPrinterA';
+
+  function OpenPrinter(_para1:LPWSTR; _para2:PHANDLE; _para3:LPPRINTER_DEFAULTSW):BOOL;stdcall; external External_library name 'OpenPrinterW';
+
+  function OpenPrinterA(_para1:LPSTR; _para2:PHANDLE; _para3:LPPRINTER_DEFAULTSA):BOOL;stdcall; external External_library name 'OpenPrinterA';
+
+  function OpenPrinterW(_para1:LPWSTR; _para2:PHANDLE; _para3:LPPRINTER_DEFAULTSW):BOOL;stdcall; external External_library name 'OpenPrinterW';
+
+  function PrinterMessageBox(_para1:HANDLE; _para2:DWORD; _para3:HWND; _para4:LPSTR; _para5:LPSTR;
+             _para6:DWORD):DWORD;stdcall; external External_library name 'PrinterMessageBoxA';
+
+  function PrinterMessageBox(_para1:HANDLE; _para2:DWORD; _para3:HWND; _para4:LPWSTR; _para5:LPWSTR;
+             _para6:DWORD):DWORD;stdcall; external External_library name 'PrinterMessageBoxW';
+
+  function PrinterMessageBoxA(_para1:HANDLE; _para2:DWORD; _para3:HWND; _para4:LPSTR; _para5:LPSTR;
+             _para6:DWORD):DWORD;stdcall; external External_library name 'PrinterMessageBoxA';
+
+  function PrinterMessageBoxW(_para1:HANDLE; _para2:DWORD; _para3:HWND; _para4:LPWSTR; _para5:LPWSTR;
+             _para6:DWORD):DWORD;stdcall; external External_library name 'PrinterMessageBoxW';
+
+  function PrinterProperties(_para1:HWND; _para2:HANDLE):BOOL;stdcall; external External_library name 'PrinterProperties';
+
+  function ReadPrinter(_para1:HANDLE; _para2:PVOID; _para3:DWORD; _para4:PDWORD):BOOL;stdcall; external External_library name 'ReadPrinter';
+
+  function ResetPrinter(_para1:HANDLE; _para2:LPPRINTER_DEFAULTSA):BOOL;stdcall; external External_library name 'ResetPrinterA';
+
+  function ResetPrinter(_para1:HANDLE; _para2:LPPRINTER_DEFAULTSW):BOOL;stdcall; external External_library name 'ResetPrinterW';
+
+  function ResetPrinterA(_para1:HANDLE; _para2:LPPRINTER_DEFAULTSA):BOOL;stdcall; external External_library name 'ResetPrinterA';
+
+  function ResetPrinterW(_para1:HANDLE; _para2:LPPRINTER_DEFAULTSW):BOOL;stdcall; external External_library name 'ResetPrinterW';
+
+  function ScheduleJob(_para1:HANDLE; _para2:DWORD):BOOL;stdcall; external External_library name 'ScheduleJob';
+
+  function SetForm(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE):BOOL;stdcall; external External_library name 'SetFormA';
+
+  function SetForm(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE):BOOL;stdcall; external External_library name 'SetFormW';
+
+  function SetFormA(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE):BOOL;stdcall; external External_library name 'SetFormA';
+
+  function SetFormW(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE):BOOL;stdcall; external External_library name 'SetFormW';
+
+  function SetJob(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PBYTE; _para5:DWORD):BOOL;stdcall; external External_library name 'SetJobA';
+
+  function SetJobA(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PBYTE; _para5:DWORD):BOOL;stdcall; external External_library name 'SetJobA';
+
+  function SetJobW(_para1:HANDLE; _para2:DWORD; _para3:DWORD; _para4:PBYTE; _para5:DWORD):BOOL;stdcall; external External_library name 'SetJobW';
+
+  function SetPrinter(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD):BOOL;stdcall; external External_library name 'SetPrinterA';
+
+  function SetPrinterA(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD):BOOL;stdcall; external External_library name 'SetPrinterA';
+
+  function SetPrinterW(_para1:HANDLE; _para2:DWORD; _para3:PBYTE; _para4:DWORD):BOOL;stdcall; external External_library name 'SetPrinterW';
+
+  function SetPrinterData(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD):BOOL;stdcall; external External_library name 'SetPrinterDataA';
+
+  function SetPrinterDataA(_para1:HANDLE; _para2:LPSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD):BOOL;stdcall; external External_library name 'SetPrinterDataA';
+
+  function SetPrinterDataW(_para1:HANDLE; _para2:LPWSTR; _para3:DWORD; _para4:PBYTE; _para5:DWORD):BOOL;stdcall; external External_library name 'SetPrinterDataW';
+
+  function StartDocPrinter(_para1:HANDLE; _para2:DWORD; _para3:PBYTE):DWORD;stdcall; external External_library name 'StartDocPrinterA';
+
+  function StartDocPrinterA(_para1:HANDLE; _para2:DWORD; _para3:PBYTE):DWORD;stdcall; external External_library name 'StartDocPrinterA';
+
+  function StartDocPrinterW(_para1:HANDLE; _para2:DWORD; _para3:PBYTE):DWORD;stdcall; external External_library name 'StartDocPrinterW';
+
+  function StartPagePrinter(_para1:HANDLE):BOOL;stdcall; external External_library name 'StartPagePrinter';
+
+  function WaitForPrinterChange(_para1:HANDLE; _para2:DWORD):DWORD;stdcall; external External_library name 'WaitForPrinterChange';
+
+  function WritePrinter(_para1:HANDLE; _para2:PVOID; _para3:DWORD; _para4:PDWORD):BOOL;stdcall; external External_library name 'WritePrinter';
+
+
+  type
+     JOB_INFO_1 = JOB_INFO_1A;
+     PJOB_INFO_1 = ^JOB_INFO_1;
+     LPJOB_INFO_1 = ^JOB_INFO_1;
+
+     JOB_INFO_2 = JOB_INFO_2A;
+     PJOB_INFO_2 = ^JOB_INFO_2;
+     LPJOB_INFO_2 = ^JOB_INFO_2;
+
+     ADDJOB_INFO_1 = ADDJOB_INFO_1A;
+     PADDJOB_INFO_1 = ^ADDJOB_INFO_1;
+     LPADDJOB_INFO_1 = ^ADDJOB_INFO_1;
+
+     DATATYPES_INFO_1 = DATATYPES_INFO_1A;
+     PDATATYPES_INFO_1 = ^DATATYPES_INFO_1;
+     LPDATATYPES_INFO_1 = ^DATATYPES_INFO_1;
+
+     MONITOR_INFO_1 = MONITOR_INFO_1A;
+     PMONITOR_INFO_1 = ^MONITOR_INFO_1;
+     LPMONITOR_INFO_1 = ^MONITOR_INFO_1;
+
+     MONITOR_INFO_2 = MONITOR_INFO_2A;
+     PMONITOR_INFO_2 = ^MONITOR_INFO_2;
+     LPMONITOR_INFO_2 = ^MONITOR_INFO_2;
+
+     DOC_INFO_1 = DOC_INFO_1A;
+     PDOC_INFO_1 = ^DOC_INFO_1;
+     LPDOC_INFO_1 = ^DOC_INFO_1;
+
+     DOC_INFO_2 = DOC_INFO_2A;
+     PDOC_INFO_2 = ^DOC_INFO_2;
+     LPDOC_INFO_2 = ^DOC_INFO_2;
+
+     PORT_INFO_1 = PORT_INFO_1A;
+     PPORT_INFO_1 = ^PORT_INFO_1;
+     LPPORT_INFO_1 = ^PORT_INFO_1;
+
+     PORT_INFO_2 = PORT_INFO_2A;
+     PPORT_INFO_2 = ^PORT_INFO_2;
+     LPPORT_INFO_2 = ^PORT_INFO_2;
+
+     PORT_INFO_3 = PORT_INFO_3A;
+     PPORT_INFO_3 = ^PORT_INFO_3;
+     LPPORT_INFO_3 = ^PORT_INFO_3;
+
+     DRIVER_INFO_1 = DRIVER_INFO_1A;
+     PDRIVER_INFO_1 = ^DRIVER_INFO_1;
+     LPDRIVER_INFO_1 = ^DRIVER_INFO_1;
+
+     DRIVER_INFO_2 = DRIVER_INFO_2A;
+     PDRIVER_INFO_2 = ^DRIVER_INFO_2;
+     LPDRIVER_INFO_2 = ^DRIVER_INFO_2;
+
+     DRIVER_INFO_3 = DRIVER_INFO_3A;
+     PDRIVER_INFO_3 = ^DRIVER_INFO_3;
+     LPDRIVER_INFO_3 = ^DRIVER_INFO_3;
+
+     DRIVER_INFO_4 = DRIVER_INFO_4A;
+     PDRIVER_INFO_4 = ^DRIVER_INFO_4;
+     LPDRIVER_INFO_4 = ^DRIVER_INFO_4;
+
+     DRIVER_INFO_5 = DRIVER_INFO_5A;
+     PDRIVER_INFO_5 = ^DRIVER_INFO_5;
+     LPDRIVER_INFO_5 = ^DRIVER_INFO_5;
+
+     DRIVER_INFO_6 = DRIVER_INFO_6A;
+     PDRIVER_INFO_6 = ^DRIVER_INFO_6;
+     LPDRIVER_INFO_6 = ^DRIVER_INFO_6;
+
+     PRINTER_ENUM_VALUES = PRINTER_ENUM_VALUESA;
+     PPRINTER_ENUM_VALUES = ^PRINTER_ENUM_VALUES;
+     LPRINTER_ENUM_VALUES = ^PRINTER_ENUM_VALUES;
+
+     PRINTER_INFO_1 = PRINTER_INFO_1A;
+     PPRINTER_INFO_1 = ^PRINTER_INFO_1;
+     LPPRINTER_INFO_1 = ^PRINTER_INFO_1;
+
+     PRINTER_INFO_2 = PRINTER_INFO_2A;
+     PPRINTER_INFO_2 = ^PRINTER_INFO_2;
+     LPPRINTER_INFO_2 = ^PRINTER_INFO_2;
+
+     PRINTER_INFO_4 = PRINTER_INFO_4A;
+     PPRINTER_INFO_4 = ^PRINTER_INFO_4;
+     LPPRINTER_INFO_4 = ^PRINTER_INFO_4;
+
+     PRINTER_INFO_5 = PRINTER_INFO_5A;
+     PPRINTER_INFO_5 = ^PRINTER_INFO_5;
+     LPPRINTER_INFO_5 = ^PRINTER_INFO_5;
+
+     PRINTER_INFO_7 = PRINTER_INFO_7A;
+     PPRINTER_INFO_7 = ^PRINTER_INFO_7;
+     LPPRINTER_INFO_7 = ^PRINTER_INFO_7;
+
+     PRINTPROCESSOR_INFO_1 = PRINTPROCESSOR_INFO_1A;
+     PPRINTPROCESSOR_INFO_1 = ^PRINTPROCESSOR_INFO_1;
+     LPPRINTPROCESSOR_INFO_1 = ^PRINTPROCESSOR_INFO_1;
+
+     FORM_INFO_1 = FORM_INFO_1A;
+     PFORM_INFO_1 = ^FORM_INFO_1;
+     LPFORM_INFO_1 = ^FORM_INFO_1;
+
+     PRINTER_DEFAULTS = PRINTER_DEFAULTSA;
+     PPRINTER_DEFAULTS = ^PRINTER_DEFAULTS;
+     LPPRINTER_DEFAULTS = ^PRINTER_DEFAULTS;
+
+     PROVIDOR_INFO_1 = PROVIDOR_INFO_1A;
+     PPROVIDOR_INFO_1 = ^PROVIDOR_INFO_1;
+     LPROVIDOR_INFO_1 = ^PROVIDOR_INFO_1;
+
+     PROVIDOR_INFO_2 = PROVIDOR_INFO_2A;
+     PPROVIDOR_INFO_2 = ^PROVIDOR_INFO_2;
+     LPROVIDOR_INFO_2 = ^PROVIDOR_INFO_2;
+
+implementation
+
+
+end.

+ 1 - 1
packages/winunits-jedi/src/jwawingdi.pas

@@ -7789,7 +7789,7 @@ implementation
 const
 const
   gdi32 = 'gdi32.dll';
   gdi32 = 'gdi32.dll';
   msimg32 = 'msimg32.dll';
   msimg32 = 'msimg32.dll';
-  winspool32 = 'winspool32.drv';
+  winspool32 = 'winspool.drv';
   opengl32 = 'opengl32.dll';
   opengl32 = 'opengl32.dll';
   {$IFDEF UNICODE}
   {$IFDEF UNICODE}
   AWSuffix = 'W';
   AWSuffix = 'W';

+ 3 - 3
rtl/win/wininc/ascfun.inc

@@ -163,10 +163,10 @@ function SetDefaultCommConfigA(lpszName:LPCSTR; lpCC:LPCOMMCONFIG; dwSize:DWORD)
 function GetComputerNameA(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameA';
 function GetComputerNameA(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameA';
 function SetComputerNameA(lpComputerName:LPCSTR):WINBOOL; external 'kernel32' name 'SetComputerNameA';
 function SetComputerNameA(lpComputerName:LPCSTR):WINBOOL; external 'kernel32' name 'SetComputerNameA';
 function GetUserNameA(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameA';
 function GetUserNameA(lpBuffer:LPSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameA';
-function wvsprintfA(_para1:LPSTR; _para2:LPCSTR; arglist:va_list):longint; external 'user32' name 'wvsprintfA';
+function wvsprintfA(_para1:LPSTR; _para2:LPCSTR; arglist:va_list):longint; cdecl; external 'user32' name 'wvsprintfA';
 function wsprintfA(_para1:LPSTR; _para2:LPCSTR; const args:array of const):longint; cdecl; external 'user32' name 'wsprintfA';
 function wsprintfA(_para1:LPSTR; _para2:LPCSTR; const args:array of const):longint; cdecl; external 'user32' name 'wsprintfA';
-function wsprintfA(_para1:LPSTR; _para2:LPCSTR):longint; external 'user32' name 'wsprintfA';
-function wsprintf(_para1:LPSTR; _para2:LPCSTR; const args:array of const):longint; external 'user32' name 'wsprintfA';
+function wsprintfA(_para1:LPSTR; _para2:LPCSTR):longint; cdecl; external 'user32' name 'wsprintfA';
+function wsprintf(_para1:LPSTR; _para2:LPCSTR; const args:array of const):longint; cdecl; external 'user32' name 'wsprintfA';
 function wsprintf(_para1:LPSTR; _para2:LPCSTR):longint; cdecl; external 'user32' name 'wsprintfA';
 function wsprintf(_para1:LPSTR; _para2:LPCSTR):longint; cdecl; external 'user32' name 'wsprintfA';
 function LoadKeyboardLayoutA(pwszKLID:LPCSTR; Flags:UINT):HKL; external 'user32' name 'LoadKeyboardLayoutA';
 function LoadKeyboardLayoutA(pwszKLID:LPCSTR; Flags:UINT):HKL; external 'user32' name 'LoadKeyboardLayoutA';
 function GetKeyboardLayoutNameA(pwszKLID:LPSTR):WINBOOL; external 'user32' name 'GetKeyboardLayoutNameA';
 function GetKeyboardLayoutNameA(pwszKLID:LPSTR):WINBOOL; external 'user32' name 'GetKeyboardLayoutNameA';

+ 36 - 46
rtl/win/wininc/base.inc

@@ -370,19 +370,19 @@
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function GetBValue(rgb : longint) : BYTE;
+  function GetBValue(rgb : longint) : BYTE; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function GetGValue(rgb : longint) : BYTE;
+  function GetGValue(rgb : longint) : BYTE; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function GetRValue(rgb : longint) : BYTE;
+  function GetRValue(rgb : longint) : BYTE; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function RGB(r,g,b : longint) : DWORD;
+  function RGB(r,g,b : longint) : DWORD; inline;
 
 
   {  Not convertable by H2PAS
   {  Not convertable by H2PAS
   #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
   #define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \
@@ -391,117 +391,117 @@
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function HIBYTE(w : longint) : BYTE;
+  function HIBYTE(w : longint) : BYTE; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function HIWORD(l : longint) : WORD;
+  function HIWORD(l : longint) : WORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function LOBYTE(w : longint) : BYTE;
+  function LOBYTE(w : longint) : BYTE; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function LOWORD(l : longint) : WORD;
+  function LOWORD(l : longint) : WORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKELONG(a,b : longint) : LONG;
+  function MAKELONG(a,b : longint) : LONG; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKEWORD(a,b : longint) : WORD;
+  function MAKEWORD(a,b : longint) : WORD; inline;
 
 
   { original Cygnus headers also had the following defined:  }
   { original Cygnus headers also had the following defined:  }
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function SEXT_HIWORD(l : longint) : longint;
+  function SEXT_HIWORD(l : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function ZEXT_HIWORD(l : longint) : longint;
+  function ZEXT_HIWORD(l : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function SEXT_LOWORD(l : longint) : longint;
+  function SEXT_LOWORD(l : longint) : longint; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function INDEXTOOVERLAYMASK(i : longint) : longint;
+  function INDEXTOOVERLAYMASK(i : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function INDEXTOSTATEIMAGEMASK(i : longint) : longint;
+  function INDEXTOSTATEIMAGEMASK(i : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKEINTATOM(i : longint) : LPTSTR;
+  function MAKEINTATOM(i : longint) : LPTSTR; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function MAKELANGID(p,s : longint) : longint;
+  function MAKELANGID(p,s : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function PRIMARYLANGID(lgid : longint) : WORD;
+  function PRIMARYLANGID(lgid : longint) : WORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function SUBLANGID(lgid : longint) : longint;
+  function SUBLANGID(lgid : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function LANGIDFROMLCID(lcid : longint) : WORD;
+  function LANGIDFROMLCID(lcid : longint) : WORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function SORTIDFROMLCID(lcid : longint) : WORD;
+  function SORTIDFROMLCID(lcid : longint) : WORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKELCID(lgid,srtid : longint) : DWORD;
+  function MAKELCID(lgid,srtid : longint) : DWORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKELPARAM(l,h : longint) : LPARAM;
+  function MAKELPARAM(l,h : longint) : LPARAM; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKELRESULT(l,h : longint) : LRESULT;
+  function MAKELRESULT(l,h : longint) : LRESULT; inline;
 
 
   {  Not convertable by H2PAS
   {  Not convertable by H2PAS
   #define MAKEPOINTS(l)   ( ((POINTS FAR  ) & (l)))
   #define MAKEPOINTS(l)   ( ((POINTS FAR  ) & (l)))
    }
    }
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKEROP4(fore,back : longint) : DWORD;
+  function MAKEROP4(fore,back : longint) : DWORD; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKEWPARAM(l,h : longint) : WPARAM;
+  function MAKEWPARAM(l,h : longint) : WPARAM; inline;
 
 
-  function GET_X_LPARAM(lp : Windows.LParam) : longint;
+  function GET_X_LPARAM(lp : Windows.LParam) : longint; inline;
 
 
-  function GET_Y_LPARAM(lp : Windows.LParam) : longint;
+  function GET_Y_LPARAM(lp : Windows.LParam) : longint; inline;
 
 
   {$ifndef max}
   {$ifndef max}
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function max(a,b : longint) : longint;
+  function max(a,b : longint) : longint;  inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
 {$endif}
 {$endif}
@@ -509,18 +509,18 @@
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function min(a,b : longint) : longint;
+  function min(a,b : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
 {$endif}
 {$endif}
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function PALETTEINDEX(i : longint) : COLORREF;
+  function PALETTEINDEX(i : longint) : COLORREF; inline;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
-  function PALETTERGB(r,g,b : longint) : longint;
+  function PALETTERGB(r,g,b : longint) : longint; inline;
     { return type might be wrong }
     { return type might be wrong }
 
 
   (*  Not convertable by H2PAS
   (*  Not convertable by H2PAS
@@ -945,32 +945,22 @@ type
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
   function max(a,b : longint) : longint;
   function max(a,b : longint) : longint;
-    { return type might be wrong }
-    var
-       if_local1 : longint;
-    (* result types are not known *)
     begin
     begin
        if a > b then
        if a > b then
-         if_local1:=a
+         max:=a
        else
        else
-         if_local1:=b;
-       max:=if_local1;
+         max:=b;
     end;
     end;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }
   function min(a,b : longint) : longint;
   function min(a,b : longint) : longint;
-    { return type might be wrong }
-    var
-       if_local1 : longint;
-    (* result types are not known *)
     begin
     begin
        if a < b then
        if a < b then
-         if_local1:=a
+         min:=a
        else
        else
-         if_local1:=b;
-       min:=if_local1;
+         min:=b;
     end;
     end;
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }

+ 68 - 3
rtl/win/wininc/defines.inc

@@ -466,6 +466,21 @@
      FILE_FLAG_DELETE_ON_CLOSE = 67108864;
      FILE_FLAG_DELETE_ON_CLOSE = 67108864;
      FILE_FLAG_BACKUP_SEMANTICS = 33554432;
      FILE_FLAG_BACKUP_SEMANTICS = 33554432;
      FILE_FLAG_POSIX_SEMANTICS = 16777216;
      FILE_FLAG_POSIX_SEMANTICS = 16777216;
+
+     IO_REPARSE_TAG_RESERVED_ZERO  = 0;
+     IO_REPARSE_TAG_RESERVED_ONE   = 1;
+     IO_REPARSE_TAG_RESERVED_RANGE = IO_REPARSE_TAG_RESERVED_ONE;
+
+     IO_REPARSE_TAG_MOUNT_POINT = $A0000003;
+     IO_REPARSE_TAG_HSM         = $C0000004;
+     IO_REPARSE_TAG_HSM2        = $80000006;
+     IO_REPARSE_TAG_SIS         = $80000007;
+     IO_REPARSE_TAG_WIM         = $80000008;
+     IO_REPARSE_TAG_CSV         = $80000009;
+     IO_REPARSE_TAG_DFS         = $8000000A;
+     IO_REPARSE_TAG_SYMLINK     = $A000000C;
+     IO_REPARSE_TAG_DFSR        = $80000012;
+
      SECURITY_ANONYMOUS = 0;
      SECURITY_ANONYMOUS = 0;
      SECURITY_IDENTIFICATION = 65536;
      SECURITY_IDENTIFICATION = 65536;
      SECURITY_IMPERSONATION = 131072;
      SECURITY_IMPERSONATION = 131072;
@@ -1681,9 +1696,12 @@
      SIF_RANGE = 1;
      SIF_RANGE = 1;
      SIF_DISABLENOSCROLL = 8;
      SIF_DISABLENOSCROLL = 8;
   { GetStdHandle  }
   { GetStdHandle  }
-     STD_INPUT_HANDLE = DWORD(-10);
-     STD_OUTPUT_HANDLE = DWORD(-11);
-     STD_ERROR_HANDLE = DWORD(-12);
+     STD_INPUT_HANDLE = HANDLE(-10);
+     STD_OUTPUT_HANDLE = HANDLE(-11);
+     STD_ERROR_HANDLE = HANDLE(-12);
+
+
+
 
 
      INVALID_HANDLE_VALUE = HANDLE(-1);
      INVALID_HANDLE_VALUE = HANDLE(-1);
 
 
@@ -4005,6 +4023,7 @@ Type
      ACS_AUTOPLAY = 4;
      ACS_AUTOPLAY = 4;
      ACS_CENTER = 1;
      ACS_CENTER = 1;
      ACS_TRANSPARENT = 2;
      ACS_TRANSPARENT = 2;
+     ACS_TIMER       = 8;  // don't use threads... use timers
   { MODEMDEVCAPS structure  }
   { MODEMDEVCAPS structure  }
      DIALOPTION_BILLING = 64;
      DIALOPTION_BILLING = 64;
      DIALOPTION_QUIET = 128;
      DIALOPTION_QUIET = 128;
@@ -5713,6 +5732,52 @@ const
     IMAGE_FILE_MACHINE_M32R              = $9041;  // M32R little-endian
     IMAGE_FILE_MACHINE_M32R              = $9041;  // M32R little-endian
     IMAGE_FILE_MACHINE_CEE               = $C0EE;
     IMAGE_FILE_MACHINE_CEE               = $C0EE;
 
 
+
+    GWLP_WNDPROC        		 = -4; 
+    GWLP_HINSTANCE      		 = -6; 
+    GWLP_HWNDPARENT     		 = -8; 
+    GWLP_USERDATA       		 = -21;
+    GWLP_ID             		 = -12;
+
+    GCLP_MENUNAME                        = -8;    
+    GCLP_HBRBACKGROUND                   = -10;
+    GCLP_HCURSOR                         = -12;
+    GCLP_HICON                           = -14;
+    GCLP_HMODULE                         = -16;
+    GCLP_WNDPROC                         = -24;
+    GCLP_HICONSM                         = -34;
+
+
+// #if(WINVER >= 0x0500)
+{/*
+ * WM_MENUDRAG return values.
+ */}
+const
+      MND_CONTINUE       = 0;
+      MND_ENDMENU        = 1;
+
+{/*
+ * MENUGETOBJECTINFO dwFlags values
+ */}
+const
+      MNGOF_TOPGAP         = $00000001;
+      MNGOF_BOTTOMGAP      = $00000002;
+
+{/*
+ * WM_MENUGETOBJECT return values
+ */}
+const
+      MNGO_NOINTERFACE     = $00000000;
+      MNGO_NOERROR         = $00000001;
+//#endif /* WINVER >= 0x0500 */
+
+
+// Menubar information 
+const
+// Constants for the tagMENUBARINFO.FocusedBits bit mask
+      MBIFB_BAR_FOCUSED = $00000001;
+      MBIFB_FOCUSED     = $00000002;
+
 {$endif read_interface}
 {$endif read_interface}
 
 
 {$ifdef read_implementation}
 {$ifdef read_implementation}

+ 12 - 2
rtl/win/wininc/func.inc

@@ -262,7 +262,7 @@ function PeekNamedPipe(hNamedPipe:HANDLE; lpBuffer:LPVOID; nBufferSize:DWORD; lp
 function TransactNamedPipe(hNamedPipe:HANDLE; lpInBuffer:LPVOID; nInBufferSize:DWORD; lpOutBuffer:LPVOID; nOutBufferSize:DWORD;lpBytesRead:LPDWORD; lpOverlapped:LPOVERLAPPED):WINBOOL; external 'kernel32' name 'TransactNamedPipe';
 function TransactNamedPipe(hNamedPipe:HANDLE; lpInBuffer:LPVOID; nInBufferSize:DWORD; lpOutBuffer:LPVOID; nOutBufferSize:DWORD;lpBytesRead:LPDWORD; lpOverlapped:LPOVERLAPPED):WINBOOL; external 'kernel32' name 'TransactNamedPipe';
 function GetMailslotInfo(hMailslot:HANDLE; lpMaxMessageSize:LPDWORD; lpNextSize:LPDWORD; lpMessageCount:LPDWORD; lpReadTimeout:LPDWORD):WINBOOL; external 'kernel32' name 'GetMailslotInfo';
 function GetMailslotInfo(hMailslot:HANDLE; lpMaxMessageSize:LPDWORD; lpNextSize:LPDWORD; lpMessageCount:LPDWORD; lpReadTimeout:LPDWORD):WINBOOL; external 'kernel32' name 'GetMailslotInfo';
 function SetMailslotInfo(hMailslot:HANDLE; lReadTimeout:DWORD):WINBOOL; external 'kernel32' name 'SetMailslotInfo';
 function SetMailslotInfo(hMailslot:HANDLE; lReadTimeout:DWORD):WINBOOL; external 'kernel32' name 'SetMailslotInfo';
-function MapViewOfFile(hFileMappingObject:HANDLE; dwDesiredAccess:DWORD; dwFileOffsetHigh:DWORD; dwFileOffsetLow:DWORD; dwNumberOfBytesToMap:DWORD):LPVOID; external 'kernel32' name 'MapViewOfFile';
+function MapViewOfFile(hFileMappingObject:HANDLE; dwDesiredAccess:DWORD; dwFileOffsetHigh:DWORD; dwFileOffsetLow:DWORD; dwNumberOfBytesToMap:SIZE_T):LPVOID; external 'kernel32' name 'MapViewOfFile';
 function FlushViewOfFile(lpBaseAddress:LPCVOID; dwNumberOfBytesToFlush:DWORD):WINBOOL; external 'kernel32' name 'FlushViewOfFile';
 function FlushViewOfFile(lpBaseAddress:LPCVOID; dwNumberOfBytesToFlush:DWORD):WINBOOL; external 'kernel32' name 'FlushViewOfFile';
 function UnmapViewOfFile(lpBaseAddress:LPVOID):WINBOOL; external 'kernel32' name 'UnmapViewOfFile';
 function UnmapViewOfFile(lpBaseAddress:LPVOID):WINBOOL; external 'kernel32' name 'UnmapViewOfFile';
 function OpenFile(lpFileName:LPCSTR; lpReOpenBuff:LPOFSTRUCT; uStyle:UINT):HFILE; external 'kernel32' name 'OpenFile';
 function OpenFile(lpFileName:LPCSTR; lpReOpenBuff:LPOFSTRUCT; uStyle:UINT):HFILE; external 'kernel32' name 'OpenFile';
@@ -368,7 +368,7 @@ function FindNextChangeNotification(hChangeHandle:HANDLE):WINBOOL; external 'ker
 function FindCloseChangeNotification(hChangeHandle:HANDLE):WINBOOL; external 'kernel32' name 'FindCloseChangeNotification';
 function FindCloseChangeNotification(hChangeHandle:HANDLE):WINBOOL; external 'kernel32' name 'FindCloseChangeNotification';
 function VirtualLock(lpAddress:LPVOID; dwSize:DWORD):WINBOOL; external 'kernel32' name 'VirtualLock';
 function VirtualLock(lpAddress:LPVOID; dwSize:DWORD):WINBOOL; external 'kernel32' name 'VirtualLock';
 function VirtualUnlock(lpAddress:LPVOID; dwSize:DWORD):WINBOOL; external 'kernel32' name 'VirtualUnlock';
 function VirtualUnlock(lpAddress:LPVOID; dwSize:DWORD):WINBOOL; external 'kernel32' name 'VirtualUnlock';
-function MapViewOfFileEx(hFileMappingObject:HANDLE; dwDesiredAccess:DWORD; dwFileOffsetHigh:DWORD; dwFileOffsetLow:DWORD; dwNumberOfBytesToMap:DWORD;lpBaseAddress:LPVOID):LPVOID; external 'kernel32' name 'MapViewOfFileEx';
+function MapViewOfFileEx(hFileMappingObject:HANDLE; dwDesiredAccess:DWORD; dwFileOffsetHigh:DWORD; dwFileOffsetLow:DWORD; dwNumberOfBytesToMap:SIZE_T;lpBaseAddress:LPVOID):LPVOID; external 'kernel32' name 'MapViewOfFileEx';
 function SetPriorityClass(hProcess:HANDLE; dwPriorityClass:DWORD):WINBOOL; external 'kernel32' name 'SetPriorityClass';
 function SetPriorityClass(hProcess:HANDLE; dwPriorityClass:DWORD):WINBOOL; external 'kernel32' name 'SetPriorityClass';
 function GetPriorityClass(hProcess:HANDLE):DWORD; external 'kernel32' name 'GetPriorityClass';
 function GetPriorityClass(hProcess:HANDLE):DWORD; external 'kernel32' name 'GetPriorityClass';
 function IsBadReadPtr(lp:pointer; ucb:UINT):WINBOOL; external 'kernel32' name 'IsBadReadPtr';
 function IsBadReadPtr(lp:pointer; ucb:UINT):WINBOOL; external 'kernel32' name 'IsBadReadPtr';
@@ -1253,6 +1253,16 @@ function SignalObjectAndWait( hObjectToSignal:THANDLE;  hObjectToWaitOn:THANDLE
 function CancelWaitableTimer(hTimer:THandle):BOOL; external 'kernel32' name 'CancelWaitableTimer';
 function CancelWaitableTimer(hTimer:THandle):BOOL; external 'kernel32' name 'CancelWaitableTimer';
 function GetComboBoxInfo(hwndCombo:HWND;pcbi:PCOMBOBOXINFO):BOOL; external 'user32' name 'GetComboBoxInfo';
 function GetComboBoxInfo(hwndCombo:HWND;pcbi:PCOMBOBOXINFO):BOOL; external 'user32' name 'GetComboBoxInfo';
 function GetAncestor(HWnd: HWND; Flag: UINT): HWND; StdCall; External 'user32';
 function GetAncestor(HWnd: HWND; Flag: UINT): HWND; StdCall; External 'user32';
+
+// #if(WINVER >= 0x0500)
+function GetMenuInfo(_hmenu:HMENU; lpcmi:LPMENUINFO):BOOL; external 'user32' name 'GetMenuInfo';
+function SetMenuInfo(_hmenu:HMENU; lpcmi:LPCMENUINFO):BOOL; external 'user32' name 'SetMenuInfo';
+function EndMenu:BOOL; external 'user32' name 'EndMenu';
+//#endif /* WINVER >= 0x0500 */
+
+
+function GetMenuBarInfo(_hwnd:HWND; idObject:longint; idItem:longint; pmbi:LPMENUBARINFO):BOOL; external 'user32' name 'GetMenuBarInfo';
+
 {$endif read_interface}
 {$endif read_interface}
 
 
 
 

+ 36 - 0
rtl/win/wininc/struct.inc

@@ -5041,6 +5041,11 @@ Const
      tagTEXTMETRIC = TEXTMETRIC;
      tagTEXTMETRIC = TEXTMETRIC;
      TTEXTMETRIC = TEXTMETRIC;
      TTEXTMETRIC = TEXTMETRIC;
      PTEXTMETRIC = ^TEXTMETRIC;
      PTEXTMETRIC = ^TEXTMETRIC;
+     TEXTMETRICA   = TEXTMETRIC;
+     LPTEXTMETRICA = ^TEXTMETRICA;
+     tagTEXTMETRICA = TEXTMETRICA;
+     TTEXTMETRICA = TEXTMETRICA;
+     PTEXTMETRICA = ^TEXTMETRICA;
 
 
      TEXTMETRICW = record
      TEXTMETRICW = record
           tmHeight : LONG;
           tmHeight : LONG;
@@ -7509,6 +7514,37 @@ type
 const
 const
   SECURITY_DESCRIPTOR_MIN_LENGTH = SIZEOF(SECURITY_DESCRIPTOR);
   SECURITY_DESCRIPTOR_MIN_LENGTH = SIZEOF(SECURITY_DESCRIPTOR);
 
 
+
+// #if(WINVER >= 0x0500)
+type
+     tagMENUGETOBJECTINFO = packed record
+       dwFlags:DWORD;
+       uPos:UINT;
+       _hmenu:HMENU;
+       riid:PVOID;
+       pvObj:PVOID;
+     end;
+     MENUGETOBJECTINFO = tagMENUGETOBJECTINFO;
+     PMENUGETOBJECTINFO = ^tagMENUGETOBJECTINFO;
+     LPMENUGETOBJECTINFO = ^tagMENUGETOBJECTINFO;
+//#endif /* WINVER >= 0x0500 */
+
+
+// Menubar information 
+type
+     tagMENUBARINFO = packed record
+       cbSize:DWORD;
+       rcBar:Windows.RECT; // rect of bar, popup, item 
+       _hmenu:HMENU;       // real menu handle of bar, popup 
+       hwndMenu:HWND;      // hwnd of item submenu if one 
+//    fBarFocused:1:BOOL;  // bar, popup has the focus 
+//    fFocused:1:BOOL;     // item has the focus 
+      FocusedBits:DWORD;
+    end;
+    MENUBARINFO = tagMENUBARINFO;
+    PMENUBARINFO = ^tagMENUBARINFO;
+    LPMENUBARINFO = ^tagMENUBARINFO;
+
 {$endif read_interface}
 {$endif read_interface}
 
 
 
 

+ 2 - 2
rtl/win/wininc/unifun.inc

@@ -163,9 +163,9 @@ function SetDefaultCommConfigW(lpszName:LPCWSTR; lpCC:LPCOMMCONFIG; dwSize:DWORD
 function GetComputerNameW(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameW';
 function GetComputerNameW(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'kernel32' name 'GetComputerNameW';
 function SetComputerNameW(lpComputerName:LPCWSTR):WINBOOL; external 'kernel32' name 'SetComputerNameW';
 function SetComputerNameW(lpComputerName:LPCWSTR):WINBOOL; external 'kernel32' name 'SetComputerNameW';
 function GetUserNameW(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameW';
 function GetUserNameW(lpBuffer:LPWSTR; nSize:LPDWORD):WINBOOL; external 'advapi32' name 'GetUserNameW';
-function wvsprintfW(_para1:LPWSTR; _para2:LPCWSTR; arglist:va_list):longint; external 'user32' name 'wvsprintfW';
+function wvsprintfW(_para1:LPWSTR; _para2:LPCWSTR; arglist:va_list):longint; cdecl; external 'user32' name 'wvsprintfW';
 function wsprintfW(_para1:LPWSTR; _para2:LPCWSTR; const args:array of const):longint;cdecl; external 'user32' name 'wsprintfW';
 function wsprintfW(_para1:LPWSTR; _para2:LPCWSTR; const args:array of const):longint;cdecl; external 'user32' name 'wsprintfW';
-function wsprintfW(_para1:LPWSTR; _para2:LPCWSTR):longint; external 'user32' name 'wsprintfW';
+function wsprintfW(_para1:LPWSTR; _para2:LPCWSTR):longint; cdecl; external 'user32' name 'wsprintfW';
 function LoadKeyboardLayoutW(pwszKLID:LPCWSTR; Flags:UINT):HKL; external 'user32' name 'LoadKeyboardLayoutW';
 function LoadKeyboardLayoutW(pwszKLID:LPCWSTR; Flags:UINT):HKL; external 'user32' name 'LoadKeyboardLayoutW';
 function GetKeyboardLayoutNameW(pwszKLID:LPWSTR):WINBOOL; external 'user32' name 'GetKeyboardLayoutNameW';
 function GetKeyboardLayoutNameW(pwszKLID:LPWSTR):WINBOOL; external 'user32' name 'GetKeyboardLayoutNameW';
 function CreateDesktopW(lpszDesktop:LPWSTR; lpszDevice:LPWSTR;pDevmodew:LPDEVMODEw; dwFlags:DWORD; dwDesiredAccess:DWORD;lpsa:LPSECURITY_ATTRIBUTES):HDESK; external 'user32' name 'CreateDesktopW';
 function CreateDesktopW(lpszDesktop:LPWSTR; lpszDevice:LPWSTR;pDevmodew:LPDEVMODEw; dwFlags:DWORD; dwDesiredAccess:DWORD;lpsa:LPSECURITY_ATTRIBUTES):HDESK; external 'user32' name 'CreateDesktopW';

+ 11 - 6
rtl/wince/wininc/base.inc

@@ -56,7 +56,8 @@
   type
   type
 
 
      MAKEINTRESOURCE = pwidechar;
      MAKEINTRESOURCE = pwidechar;
-	 ATOM = word;                     //windef
+     
+     ATOM = word;                     //windef
      TAtom = ATOM;
      TAtom = ATOM;
 
 
      WINBOOL = longbool;
      WINBOOL = longbool;
@@ -472,9 +473,13 @@ type
   { argument types are unknown }
   { argument types are unknown }
   function HIWORD(l : longint) : WORD;      //windef
   function HIWORD(l : longint) : WORD;      //windef
 
 
+type
+     LOBYTE = byte;
+(*
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   function LOBYTE(w : longint) : BYTE;      //windef
   function LOBYTE(w : longint) : BYTE;      //windef
+*)
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
@@ -519,8 +524,7 @@ type
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKEINTATOM(i : longint) : LPTSTR;
-
+  function MAKEINTATOM(i : longint) : LPTSTR; 
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
@@ -838,16 +842,18 @@ type
        HIWORD:=WORD(((DWORD(l)) shr 16) and $FFFF);
        HIWORD:=WORD(((DWORD(l)) shr 16) and $FFFF);
     end;
     end;
 
 
+(*
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   function LOBYTE(w : longint) : BYTE;
   function LOBYTE(w : longint) : BYTE;
     begin
     begin
        LOBYTE:=BYTE(w);
        LOBYTE:=BYTE(w);
     end;
     end;
+*)
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function LOWORD(l : longint) : WORD;
+  function LOWORD(l : longint) : WORD; inline;
     begin
     begin
        LOWORD:=WORD(l);
        LOWORD:=WORD(l);
     end;
     end;
@@ -911,12 +917,11 @@ type
 
 
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
-  function MAKEINTATOM(i : longint) : LPTSTR;
+  function MAKEINTATOM(i : longint) : LPTSTR; inline;
     begin
     begin
        MAKEINTATOM:=LPTSTR(DWORD(WORD(i)));
        MAKEINTATOM:=LPTSTR(DWORD(WORD(i)));
     end;
     end;
 
 
-
   { was #define dname(params) def_expr }
   { was #define dname(params) def_expr }
   { argument types are unknown }
   { argument types are unknown }
   { return type might be wrong }
   { return type might be wrong }

+ 51 - 27
rtl/wince/wininc/coredll.inc

@@ -85,7 +85,6 @@
       378 CacheSync
       378 CacheSync
       1EA CeChangeDatabaseLCID
       1EA CeChangeDatabaseLCID
       1EF CeClearReplChangeBitsEx
       1EF CeClearReplChangeBitsEx
-      2DB CeClearUserNotification
       1D1 CeCreateDatabase
       1D1 CeCreateDatabase
       1D2 CeCreateDatabaseEx
       1D2 CeCreateDatabaseEx
       1DC CeCreateDatabaseEx2
       1DC CeCreateDatabaseEx2
@@ -111,10 +110,6 @@
       1F0 CeGetReplOtherBitsEx
       1F0 CeGetReplOtherBitsEx
       313 CeGetThreadPriority
       313 CeGetThreadPriority
       315 CeGetThreadQuantum
       315 CeGetThreadQuantum
-      2E2 CeGetUserNotification
-      2E1 CeGetUserNotificationHandles
-      2DF CeGetUserNotificationPreferences
-      2DE CeHandleAppNotifications
        96 CeLogData
        96 CeLogData
        98 CeLogGetZones
        98 CeLogGetZones
        99 CeLogReSync
        99 CeLogReSync
@@ -134,8 +129,6 @@
       1F2 CeRegisterReplNotification
       1F2 CeRegisterReplNotification
       4E4 CeRemoveFontResource
       4E4 CeRemoveFontResource
       15D CeResyncFilesys
       15D CeResyncFilesys
-      2DD CeRunAppAtEvent
-      2DC CeRunAppAtTime
       1D9 CeSeekDatabase
       1D9 CeSeekDatabase
       1E0 CeSeekDatabaseEx
       1E0 CeSeekDatabaseEx
       1D3 CeSetDatabaseInfo
       1D3 CeSetDatabaseInfo
@@ -149,8 +142,6 @@
       1F1 CeSetReplOtherBitsEx
       1F1 CeSetReplOtherBitsEx
       312 CeSetThreadPriority
       312 CeSetThreadPriority
       314 CeSetThreadQuantum
       314 CeSetThreadQuantum
-      2DA CeSetUserNotification
-      2E0 CeSetUserNotificationEx
       1E6 CeUnmountDBVol
       1E6 CeUnmountDBVol
       1E5 CeWriteRecordProps
       1E5 CeWriteRecordProps
        2F CeZeroPointer
        2F CeZeroPointer
@@ -206,7 +197,6 @@
        C2 DDKReg_GetWindowInfo
        C2 DDKReg_GetWindowInfo
       3BF DebugNotify
       3BF DebugNotify
       38B DecompressBinaryBlock
       38B DecompressBinaryBlock
-       FF DeleteAndRenameFile
       37B DeleteTrackedItem
       37B DeleteTrackedItem
       179 DeregisterAFS
       179 DeregisterAFS
       17B DeregisterAFSName
       17B DeregisterAFSName
@@ -215,8 +205,6 @@
       30C DumpKCallProfile
       30C DumpKCallProfile
       3DB EnableCaretSystemWide
       3DB EnableCaretSystemWide
       553 EnableEUDC
       553 EnableEUDC
-      50E EnumDisplayDevices
-      666 EnumDisplayMonitors
       14D EnumUILanguagesW
       14D EnumUILanguagesW
       374 ExtractResource
       374 ExtractResource
       17F FileSystemPowerFunction
       17F FileSystemPowerFunction
@@ -247,7 +235,6 @@
       405 GetKeyboardTarget
       405 GetKeyboardTarget
       4B7 GetMessageWNoWait
       4B7 GetMessageWNoWait
       30B GetModuleInformation
       30B GetModuleInformation
-      665 GetMonitorInfo
       397 GetOwnerProcess
       397 GetOwnerProcess
       110 GetPasswordStatus
       110 GetPasswordStatus
       1B6 GetPrivateCallbacks
       1B6 GetPrivateCallbacks
@@ -259,7 +246,6 @@
       371 GetRealTime
       371 GetRealTime
       377 GetRomFileBytes
       377 GetRomFileBytes
       376 GetRomFileInfo
       376 GetRomFileInfo
-      102 GetStoreInformation
       2D0 GetUserDirectory
       2D0 GetUserDirectory
       1B7 GetWindowTextWDirect
       1B7 GetWindowTextWDirect
       37E GiveKPhys
       37E GiveKPhys
@@ -277,7 +263,6 @@
        4D Int_HeapFree
        4D Int_HeapFree
        49 Int_HeapReAlloc
        49 Int_HeapReAlloc
        4B Int_HeapSize
        4B Int_HeapSize
-       15 InterlockedCompareExchange
       3B1 InterruptDisable
       3B1 InterruptDisable
       3B0 InterruptDone
       3B0 InterruptDone
       3AE InterruptInitialize
       3AE InterruptInitialize
@@ -298,8 +283,6 @@
       396 KillAllOtherThreads
       396 KillAllOtherThreads
       38E LeaveCritSec
       38E LeaveCritSec
       3AA LoadDriver
       3AA LoadDriver
-      151 LoadFSD
-      152 LoadFSDEx
       3AB LoadIntChainHandler
       3AB LoadIntChainHandler
       3AD LoadKernelLibrary
       3AD LoadKernelLibrary
        3E LocalAllocInProcess
        3E LocalAllocInProcess
@@ -350,7 +333,6 @@
       484 QASetWindowsJournalHook
       484 QASetWindowsJournalHook
       485 QAUnhookWindowsJournalHook
       485 QAUnhookWindowsJournalHook
       2F2 QueryAPISetID
       2F2 QueryAPISetID
-       91 Random
       181 ReadFileWithSeek
       181 ReadFileWithSeek
       3C0 ReadRegistryFromOEM
       3C0 ReadRegistryFromOEM
       1BE RectangleAnimation
       1BE RectangleAnimation
@@ -362,7 +344,6 @@
       17A RegisterAFSName
       17A RegisterAFSName
       3B8 RegisterAPISet
       3B8 RegisterAPISet
       33D RegisterDbgZones
       33D RegisterDbgZones
-      4DB RegisterDesktop
       1BD RegisterSIPanel
       1BD RegisterSIPanel
       380 RegisterTrackedItem
       380 RegisterTrackedItem
         E ReinitLocale
         E ReinitLocale
@@ -374,14 +355,10 @@
        3D RemoteLocalFree
        3D RemoteLocalFree
        3B RemoteLocalReAlloc
        3B RemoteLocalReAlloc
        3C RemoteLocalSize
        3C RemoteLocalSize
-      15A ResourceCreateList
-      15C ResourceRelease
-      15B ResourceRequest
       2E6 SHCreateExplorerInstance
       2E6 SHCreateExplorerInstance
       2E8 SHCreateShortcut
       2E8 SHCreateShortcut
       2EA SHCreateShortcutEx
       2EA SHCreateShortcutEx
       2E9 SHGetShortcutTarget
       2E9 SHGetShortcutTarget
-      2EC SHLoadDIBitmap
       2EB SHShowOutOfMemory
       2EB SHShowOutOfMemory
       11B SetACP
       11B SetACP
       1C0 SetAssociatedMenu
       1C0 SetAssociatedMenu
@@ -413,9 +390,7 @@
       3B5 SetWDevicePowerHandler
       3B5 SetWDevicePowerHandler
       406 ShellModalEnd
       406 ShellModalEnd
       1C4 ShowStartupWindow
       1C4 ShowStartupWindow
-      176 SignalStarted
       361 SleepTillTick
       361 SleepTillTick
-      156 StopDeviceNotifications
       648 StringCbCatA
       648 StringCbCatA
       64A StringCbCatExA
       64A StringCbCatExA
        82 StringCbCatExW
        82 StringCbCatExW
@@ -2011,6 +1986,7 @@ function DefDlgProcW(hDlg:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT;
 function DeferWindowPos(hWinPosInfo:HDWP; hWnd:HWND; hWndInsertAfter:HWND; x:longint; y:longint;cx:longint; cy:longint; uFlags:UINT):HDWP; external KernelDLL name 'DeferWindowPos';
 function DeferWindowPos(hWinPosInfo:HDWP; hWnd:HWND; hWndInsertAfter:HWND; x:longint; y:longint;cx:longint; cy:longint; uFlags:UINT):HDWP; external KernelDLL name 'DeferWindowPos';
 function DefWindowProc(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT; external KernelDLL name 'DefWindowProcW';
 function DefWindowProc(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT; external KernelDLL name 'DefWindowProcW';
 function DefWindowProcW(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT; external KernelDLL name 'DefWindowProcW';
 function DefWindowProcW(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT; external KernelDLL name 'DefWindowProcW';
+function DeleteAndRenameFile(lpszDestFile:LPCWSTR; lpszSourceFile:LPCWSTR):BOOL; external KernelDLL name 'DeleteAndRenameFile'; // index FF
 procedure DeleteCriticalSection(lpCriticalSection:LPCRITICAL_SECTION); external KernelDLL name 'DeleteCriticalSection';
 procedure DeleteCriticalSection(lpCriticalSection:LPCRITICAL_SECTION); external KernelDLL name 'DeleteCriticalSection';
 function DeleteDC(_para1:HDC):WINBOOL; external KernelDLL name 'DeleteDC';
 function DeleteDC(_para1:HDC):WINBOOL; external KernelDLL name 'DeleteDC';
 function DeleteEnhMetaFile(_para1:HENHMETAFILE):WINBOOL; external KernelDLL name 'DeleteEnhMetaFile';
 function DeleteEnhMetaFile(_para1:HENHMETAFILE):WINBOOL; external KernelDLL name 'DeleteEnhMetaFile';
@@ -2053,6 +2029,8 @@ function EnumCalendarInfo(lpCalInfoEnumProc:CALINFO_ENUMPROC; Locale:LCID; Calen
 function EnumCalendarInfoW(lpCalInfoEnumProc:CALINFO_ENUMPROC; Locale:LCID; Calendar:CALID; CalType:CALTYPE):WINBOOL; external KernelDLL name 'EnumCalendarInfoW';
 function EnumCalendarInfoW(lpCalInfoEnumProc:CALINFO_ENUMPROC; Locale:LCID; Calendar:CALID; CalType:CALTYPE):WINBOOL; external KernelDLL name 'EnumCalendarInfoW';
 function EnumDateFormats(lpDateFmtEnumProc:DATEFMT_ENUMPROC; Locale:LCID; dwFlags:DWORD):WINBOOL; external KernelDLL name 'EnumDateFormatsW';
 function EnumDateFormats(lpDateFmtEnumProc:DATEFMT_ENUMPROC; Locale:LCID; dwFlags:DWORD):WINBOOL; external KernelDLL name 'EnumDateFormatsW';
 function EnumDateFormatsW(lpDateFmtEnumProc:DATEFMT_ENUMPROC; Locale:LCID; dwFlags:DWORD):WINBOOL; external KernelDLL name 'EnumDateFormatsW';
 function EnumDateFormatsW(lpDateFmtEnumProc:DATEFMT_ENUMPROC; Locale:LCID; dwFlags:DWORD):WINBOOL; external KernelDLL name 'EnumDateFormatsW';
+function EnumDisplayDevices(lpDevice:LPCTSTR; iDevNum:DWORD; lpDisplayDevice:PDISPLAY_DEVICE; dwFlags:DWORD):BOOL; external KernelDLL name 'EnumDisplayDevices'; // index 50E
+function EnumDisplayMonitors(_hdc:HDC; lprcClip:LPRECT; lpfnEnum:MONITORENUMPROC; dwData:LPARAM):BOOL; external KernelDLL name 'EnumDisplayMonitors'; // index 666
 function EnumDisplaySettings(lpszDeviceName:LPCWSTR; iModeNum:DWORD; lpDevMode:LPDEVMODEW):WINBOOL; external KernelDLL name 'EnumDisplaySettings';
 function EnumDisplaySettings(lpszDeviceName:LPCWSTR; iModeNum:DWORD; lpDevMode:LPDEVMODEW):WINBOOL; external KernelDLL name 'EnumDisplaySettings';
 function EnumFonts(_para1:HDC; _para2:LPCWSTR; _para3:ENUMFONTSPROC; _para4:LPARAM):longint; external KernelDLL name 'EnumFontsW';
 function EnumFonts(_para1:HDC; _para2:LPCWSTR; _para3:ENUMFONTSPROC; _para4:LPARAM):longint; external KernelDLL name 'EnumFontsW';
 function EnumFontsW(_para1:HDC; _para2:LPCWSTR; _para3:ENUMFONTSPROC; _para4:LPARAM):longint; external KernelDLL name 'EnumFontsW';
 function EnumFontsW(_para1:HDC; _para2:LPCWSTR; _para3:ENUMFONTSPROC; _para4:LPARAM):longint; external KernelDLL name 'EnumFontsW';
@@ -2213,6 +2191,7 @@ function GetModuleFileName(hModule:HMODULE; lpFilename:LPWSTR; nSize:DWORD):DWOR
 function GetModuleFileNameW(hModule:HMODULE; lpFilename:LPWSTR; nSize:DWORD):DWORD; external KernelDLL name 'GetModuleFileNameW';
 function GetModuleFileNameW(hModule:HMODULE; lpFilename:LPWSTR; nSize:DWORD):DWORD; external KernelDLL name 'GetModuleFileNameW';
 function GetModuleHandle(lpModuleName:LPCWSTR):HMODULE; external KernelDLL name 'GetModuleHandleW';
 function GetModuleHandle(lpModuleName:LPCWSTR):HMODULE; external KernelDLL name 'GetModuleHandleW';
 function GetModuleHandleW(lpModuleName:LPCWSTR):HMODULE; external KernelDLL name 'GetModuleHandleW';
 function GetModuleHandleW(lpModuleName:LPCWSTR):HMODULE; external KernelDLL name 'GetModuleHandleW';
+function GetMonitorInfo(_hMonitor:HMONITOR; lpmi:LPMONITORINFO):BOOL; external KernelDLL name 'GetMonitorInfo'; // index 665
 function GetMouseMovePoints(pptBuf:PPOINT; nBufPoints:UINT; pnPointsRetrieved:PUINT):BOOL; external KernelDLL name 'GetMouseMovePoints'; // index 481
 function GetMouseMovePoints(pptBuf:PPOINT; nBufPoints:UINT; pnPointsRetrieved:PUINT):BOOL; external KernelDLL name 'GetMouseMovePoints'; // index 481
 function GetNearestColor(_para1:HDC; _para2:COLORREF):COLORREF; external KernelDLL name 'GetNearestColor';
 function GetNearestColor(_para1:HDC; _para2:COLORREF):COLORREF; external KernelDLL name 'GetNearestColor';
 function GetNearestPaletteIndex(_para1:HPALETTE; _para2:COLORREF):UINT; external KernelDLL name 'GetNearestPaletteIndex';
 function GetNearestPaletteIndex(_para1:HPALETTE; _para2:COLORREF):UINT; external KernelDLL name 'GetNearestPaletteIndex';
@@ -2315,9 +2294,21 @@ function GlobalFindAtom(lpString:LPCWSTR):ATOM; external KernelDLL name 'GlobalF
 function GlobalFindAtomW(lpString:LPCWSTR):ATOM; external KernelDLL name 'GlobalFindAtomW';
 function GlobalFindAtomW(lpString:LPCWSTR):ATOM; external KernelDLL name 'GlobalFindAtomW';
 function GlobalFree(hMem:HGLOBAL):HGLOBAL;
 function GlobalFree(hMem:HGLOBAL):HGLOBAL;
 function GlobalFreePtr(lp:Pointer):Pointer;
 function GlobalFreePtr(lp:Pointer):Pointer;
+
+type
+     GlobalHandle = HGLOBAL;
+{
 function GlobalHandle(pMem:LPCVOID):HGLOBAL;
 function GlobalHandle(pMem:LPCVOID):HGLOBAL;
+}
+
 function GlobalLockPtr(lp:pointer):Pointer;
 function GlobalLockPtr(lp:pointer):Pointer;
+
+type
+     GlobalLock = LPVOID;
+{
 function GlobalLock(hMem:HGLOBAL):LPVOID;
 function GlobalLock(hMem:HGLOBAL):LPVOID;
+}
+
 function GlobalReAlloc(hMem:HGLOBAL; dwBytes:DWORD; uFlags:UINT):HGLOBAL;
 function GlobalReAlloc(hMem:HGLOBAL; dwBytes:DWORD; uFlags:UINT):HGLOBAL;
 function GlobalReAllocPtr(lp:Pointer;cbNew,flags:DWord):Pointer;
 function GlobalReAllocPtr(lp:Pointer;cbNew,flags:DWord):Pointer;
 function GlobalSize(hMem:HGLOBAL):DWORD;
 function GlobalSize(hMem:HGLOBAL):DWORD;
@@ -2473,6 +2464,16 @@ function LoadBitmap(hInstance:HINST; lpBitmapName:LPCWSTR):HBITMAP; external Ker
 function LoadBitmapW(hInstance:HINST; lpBitmapName:LPCWSTR):HBITMAP; external KernelDLL name 'LoadBitmapW';
 function LoadBitmapW(hInstance:HINST; lpBitmapName:LPCWSTR):HBITMAP; external KernelDLL name 'LoadBitmapW';
 function LoadCursor(hInstance:HINST; lpCursorName:LPCWSTR):HCURSOR; external KernelDLL name 'LoadCursorW';
 function LoadCursor(hInstance:HINST; lpCursorName:LPCWSTR):HCURSOR; external KernelDLL name 'LoadCursorW';
 function LoadCursorW(hInstance:HINST; lpCursorName:LPCWSTR):HCURSOR; external KernelDLL name 'LoadCursorW';
 function LoadCursorW(hInstance:HINST; lpCursorName:LPCWSTR):HCURSOR; external KernelDLL name 'LoadCursorW';
+
+// This function is called by a device driver to load its associated FSD.
+// This function is obsolete in Windows CE .NET 4.0 and later.
+// Instead, place a storage class identifier in the device driver registry setting
+// to notify the Storage Manager of the block driver being loaded.
+// The Storage Manager will then parse the partitions and load the appropriate
+// file system.
+function LoadFSD(hDevice:HANDLE; lpFSDName:LPCWSTR):BOOL; external KernelDLL name 'LoadFSD'; // index 151
+function LoadFSDEx(hDevice:HANDLE; lpFSDName:LPCWSTR; dwFlag:DWORD):BOOL; external KernelDLL name 'LoadFSDEx'; // index 152
+
 function LoadIcon(hInstance:HINST; lpIconName:LPCWSTR):HICON; external KernelDLL name 'LoadIconW';
 function LoadIcon(hInstance:HINST; lpIconName:LPCWSTR):HICON; external KernelDLL name 'LoadIconW';
 function LoadIconW(hInstance:HINST; lpIconName:LPCWSTR):HICON; external KernelDLL name 'LoadIconW';
 function LoadIconW(hInstance:HINST; lpIconName:LPCWSTR):HICON; external KernelDLL name 'LoadIconW';
 function LoadImage(_para1:HINST; _para2:LPCWSTR; _para3:UINT; _para4:longint; _para5:longint;_para6:UINT):HANDLE; external KernelDLL name 'LoadImageW';
 function LoadImage(_para1:HINST; _para2:LPCWSTR; _para3:UINT; _para4:longint; _para5:longint;_para6:UINT):HANDLE; external KernelDLL name 'LoadImageW';
@@ -2492,7 +2493,13 @@ function LocalAlloc(uFlags:UINT; uBytes:UINT):HLOCAL; external KernelDLL name 'L
 function LocalDiscard(hlocMem:HLOCAL):HLOCAL;
 function LocalDiscard(hlocMem:HLOCAL):HLOCAL;
 function LocalFileTimeToFileTime(lpLocalFileTime:LPFILETIME; lpFileTime:LPFILETIME):WINBOOL; external KernelDLL name 'LocalFileTimeToFileTime';
 function LocalFileTimeToFileTime(lpLocalFileTime:LPFILETIME; lpFileTime:LPFILETIME):WINBOOL; external KernelDLL name 'LocalFileTimeToFileTime';
 function LocalFree(hMem:HLOCAL):HLOCAL; external KernelDLL name 'LocalFree';
 function LocalFree(hMem:HLOCAL):HLOCAL; external KernelDLL name 'LocalFree';
+
+type
+     LocalHandle = HLOCAL;
+{
 function LocalHandle(pMem:LPCVOID):HLOCAL;
 function LocalHandle(pMem:LPCVOID):HLOCAL;
+}
+
 function LocalLock(hMem:HLOCAL):LPVOID;
 function LocalLock(hMem:HLOCAL):LPVOID;
 function LocalReAlloc(hMem:HLOCAL; uBytes:UINT; uFlags:UINT):HLOCAL; external KernelDLL name 'LocalReAlloc';
 function LocalReAlloc(hMem:HLOCAL; uBytes:UINT; uFlags:UINT):HLOCAL; external KernelDLL name 'LocalReAlloc';
 function LocalSize(hMem:HLOCAL):UINT; external KernelDLL name 'LocalSize';
 function LocalSize(hMem:HLOCAL):UINT; external KernelDLL name 'LocalSize';
@@ -2582,6 +2589,8 @@ function QueryInstructionSet(dwInstructionSet:DWORD; lpdwCurrentInstructionSet:L
 function QueryPerformanceCounter(lpPerformanceCount:PLARGE_INTEGER):WINBOOL; external Kerneldll name 'QueryPerformanceCounter';
 function QueryPerformanceCounter(lpPerformanceCount:PLARGE_INTEGER):WINBOOL; external Kerneldll name 'QueryPerformanceCounter';
 function QueryPerformanceFrequency(lpFrequency:PLARGE_INTEGER):WINBOOL; external Kerneldll name 'QueryPerformanceFrequency';
 function QueryPerformanceFrequency(lpFrequency:PLARGE_INTEGER):WINBOOL; external Kerneldll name 'QueryPerformanceFrequency';
 procedure RaiseException(dwExceptionCode:DWORD; dwExceptionFlags:DWORD; nNumberOfArguments:DWORD; lpArguments:LPDWORD); external KernelDLL name 'RaiseException';
 procedure RaiseException(dwExceptionCode:DWORD; dwExceptionFlags:DWORD; nNumberOfArguments:DWORD; lpArguments:LPDWORD); external KernelDLL name 'RaiseException';
+// This function generates a random number.
+function WINCE_Random:DWORD; external KernelDLL name 'Random'; // index 91
 function ReadFile(hFile:HANDLE; lpBuffer:LPVOID; nNumberOfBytesToRead:DWORD; lpNumberOfBytesRead:LPDWORD; lpOverlapped:LPOVERLAPPED):BOOL; external KernelDLL name 'ReadFile'; // index F4
 function ReadFile(hFile:HANDLE; lpBuffer:LPVOID; nNumberOfBytesToRead:DWORD; lpNumberOfBytesRead:LPDWORD; lpOverlapped:LPOVERLAPPED):BOOL; external KernelDLL name 'ReadFile'; // index F4
 function ReadProcessMemory(hProcess:HANDLE; lpBaseAddress:LPCVOID; lpBuffer:LPVOID; nSize:DWORD; lpNumberOfBytesRead:LPDWORD):WINBOOL; external KernelDLL name 'ReadProcessMemory';
 function ReadProcessMemory(hProcess:HANDLE; lpBaseAddress:LPCVOID; lpBuffer:LPVOID; nSize:DWORD; lpNumberOfBytesRead:LPDWORD):WINBOOL; external KernelDLL name 'ReadProcessMemory';
 function RealizePalette(_para1:HDC):UINT; external KernelDLL name 'RealizePalette'; // index 52F
 function RealizePalette(_para1:HDC):UINT; external KernelDLL name 'RealizePalette'; // index 52F
@@ -2610,6 +2619,7 @@ function RegisterClass(lpWndClass:LPWNDCLASS):ATOM; external KernelDLL name 'Reg
 function RegisterClassW(lpWndClass:LPWNDCLASS):ATOM; external KernelDLL name 'RegisterClassW';
 function RegisterClassW(lpWndClass:LPWNDCLASS):ATOM; external KernelDLL name 'RegisterClassW';
 function RegisterClipboardFormat(lpszFormat:LPCWSTR):UINT; external KernelDLL name 'RegisterClipboardFormatW';
 function RegisterClipboardFormat(lpszFormat:LPCWSTR):UINT; external KernelDLL name 'RegisterClipboardFormatW';
 function RegisterClipboardFormatW(lpszFormat:LPCWSTR):UINT; external KernelDLL name 'RegisterClipboardFormatW';
 function RegisterClipboardFormatW(lpszFormat:LPCWSTR):UINT; external KernelDLL name 'RegisterClipboardFormatW';
+function RegisterDesktop(_hwndDesktop:HWND):BOOL; external KernelDLL name 'RegisterDesktop'; // index 4DB
 function RegisterDevice(lpszType:LPCWSTR; dwIndex:DWORD; lpszLib:LPCWSTR; dwInfo:DWORD):HANDLE; external KernelDLL name 'RegisterDevice'; // index 14F
 function RegisterDevice(lpszType:LPCWSTR; dwIndex:DWORD; lpszLib:LPCWSTR; dwInfo:DWORD):HANDLE; external KernelDLL name 'RegisterDevice'; // index 14F
 function RegisterTaskBar(hwndTaskbar:HWND):BOOL; external KernelDLL name 'RegisterTaskBar'; // index 4D9
 function RegisterTaskBar(hwndTaskbar:HWND):BOOL; external KernelDLL name 'RegisterTaskBar'; // index 4D9
 function RegisterTaskBarEx(hwndTaskbar:HWND; bTaskBarOnTop:BOOL):BOOL; external KernelDLL name 'RegisterTaskBarEx'; // index 4DA
 function RegisterTaskBarEx(hwndTaskbar:HWND; bTaskBarOnTop:BOOL):BOOL; external KernelDLL name 'RegisterTaskBarEx'; // index 4DA
@@ -2639,6 +2649,12 @@ function RemoveMenu(hMenu:HMENU; uPosition:UINT; uFlags:UINT):WINBOOL; external
 function RemoveProp(hWnd:HWND; lpString:LPCWSTR):HANDLE; external KernelDLL name 'RemoveProp';
 function RemoveProp(hWnd:HWND; lpString:LPCWSTR):HANDLE; external KernelDLL name 'RemoveProp';
 function RequestDeviceNotifications(devclass:LPGUID; hMsgQ:HANDLE; fAll:BOOL):HANDLE; external KernelDLL name 'RequestDeviceNotifications'; // index 155
 function RequestDeviceNotifications(devclass:LPGUID; hMsgQ:HANDLE; fAll:BOOL):HANDLE; external KernelDLL name 'RequestDeviceNotifications'; // index 155
 function ResetEvent(hEvent:HANDLE):WINBOOL;
 function ResetEvent(hEvent:HANDLE):WINBOOL;
+function ResourceCreateList(dwResId:DWORD; dwMinimum:DWORD; dwCount:DWORD):BOOL; external KernelDLL name 'ResourceCreateList'; // index 15A
+function ResourceRelease(dwResId:DWORD; dwId:DWORD; dwLen:DWORD):BOOL; external KernelDLL name 'ResourceRelease'; // index 15C
+function ResourceRequest(dwResId:DWORD; dwId:DWORD; dwLen:DWORD):BOOL; external KernelDLL name 'ResourceRequest'; // index 15B
+function ResourceDestroyList(dwResId:DWORD):BOOL; external KernelDLL name 'ResourceDestroyList';
+function ResourceRequestEx(dwResId:DWORD; dwId:DWORD; dwLen:DWORD; dwFlags:DWORD):BOOL; external KernelDLL name 'ResourceRequestEx';
+function ResourceMarkAsShareable(dwResId:DWORD; dwId:DWORD; dwLen:DWORD; fShareable:BOOL):BOOL; external KernelDLL name 'ResourceMarkAsShareable';
 function RestoreDC(_para1:HDC; _para2:longint):WINBOOL; external KernelDLL name 'RestoreDC';
 function RestoreDC(_para1:HDC; _para2:longint):WINBOOL; external KernelDLL name 'RestoreDC';
 function ResumeThread(hThread:HANDLE):DWORD; external KernelDLL name 'ResumeThread';
 function ResumeThread(hThread:HANDLE):DWORD; external KernelDLL name 'ResumeThread';
 function RoundRect(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:longint; _para7:longint):WINBOOL; external KernelDLL name 'RoundRect';
 function RoundRect(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:longint; _para7:longint):WINBOOL; external KernelDLL name 'RoundRect';
@@ -2734,14 +2750,17 @@ function Shell_NotifyIcon(dwMessage: DWORD; lpData: PNotifyIconDataA): WINBOOL;
 function ShellExecuteEx(lpExecInfo:LPSHELLEXECUTEINFO):WINBOOL; external KernelDLL name 'ShellExecuteEx';
 function ShellExecuteEx(lpExecInfo:LPSHELLEXECUTEINFO):WINBOOL; external KernelDLL name 'ShellExecuteEx';
 function SHGetFileInfo(_para1:LPCTSTR; _para2:DWORD; var _para3:SHFILEINFO; _para4:UINT; _para5:UINT):DWORD; external KernelDLL name 'SHGetFileInfo';
 function SHGetFileInfo(_para1:LPCTSTR; _para2:DWORD; var _para3:SHFILEINFO; _para4:UINT; _para5:UINT):DWORD; external KernelDLL name 'SHGetFileInfo';
 function SHGetFileInfoW(_para1:LPCTSTR; _para2:DWORD; var _para3:SHFILEINFO; _para4:UINT; _para5:UINT):DWORD; external KernelDLL name 'SHGetFileInfo';
 function SHGetFileInfoW(_para1:LPCTSTR; _para2:DWORD; var _para3:SHFILEINFO; _para4:UINT; _para5:UINT):DWORD; external KernelDLL name 'SHGetFileInfo';
+function SHLoadDIBitmap(szFileName:LPCTSTR):HBITMAP; external KernelDLL name 'SHLoadDIBitmap'; // index 2EC
 function ShowCaret(hWnd:HWND):WINBOOL; external KernelDLL name 'ShowCaret';
 function ShowCaret(hWnd:HWND):WINBOOL; external KernelDLL name 'ShowCaret';
 function ShowCursor(bShow:WINBOOL):longint; external KernelDLL name 'ShowCursor';
 function ShowCursor(bShow:WINBOOL):longint; external KernelDLL name 'ShowCursor';
 function ShowWindow(hWnd:HWND; nCmdShow:longint):WINBOOL; external KernelDLL name 'ShowWindow';
 function ShowWindow(hWnd:HWND; nCmdShow:longint):WINBOOL; external KernelDLL name 'ShowWindow';
+procedure SignalStarted(dw:DWORD); external KernelDLL name 'SignalStarted'; // index 176
 function SizeofResource(hModule:HINST; hResInfo:HRSRC):DWORD; external KernelDLL name 'SizeofResource';
 function SizeofResource(hModule:HINST; hResInfo:HRSRC):DWORD; external KernelDLL name 'SizeofResource';
 procedure Sleep(dwMilliseconds:DWORD); external KernelDLL name 'Sleep';
 procedure Sleep(dwMilliseconds:DWORD); external KernelDLL name 'Sleep';
 function StartDoc(_para1:HDC; _para2:PDOCINFOW):longint; external KernelDLL name 'StartDocW';
 function StartDoc(_para1:HDC; _para2:PDOCINFOW):longint; external KernelDLL name 'StartDocW';
 function StartDocW(_para1:HDC; _para2:PDOCINFOW):longint; external KernelDLL name 'StartDocW';
 function StartDocW(_para1:HDC; _para2:PDOCINFOW):longint; external KernelDLL name 'StartDocW';
 function StartPage(_para1:HDC):longint; external KernelDLL name 'StartPage';
 function StartPage(_para1:HDC):longint; external KernelDLL name 'StartPage';
+function StopDeviceNotifications(h:HANDLE):BOOL; external KernelDLL name 'StopDeviceNotifications'; // index 156
 function StretchBlt(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:HDC; _para7:longint; _para8:longint; _para9:longint; _para10:longint;_para11:DWORD):WINBOOL; external KernelDLL name 'StretchBlt';
 function StretchBlt(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:HDC; _para7:longint; _para8:longint; _para9:longint; _para10:longint;_para11:DWORD):WINBOOL; external KernelDLL name 'StretchBlt';
 function StretchDIBits(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:longint; _para7:longint; _para8:longint; _para9:longint; _para10:pointer;var _para11:BITMAPINFO; _para12:UINT; _para13:DWORD):longint;
 function StretchDIBits(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:longint; _para7:longint; _para8:longint; _para9:longint; _para10:pointer;var _para11:BITMAPINFO; _para12:UINT; _para13:DWORD):longint;
   external KernelDLL name 'StretchDIBits';
   external KernelDLL name 'StretchDIBits';
@@ -3065,11 +3084,13 @@ begin
   GlobalFree:=LocalFree(hMem);
   GlobalFree:=LocalFree(hMem);
 end;
 end;
 
 
+{
 function GlobalHandle(pMem:LPCVOID):HGLOBAL;
 function GlobalHandle(pMem:LPCVOID):HGLOBAL;
 begin
 begin
   //GlobalHandle:=LocalHandle(pMem);
   //GlobalHandle:=LocalHandle(pMem);
   GlobalHandle:=HLOCAL(pMem); //see localhandle
   GlobalHandle:=HLOCAL(pMem); //see localhandle
 end;
 end;
+}
 
 
 function GlobalReAlloc(hMem:HGLOBAL; dwBytes:DWORD; uFlags:UINT):HGLOBAL;
 function GlobalReAlloc(hMem:HGLOBAL; dwBytes:DWORD; uFlags:UINT):HGLOBAL;
 begin
 begin
@@ -3081,11 +3102,13 @@ begin
   GlobalSize:=LocalSize(hMem);
   GlobalSize:=LocalSize(hMem);
 end;
 end;
 
 
+{
 function GlobalLock(hMem:HGLOBAL):LPVOID;
 function GlobalLock(hMem:HGLOBAL):LPVOID;
 begin
 begin
   //GlobalLock:=LocalLock(hMem);
   //GlobalLock:=LocalLock(hMem);
   GlobalLock:=LPVOID(hMem);  //see locallock
   GlobalLock:=LPVOID(hMem);  //see locallock
 end;
 end;
+}
 
 
 function GlobalUnlock(hMem:HGLOBAL):WINBOOL;
 function GlobalUnlock(hMem:HGLOBAL):WINBOOL;
 begin
 begin
@@ -3462,11 +3485,12 @@ begin
   ListView_Update:=SendMessage(hwndLV,LVM_UPDATE,WPARAM(i),0);
   ListView_Update:=SendMessage(hwndLV,LVM_UPDATE,WPARAM(i),0);
 end;
 end;
 
 
-
+{
 function LocalHandle(pMem:LPCVOID):HLOCAL;
 function LocalHandle(pMem:LPCVOID):HLOCAL;
 begin
 begin
   LocalHandle:=HLOCAL(pMem);
   LocalHandle:=HLOCAL(pMem);
 end;
 end;
+}
 
 
 function LocalDiscard(hlocMem:HLOCAL):HLOCAL;
 function LocalDiscard(hlocMem:HLOCAL):HLOCAL;
 begin
 begin
@@ -3571,7 +3595,7 @@ begin
 end;
 end;
 
 
 
 
-function PropSheet_SetCurSelByID(hPropSheetDlg : HWND; id : longint) : LRESULT;
+function PropSheet_SetCurSelByID(hPropSheetDlg : HWND; id : longint) : LRESULT; inline;
 begin
 begin
   PropSheet_SetCurSelByID:=SendMessage(hPropSheetDlg,PSM_SETCURSELID,0,LPARAM(id));
   PropSheet_SetCurSelByID:=SendMessage(hPropSheetDlg,PSM_SETCURSELID,0,LPARAM(id));
 end;
 end;

+ 315 - 1
rtl/wince/wininc/defines.inc

@@ -1633,7 +1633,8 @@
      ANSI_FIXED_FONT = 11;
      ANSI_FIXED_FONT = 11;
      ANSI_VAR_FONT = 12;
      ANSI_VAR_FONT = 12;
      DEVICE_DEFAULT_FONT = 14;
      DEVICE_DEFAULT_FONT = 14;
-     DEFAULT_GUI_FONT = 17;
+//     DEFAULT_GUI_FONT = 17;  Returns zero in the emulator and
+                            // isn't listed in MSDN, see bug 15062
      OEM_FIXED_FONT = 10;
      OEM_FIXED_FONT = 10;
      SYSTEM_FONT = 13;
      SYSTEM_FONT = 13;
      SYSTEM_FIXED_FONT = 16;
      SYSTEM_FIXED_FONT = 16;
@@ -2228,6 +2229,7 @@
      MOD_CONTROL = 2;
      MOD_CONTROL = 2;
      MOD_SHIFT = 4;
      MOD_SHIFT = 4;
      MOD_WIN = 8;
      MOD_WIN = 8;
+     MOD_KEYUP = $1000;
      IDHOT_SNAPDESKTOP = -(2);
      IDHOT_SNAPDESKTOP = -(2);
      IDHOT_SNAPWINDOW = -(1);
      IDHOT_SNAPWINDOW = -(1);
   { RegNotifyChangeKeyValue  }
   { RegNotifyChangeKeyValue  }
@@ -2657,6 +2659,9 @@
      TPM_HORIZONTAL = 0;
      TPM_HORIZONTAL = 0;
      TPM_BOTTOMALIGN = $20;
      TPM_BOTTOMALIGN = $20;
      TPM_VERTICAL = $40;
      TPM_VERTICAL = $40;
+     TPM_NONOTIFY        = $0080;     //* Don't send any notification msgs */
+     TPM_RETURNCMD       = $0100;
+
   { TranslateCharsetInfo  }
   { TranslateCharsetInfo  }
      TCI_SRCCHARSET = 1;
      TCI_SRCCHARSET = 1;
      TCI_SRCCODEPAGE = 2;
      TCI_SRCCODEPAGE = 2;
@@ -3866,6 +3871,7 @@
      ACS_AUTOPLAY = 4;
      ACS_AUTOPLAY = 4;
      ACS_CENTER = 1;
      ACS_CENTER = 1;
      ACS_TRANSPARENT = 2;
      ACS_TRANSPARENT = 2;
+     ACS_TIMER       = 8;  // don't use threads... use timers
   { MODEMDEVCAPS structure  }
   { MODEMDEVCAPS structure  }
      DIALOPTION_BILLING = 64;
      DIALOPTION_BILLING = 64;
      DIALOPTION_QUIET = 128;
      DIALOPTION_QUIET = 128;
@@ -5799,6 +5805,254 @@ const
       MSGSRC_SOFTWARE_POST        = 1;
       MSGSRC_SOFTWARE_POST        = 1;
       MSGSRC_HARDWARE_KEYBOARD    = 2;
       MSGSRC_HARDWARE_KEYBOARD    = 2;
 
 
+// define dwFlag values for LoadFSDEx function...
+const
+      LOADFSD_ASYNCH        = $0000;
+      LOADFSD_SYNCH        = $0001;
+
+// flag values for ResourceRequestEx()
+const
+      RREXF_REQUEST_EXCLUSIVE         = $0001;
+
+
+{* File:    ResMgr.h
+ *
+ * Purpose: Resource manager definitions
+ * The resource manager itself is part of the device manager (device.exe)
+ * and its affliated entry points are declared in winbase.h.
+ *
+ *}
+// Resource ids less than BASE_OEM are reserved by Microsoft;
+// Resource ids between these limits are for OEM use.
+const
+      RESMGR_BASE_OEM     = $00080000;
+      RESMGR_MAX_OEM      = $000FFFFF;
+// Resource ids greater than MAX_OEM are reserved for future use by Microsoft.
+
+// --- FIVE hex digits (not four) in these constants!
+const
+      RESMGR_IRQ          = $00001;
+      RESMGR_IOSPACE      = $00002;
+// End-of-file ResMgr.h
+
+const
+      MONITOR_DEFAULTTONULL    = $00000000;
+      MONITOR_DEFAULTTOPRIMARY = $00000001;
+      MONITOR_DEFAULTTONEAREST = $00000002;
+
+const
+      MONITORINFOF_PRIMARY        = $00000001;
+
+const
+      ENUM_CURRENT_SETTINGS  = DWORD(-1);
+      ENUM_REGISTRY_SETTINGS = DWORD(-2);
+
+// For EnumDisplayDevices
+const
+      DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = $00000001;
+      DISPLAY_DEVICE_MULTI_DRIVER        = $00000002;
+      DISPLAY_DEVICE_PRIMARY_DEVICE      = $00000004;
+      DISPLAY_DEVICE_MIRRORING_DRIVER    = $00000008;
+      DISPLAY_DEVICE_VGA_COMPATIBLE      = $00000010;
+      DISPLAY_DEVICE_REMOVABLE           = $00000020;
+      DISPLAY_DEVICE_MODESPRUNED         = $08000000;
+      DISPLAY_DEVICE_REMOTE              = $04000000;
+      DISPLAY_DEVICE_DISCONNECT          = $02000000;
+
+// Child device state
+const
+      DISPLAY_DEVICE_ACTIVE              = $00000001;
+      DISPLAY_DEVICE_ATTACHED            = $00000002;
+
+// winuserm.h
+// Mobile extensions to winuser.h
+
+//***  VK_T* Virtual keycodes for telephone keyboard
+{
+// the phone keypad maps to VK_* as shown below.
+// some keys might not be present, e.g. VK_TFLIP
+    sofkey1     softkey2    VK_TSOFT1, VK_TSOFT2
+            ^               VK_TUP
+        <   +   >           VK_TLEFT, VK_TACTION, VK_TRIGHT
+            v               VK_TDOWN
+    home        back        VK_THOME, VK_TBACK
+    talk        end         VK_TTALK, VK_TEND
+    1       2       3       VK_T0..VK_T9
+    4       5       6       ...
+    7       8       9       ...
+    *       0       #       VK_TSTAR, VK_TPOUND
+// other buttons include
+    VK_TRECORD
+    VK_TPOWER, VK_TVOLUMEUP, VK_TVOLUMEDOWN
+    VK_TFLIP
+}
+const
+      VK_TSOFT1               = VK_F1;               // Softkey 1
+      VK_TSOFT2               = VK_F2;               // Softkey 2
+      VK_TTALK                = VK_F3;               // Talk
+      VK_TEND                 = VK_F4;               // End
+      VK_THOME                = VK_LWIN;             // Home
+      VK_TBACK                = VK_ESCAPE;           // Back
+
+      VK_TACTION              = VK_RETURN;       // Action
+      VK_TRECORD              = VK_F10;          // Record
+      VK_TFLIP                = VK_F17;          // Flip
+      VK_TPOWER               = VK_F18;          // Power
+      VK_TVOLUMEUP            = VK_F6;           // Volume Up
+      VK_TVOLUMEDOWN          = VK_F7;           // Volume Down
+
+      VK_TSPEAKERPHONE_TOGGLE = VK_F16;
+      VK_END_ALL_DATA_CALLS   = VK_F15;
+
+
+      VK_TUP                  = VK_UP;               // Up
+      VK_TDOWN                = VK_DOWN;             // Down
+      VK_TLEFT                = VK_LEFT;             // Left
+      VK_TRIGHT               = VK_RIGHT;            // Right
+
+      VK_T0                   = longint(WideChar('0'));                // 0 .. 9 keys
+      VK_T1                   = longint(WideChar('1'));
+      VK_T2                   = longint(WideChar('2'));
+      VK_T3                   = longint(WideChar('3'));
+      VK_T4                   = longint(WideChar('4'));
+      VK_T5                   = longint(WideChar('5'));
+      VK_T6                   = longint(WideChar('6'));
+      VK_T7                   = longint(WideChar('7'));
+      VK_T8                   = longint(WideChar('8'));
+      VK_T9                   = longint(WideChar('9'));
+      VK_TSTAR                = VK_F8;               // *
+      VK_TPOUND               = VK_F9;               // #
+
+      VK_SYMBOL               = VK_F11;              // Symbol (SYM) key
+
+      VK_REDKEY               = VK_F19;              // Sent by a keypad that has a special red function key
+      VK_ROCKER               = VK_F20;              // Arrow keys came from a Rocker
+      VK_DPAD                 = VK_F21;              // Arrow keys came from a DPAD
+      VK_ACTION               = VK_F23;              // Sent with VK_RETURN when doing Action on PPC rockers
+
+      VK_VOICEDIAL            = VK_F24;            // Key used to kick off voice dial recognition
+      VK_KEYLOCK              = VK_F22;            // Key used to lock the device
+
+// Chorded keys.  DONE is VK_RWIN + VK_F6 and MOJI is VK_RWIN + VK_F7
+const
+      VK_DONE     = VK_F6;                 // <OK/Close> hotkey code
+      MOD_DONE    = MOD_WIN or MOD_KEYUP; // <OK/Close> hotkey modifiers
+
+      VK_MOJI     = VK_F7;                 // Key used to switch between FE language layouts
+      MOD_MOJI    = MOD_WIN or MOD_KEYUP;  //Modifiers so MOJI goes to the shell
+
+
+// App keys
+const
+      VK_APP_FIRST    = $C1;
+      VK_APP1         = $C1;
+      VK_APP2         = $C2;
+      VK_APP3         = $C3;
+      VK_APP4         = $C4;
+      VK_APP5         = $C5;
+      VK_APP6         = $C6;
+      VK_APP_LAST     = $C6;
+
+// Specifies keys whose autorepeats should be silent. (Used by the keyboard driver.)
+// All keys except the nav keys should have silent autorepeats.
+// #define SILENT_REPEAT(uVKey) (uVKey < VK_LEFT || uVKey > VK_DOWN)
+function SILENT_REPEAT(uVKey:longint):BOOL; inline;
+
+// #define Edit_GetInputMode(hwndCtl, fActual)     ((int)(DWORD)SNDMSG((hwndCtl), EM_GETINPUTMODE, 0L, (LPARAM)(BOOL)(fActual)))
+function Edit_GetInputMode(hwndCtl:HWND; fActual:BOOL):longint;
+// #define Edit_SetInputMode(hwndCtl, nInputMode)  ((BOOL)(DWORD)SNDMSG((hwndCtl), EM_SETINPUTMODE, 0L, (LPARAM)(int)(nInputMode)))
+function Edit_SetInputMode(hwndCtl:HWND; nInputMode:longint):Bool;
+
+// #define Edit_SetSymbols(hwndCtl, pszSymbols)    ((BOOL)(DWORD)SNDMSG((hwndCtl), EM_SETSYMBOLS, 0L, (LPARAM)(LPCTSTR)(pszSymbols)))
+function Edit_SetSymbols(hwndCtl:HWND; pszSymbols:LPCTSTR):BOOL;
+
+// #define Edit_SetExtendedStyle(hwndCtl, dwMask, dwExStyle)    ((DWORD)SNDMSG((hwndCtl), EM_SETEXTENDEDSTYLE, (WPARAM)(DWORD)(dwMask), (LPARAM)(DWORD)(dwExStyle)))
+function Edit_SetExtendedStyle(hwndCtl:HWND; dwMask:DWORD; dwExStyle:DWORD):DWORD;
+
+// #define Edit_GetExtendedStyle(hwndCtl)                       ((DWORD)SNDMSG((hwndCtl), EM_GETEXTENDEDSTYLE, 0L, 0L))
+function Edit_GetExtendedStyle(hwndCtl:HWND):DWORD;
+
+// Edit control extended styles
+const
+      ES_EX_CLEARONBACKPRESSHOLD      = $00000001;  // Clear all contents when user does Press&Hold of Back key.
+      ES_EX_FOCUSBORDERDISABLED       = $00000002;  // Prevent control from drawing a border when it gains focus.
+
+// IME Input Modes
+const
+      IM_SPELL           = 0;
+      IM_AMBIG           = 1;
+      IM_NUMBERS         = 2;
+      IM_LAST            = IM_NUMBERS;
+      IM_MASK            = $0000FFFF;       // Mask to access mode.
+
+// IME Input Mode Modifier Flags
+      IMMF_SETCLR_SHIFT       = $00010000;  // In. Used to set/clear Shift.
+      IMMF_SETCLR_CAPSLOCK    = $00020000;  // In. Used to set/clear Capslock.
+      IMMF_SHIFT              = $01000000;  // In/Out. Shift state.
+      IMMF_CAPSLOCK           = $02000000;  // In/Out. CapsLock state.
+      IMMF_MASK               = $FFFF0000;  // Mask to access modifier flags.
+
+// Input modes for EM_SETINPUTMODE/EM_GETINPUTMODE
+      EIM_SPELL                   = IM_SPELL;       // Spell input mode
+      EIM_AMBIG                   = IM_AMBIG;       // Ambiguous mode if input engine supports this mode. Else defaults to Spell mode.
+      EIM_NUMBERS                 = IM_NUMBERS;     // Numbers mode.
+      EIM_TEXT                    = IM_LAST + 1;    // User's preferred mode. This is the user's last Spell or Ambig mode selection
+                                                    // in an EIM_TEXT edit control.
+      EIM_MASK                    = IM_MASK;        // Mask to access mode.
+
+// Macro to access mode
+// #define EIM_MODE(x)                 (x & EIM_MASK)
+function EIM_MODE(x:DWORD):DWORD;
+
+// Input mode modifier flags
+const
+      EIMMF_SETCLR_SHIFT          = IMMF_SETCLR_SHIFT;       // In. Used to set/clear Shift.
+      EIMMF_SETCLR_CAPSLOCK       = IMMF_SETCLR_CAPSLOCK;    // In. Used to set/clear Capslock.
+      EIMMF_SHIFT                 = IMMF_SHIFT;              // In/Out. Shift state.
+      EIMMF_CAPSLOCK              = IMMF_CAPSLOCK;           // In/Out. CapsLock state.
+      EIMMF_MASK                  = IMMF_MASK;               // Mask to access modifier flags.
+
+// Macro to access modifier flags
+// #define EIM_MODIFIERS(x)            (x & EIMMF_MASK)
+function EIM_MODIFIERS(x:DWORD):DWORD;
+
+
+// #define ListBox_GetInputMode(hwndCtl, fActual)              ((int)(DWORD)SNDMSG((hwndCtl), LB_GETINPUTMODE, 0L, (WPARAM)(BOOL)(fActual)))
+function ListBox_GetInputMode(hwndCtl:HWND; fActual:BOOL):longint;
+
+// #define ListBox_SetInputMode(hwndCtl, nInputMode)           ((BOOL)(DWORD)SNDMSG((hwndCtl), LB_SETINPUTMODE, 0L, (LPARAM)(int)(nInputMode)))
+function ListBox_SetInputMode(hwndCtl:HWND; nInputMode:longint):BOOL;
+
+// Input modes for LB_SETINPUTMODE/LB_GETINPUTMODE
+const
+      LIM_SPELL                   = IM_SPELL;                // Spell input mode
+      LIM_NUMBERS                 = IM_NUMBERS;              // Numbers mode.
+
+// wParam of  WM_IME_REQUEST. Extension for Mobile.
+const
+      IMR_ISIMEAWARE           = $1000;  // Is window IME aware?
+
+// Return values of IMR_ISIMEAWARE
+const
+      IMEAF_AWARE         = $00000001; // Window is IME aware
+      IMEAF_SMART_CAPS    = $00000002; // Window uses smart caps.
+
+// Extension of WM_HOTKEY MOD_* values for Mobile
+const
+      MOD_HOLD                = $8000; // Was WM_HOTKEY caused by Press&Hold
+
+const
+      MIIM_FULLSTR            = $10000000;
+
+const
+      SS_REALSIZEIMAGE    = $00000800;
+      
+// End-of-winuserm.h
+
+const
+      MAXINTATOM = ATOM($C000);
+      INVALID_ATOM = ATOM(0);
+
 {$endif read_interface}
 {$endif read_interface}
 
 
 
 
@@ -5985,6 +6239,66 @@ const
        GetFirstChild:=GetWindow(h,GW_CHILD);
        GetFirstChild:=GetWindow(h,GW_CHILD);
     end;
     end;
 
 
+// winuserm.h
+// Mobile extensions to winuser.h
+
+// Specifies keys whose autorepeats should be silent. (Used by the keyboard driver.)
+// All keys except the nav keys should have silent autorepeats.
+// #define SILENT_REPEAT(uVKey) (uVKey < VK_LEFT || uVKey > VK_DOWN)
+function SILENT_REPEAT(uVKey:longint):BOOL; inline;
+begin
+  SILENT_REPEAT:=(uVKey<VK_LEFT) or (uVKey>VK_DOWN);
+end;
+
+
+function Edit_GetInputMode(hwndCtl:HWND; fActual:BOOL):longint; inline;
+begin
+  Edit_GetInputMode:=longint(SendMessage(hwndCtl,EM_GETINPUTMODE,WPARAM(0),LPARAM(fActual)));
+end;
+
+function Edit_SetInputMode(hwndCtl:HWND; nInputMode:longint):Bool; inline;
+begin
+  Edit_SetInputMode:=BOOL(DWORD(SendMessage(hwndCtl,EM_SETINPUTMODE,WPARAM(0),LPARAM(nInputMode))));
+end;
+
+function Edit_SetSymbols(hwndCtl:HWND; pszSymbols:LPCTSTR):BOOL; inline;
+begin
+  Edit_SetSymbols:=BOOL(SendMessage(hwndCtl,EM_SETSYMBOLS,WPARAM(0),LPARAM(pszSymbols)));
+end;
+
+function Edit_SetExtendedStyle(hwndCtl:HWND; dwMask:DWORD; dwExStyle:DWORD):DWORD; inline;
+begin
+  Edit_SetExtendedStyle:=DWORD(SendMessage(hwndCtl,EM_SETEXTENDEDSTYLE,WPARAM(dwMask),LPARAM(dwExStyle)));
+end;
+
+function Edit_GetExtendedStyle(hwndCtl:HWND):DWORD; inline;
+begin
+  Edit_GetExtendedStyle:=DWORD(SendMessage(hwndCtl,EM_GETEXTENDEDSTYLE,WPARAM(0),LPARAM(0)));
+end;
+
+
+function EIM_MODE(x:DWORD):DWORD; inline;
+begin
+  EIM_MODE:=x and EIM_MASK;
+end;
+
+function EIM_MODIFIERS(x:DWORD):DWORD; inline;
+begin
+  EIM_MODIFIERS:=x and EIMMF_MASK;
+end;
+
+function ListBox_GetInputMode(hwndCtl:HWND; fActual:BOOL):longint; inline;
+begin
+  ListBox_GetInputMode:=longint(SendMessage(hwndCtl,LB_GETINPUTMODE,WPARAM(0),LPARAM(fActual)));
+end;
+
+function ListBox_SetInputMode(hwndCtl:HWND; nInputMode:longint):BOOL; inline;
+begin
+  ListBox_SetInputMode:=BOOL(SendMessage(hwndCtl,LB_SETINPUTMODE,WPARAM(0),LPARAM(nInputMode)));
+end;
+
+// End-of-winuserm.h
+
 {$ifdef WINCE}
 {$ifdef WINCE}
 {$endif WINCE}
 {$endif WINCE}
 
 

+ 49 - 0
rtl/wince/wininc/messages.inc

@@ -1132,6 +1132,55 @@
      WM_XBUTTONUP     = 524;
      WM_XBUTTONUP     = 524;
      WM_XBUTTONDBLCLK = 525;
      WM_XBUTTONDBLCLK = 525;
 
 
+// winuserm.h
+// Mobile extensions to winuser.h
+
+// Edit control extensions for Mobile
+const
+     // If lParam is FALSE, gets default input mode.
+     // If lParam is TRUE, gets actual input mode if control has focus, else
+     // gets default input mode. Returns EIM_*|EIMMF_*
+      EM_GETINPUTMODE       = $00DD;
+
+     // Sets default input mode when control gets focus. lParam should be be EIM_*|EIMMF_*.
+      EM_SETINPUTMODE       = $00DE;
+
+     // Sets symbols that are displayed when the user presses the 1 key in
+     // Multipress mode. lParam is a null-teminated string containing the symbols
+     // or NULL to revert to standard symbols.
+      EM_SETSYMBOLS         = $00DF;
+
+     // Sets extended styles. wParam = Mask. lParam = Extended styles. Returns old styles.
+      EM_SETEXTENDEDSTYLE   = $00E0;
+
+     // Gets extended styles.
+      EM_GETEXTENDEDSTYLE   = $00E1;
+
+
+// Listbox control extensions for Mobile. Supported only for single selection listboxes.
+const
+     // If lParam is FALSE, gets default input mode.
+     // If lParam is TRUE, gets actual input mode if control has focus, else
+     // gets default input mode. Returns LIM_*
+      LB_GETINPUTMODE       = $01C0;
+
+     // Sets default input mode when control gets focus. lParam should be be LIM_*.
+      LB_SETINPUTMODE       = $01C1;
+
+// Dialog message extensions
+//
+// Reset scroll info. To be sent by a dialog if it does a relayout of child
+// controls after WM_INITDIALOG. Supported only if the dialog returns DLGC_SCROLL
+// on WM_GETDLGCODE.
+// wParam: TRUE to scroll back to top if user scrolled dialog. FALSE to leave
+// dialog in position that user scrolled to.
+// lParam: TRUE to recompute scroll information. FALSE to use previously computed
+// scroll information.
+const
+      DM_RESETSCROLL          = WM_USER + 2;
+
+// End-of-winuserm.h
+
 Type
 Type
 {$ifdef MESSAGESUNIT}
 {$ifdef MESSAGESUNIT}
 
 

+ 1 - 0
rtl/wince/wininc/redef.inc

@@ -20,6 +20,7 @@
 type
 type
   PIID = PGUID;
   PIID = PGUID;
   TIID = TGUID;
   TIID = TGUID;
+  REFIID = ^TIID;
   THANDLE = HANDLE;
   THANDLE = HANDLE;
 
 
   PSmallRect = ^TSmallRect;
   PSmallRect = ^TSmallRect;

+ 48 - 0
rtl/wince/wininc/struct.inc

@@ -280,6 +280,7 @@
              1: (TopLeft,BottomRight : TPoint);
              1: (TopLeft,BottomRight : TPoint);
        end;
        end;
      LPRECT = ^RECT;
      LPRECT = ^RECT;
+     LPCRECT = ^RECT;
      _RECT = RECT;
      _RECT = RECT;
      TRECT = RECT;
      TRECT = RECT;
      PRECT = ^RECT;
      PRECT = ^RECT;
@@ -5347,11 +5348,18 @@
      _GUID = GUID;
      _GUID = GUID;
      TGUID = GUID;
      TGUID = GUID;
      PGUID = ^GUID;
      PGUID = ^GUID;
+     REFGUID = ^GUID;
 
 
      CLSID = GUID;
      CLSID = GUID;
      LPCLSID = ^CLSID;
      LPCLSID = ^CLSID;
      TCLSID = CLSID;
      TCLSID = CLSID;
      PCLSID = ^CLSID;
      PCLSID = ^CLSID;
+     REFCLSID = ^CLSID;
+
+     FMTID = GUID;
+     LPFMTID = ^FMTID;
+     REFFMTID = ^FMTID;
+
 
 
      SERVICE_INFO = record
      SERVICE_INFO = record
           lpServiceType : LPGUID;
           lpServiceType : LPGUID;
@@ -7721,6 +7729,46 @@ type
     PINPUT = ^tagINPUT;
     PINPUT = ^tagINPUT;
     LPINPUT = ^tagINPUT;
     LPINPUT = ^tagINPUT;
 
 
+
+// For EnumDisplayMonitors
+type
+     MONITORENUMPROC = function(_hMonitor:HMONITOR; hdcMonitor:HDC; lprcMonitor:LPRECT; dwData:LPARAM):BOOL;
+
+// For GetMonitorInfo
+type
+     tagMONITORINFO = record
+       cbSize:DWORD;
+       rcMonitor:RECT;
+       rcWork:RECT;
+       dwFlags:DWORD;
+     end;
+     MONITORINFO = tagMONITORINFO;
+     LPMONITORINFO = ^tagMONITORINFO;
+
+     tagMONITORINFOEX = record
+       cbSize:DWORD;
+       rcMonitor:RECT;
+       rcWork:RECT;
+       dwFlags:DWORD;
+        szDevice:array[0..CCHDEVICENAME-1] of TCHAR;
+     end;
+     MONITORINFOEX = tagMONITORINFOEX;
+     LPMONITORINFOEX = ^tagMONITORINFOEX;
+
+// For EnumDisplayDevices
+type
+     _DISPLAY_DEVICE = record
+       cb:DWORD;
+       DeviceName:array[0..31] of TCHAR;
+       DeviceString:array[0..127] of TCHAR;
+       StateFlags:DWORD;
+       DeviceID:array[0..127] of TCHAR;
+       DeviceKey:array[0..127] of TCHAR;
+     end;
+     DISPLAY_DEVICE = _DISPLAY_DEVICE;
+     PDISPLAY_DEVICE = ^_DISPLAY_DEVICE;
+     LPDISPLAY_DEVICE = ^_DISPLAY_DEVICE;
+
 {$endif read_interface}
 {$endif read_interface}