Quellcode durchsuchen

Merged revisions 10961-10965,10970-10971 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r10961 | yury | 2008-05-13 13:52:03 +0300 (Вт, 13 май 2008) | 1 line

* Added some API imports and constants by Vasil.
........
r10962 | yury | 2008-05-13 13:55:53 +0300 (Вт, 13 май 2008) | 1 line

+ Added sipapi unit by Vasil.
........
r10963 | yury | 2008-05-13 16:12:07 +0300 (Вт, 13 май 2008) | 1 line

* Fixed removing stabs for unused functions. It fixes debugging problems.
........
r10970 | yury | 2008-05-14 19:26:02 +0300 (Ср, 14 май 2008) | 1 line

* Some additions to Windows unit by Vasil Maximov.
........
r10971 | yury | 2008-05-14 19:34:19 +0300 (Ср, 14 май 2008) | 1 line

+ Added cpl unit by Vasil Maximov.
........

git-svn-id: branches/fixes_2_2@10972 -

yury vor 17 Jahren
Ursprung
Commit
c2e48b7eec

+ 2 - 0
.gitattributes

@@ -4341,6 +4341,7 @@ packages/winceunits/src/buildwinceunits.pp svneol=native#text/plain
 packages/winceunits/src/cesync.pp svneol=native#text/plain
 packages/winceunits/src/commctrl.pp svneol=native#text/plain
 packages/winceunits/src/commdlg.pp svneol=native#text/plain
+packages/winceunits/src/cpl.pp svneol=native#text/plain
 packages/winceunits/src/gpsapi.pp svneol=native#text/plain
 packages/winceunits/src/gx.pp svneol=native#text/plain
 packages/winceunits/src/htmlctrl.pp svneol=native#text/plain
@@ -4354,6 +4355,7 @@ packages/winceunits/src/rapi.pp svneol=native#text/plain
 packages/winceunits/src/service.pp svneol=native#text/plain
 packages/winceunits/src/shellapi.pp svneol=native#text/plain
 packages/winceunits/src/simmgr.pp svneol=native#text/plain
+packages/winceunits/src/sipapi.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/windbase.pp svneol=native#text/plain

+ 3 - 2
compiler/ogbase.pas

@@ -2218,8 +2218,9 @@ implementation
                       skipstab:=true;
                     if skipfun then
                       begin
-                        skipstab:=hstab.ntype in [N_TextLine,N_RSYM,N_LSYM,N_tsym,N_LBRAC,N_RBRAC,N_IncludeFile];
-                        skipfun:=skipstab;
+                        { Skip all stabs for function body until N_RBRAC }
+                        skipfun:=hstab.ntype<>N_RBRAC;
+                        skipstab:=true;
                       end;
                     if not skipstab then
                       begin

+ 2 - 2
packages/winceunits/Makefile

@@ -252,10 +252,10 @@ ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_UNITS+=buildwinceunits
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl
+override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl sipapi cpl
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl
+override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl sipapi cpl
 endif
 override INSTALL_BUILDUNIT=buildwinceunits
 override INSTALL_FPCPACKAGE=y

+ 2 - 1
packages/winceunits/Makefile.fpc

@@ -9,7 +9,8 @@ version=2.2.0
 [target]
 units_wince=buildwinceunits
 implicitunits_wince=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi \
-                    gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl
+                    gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl \
+                    sipapi cpl
 units_win32=rapi cesync
 
 [install]

+ 2 - 1
packages/winceunits/src/buildwinceunits.pp

@@ -22,7 +22,8 @@ interface
 
 uses
   aygshell,commctrl,commdlg,iphlpapi,notify,oleauto,power,shellapi,simmgr,tapi,
-  gpsapi,todaycmn,windbase,cesync,gx,winioctl,msgqueue,pm,service,htmlctrl;
+  gpsapi,todaycmn,windbase,cesync,gx,winioctl,msgqueue,pm,service,htmlctrl,
+  sipapi, cpl;
 
 implementation
 

+ 247 - 0
packages/winceunits/src/cpl.pp

