• R/O
  • HTTP
  • SSH
  • HTTPS

mingw-org-wsl: Commit

The MinGW.OSDN Windows System Libraries. Formerly designated as "MinGW.org Windows System Libraries", this encapsulates the "mingwrt" C runtime library extensions, and the "w32api" 32-bit MS-Windows API libraries.

Please note that this project no longer owns the "MinGW.org" domain name; any software which may be distributed from that domain is NOT supported by this project.


Commit MetaInfo

Revision5ae20fb2ea2f986ba30174feafc6842f0e98fd14 (tree)
Time2022-11-05 05:30:53
AuthorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Provide LocalDiscard() implementation per issue #44471.

Change Summary

Incremental Difference

--- a/w32api/ChangeLog
+++ b/w32api/ChangeLog
@@ -1,3 +1,12 @@
1+2022-11-04 Keith Marshall <keith@users.osdn.me>
2+
3+ Provide LocalDiscard() implementation per issue #44471.
4+
5+ * include/winbase.h (LocalDiscard): There is no DLL exporting this
6+ function; delete prototype declaration which suggests that there is;
7+ replace it with an intrinsic function implementation, based on a hint
8+ found in ReactOS documentation of a macro definition.
9+
110 2022-11-04 Eli Zaretskii <eliz@gnu.org>
211
312 Fix IsProcessInJob() function prototype per issue #44471.
--- a/w32api/include/winbase.h
+++ b/w32api/include/winbase.h
@@ -2180,7 +2180,6 @@ WINBASEAPI DWORD WINAPI LoadModule (LPCSTR, PVOID);
21802180 WINBASEAPI HGLOBAL WINAPI LoadResource (HINSTANCE, HRSRC);
21812181 WINBASEAPI HLOCAL WINAPI LocalAlloc (UINT, SIZE_T);
21822182 WINBASEAPI SIZE_T WINAPI LocalCompact (UINT); /* Obsolete: Has no effect. */
2183-WINBASEAPI HLOCAL LocalDiscard (HLOCAL);
21842183 WINBASEAPI BOOL WINAPI LocalFileTimeToFileTime (CONST FILETIME *, LPFILETIME);
21852184 WINBASEAPI UINT WINAPI LocalFlags (HLOCAL); /* Obsolete: Has no effect. */
21862185 WINBASEAPI HLOCAL WINAPI LocalFree (HLOCAL);
@@ -2195,6 +2194,14 @@ WINBASEAPI BOOL WINAPI LockFileEx
21952194 (HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED);
21962195 WINBASEAPI PVOID WINAPI LockResource (HGLOBAL);
21972196
2197+/* Microsoft's documentation suggests that LocalDiscard()
2198+ * should be defined as a macro; we prefer this intrinsic
2199+ * definition, since it has the effect of a macro, but it
2200+ * offers an added type checking benefit.
2201+ */
2202+_WIN32_INTRINSIC HLOCAL LocalDiscard (HLOCAL addr)
2203+{ return LocalReAlloc (addr, 0, LMEM_MOVEABLE); }
2204+
21982205 #define LockSegment(w) GlobalFix((HANDLE)(w)) /* Obsolete: Has no effect. */
21992206
22002207 #define LogonUser __AW_SUFFIXED__(LogonUser)
Show on old repository browser