1 ##########################################################################
3 # Copyright 2008-2009 VMware, Inc.
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 ##########################################################################/
26 """Win32 API type description."""
30 SHORT = Alias("SHORT", Short)
31 USHORT = Alias("USHORT", UShort)
32 INT = Alias("INT", Int)
33 UINT = Alias("UINT", UInt)
34 LONG = Alias("LONG", Long)
35 ULONG = Alias("ULONG", ULong)
36 LONGLONG = Alias("LONGLONG", LongLong)
37 FLOAT = Alias("FLOAT", Float)
39 INT32 = Literal("INT32", "UInt")
40 UINT32 = Literal("UINT32", "UInt")
42 BYTE = Literal("BYTE", "UInt", base=16)
43 WORD = Literal("WORD", "UInt", base=16)
44 DWORD = Literal("DWORD", "UInt", base=16)
46 BOOL = Alias("BOOL", Bool)
48 LPLONG = Pointer(LONG)
49 LPWORD = Pointer(WORD)
50 LPDWORD = Pointer(DWORD)
51 LPBOOL = Pointer(BOOL)
55 LPCSTR = Const(CString)
57 LPCWSTR = Const(WString)
59 LARGE_INTEGER = Struct("LARGE_INTEGER", [
60 (LONGLONG, 'QuadPart'),
63 SIZE_T = Alias("SIZE_T", SizeT)
65 HRESULT = Alias("HRESULT", Int)
68 PVOID = Opaque("PVOID")
70 HANDLE = Opaque("HANDLE")
73 HMONITOR = Opaque("HMONITOR")
75 GUID = Struct("GUID", [
88 LPGUID = Pointer(GUID)
90 #REFGUID = Alias("REFGUID", Pointer(GUID))
91 REFGUID = Alias("REFGUID", GUID)
93 IID = Alias("IID", GUID)
94 #REFIID = Alias("REFIID", Pointer(IID))
95 REFIID = Alias("REFIID", IID)
97 CLSID = Alias("CLSID", GUID)
98 #REFCLSID = Alias("REFCLSID", Pointer(CLSID))
99 REFCLSID = Alias("REFCLSID", CLSID)
101 LUID = Struct("LUID", [
106 POINT = Struct("POINT", (
110 LPPOINT = Pointer(POINT)
112 RECT = Struct("RECT", (
118 LPRECT = Pointer(RECT)
120 PALETTEENTRY = Struct("PALETTEENTRY", (
126 LPPALETTEENTRY = Pointer(PALETTEENTRY)
129 RGNDATAHEADER = Struct("RGNDATAHEADER", [
137 RGNDATA = Struct("RGNDATA", [
138 (RGNDATAHEADER, "rdh"),
139 #(Char, "Buffer[1]"),
141 LPRGNDATA = Pointer(RGNDATA)
143 HMODULE = Opaque("HMODULE")
145 IUnknown = Interface("IUnknown")
148 Method(HRESULT, "QueryInterface", ((REFIID, "riid"), (Pointer(OpaquePointer(Void)), "ppvObj"))),
149 Method(ULONG, "AddRef", ()),
150 Method(ULONG, "Release", ()),