@@ -0,0 +1,247 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+//*******************************************************************************
+//*                                                                             *
+//* cpl.h -       Control panel extension DLL definitions                       *
+//*                                                                             *
+//*               Version 3.10                                                  *
+//*                                                                             *
+//*               Copyright (c) Microsoft Corporation. All rights reserved.     *
+//*                                                                             *
+//*******************************************************************************
+//*
+//*  General rules for being installed in the Control Panel:
+//*
+//*      1) The DLL must export a function named CPlApplet which will handle
+//*         the messages discussed below.
+//*      2) If the applet needs to save information in CONTROL.INI minimize
+//*         clutter by using the application name [MMCPL.appletname].
+//*      2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
+//*         the following form:
+//*              ...
+//*              [MMCPL]
+//*              uniqueName=c:\mydir\myapplet.dll
+//*              ...
+//*
+//*
+//*  The order applet DLL's are loaded by CONTROL.EXE is:
+//*
+//*      1) MAIN.CPL is loaded from the windows system directory.
+//*
+//*      2) Installable drivers that are loaded and export the
+//*         CplApplet() routine.
+//*
+//*      3) DLL's specified in the [MMCPL] section of CONTROL.INI.
+//*
+//*      4) DLL's named *.CPL from windows system directory.
+//*
+//*
+
+//
+//  Microsoft Windows Mobile 6.0 for PocketPC SDK.
+//
+
+unit cpl;
+
+interface
+
+uses Windows;
+
+{$PACKRECORDS 1} // #include "pshpack1.h"   /* Assume byte packing throughout */
+
+{*
+ * CONTROL.EXE will answer this message and launch an applet
+ *
+ * WM_CPL_LAUNCH
+ *
+ *      wParam      - window handle of calling app
+ *      lParam      - LPTSTR of name of applet to launch
+ *
+ * WM_CPL_LAUNCHED
+ *
+ *      wParam      - TRUE/FALSE if applet was launched
+ *      lParam      - NULL
+ *
+ * CONTROL.EXE will post this message to the caller when the applet returns
+ * (ie., when wParam is a valid window handle)
+ *
+ *}
+const
+      WM_CPL_LAUNCH   = WM_USER + 1000;
+      WM_CPL_LAUNCHED = WM_USER + 1001;
+
+//* A function prototype for CPlApplet() */
+
+//typedef LRESULT (APIENTRY *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
+type
+     APPLET_PROC = function(hwndCpl:HWND; msg:UINT; lParam1:LONG; lParam2:LONG):LONG; cdecl;
+
+
+//* The data structure CPlApplet() must fill in. */
+
+type
+     tagCPLINFO = record
+       idIcon:longint;     //* icon resource id, provided by CPlApplet() */
+       idName:longint;     //* name string res. id, provided by CPlApplet() */
+       idInfo:longint;     //* info string res. id, provided by CPlApplet() */
+       lData:LONG;      //* user defined data */
+     end;
+     CPLINFO = tagCPLINFO;
+     LPCPLINFO = ^tagCPLINFO;
+
+type
+     tagNEWCPLINFOA = record
+       dwSize:DWORD;         //* similar to the commdlg */
+       dwFlags:DWORD;
+       dwHelpContext:DWORD;  //* help context to use */
+       lData:LONG;          //* user defined data */
+       _hIcon:HICON;        //* icon to use, this is owned by CONTROL.EXE (may be deleted) */
+       szName:array[0..31] of AnsiChar;     //* short name */
+       szInfo:array[0..63] of AnsiChar;     //* long name (status line) */
+       szHelpFile:array[0..127] of AnsiChar;//* path to help file to use */
+     end;
+     NEWCPLINFOA = tagNEWCPLINFOA;
+     LPNEWCPLINFOA = ^tagNEWCPLINFOA;
+
+type
+     tagNEWCPLINFOW = record
+       dwSize:DWORD;         //* similar to the commdlg */
+       dwFlags:DWORD;
+       dwHelpContext:DWORD;  //* help context to use */
+       lData:LONG;          //* user defined data */
+       _hIcon:HICON;          //* icon to use, this is owned by CONTROL.EXE (may be deleted) */
+       szName:array[0..31] of WideChar;     //* short name */
+       szInfo:array[0..63] of WideChar;     //* long name (status line) */
+       szHelpFile:array[0..127] of WideChar;//* path to help file to use */
+     end;
+     NEWCPLINFOW = tagNEWCPLINFOW;
+     LPNEWCPLINFOW = ^tagNEWCPLINFOW;
+
+{$IFDEF UNICODE}
+type
+     NEWCPLINFO = NEWCPLINFOW;
+     LPNEWCPLINFO = LPNEWCPLINFOW;
+{$ELSE UNICODE}
+type
+     NEWCPLINFO = NEWCPLINFOA;
+     LPNEWCPLINFO = LPNEWCPLINFOA;
+{$ENDIF UNICODE}
+
+///* The messages CPlApplet() must handle: */
+
+const
+      CPL_DYNAMIC_RES = 0;
+// This constant may be used in place of real resource IDs for the idIcon,
+// idName or idInfo members of the CPLINFO structure.  Normally, the system
+// uses these values to extract copies of the resources and store them in a
+// cache.  Once the resource information is in the cache, the system does not
+// need to load a CPL unless the user actually tries to use it.
+// CPL_DYNAMIC_RES tells the system not to cache the resource, but instead to
+// load the CPL every time it needs to display information about an item.  This
+// allows a CPL to dynamically decide what information will be displayed, but
+// is SIGNIFICANTLY SLOWER than displaying information from a cache.
+// Typically, CPL_DYNAMIC_RES is used when a control panel must inspect the
+// runtime status of some device in order to provide text or icons to display.
+
+
+const
+      CPL_INIT        = 1;
+//*  This message is sent to indicate CPlApplet() was found. */
+//*  lParam1 and lParam2 are not defined. */
+//*  Return TRUE or FALSE indicating whether the control panel should proceed. */
+
+
+const
+      CPL_GETCOUNT    = 2;
+//*  This message is sent to determine the number of applets to be displayed. */
+//*  lParam1 and lParam2 are not defined. */
+//*  Return the number of applets you wish to display in the control */
+//*  panel window. */
+
+
+const
+      CPL_INQUIRE     = 3;
+//*  This message is sent for information about each applet. */
+//*  lParam1 is the applet number to register, a value from 0 to */
+//*  (CPL_GETCOUNT - 1).  lParam2 is a far ptr to a CPLINFO structure. */
+//*  Fill in CPL_INFO's idIcon, idName, idInfo and lData fields with */
+//*  the resource id for an icon to display, name and description string ids, */
+//*  and a long data item associated with applet #lParam1. */
+
+
+const
+      CPL_SELECT      = 4;
+//*  This message is sent when the applet's icon has been clicked upon. */
+//*  lParam1 is the applet number which was selected.  lParam2 is the */
+//*  applet's lData value. */
+
+
+const
+      CPL_DBLCLK      = 5;
+//*  This message is sent when the applet's icon has been double-clicked */
+//*  upon.  lParam1 is the applet number which was selected.  lParam2 is the */
+//*  applet's lData value. */
+//*  This message should initiate the applet's dialog box. */
+
+
+const
+      CPL_STOP        = 6;
+//*  This message is sent for each applet when the control panel is exiting. */
+//*  lParam1 is the applet number.  lParam2 is the applet's lData  value. */
+//*  Do applet specific cleaning up here. */
+
+
+const
+      CPL_EXIT        = 7;
+//*  This message is sent just before the control panel calls FreeLibrary. */
+//*  lParam1 and lParam2 are not defined. */
+//*  Do non-applet specific cleaning up here. */
+
+
+const
+      CPL_NEWINQUIRE    = 8;
+//* this is the same as CPL_INQUIRE execpt lParam2 is a pointer to a */
+//* NEWCPLINFO structure.  this will be sent before the CPL_INQUIRE */
+//* and if it is responed to (return != 0) CPL_INQUIRE will not be sent */
+
+
+const
+      CPL_STARTWPARMS  = 9;
+{* this message parallels CPL_DBLCLK in that the applet should initiate
+** its dialog box.  where it differs is that this invocation is coming
+** out of RUNDLL, and there may be some extra directions for execution.
+** lParam1: the applet number.
+** lParam2: an LPSTR to any extra directions that might exist.
+** returns: TRUE if the message was handled; FALSE if not.
+*}
+
+
+const
+      CPL_IDNAME    = 100;
+(* this message gives the id (WCHAR) name of a cpl that can be used
+** to find it's registry data hive (HKLM\ControlPanel\{name})
+** lParam2 == pointer to string of buffer length 32.  the name is NOT
+** required to be the display name
+** lParam1 == which applet of the cpl
+*)
+
+//* This message is internal to the Control Panel and MAIN applets.  */
+//* It is only sent when an applet is invoked from the Command line  */
+//* during system installation.                                      */
+const
+      CPL_SETUP               = 200;
+
+{$PACKRECORDS DEFAULT} // #include "poppack.h"
+
+implementation
+
+end.

