Repository: retep998/winapi-rs (language: rust)

Issue:
Question: Where can I find GMEM_MOVEABLE?
Hello,

I am trying to allocate memory using `GlobalAlloc`.
I want to pass data to clipboard, and the MSDN documentation says I need to use `GlobalAlloc`.
One of the things I need to do is to pass `GMEM_MOVEABLE` into `GlobalAlloc`.

I only found [a comment `GMEM_*` in the source code](https://github.com/retep998/winapi-rs/blob/3792048cb07f9b762f8f0913293027759ea78db2/src/um/winbase.rs#L226).

Relevant flags are missing as well:
- GHND
- GPTR
- GMEM_FIXED
- GMEM_MOVEABLE
- GMEM_ZEROINIT

And obsolete flags:

- GMEM_DDESHARE
- GMEM_DISCARDABLE
- GMEM_LOWER
- GMEM_NOCOMPACT
- GMEM_NODISCARD
- GMEM_NOT_BANKED
- GMEM_NOTIFY
- GMEM_SHARE

Which, I found in [MSDN documentation](https://docs.microsoft.com/en-us/windows/desktop/api/WinBase/nf-winbase-globalalloc).

I could find `LocalAlloc` counterparts (`LHND`, `LPTR`, `LMEM_MOVEABLE`, etc.) [here](https://github.com/retep998/winapi-rs/blob/fa4e2c5a6dc495c71e6031bdde2e52870ebf6fdf/src/um/minwinbase.rs#L318).

Are these simply overlooked or not implemented yet? Do I need to look at different crate?

Thanks.


Discussion / hints:
This is the correct crate. They're just not implemented yet.

Fix patch:
diff --git a/src/um/winbase.rs b/src/um/winbase.rs
index bb74b4121..12078c276 100644
--- a/src/um/winbase.rs
+++ b/src/um/winbase.rs
@@ -223,7 +223,24 @@ STRUCT!{struct COMMCONFIG {
     wcProviderData: [WCHAR; 1],
 }}
 pub type LPCOMMCONFIG = *mut COMMCONFIG;
-// GMEM_*
+pub const GMEM_FIXED: UINT = 0x0000;
+pub const GMEM_MOVEABLE: UINT = 0x0002;
+pub const GMEM_NOCOMPACT: UINT = 0x0010;
+pub const GMEM_NODISCARD: UINT = 0x0020;
+pub const GMEM_ZEROINIT: UINT = 0x0040;
+pub const GMEM_MODIFY: UINT = 0x0080;
+pub const GMEM_DISCARDABLE: UINT = 0x0100;
+pub const GMEM_NOT_BANKED: UINT = 0x1000;
+pub const GMEM_SHARE: UINT = 0x2000;
+pub const GMEM_DDESHARE: UINT = 0x2000;
+pub const GMEM_NOTIFY: UINT = 0x4000;
+pub const GMEM_LOWER: UINT = GMEM_NOT_BANKED;
+pub const GMEM_VALID_FLAGS: UINT = 0x7F72;
+pub const GMEM_INVALID_HANDLE: UINT = 0x8000;
+pub const GHND: UINT = GMEM_MOVEABLE | GMEM_ZEROINIT;
+pub const GPTR: UINT = GMEM_FIXED | GMEM_ZEROINIT;
+pub const GMEM_DISCARDED: UINT = 0x4000;
+pub const GMEM_LOCKCOUNT: UINT = 0x00FF;
 STRUCT!{struct MEMORYSTATUS {
     dwLength: DWORD,
     dwMemoryLoad: DWORD,


Test patch: