From e00114c414c42005007e3317a471b59f7f8e73a6 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <mohr@elektron.ikp.physik.tu-darmstadt.de>
Date: Sat, 3 Jul 1999 11:56:07 +0000
Subject: [PATCH] Added UnlockFileEx stub.

---
 files/file.c          | 26 ++++++++++++++++++++++++++
 relay32/kernel32.spec |  2 +-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/files/file.c b/files/file.c
index 5734cbb8f0a..81fb8effe42 100644
--- a/files/file.c
+++ b/files/file.c
@@ -1960,6 +1960,32 @@ BOOL WINAPI UnlockFile( HFILE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHi
 }
 
 
+/**************************************************************************
+ *           UnlockFileEx   (KERNEL32.705)
+ */
+BOOL WINAPI UnlockFileEx(
+		HFILE hFile,
+		DWORD dwReserved,
+		DWORD nNumberOfBytesToUnlockLow,
+		DWORD nNumberOfBytesToUnlockHigh,
+		LPOVERLAPPED lpOverlapped
+)
+{
+	FIXME(file, "hFile=%d,reserved=%ld,lowbytes=%ld,highbytes=%ld,overlapped=%p: stub.\n",
+	  hFile, dwReserved, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh,
+	  lpOverlapped);
+	if (dwReserved == 0)
+		SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+	else
+	{
+		ERR(file, "reserved == %ld: Supposed to be 0??\n", dwReserved);
+		SetLastError(ERROR_INVALID_PARAMETER);
+	}
+
+	return FALSE;
+}
+
+
 #if 0
 
 struct DOS_FILE_LOCK {
diff --git a/relay32/kernel32.spec b/relay32/kernel32.spec
index 0dab5e63683..15c8e145d6e 100644
--- a/relay32/kernel32.spec
+++ b/relay32/kernel32.spec
@@ -721,7 +721,7 @@ import  ntdll.dll
 702 stdcall UnhandledExceptionFilter(ptr) UnhandledExceptionFilter
 703 stdcall UninitializeCriticalSection(ptr) UninitializeCriticalSection
 704 stdcall UnlockFile(long long long long long) UnlockFile
-705 stub UnlockFileEx
+705 stdcall UnlockFileEx(long long long long ptr) UnlockFileEx
 706 stdcall UnmapViewOfFile(ptr) UnmapViewOfFile
 707 stdcall UpdateResourceA(long str str long ptr long) UpdateResourceA
 708 stdcall UpdateResourceW(long wstr wstr long ptr long) UpdateResourceW
-- 
GitLab