+ 107 - 0
packages/winceunits/src/sipapi.pp

@@ -0,0 +1,107 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ ********************************************************************** }
+//
+// Module: sipapi.h
+//
+
+//
+//  Microsoft Windows Mobile 5.0 for PocketPC SDK.
+//
+
+unit SIPApi;
+
+{$CALLING cdecl}
+
+interface
+
+uses Windows;
+
+const
+      SIP_STATUS_UNAVAILABLE	= 0;
+      SIP_STATUS_AVAILABLE	  = 1;
+
+function SipStatus:DWORD; external KernelDLL name 'SipStatus'; // index 659
+
+
+function SipSetDefaultRect(lprt:LPRECT):BOOL; external KernelDLL name 'SipSetDefaultRect'; // index 661
+function SipRegisterNotification(hWin:HWND):BOOL; external KernelDLL name 'SipRegisterNotification'; // index 65A
+
+function SipShowIM(dwFlag:DWORD):BOOL; external KernelDLL name 'SipShowIM'; // index 65B
+
+const
+      SIPF_OFF	   = $00000000;
+      SIPF_ON 	   = $00000001;
+      SIPF_DOCKED	= $00000002;
+      SIPF_LOCKED	= $00000004;
+
+      SPI_SETCOMPLETIONINFO	= 223;
+      SPI_SETSIPINFO			     = 224;
+      SPI_GETSIPINFO			     = 225;
+      SPI_SETCURRENTIM      = 226;
+      SPI_GETCURRENTIM      = 227;
+      SPI_SIPMOVE	          = 250;
+
+type
+     tagSIPINFO = record
+       cbSize:DWORD;
+       fdwFlags:DWORD;
+       rcVisibleDesktop:RECT;
+       rcSipRect:RECT;
+       dwImDataSize:DWORD;
+       pvImData:LPVOID;
+     end;
+     SIPINFO = tagSIPINFO;
+     LPSIPINFO = ^tagSIPINFO;
+
+function SipGetInfo(pSipInfo:LPSIPINFO):BOOL; external KernelDLL name 'SipGetInfo'; // index 65C
+
+function SipSetInfo(pSipInfo:LPSIPINFO):BOOL; external KernelDLL name 'SipSetInfo'; // index 65D
+
+type
+     tagIMENUMINFO = record
+       szName:array[0..MAX_PATH-1] of TCHAR;
+       clsid:CLSID;
+     end;
+     IMENUMINFO = tagIMENUMINFO;
+     PIMENUMINFO = ^tagIMENUMINFO;
+
+type
+     IMENUMPROC = function(pIMInfo:PIMENUMINFO):longint;
+
+function SipEnumIM(pEnumIMProc:IMENUMPROC):longint; external KernelDLL name 'SipEnumIM'; // index 65E
+function SipGetCurrentIM(pClsid:LPCLSID):BOOL; external KernelDLL name 'SipGetCurrentIM'; // index 65F
+function SipSetCurrentIM(pClsid:LPCLSID):BOOL; external KernelDLL name 'SipSetCurrentIM'; // index 660
+
+type
+     tagIMWINDOWPOS = record
+       x:longint;	    // Screen coordinate
+       y:longint;	    // Screen coordinate
+       cx:longint;     // Screen coordinate
+       cy:longint;     // Screen coordinate
+     end;
+     IMWINDOWPOS = tagIMWINDOWPOS;
+     LPIMWINDOWPOS = ^tagIMWINDOWPOS;
+
+// The following defines are for the WPARAM value in WM_IM_INFO.
+const
+      IM_POSITION			= 0;
+      IM_WIDEIMAGE		= 1;
+      IM_NARROWIMAGE		= 2;
+      IM_HWND_CONTEXT		= 3;
+      IM_CONVERSION_MODE	= 4;
+      IM_SENTENCE_MODE	= 5;
+      IM_KEYBOARD_LAYOUT	= 6;
+
+implementation
+
+end.

