|
@@ -541,15 +541,11 @@ begin
|
|
|
SetEvent(THandle(state));
|
|
|
end;
|
|
|
|
|
|
-
|
|
|
-type
|
|
|
- PWOHandleArray = ^THandle;
|
|
|
-
|
|
|
function FirstCoWaitForMultipleHandles(dwFlags, dwTimeout: DWORD; cHandles: uint32; pHandles: PWOHandleArray; out lpdwindex: DWORD): HRESULT; stdcall; forward;
|
|
|
|
|
|
var
|
|
|
Ole32Dll: THandle = 0; { Unloaded at win32 & win64 system_exit. }
|
|
|
- CoWaitForMultipleHandles: function(dwFlags, dwTimeout: DWORD; cHandles: uint32; pHandles: PWOHandleArray; out lpdwindex: DWORD): HRESULT; stdcall;
|
|
|
+ CoWaitForMultipleHandlesImpl: function(dwFlags, dwTimeout: DWORD; cHandles: uint32; pHandles: PWOHandleArray; out lpdwindex: DWORD): HRESULT; stdcall;
|
|
|
= @FirstCoWaitForMultipleHandles;
|
|
|
|
|
|
function FirstCoWaitForMultipleHandles(dwFlags, dwTimeout: DWORD; cHandles: uint32; pHandles: PWOHandleArray; out lpdwindex: DWORD): HRESULT; stdcall;
|
|
@@ -562,8 +558,13 @@ begin
|
|
|
if InterlockedCompareExchange(Pointer(Ole32Dll), Pointer(LocalOle32Dll), nil) <> nil then
|
|
|
WinFreeLibrary(LocalOle32Dll);
|
|
|
end;
|
|
|
- CodePointer(CoWaitForMultipleHandles) := WinGetProcAddress(Ole32Dll, 'CoWaitForMultipleHandles');
|
|
|
- Result := CoWaitForMultipleHandles(dwFlags, dwTimeout, cHandles, pHandles, lpdwindex);
|
|
|
+ CodePointer(CoWaitForMultipleHandlesImpl) := WinGetProcAddress(Ole32Dll, 'CoWaitForMultipleHandles');
|
|
|
+ Result := CoWaitForMultipleHandlesImpl(dwFlags, dwTimeout, cHandles, pHandles, lpdwindex);
|
|
|
+end;
|
|
|
+
|
|
|
+function CoWaitForMultipleHandles(dwFlags, dwTimeout: DWORD; cHandles: uint32; pHandles: PWOHandleArray; out lpdwindex: DWORD): HRESULT;
|
|
|
+begin
|
|
|
+ Result := CoWaitForMultipleHandlesImpl(dwFlags, dwTimeout, cHandles, pHandles, lpdwindex);
|
|
|
end;
|
|
|
|
|
|
function intbasiceventWaitFor(Timeout : Cardinal;state:peventstate;UseCOMWait: Boolean = False) : longint;
|