mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 15:49:16 +02:00
*wince: criticalsection
git-svn-id: trunk@3684 -
This commit is contained in:
parent
9e8b3eedfb
commit
2c84728dc1
@ -29,6 +29,7 @@ type
|
|||||||
{ and they shouldn't be used in a program }
|
{ and they shouldn't be used in a program }
|
||||||
{ only the type TCriticalSection is important }
|
{ only the type TCriticalSection is important }
|
||||||
PRTLCriticalSection = ^TRTLCriticalSection;
|
PRTLCriticalSection = ^TRTLCriticalSection;
|
||||||
|
{$ifndef WINCE}
|
||||||
TRTLCriticalSection = packed record
|
TRTLCriticalSection = packed record
|
||||||
DebugInfo : pointer;
|
DebugInfo : pointer;
|
||||||
LockCount : longint;
|
LockCount : longint;
|
||||||
@ -37,6 +38,16 @@ type
|
|||||||
LockSemaphore : THandle;
|
LockSemaphore : THandle;
|
||||||
SpinCount : ULONG_PTR;
|
SpinCount : ULONG_PTR;
|
||||||
end;
|
end;
|
||||||
|
{$else WINCE}
|
||||||
|
//CE only
|
||||||
|
TRTLCriticalSection = packed record
|
||||||
|
LockCount : uint ; // Nesting count on critical section
|
||||||
|
OwnerThread : THandle; // Handle of owner thread
|
||||||
|
hCrit : THandle; // Handle to this critical section
|
||||||
|
needtrap : DWORD; // Trap in when freeing critical section
|
||||||
|
dwContentions : DWORD ; // Count of contentions
|
||||||
|
end;
|
||||||
|
{$endif WINCE}
|
||||||
|
|
||||||
const
|
const
|
||||||
{$ifdef WINCE}
|
{$ifdef WINCE}
|
||||||
|
@ -297,7 +297,6 @@
|
|||||||
198 DefWindowProcW
|
198 DefWindowProcW
|
||||||
1B1 DeferWindowPos
|
1B1 DeferWindowPos
|
||||||
FF DeleteAndRenameFile
|
FF DeleteAndRenameFile
|
||||||
7 DeleteCriticalSection
|
|
||||||
4FD DeleteDC
|
4FD DeleteDC
|
||||||
535 DeleteEnhMetaFile
|
535 DeleteEnhMetaFile
|
||||||
EE DeleteFileW
|
EE DeleteFileW
|
||||||
@ -340,7 +339,6 @@
|
|||||||
536 EndDoc
|
536 EndDoc
|
||||||
537 EndPage
|
537 EndPage
|
||||||
196 EndPaint
|
196 EndPaint
|
||||||
8 EnterCriticalSection
|
|
||||||
12D EnumCalendarInfoW
|
12D EnumCalendarInfoW
|
||||||
3E3 EnumClipboardFormats
|
3E3 EnumClipboardFormats
|
||||||
12F EnumDateFormatsW
|
12F EnumDateFormatsW
|
||||||
@ -535,7 +533,6 @@
|
|||||||
558 GetScrollInfo
|
558 GetScrollInfo
|
||||||
16F GetServiceByIndex
|
16F GetServiceByIndex
|
||||||
174 GetServiceHandle
|
174 GetServiceHandle
|
||||||
5CB GetStdioPathW
|
|
||||||
505 GetStockObject
|
505 GetStockObject
|
||||||
102 GetStoreInformation
|
102 GetStoreInformation
|
||||||
139 GetStringTypeExW
|
139 GetStringTypeExW
|
||||||
@ -697,7 +694,6 @@
|
|||||||
4C0 InSendMessage
|
4C0 InSendMessage
|
||||||
A5 InflateRect
|
A5 InflateRect
|
||||||
D InitLocale
|
D InitLocale
|
||||||
6 InitializeCriticalSection
|
|
||||||
38C InputDebugCharW
|
38C InputDebugCharW
|
||||||
4A1 InsertMenuW
|
4A1 InsertMenuW
|
||||||
349 Int_CloseHandle
|
349 Int_CloseHandle
|
||||||
@ -755,7 +751,6 @@
|
|||||||
4C6 KillTimer
|
4C6 KillTimer
|
||||||
126 LCMapStringW
|
126 LCMapStringW
|
||||||
38E LeaveCritSec
|
38E LeaveCritSec
|
||||||
9 LeaveCriticalSection
|
|
||||||
525 LineTo
|
525 LineTo
|
||||||
A2 LoadAcceleratorsW
|
A2 LoadAcceleratorsW
|
||||||
41E LoadAnimatedCursor
|
41E LoadAnimatedCursor
|
||||||
@ -789,7 +784,6 @@
|
|||||||
34F MapCallerPtr
|
34F MapCallerPtr
|
||||||
3F9 MapDialogRect
|
3F9 MapDialogRect
|
||||||
350 MapPtrToProcWithSize
|
350 MapPtrToProcWithSize
|
||||||
38F MapPtrToProcess
|
|
||||||
390 MapPtrUnsecure
|
390 MapPtrUnsecure
|
||||||
342 MapViewOfFile
|
342 MapViewOfFile
|
||||||
48C MapVirtualKeyW
|
48C MapVirtualKeyW
|
||||||
@ -1065,7 +1059,6 @@
|
|||||||
555 SetScrollInfo
|
555 SetScrollInfo
|
||||||
556 SetScrollPos
|
556 SetScrollPos
|
||||||
557 SetScrollRange
|
557 SetScrollRange
|
||||||
5CC SetStdioPathW
|
|
||||||
4D7 SetSysColors
|
4D7 SetSysColors
|
||||||
135 SetSystemDefaultLCID
|
135 SetSystemDefaultLCID
|
||||||
17D SetSystemMemoryDivision
|
17D SetSystemMemoryDivision
|
||||||
@ -1191,7 +1184,6 @@
|
|||||||
4BD TranslateMessage
|
4BD TranslateMessage
|
||||||
BC TransmitCommChar
|
BC TransmitCommChar
|
||||||
4F5 TransparentImage
|
4F5 TransparentImage
|
||||||
355 TryEnterCriticalSection
|
|
||||||
3A6 TurnOffProfiling
|
3A6 TurnOffProfiling
|
||||||
3A5 TurnOnProfiling
|
3A5 TurnOnProfiling
|
||||||
36C U_rclose
|
36C U_rclose
|
||||||
@ -1547,7 +1539,6 @@
|
|||||||
198 __imp_DefWindowProcW
|
198 __imp_DefWindowProcW
|
||||||
1B1 __imp_DeferWindowPos
|
1B1 __imp_DeferWindowPos
|
||||||
FF __imp_DeleteAndRenameFile
|
FF __imp_DeleteAndRenameFile
|
||||||
7 __imp_DeleteCriticalSection
|
|
||||||
4FD __imp_DeleteDC
|
4FD __imp_DeleteDC
|
||||||
535 __imp_DeleteEnhMetaFile
|
535 __imp_DeleteEnhMetaFile
|
||||||
EE __imp_DeleteFileW
|
EE __imp_DeleteFileW
|
||||||
@ -1590,7 +1581,6 @@
|
|||||||
536 __imp_EndDoc
|
536 __imp_EndDoc
|
||||||
537 __imp_EndPage
|
537 __imp_EndPage
|
||||||
196 __imp_EndPaint
|
196 __imp_EndPaint
|
||||||
8 __imp_EnterCriticalSection
|
|
||||||
12D __imp_EnumCalendarInfoW
|
12D __imp_EnumCalendarInfoW
|
||||||
3E3 __imp_EnumClipboardFormats
|
3E3 __imp_EnumClipboardFormats
|
||||||
12F __imp_EnumDateFormatsW
|
12F __imp_EnumDateFormatsW
|
||||||
@ -1785,7 +1775,6 @@
|
|||||||
558 __imp_GetScrollInfo
|
558 __imp_GetScrollInfo
|
||||||
16F __imp_GetServiceByIndex
|
16F __imp_GetServiceByIndex
|
||||||
174 __imp_GetServiceHandle
|
174 __imp_GetServiceHandle
|
||||||
5CB __imp_GetStdioPathW
|
|
||||||
505 __imp_GetStockObject
|
505 __imp_GetStockObject
|
||||||
102 __imp_GetStoreInformation
|
102 __imp_GetStoreInformation
|
||||||
139 __imp_GetStringTypeExW
|
139 __imp_GetStringTypeExW
|
||||||
@ -1947,7 +1936,6 @@
|
|||||||
4C0 __imp_InSendMessage
|
4C0 __imp_InSendMessage
|
||||||
A5 __imp_InflateRect
|
A5 __imp_InflateRect
|
||||||
D __imp_InitLocale
|
D __imp_InitLocale
|
||||||
6 __imp_InitializeCriticalSection
|
|
||||||
38C __imp_InputDebugCharW
|
38C __imp_InputDebugCharW
|
||||||
4A1 __imp_InsertMenuW
|
4A1 __imp_InsertMenuW
|
||||||
349 __imp_Int_CloseHandle
|
349 __imp_Int_CloseHandle
|
||||||
@ -2005,7 +1993,6 @@
|
|||||||
4C6 __imp_KillTimer
|
4C6 __imp_KillTimer
|
||||||
126 __imp_LCMapStringW
|
126 __imp_LCMapStringW
|
||||||
38E __imp_LeaveCritSec
|
38E __imp_LeaveCritSec
|
||||||
9 __imp_LeaveCriticalSection
|
|
||||||
525 __imp_LineTo
|
525 __imp_LineTo
|
||||||
A2 __imp_LoadAcceleratorsW
|
A2 __imp_LoadAcceleratorsW
|
||||||
41E __imp_LoadAnimatedCursor
|
41E __imp_LoadAnimatedCursor
|
||||||
@ -2317,7 +2304,6 @@
|
|||||||
555 __imp_SetScrollInfo
|
555 __imp_SetScrollInfo
|
||||||
556 __imp_SetScrollPos
|
556 __imp_SetScrollPos
|
||||||
557 __imp_SetScrollRange
|
557 __imp_SetScrollRange
|
||||||
5CC __imp_SetStdioPathW
|
|
||||||
4D7 __imp_SetSysColors
|
4D7 __imp_SetSysColors
|
||||||
135 __imp_SetSystemDefaultLCID
|
135 __imp_SetSystemDefaultLCID
|
||||||
17D __imp_SetSystemMemoryDivision
|
17D __imp_SetSystemMemoryDivision
|
||||||
@ -2443,7 +2429,6 @@
|
|||||||
4BD __imp_TranslateMessage
|
4BD __imp_TranslateMessage
|
||||||
BC __imp_TransmitCommChar
|
BC __imp_TransmitCommChar
|
||||||
4F5 __imp_TransparentImage
|
4F5 __imp_TransparentImage
|
||||||
355 __imp_TryEnterCriticalSection
|
|
||||||
3A6 __imp_TurnOffProfiling
|
3A6 __imp_TurnOffProfiling
|
||||||
3A5 __imp_TurnOnProfiling
|
3A5 __imp_TurnOnProfiling
|
||||||
36C __imp_U_rclose
|
36C __imp_U_rclose
|
||||||
@ -3414,8 +3399,9 @@
|
|||||||
|
|
||||||
|
|
||||||
//function ChangeDisplaySettingsEx(lpszDeviceName: LPCTSTR; lpDevMode: LPDEVMODE; hwnd: HWND; dwflags: DWORD ; lParam: LPVOID ): LONG; external KernelDLL name 'ChangeDisplaySettingsEx';
|
//function ChangeDisplaySettingsEx(lpszDeviceName: LPCTSTR; lpDevMode: LPDEVMODE; hwnd: HWND; dwflags: DWORD ; lParam: LPVOID ): LONG; external KernelDLL name 'ChangeDisplaySettingsEx';
|
||||||
|
function GetStdioPathW(id: DWORD ; pwszBuf:LPWSTR ; lpdwLen:LPDWORD):WINBOOL; external KernelDLL name 'GetStdioPathW';
|
||||||
|
function MapPtrToProcess(lpv: LPVOID; hProc: HANDLE ): LPVOID; external KernelDLL name 'MapPtrToProcess';
|
||||||
|
function SetStdioPathW(id: DWORD; pwszPath: LPWSTR ):WINBOOL; external KernelDLL name 'SetStdioPathW';
|
||||||
{$endif read_interface}
|
{$endif read_interface}
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,22 +142,25 @@ function LOCALE_NEUTRAL: DWORD; //winnt
|
|||||||
function LOCALE_INVARIANT: DWORD; //winnt
|
function LOCALE_INVARIANT: DWORD; //winnt
|
||||||
|
|
||||||
|
|
||||||
function GetVersionExW(var lpVersionInformation: TOSVersionInfoW): BOOL; external KernelDLL name 'GetVersionExW';
|
|
||||||
procedure GetLocalTime(var SystemTime: SYSTEMTIME); external KernelDLL name 'GetLocalTime';
|
|
||||||
function SetLocalTime(var lpSystemTime:SYSTEMTIME):WINBOOL; external KernelDLL name 'SetLocalTime';
|
|
||||||
function CreateProcessW(lpApplicationName: LPWSTR; lpCommandLine: LPWSTR; lpProcessAttributes, lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: LPWSTR;
|
function CreateProcessW(lpApplicationName: LPWSTR; lpCommandLine: LPWSTR; lpProcessAttributes, lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: LPWSTR;
|
||||||
const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; external KernelDLL name 'CreateProcessW';
|
const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; external KernelDLL name 'CreateProcessW';
|
||||||
function GetExitCodeProcess(hProcess: THandle; var lpExitCode: DWORD): BOOL; external KernelDLL name 'GetExitCodeProcess';
|
procedure DeleteCriticalSection(var CriticalSection : TRTLCriticalSection); external KernelDLL name 'DeleteCriticalSection';
|
||||||
function ReadFile(hFile: THandle; var Buffer; nNumberOfBytesToRead: DWORD; var lpNumberOfBytesRead: DWORD; lpOverlapped: POverlapped): BOOL; external KernelDLL name 'ReadFile';
|
|
||||||
function WriteFile(hFile: THandle; const Buffer; nNumberOfBytesToWrite: DWORD; var lpNumberOfBytesWritten: DWORD; lpOverlapped: POverlapped): BOOL; external KernelDLL name 'WriteFile';
|
|
||||||
function SetFileTime(hFile:HANDLE; var lpCreationTime:FILETIME; var lpLastAccessTime:FILETIME; var lpLastWriteTime:FILETIME):WINBOOL; external KernelDLL name 'SetFileTime';
|
|
||||||
procedure EnterCriticalSection(var CriticalSection : TRTLCriticalSection); external KernelDLL name 'EnterCriticalSection';
|
procedure EnterCriticalSection(var CriticalSection : TRTLCriticalSection); external KernelDLL name 'EnterCriticalSection';
|
||||||
|
function GetExitCodeProcess(hProcess: THandle; var lpExitCode: DWORD): BOOL; external KernelDLL name 'GetExitCodeProcess';
|
||||||
|
function GetExitCodeThread(hThread: THandle; var lpExitCode: DWORD): BOOL; external KernelDLL name 'GetExitCodeThread';
|
||||||
|
procedure GetLocalTime(var SystemTime: SYSTEMTIME); external KernelDLL name 'GetLocalTime';
|
||||||
|
function GetVersionExW(var lpVersionInformation: TOSVersionInfoW): BOOL; external KernelDLL name 'GetVersionExW';
|
||||||
|
procedure InitializeCriticalSection(var CriticalSection : TRTLCriticalSection); external KernelDLL name 'InitializeCriticalSection';
|
||||||
procedure LeaveCriticalSection(var CriticalSection : TRTLCriticalSection); external KernelDLL name 'LeaveCriticalSection';
|
procedure LeaveCriticalSection(var CriticalSection : TRTLCriticalSection); external KernelDLL name 'LeaveCriticalSection';
|
||||||
function RegisterClassW(const lpWndClass: TWndClassW): ATOM; external UserDLLCore name 'RegisterClassW';
|
|
||||||
//redirected to MsgWaitForMultipleObjectsEx
|
//redirected to MsgWaitForMultipleObjectsEx
|
||||||
function MsgWaitForMultipleObjects(nCount: DWORD; var pHandles; fWaitAll: BOOL; dwMilliseconds, dwWakeMask: DWORD): DWORD;
|
function MsgWaitForMultipleObjects(nCount: DWORD; var pHandles; fWaitAll: BOOL; dwMilliseconds, dwWakeMask: DWORD): DWORD;
|
||||||
function PeekMessageW(var lpMsg: TMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external UserDLLCore name 'PeekMessageW';
|
function PeekMessageW(var lpMsg: TMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external UserDLLCore name 'PeekMessageW';
|
||||||
function GetExitCodeThread(hThread: THandle; var lpExitCode: DWORD): BOOL; external KernelDLL name 'GetExitCodeThread';
|
function ReadFile(hFile: THandle; var Buffer; nNumberOfBytesToRead: DWORD; var lpNumberOfBytesRead: DWORD; lpOverlapped: POverlapped): BOOL; external KernelDLL name 'ReadFile';
|
||||||
|
function RegisterClassW(const lpWndClass: TWndClassW): ATOM; external UserDLLCore name 'RegisterClassW';
|
||||||
|
function SetFileTime(hFile:HANDLE; var lpCreationTime:FILETIME; var lpLastAccessTime:FILETIME; var lpLastWriteTime:FILETIME):WINBOOL; external KernelDLL name 'SetFileTime';
|
||||||
|
function SetLocalTime(var lpSystemTime:SYSTEMTIME):WINBOOL; external KernelDLL name 'SetLocalTime';
|
||||||
|
function TryEnterCriticalSection(var CriticalSection : TRTLCriticalSection) : BOOL; external KernelDLL name 'TryEnterCriticalSection';
|
||||||
|
function WriteFile(hFile: THandle; const Buffer; nNumberOfBytesToWrite: DWORD; var lpNumberOfBytesWritten: DWORD; lpOverlapped: POverlapped): BOOL; external KernelDLL name 'WriteFile';
|
||||||
//end common win32 & wince
|
//end common win32 & wince
|
||||||
|
|
||||||
{$ifdef WINCE}
|
{$ifdef WINCE}
|
||||||
@ -174,9 +177,11 @@ function PeekMessage(var lpMsg: TMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax,
|
|||||||
|
|
||||||
{$ifdef WIN32}
|
{$ifdef WIN32}
|
||||||
//begin win32 only ie not exist in wince4.2 second release lib imported functions from dlls
|
//begin win32 only ie not exist in wince4.2 second release lib imported functions from dlls
|
||||||
function GetVersionExA(var lpVersionInformation: TOSVersionInfo): BOOL; external 'kernel32' name 'GetVersionExA';
|
|
||||||
function CreateProcessA(lpApplicationName: LPCSTR; lpCommandLine: LPCSTR; lpProcessAttributes, lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: LPCSTR;
|
function CreateProcessA(lpApplicationName: LPCSTR; lpCommandLine: LPCSTR; lpProcessAttributes, lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: LPCSTR;
|
||||||
const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; external 'kernel32' name 'CreateProcessA';
|
const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; external 'kernel32' name 'CreateProcessA';
|
||||||
|
function GetVersionExA(var lpVersionInformation: TOSVersionInfo): BOOL; external 'kernel32' name 'GetVersionExA';
|
||||||
|
function InitializeCriticalSectionAndSpinCount(var CriticalSection : TRTLCriticalSection;dwSpinCount : DWORD) : BOOL; external 'kernel32' name 'InitializeCriticalSectionAndSpinCount';
|
||||||
|
function SetCriticalSectionSpinCount(var CriticalSection : TRTLCriticalSection;dwSpinCount : DWORD ): DWORD; external 'kernel32' name 'SetCriticalSectionSpinCount';
|
||||||
//end win32 only
|
//end win32 only
|
||||||
{$endif WIN32}
|
{$endif WIN32}
|
||||||
|
|
||||||
@ -221,12 +226,6 @@ function MakeResult(p1,p2,mask : Longint) : HRESULT;
|
|||||||
function HResultFromWin32(x : Longint) : HRESULT;
|
function HResultFromWin32(x : Longint) : HRESULT;
|
||||||
function HResultFromNT(x : Longint) : HRESULT;
|
function HResultFromNT(x : Longint) : HRESULT;
|
||||||
|
|
||||||
procedure InitializeCriticalSection(var CriticalSection : TRTLCriticalSection); external 'kernel32' name 'InitializeCriticalSection';
|
|
||||||
procedure DeleteCriticalSection(var CriticalSection : TRTLCriticalSection); external 'kernel32' name 'DeleteCriticalSection';
|
|
||||||
function InitializeCriticalSectionAndSpinCount(var CriticalSection : TRTLCriticalSection;dwSpinCount : DWORD) : BOOL; external 'kernel32' name 'InitializeCriticalSectionAndSpinCount';
|
|
||||||
function SetCriticalSectionSpinCount(var CriticalSection : TRTLCriticalSection;dwSpinCount : DWORD ): DWORD; external 'kernel32' name 'SetCriticalSectionSpinCount';
|
|
||||||
function TryEnterCriticalSection(var CriticalSection : TRTLCriticalSection) : BOOL; external 'kernel32' name 'TryEnterCriticalSection';
|
|
||||||
|
|
||||||
//function _lwrite(hFile: HFILE; const lpBuffer: LPCSTR; uBytes: UINT): UINT; external 'kernel32' name '_lwrite';
|
//function _lwrite(hFile: HFILE; const lpBuffer: LPCSTR; uBytes: UINT): UINT; external 'kernel32' name '_lwrite';
|
||||||
//function AccessCheck(pSecurityDescriptor: PSecurityDescriptor; ClientToken: THandle; DesiredAccess: DWORD; const GenericMapping: TGenericMapping; var PrivilegeSet: TPrivilegeSet; var PrivilegeSetLength: DWORD; var GrantedAccess: DWORD;
|
//function AccessCheck(pSecurityDescriptor: PSecurityDescriptor; ClientToken: THandle; DesiredAccess: DWORD; const GenericMapping: TGenericMapping; var PrivilegeSet: TPrivilegeSet; var PrivilegeSetLength: DWORD; var GrantedAccess: DWORD;
|
||||||
// var AccessStatus: BOOL): BOOL; external 'advapi32' name 'AccessCheck';
|
// var AccessStatus: BOOL): BOOL; external 'advapi32' name 'AccessCheck';
|
||||||
|
Loading…
Reference in New Issue
Block a user