+ 12 - 23
rtl/wince/wininc/coredll.inc

@@ -375,9 +375,6 @@
       694 MD5Init
       695 MD5Update
        17 MainThreadBaseFunc
-      662 MonitorFromPoint
-      663 MonitorFromRect
-      664 MonitorFromWindow
       33C NKDbgPrintfW
       3A7 NKTerminateThread
       36F NKvDbgPrintfW
@@ -410,7 +407,6 @@
       1CE PegWriteRecordProps
       2F1 PerformCallBack4
       267 PlaySoundW
-      48D PostKeybdMessage
       3A3 PowerOffSystem
       37C PrintTrackedItem
       373 ProcessDetachAllDLLs
@@ -422,7 +418,6 @@
       484 QASetWindowsJournalHook
       485 QAUnhookWindowsJournalHook
       2F2 QueryAPISetID
-      338 QueryInstructionSet
        91 Random
       1FC RasDeleteEntry
       207 RasDevConfigDialogEditW
@@ -451,13 +446,11 @@
       1FB RasValidateEntryName
       181 ReadFileWithSeek
       3C0 ReadRegistryFromOEM
-      52F RealizePalette
       1BE RectangleAnimation
       383 RefreshKernelAlarm
       2CA RegCopyFile
       159 RegOpenProcessKey
       2CB RegRestoreFile
-      2C8 RegSetValueExW
       178 RegisterAFSEx
       17A RegisterAFSName
       3B8 RegisterAPISet
@@ -483,13 +476,10 @@
       2E9 SHGetShortcutTarget
       2EC SHLoadDIBitmap
       2EB SHShowOutOfMemory
-      482 SendInput
       11B SetACP
       1C0 SetAssociatedMenu
-      522 SetBrushOrgEx
       3A1 SetCleanRebootFlag
       2CE SetCurrentUser
-      33E SetDaylightTime
       3A4 SetDbgZone
       2FB SetEventData
       37F SetExceptionHandler
@@ -513,21 +503,10 @@
       17D SetSystemMemoryDivision
       3A0 SetTimeZoneBias
       2CF SetUserData
-      137 SetUserDefaultLCID
-      14C SetUserDefaultUILanguage
       3B5 SetWDevicePowerHandler
       406 ShellModalEnd
       1C4 ShowStartupWindow
       176 SignalStarted
-      65E SipEnumIM
-      65F SipGetCurrentIM
-      65C SipGetInfo
-      65A SipRegisterNotification
-      660 SipSetCurrentIM
-      661 SipSetDefaultRect
-      65D SipSetInfo
-      65B SipShowIM
-      659 SipStatus
       361 SleepTillTick
       156 StopDeviceNotifications
       648 StringCbCatA
@@ -2730,6 +2709,9 @@ function memset(dest:LPWSTR; c:WideChar; count:SIZE_T):LPWSTR; external KernelDl
 function MessageBeep(uType:UINT):WINBOOL; external KernelDLL name 'MessageBeep';
 function MessageBox(hWnd:HWND; lpText:LPCWSTR; lpCaption:LPCWSTR; uType:UINT):longint; external KernelDLL name 'MessageBoxW'; //~winuser, result declared as int
 function MessageBoxW(hWnd:HWND; lpText:LPCWSTR; lpCaption:LPCWSTR; uType:UINT):longint; external KernelDLL name 'MessageBoxW'; //~winuser, result declared as int
+function MonitorFromPoint(pt:POINT; dwFlags:DWORD):HMONITOR; external KernelDLL name 'MonitorFromPoint'; // index 662
+function MonitorFromRect(lprc:LPRECT; dwFlags:DWORD):HMONITOR; external KernelDLL name 'MonitorFromRect'; // index 663
+function MonitorFromWindow(hWin:HWND; dwFlags:DWORD):HMONITOR; external KernelDLL name 'MonitorFromWindow'; // index 664
 procedure mouse_event(dwFlags:DWORD; dx:DWORD; dy:DWORD; cButtons:DWORD; dwExtraInfo:DWORD); external KernelDLL name 'mouse_event';
 function MoveToEx(_para1:HDC; _para2:longint; _para3:longint; _para4:LPPOINT):WINBOOL; external KernelDLL name 'MoveToEx';
 procedure MoveMemory(Destination:PVOID; Source:pointer; Length:DWORD);
