"Alexandre Julliard" julliard@winehq.org wrote:
+static BOOL hold_key(int vk) +{
- BYTE key_state[256];
- BOOL result;
- result = GetKeyboardState((LPBYTE)&key_state);
- ok(result, "GetKeyboardState failed.\n");
- if (!result) return FALSE;
- key_state[vk] |= 0x80;
- result = SetKeyboardState((LPBYTE)&key_state);
- ok(result, "SetKeyboardState failed.\n");
- return result != 0;
+}
+static BOOL release_key(int vk) +{
- BYTE key_state[256];
- BOOL result;
- result = GetKeyboardState((LPBYTE)&key_state);
- ok(result, "GetKeyboardState failed.\n");
- if (!result) return FALSE;
- key_state[vk] &= ~0x80;
- result = SetKeyboardState((LPBYTE)&key_state);
- ok(result, "SetKeyboardState failed.\n");
- return result != 0;
+}
This is already committed, but the casts in the above code clearly show that the pointer syntax is wrong there.