OSDN Git Service

Declare SRWLOCK API, to support feature request [#2314]
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 29 May 2017 15:39:51 +0000 (16:39 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 29 May 2017 15:39:51 +0000 (16:39 +0100)
w32api/ChangeLog
w32api/include/winbase.h

index 50d6a05..73022e8 100644 (file)
@@ -1,3 +1,14 @@
+2017-05-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Declare SRWLOCK API, to support feature request [#2314]
+
+       * include/winbase.h [_WIN32_WINNT >= _WIN32_WINNT_VISTA]
+       (SRWLOCK, *PSRWLOCK): Define these data types, and declare...
+       (InitializeSRWLock, AcquireSRWLockExclusive, AcquireSRWLockShared)
+       (ReleaseSRWLockExclusive, ReleaseSRWLockShared): ...these prototypes.
+       [_WIN32_WINNT >= _WIN32_WINNT_WIN7] (TryAcquireSRWLockExclusive)
+       (TryAcquireSRWLockShared): Declare additional prototypes.
+
 2017-03-24  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Resolve potential <winbase.h> vs. <winerror.h> inconsistency.
index b869c6f..dc541f2 100644 (file)
@@ -3004,6 +3004,19 @@ WINBASEAPI DWORD WINAPI GetFinalPathNameByHandleA (HANDLE, LPSTR, DWORD, DWORD);
 WINBASEAPI DWORD WINAPI GetFinalPathNameByHandleW
 (HANDLE, LPWSTR, DWORD, DWORD);
 
+/* https://msdn.microsoft.com/en-us/library/aa904937%28v=vs.85%29.aspx */
+/* Note: MSDN does not offer any detail of how SRWLOCK should be defined,
+ * (other than stating that it is a structure with the size of a pointer);
+ * an opaque generic pointer type appears to be sufficient.
+ */
+typedef PVOID SRWLOCK, *PSRWLOCK;
+
+void WINAPI InitializeSRWLock (PSRWLOCK);
+void WINAPI AcquireSRWLockExclusive (PSRWLOCK);
+void WINAPI AcquireSRWLockShared (PSRWLOCK);
+void WINAPI ReleaseSRWLockExclusive (PSRWLOCK);
+void WINAPI ReleaseSRWLockShared (PSRWLOCK);
+
 #if _WIN32_WINNT >= _WIN32_WINNT_WIN7
 /* Additional features, available only on the WinNT series platforms, from
  * the release of Windows-7 onwards.
@@ -3013,6 +3026,10 @@ WINBASEAPI DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy (void);
 
 WINBASEAPI BOOL WINAPI SetProcessDEPPolicy (DWORD);
 
+/* https://msdn.microsoft.com/en-us/library/aa904937%28v=vs.85%29.aspx */
+BOOLEAN WINAPI TryAcquireSRWLockExclusive (PSRWLOCK);
+BOOLEAN WINAPI TryAcquireSRWLockShared (PSRWLOCK);
+
 #endif /* Win7 and later */
 #endif /* Windows Vista and later */
 #endif /* Windows Server-2003 and later */