@@ -2750,6 +2732,8 @@ procedure OutputDebugStringW(lpOutputString:LPCWSTR); external KernelDLL name 'O
 function PatBlt(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:DWORD):WINBOOL; external KernelDLL name 'PatBlt';
 function PeekMessage(lpMsg:LPMSG; hWnd:HWND; wMsgFilterMin:UINT; wMsgFilterMax:UINT; wRemoveMsg:UINT):WINBOOL; external KernelDLL name 'PeekMessageW';
 function PeekMessageW(lpMsg:LPMSG; hWnd:HWND; wMsgFilterMin:UINT; wMsgFilterMax:UINT; wRemoveMsg:UINT):WINBOOL; external KernelDLL name 'PeekMessageW';
+function PostKeybdMessage(hWin:HWND; VKey:UINT; KeyStateFlags:UINT{KEY_STATE_FLAGS};
+                          cCharacters:UINT; pShiftStateBuffer:PUINT; pCharacterBuffer:PUINT):BOOL; external KernelDLL name 'PostKeybdMessage'; // index 48D
 function PostMessage(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):WINBOOL; external KernelDLL name 'PostMessageW';
 function PostMessageW(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):WINBOOL; external KernelDLL name 'PostMessageW';
 procedure PostQuitMessage(nExitCode:longint); external KernelDLL name 'PostQuitMessage';
@@ -2780,12 +2764,13 @@ function PtInRect(lprc:LPRECT; pt:POINT):WINBOOL; external KernelDLL name 'PtInR
 function PtInRegion(_para1:HRGN; _para2:longint; _para3:longint):WINBOOL; external KernelDLL name 'PtInRegion';
 function PulseEvent(hEvent:HANDLE):WINBOOL;
 function PurgeComm(hFile:HANDLE; dwFlags:DWORD):WINBOOL; external KernelDLL name 'PurgeComm';
+function QueryInstructionSet(dwInstructionSet:DWORD; lpdwCurrentInstructionSet:LPDWORD):BOOL; external KernelDLL name 'QueryInstructionSet'; // index 338
 function QueryPerformanceCounter(lpPerformanceCount:PLARGE_INTEGER):WINBOOL; external Kerneldll name 'QueryPerformanceCounter';
 function QueryPerformanceFrequency(lpFrequency:PLARGE_INTEGER):WINBOOL; external Kerneldll name 'QueryPerformanceFrequency';
 procedure RaiseException(dwExceptionCode:DWORD; dwExceptionFlags:DWORD; nNumberOfArguments:DWORD; lpArguments:LPDWORD); external KernelDLL name 'RaiseException';
-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 RealizePalette(_para1:HDC):UINT; external KernelDLL name 'RealizePalette';
+function RealizePalette(_para1:HDC):UINT; external KernelDLL name 'RealizePalette'; // index 52F
 function RectInRegion(_para1:HRGN; const _para2:RECT):WINBOOL; external KernelDLL name 'RectInRegion';
 function RectVisible(_para1:HDC; const _para2:RECT):WINBOOL; external KernelDLL name 'RectVisible';
 function Rectangle(_para1:HDC; _para2:longint; _para3:longint; _para4:longint; _para5:longint):WINBOOL; external KernelDLL name 'Rectangle';
