1 // Copyright © 2015, Peter Atashian
2 // Licensed under the MIT License <LICENSE.md>
3 //! Basic Windows Type Definitions for minwin partition
4 pub type ULONG = ::c_ulong;
5 pub type PULONG = *mut ULONG;
6 pub type USHORT = ::c_ushort;
7 pub type PUSHORT = *mut USHORT;
8 pub type UCHAR = ::c_uchar;
9 pub type PUCHAR = *mut UCHAR;
10 pub type PSZ = *mut ::c_char;
11 pub const MAX_PATH: usize = 260;
12 pub const FALSE: BOOL = 0;
13 pub const TRUE: BOOL = 1;
14 pub type DWORD = ::c_ulong;
15 pub type BOOL = ::c_int;
16 pub type BYTE = ::c_uchar;
17 pub type WORD = ::c_ushort;
18 pub type FLOAT = ::c_float;
19 pub type PFLOAT = *mut FLOAT;
20 pub type PBOOL = *mut BOOL;
21 pub type LPBOOL = *mut BOOL;
22 pub type PBYTE = *mut BYTE;
23 pub type LPBYTE = *mut BYTE;
24 pub type PINT = *mut ::c_int;
25 pub type LPINT = *mut ::c_int;
26 pub type PWORD = *mut WORD;
27 pub type LPWORD = *mut WORD;
28 pub type LPLONG = *mut ::c_long;
29 pub type PDWORD = *mut DWORD;
30 pub type LPDWORD = *mut DWORD;
31 pub type LPVOID = *mut ::c_void;
32 pub type LPCVOID = *const ::c_void;
33 pub type INT = ::c_int;
34 pub type UINT = ::c_uint;
35 pub type PUINT = *mut ::c_uint;
36 pub type WPARAM = ::UINT_PTR;
37 pub type LPARAM = ::LONG_PTR;
38 pub type LRESULT = ::LONG_PTR;
MAKEWORD(a: BYTE, b: BYTE) -> WORD39 pub fn MAKEWORD(a: BYTE, b: BYTE) -> WORD {
40     (a as WORD) | ((b as WORD) << 8)
41 }
MAKELONG(a: WORD, b: WORD) -> ::LONG42 pub fn MAKELONG(a: WORD, b: WORD) -> ::LONG {
43     ((a as DWORD) | ((b as DWORD) << 16)) as ::LONG
44 }
LOWORD(l: DWORD) -> WORD45 pub fn LOWORD(l: DWORD) -> WORD {
46     (l & 0xffff) as WORD
47 }
HIWORD(l: DWORD) -> WORD48 pub fn HIWORD(l: DWORD) -> WORD {
49     ((l >> 16) & 0xffff) as WORD
50 }
LOBYTE(l: WORD) -> BYTE51 pub fn LOBYTE(l: WORD) -> BYTE {
52     (l & 0xff) as BYTE
53 }
HIBYTE(l: WORD) -> BYTE54 pub fn HIBYTE(l: WORD) -> BYTE {
55     ((l >> 8) & 0xff) as BYTE
56 }
57 pub type SPHANDLE = *mut ::HANDLE;
58 pub type LPHANDLE = *mut ::HANDLE;
59 pub type HGLOBAL = ::HANDLE;
60 pub type HLOCAL = ::HANDLE;
61 pub type GLOBALHANDLE = ::HANDLE;
62 pub type LOCALHANDLE = ::HANDLE;
63 /// Pointer to probably a function with unknown type signature.
64 pub type FARPROC = *const ::c_void;
65 /// Pointer to probably a function with unknown type signature.
66 pub type NEARPROC = *const ::c_void;
67 /// Pointer to probably a function with unknown type signature.
68 pub type PROC = *const ::c_void;
69 pub type ATOM = WORD;
70 DECLARE_HANDLE!(HKEY, HKEY__);
71 pub type PHKEY = *mut HKEY;
72 DECLARE_HANDLE!(HMETAFILE, HMETAFILE__);
73 DECLARE_HANDLE!(HINSTANCE, HINSTANCE__);
74 pub type HMODULE = HINSTANCE;
75 DECLARE_HANDLE!(HRGN, HRGN__);
76 DECLARE_HANDLE!(HRSRC, HRSRC__);
77 DECLARE_HANDLE!(HSPRITE, HSPRITE__);
78 DECLARE_HANDLE!(HLSURF, HLSURF__);
79 DECLARE_HANDLE!(HSTR, HSTR__);
80 DECLARE_HANDLE!(HTASK, HTASK__);
81 DECLARE_HANDLE!(HWINSTA, HWINSTA__);
82 DECLARE_HANDLE!(HKL, HKL__);
83 pub type HFILE = ::c_int;
84 STRUCT!{struct FILETIME {
85     dwLowDateTime: DWORD,
86     dwHighDateTime: DWORD,
87 }}
88 pub type PFILETIME = *mut FILETIME;
89 pub type LPFILETIME = *mut FILETIME;
90