@@ -2851,6 +2836,7 @@ function SelectObject(_para1:HDC; _para2:HGDIOBJ):HGDIOBJ; external KernelDLL na
 function SelectPalette(_para1:HDC; _para2:HPALETTE; _para3:WINBOOL):HPALETTE; external KernelDLL name 'SelectPalette';
 function SendDlgItemMessage(hDlg:HWND; nIDDlgItem:longint; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LONG; external KernelDLL name 'SendDlgItemMessageW';
 function SendDlgItemMessageW(hDlg:HWND; nIDDlgItem:longint; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LONG; external KernelDLL name 'SendDlgItemMessageW';
+function SendInput(nInputs:UINT; pInputs:LPINPUT; cbSize:longint):UINT; external KernelDLL name 'SendInput'; // index 482
 function SendMessage(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT; external KernelDLL name 'SendMessageW';
 function SendMessageW(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM):LRESULT; external KernelDLL name 'SendMessageW';
 function SendMessageTimeout(hWnd:HWND; Msg:UINT; wParam:WPARAM; lParam:LPARAM; fuFlags:UINT;uTimeout:UINT; lpdwResult:LPDWORD):LRESULT; external KernelDLL name 'SendMessageTimeout';
@@ -2874,6 +2860,7 @@ function SetCommState(hFile:HANDLE; lpDCB:LPDCB):WINBOOL; external KernelDLL nam
 function SetCommTimeouts(hFile:HANDLE; lpCommTimeouts:LPCOMMTIMEOUTS):WINBOOL; external KernelDLL name 'SetCommTimeouts';
 function SetCursor(hCursor:HCURSOR):HCURSOR; external KernelDLL name 'SetCursor';
 function SetCursorPos(X:longint; Y:longint):WINBOOL; external KernelDLL name 'SetCursorPos';
+procedure SetDaylightTime(dst:DWORD); external KernelDLL name 'SetDaylightTime'; // index 33E
 function SetDIBColorTable(_para1:HDC; _para2:UINT; _para3:UINT; var _para4:RGBQUAD):UINT; external KernelDLL name 'SetDIBColorTable';
 function SetDIBitsToDevice(_para1:HDC; _para2:longint; _para3:longint; _para4:DWORD; _para5:DWORD;_para6:longint; _para7:longint; _para8:UINT; _para9:UINT; _para10:pointer;var _para11:BITMAPINFO; _para12:UINT):longint;
   external KernelDLL name 'SetDIBitsToDevice';
@@ -2916,6 +2903,8 @@ function SetTimer(hWnd:HWND; nIDEvent:UINT; uElapse:UINT; lpTimerFunc:TIMERPROC)
 function SetThreadPriority(hThread:HANDLE; nPriority:longint):WINBOOL; external KernelDLL name 'SetThreadPriority';
 function SetTimeZoneInformation(lpTimeZoneInformation:LPTIME_ZONE_INFORMATION):WINBOOL; external KernelDLL name 'SetTimeZoneInformation';
 function SetupComm(hFile:HANDLE; dwInQueue:DWORD; dwOutQueue:DWORD):WINBOOL; external KernelDLL name 'SetupComm';
+function SetUserDefaultLCID(_locale:LCID):BOOL; external KernelDLL name 'SetUserDefaultLCID'; // index 137
+function SetUserDefaultUILanguage(_langid:LANGID):BOOL; external KernelDLL name 'SetUserDefaultUILanguage'; // index 14C
 function SetViewportOrgEx(_para1:HDC; _para2:longint; _para3:longint; _para4:LPPOINT):WINBOOL; external KernelDLL name 'SetViewportOrgEx';
 function SetWindowPos(hWnd:HWND; hWndInsertAfter:HWND; X:longint; Y:longint; cx:longint;cy:longint; uFlags:UINT):WINBOOL; external KernelDLL name 'SetWindowPos';
 function SetWindowRgn(hWnd:HWND; hRgn:HRGN; bRedraw:WINBOOL):longint; external KernelDLL name 'SetWindowRgn';

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

@@ -2005,6 +2005,7 @@
   { keybd_event  }
      KEYEVENTF_EXTENDEDKEY = 1;
      KEYEVENTF_KEYUP = 2;
+     KEYEVENTF_SILENT = 4;
   { LoadBitmap  }
      OBM_BTNCORNERS = 32758;
      OBM_BTSIZE = 32761;
@@ -4088,8 +4089,182 @@
      PROCESSOR_INTEL_386 = 386;
      PROCESSOR_INTEL_486 = 486;
      PROCESSOR_INTEL_PENTIUM = 586;
-     PROCESSOR_MIPS_R4000 = 4000;
+     PROCESSOR_MIPS_R4000 = 4000; // incl R4101 & R3910 for Windows CE
      PROCESSOR_ALPHA_21064 = 21064;
+
+     PROCESSOR_INTEL_PENTIUMII = 686;
+     PROCESSOR_MIPS_R5000      = 5000;  // incl R5432 for Windows CE
+     PROCESSOR_PPC_403         = 403;
+     PROCESSOR_PPC_601         = 601;
+     PROCESSOR_PPC_603         = 603;
+     PROCESSOR_PPC_604         = 604;
+     PROCESSOR_PPC_620         = 620;
+     PROCESSOR_HITACHI_SH3     = 10003;   // Windows CE
+     PROCESSOR_HITACHI_SH3E    = 10004;   // Windows CE
+     PROCESSOR_HITACHI_SH4     = 10005;   // Windows CE
+     PROCESSOR_MOTOROLA_821    = 821;     // Windows CE
+     PROCESSOR_SHx_SH3         = 103;     // Windows CE
+     PROCESSOR_SHx_SH3DSP      = 105;     // Windows CE
+     PROCESSOR_SHx_SH4         = 104;     // Windows CE
+     PROCESSOR_STRONGARM       = 2577;    // Windows CE - 0xA11
+     PROCESSOR_ARM720          = 1824;    // Windows CE - 0x720
+     PROCESSOR_ARM820          = 2080;    // Windows CE - 0x820
+     PROCESSOR_ARM920          = 2336;    // Windows CE - 0x920
+     PROCESSOR_ARM_7TDMI       = 70001;   // Windows CE
+
+     PROCESSOR_ARCHITECTURE_INTEL = 0;
+     PROCESSOR_ARCHITECTURE_MIPS  = 1;
+     PROCESSOR_ARCHITECTURE_ALPHA = 2;
+     PROCESSOR_ARCHITECTURE_PPC   = 3;
+     PROCESSOR_ARCHITECTURE_SHX   = 4;
+     PROCESSOR_ARCHITECTURE_ARM   = 5;
+     PROCESSOR_ARCHITECTURE_IA64  = 6;
+     PROCESSOR_ARCHITECTURE_ALPHA64 = 7;
+     PROCESSOR_ARCHITECTURE_UNKNOWN = $FFFF;
+
+     PROCESSOR_X86_32BIT_CORE                = 1;
+
+     PROCESSOR_MIPS16_CORE                   = 1;
+     PROCESSOR_MIPSII_CORE                   = 2;
+     PROCESSOR_MIPSIV_CORE                   = 3;
+
+     PROCESSOR_HITACHI_SH3_CORE              = 1;
+     PROCESSOR_HITACHI_SH4_CORE              = 2;
+
+     PROCESSOR_ARM_V4_CORE                   = 1;
+     PROCESSOR_ARM_V4I_CORE                  = 2;
+     PROCESSOR_ARM_V4T_CORE                  = 3;
+
+     PROCESSOR_FEATURE_NOFP                  = 0;
+     PROCESSOR_FEATURE_FP                    = 1;
+     PROCESSOR_FEATURE_DSP                   = PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_QUERY_INSTRUCTION             = $00000000;
+
+{
+#define PROCESSOR_INSTRUCTION_CODE(arch, core, feature)      \
+    ((arch) << 24 | (core) << 16 | (feature))
+}
+     
+     PROCESSOR_X86_32BIT_INSTRUCTION = (PROCESSOR_ARCHITECTURE_INTEL shl 24) or
+                                       (PROCESSOR_X86_32BIT_CORE shl 16) or
+                                       PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_MIPS_MIPS16_INSTRUCTION = (PROCESSOR_ARCHITECTURE_MIPS shl 24) or
+                                         (PROCESSOR_MIPS16_CORE shl 16) or
+                                         PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_MIPS_MIPSII_INSTRUCTION = (PROCESSOR_ARCHITECTURE_MIPS shl 24) or
+                                         (PROCESSOR_MIPSII_CORE shl 16) or
+                                         PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_MIPS_MIPSIIFP_INSTRUCTION = (PROCESSOR_ARCHITECTURE_MIPS shl 24) or
+                                           (PROCESSOR_MIPSII_CORE shl 16) or
+                                           PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_MIPS_MIPSIV_INSTRUCTION = (PROCESSOR_ARCHITECTURE_MIPS shl 24) or
+                                         (PROCESSOR_MIPSIV_CORE shl 16) or
+                                         PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_MIPS_MIPSIVFP_INSTRUCTION = (PROCESSOR_ARCHITECTURE_MIPS shl 24) or
+                                           (PROCESSOR_MIPSIV_CORE shl 16) or
+                                           PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_HITACHI_SH3_INSTRUCTION = (PROCESSOR_ARCHITECTURE_SHX shl 24) or
+                                         (PROCESSOR_HITACHI_SH3_CORE shl 16) or
+                                         PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_HITACHI_SH3DSP_INSTRUCTION = (PROCESSOR_ARCHITECTURE_SHX shl 24) or
+                                            (PROCESSOR_HITACHI_SH3_CORE shl 16) or
+                                            PROCESSOR_FEATURE_DSP;
+
+     PROCESSOR_HITACHI_SH4_INSTRUCTION = (PROCESSOR_ARCHITECTURE_SHX shl 24) or
+                                         (PROCESSOR_HITACHI_SH4_CORE shl 16) or
+                                         PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_ARM_V4_INSTRUCTION = (PROCESSOR_ARCHITECTURE_ARM shl 24) or
+                                    (PROCESSOR_ARM_V4_CORE shl 16) or
+                                    PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_ARM_V4FP_INSTRUCTION = (PROCESSOR_ARCHITECTURE_ARM shl 24) or
+                                      (PROCESSOR_ARM_V4_CORE shl 16) or
+                                      PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_ARM_V4I_INSTRUCTION = (PROCESSOR_ARCHITECTURE_ARM shl 24) or
+                                     (PROCESSOR_ARM_V4I_CORE shl 16) or
+                                     PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_ARM_V4IFP_INSTRUCTION = (PROCESSOR_ARCHITECTURE_ARM shl 24) or
+                                       (PROCESSOR_ARM_V4I_CORE shl 16) or
+                                       PROCESSOR_FEATURE_FP;
+
+     PROCESSOR_ARM_V4T_INSTRUCTION = (PROCESSOR_ARCHITECTURE_ARM shl 24) or
+                                     (PROCESSOR_ARM_V4T_CORE shl 16) or
+                                     PROCESSOR_FEATURE_NOFP;
+
+     PROCESSOR_ARM_V4TFP_INSTRUCTION = (PROCESSOR_ARCHITECTURE_ARM shl 24) or
+                                       (PROCESSOR_ARM_V4T_CORE shl 16) or
+                                       PROCESSOR_FEATURE_FP;
+
+     PF_FLOATING_POINT_PRECISION_ERRATA  = 0;
+     PF_FLOATING_POINT_EMULATED          = 1;
+     PF_COMPARE_EXCHANGE_DOUBLE          = 2;
+     PF_MMX_INSTRUCTIONS_AVAILABLE       = 3;
+     PF_PPC_MOVEMEM_64BIT_OK             = 4;
+     PF_ALPHA_BYTE_INSTRUCTIONS          = 5;
+     PF_XMMI_INSTRUCTIONS_AVAILABLE      = 6;
+     PF_3DNOW_INSTRUCTIONS_AVAILABLE     = 7;
+     PF_RDTSC_INSTRUCTION_AVAILABLE      = 8;
+     PF_PAE_ENABLED                      = 9;
+     PF_XMMI64_INSTRUCTIONS_AVAILABLE    = 10;
+
+{ Table from MSDN. Instruction set compatibility.
+OS instructions set                    Supported instruction sets
+--------------------------------------------------------------------------------
+PROCESSOR_X86_32BIT_INSTRUCTION        PROCESSOR_X86_32BIT_INSTRUCTION
+
+PROCESSOR_MIPS_MIPS16_INSTRUCTION      PROCESSOR_MIPS_MIPS16_INSTRUCTION
+                                       PROCESSOR_MIPS_MIPSII_INSTRUCTION
+
+PROCESSOR_MIPS_MIPSII_INSTRUCTION      PROCESSOR_MIPS_MIPSII_INSTRUCTION
+
+PROCESSOR_MIPS_MIPSIIFP_INSTRUCTION    PROCESSOR_MIPS_MIPSIIFP_INSTRUCTION
+
+PROCESSOR_MIPS_MIPSIV_INSTRUCTION      PROCESSOR_MIPS_MIPSIV_INSTRUCTION
+
+PROCESSOR_MIPS_MIPSIVFP_INSTRUCTION    PROCESSOR_MIPS_MIPSIVFP_INSTRUCTION
+
+PROCESSOR_HITACHI_SH3_INSTRUCTION      PROCESSOR_HITACHI_SH3_INSTRUCTION
+
+PROCESSOR_HITACHI_SH3DSP_INSTRUCTION   PROCESSOR_HITACHI_SH3DSP_INSTRUCTION
+                                       PROCESSOR_HITACHI_SH3_INSTRUCTION
+
+PROCESSOR_HITACHI_SH4_INSTRUCTION      PROCESSOR_HITACHI_SH4_INSTRUCTION
+
+PROCESSOR_ARM_V4_INSTRUCTION           PROCESSOR_ARM_V4_INSTRUCTION
+
+PROCESSOR_ARM_V4FP_INSTRUCTION         PROCESSOR_ARM_V4FP_INSTRUCTION
+                                       PROCESSOR_ARM_V4_INSTRUCTION
+
+PROCESSOR_ARM_V4I_INSTRUCTION          PROCESSOR_ARM_V4I_INSTRUCTION
+                                       PROCESSOR_ARM_V4T_INSTRUCTION
+
+PROCESSOR_ARM_V4IFP_INSTRUCTION        PROCESSOR_ARM_V4IFP_INSTRUCTION
+                                       PROCESSOR_ARM_V4TFP_INSTRUCTION
+                                       PROCESSOR_ARM_V4I_INSTRUCTION
+                                       PROCESSOR_ARM_V4T_INSTRUCTION
+
+PROCESSOR_ARM_V4T_INSTRUCTION          PROCESSOR_ ARM_V4I_INSTRUCTION
+                                       PROCESSOR_ARM_V4T_INSTRUCTION
+
+PROCESSOR_ARM_V4TFP_INSTRUCTION        PROCESSOR_ARM_V4TFP_INSTRUCTION
+                                       PROCESSOR_ARM_V4IFP_INSTRUCTION
+                                       PROCESSOR_ARM_V4I_INSTRUCTION
+                                       PROCESSOR_ARM_V4T_INSTRUCTION
+}
+
+
+
   { FSCTL_SET_COMPRESSION  }
      COMPRESSION_FORMAT_NONE = 0;
      COMPRESSION_FORMAT_DEFAULT = 1;
@@ -5269,10 +5444,12 @@
      STATUS_STACK_OVERFLOW = $C00000FD;
      STATUS_CONTROL_C_EXIT = $C000013A;
 {$define EXCEPTION_CTRL_C}
+{ Declared above.
      PROCESSOR_ARCHITECTURE_INTEL = 0;
      PROCESSOR_ARCHITECTURE_MIPS = 1;
      PROCESSOR_ARCHITECTURE_ALPHA = 2;
      PROCESSOR_ARCHITECTURE_PPC = 3;
+}
   { was #define dname(params) def_expr }
   function FreeModule(h:HINST):WINBOOL;
 
@@ -5571,6 +5748,12 @@ const
   SEE_MASK_NOCLOSEPROCESS =  $00000040;
   SEE_MASK_FLAG_NO_UI     =  $00000400;
 
+
+const
+      INPUT_MOUSE     = 0;
+      INPUT_KEYBOARD  = 1;
+      INPUT_HARDWARE  = 2;
+
 {$endif read_interface}
 
 

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

@@ -7640,6 +7640,52 @@ type
   TCLIPDATA=CLIPDATA;
   PCLIPDATA=^CLIPDATA;
 
+
+type
+     tagMOUSEINPUT = record
+       dx:LONG;
+       dy:LONG;
+       mouseData:DWORD;
+       dwFlags:DWORD;
+       time:DWORD;
+       dwExtraInfo:DWORD;
+     end;
+     MOUSEINPUT = tagMOUSEINPUT;
+     PMOUSEINPUT = ^tagMOUSEINPUT;
+     LPMOUSEINPUT = ^tagMOUSEINPUT;
+
+     tagKEYBDINPUT = record
+       wVk:word;
+       wScan:word;
+       dwFlags:DWORD;
+       time:DWORD;
+       dwExtraInfo:DWORD;
+     end;
+     KEYBDINPUT = tagKEYBDINPUT;
+     PKEYBDINPUT = ^tagKEYBDINPUT;
+     LPKEYBDINPUT = ^tagKEYBDINPUT;
+
+     tagHARDWAREINPUT = record
+       uMsg:DWORD;
+       wParamL:word;
+       wParamH:word;
+       dwExtraInfo:DWORD;
+     end;
+     HARDWAREINPUT = tagHARDWAREINPUT;
+     PHARDWAREINPUT = ^tagHARDWAREINPUT;
+     LPHARDWAREINPUT = ^tagHARDWAREINPUT;
+
+     tagINPUT = record
+       _type:DWORD;
+       case longint of
+         0: (mi:MOUSEINPUT);
+         1: (ki:KEYBDINPUT);
+         2: (hi:HARDWAREINPUT);
+     end;
+    INPUT = tagINPUT;
+    PINPUT = ^tagINPUT;
+    LPINPUT = ^tagINPUT;
+
 {$endif read_interface}