]> git.cworth.org Git - apitrace/commitdiff
windows.py -> winapi.py
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Nov 2010 11:39:57 +0000 (11:39 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Nov 2010 11:39:57 +0000 (11:39 +0000)
16 files changed:
CMakeLists.txt
d3d.py
d3d10_1.py
d3d10misc.py
d3d8.py
d3d8caps.py
d3d8types.py
d3d9.py
d3d9caps.py
d3d9types.py
d3dcaps.py
d3dtypes.py
ddraw.py
wglapi.py
winapi.py [new file with mode: 0644]
windows.py [deleted file]

index 30befd33891b856f0a02ac51b64734a9397662fd..99dde6833ddfffd12e18ce9b36f7d3dfa5e17a46 100644 (file)
@@ -95,7 +95,7 @@ if (WIN32)
        #       add_custom_command (
        #               OUTPUT d3d8.cpp
        #               COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp
-       #               DEPENDS d3d8.py d3d8types.py d3d8caps.py windows.py base.py
+       #               DEPENDS d3d8.py d3d8types.py d3d8caps.py winapi.py base.py
        #       )
        #       add_library (d3d8 SHARED d3d8.def d3d8.cpp log.cpp os_win32.cpp)
        #       set_target_properties (d3d8 PROPERTIES PREFIX "")
@@ -107,7 +107,7 @@ if (WIN32)
        #       add_custom_command (
        #               OUTPUT d3d9.cpp
        #               COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9.cpp
-       #               DEPENDS d3d9.py d3d9types.py d3d9caps.py d3dshader.py windows.py base.py
+       #               DEPENDS d3d9.py d3d9types.py d3d9caps.py d3dshader.py winapi.py base.py
        #       )
        #       add_library (d3d9 SHARED d3d9.def d3d9.cpp log.cpp os_win32.cpp)
        #       set_target_properties (d3d9 PROPERTIES PREFIX "")
@@ -119,7 +119,7 @@ if (WIN32)
        #       add_custom_command (
        #               OUTPUT d3d10.cpp
        #               COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10misc.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10.cpp
-       #               DEPENDS d3d10misc.py windows.py base.py
+       #               DEPENDS d3d10misc.py winapi.py base.py
        #       )
        #       add_library (d3d10 SHARED d3d10.def d3d10.cpp log.cpp os_win32.cpp)
        #       set_target_properties (d3d10 PROPERTIES PREFIX "")
@@ -129,7 +129,7 @@ if (WIN32)
        add_custom_command (
                OUTPUT opengl32.cpp
                COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/opengl32.py > ${CMAKE_CURRENT_BINARY_DIR}/opengl32.cpp
-               DEPENDS opengl32.py trace.py wglapi.py glapi.py windows.py base.py
+               DEPENDS opengl32.py trace.py wglapi.py glapi.py winapi.py base.py
        )
        add_library (opengl SHARED opengl32.def opengl32.cpp log.cpp os_win32.cpp)
        set_target_properties (opengl PROPERTIES
diff --git a/d3d.py b/d3d.py
index 7b711582b5a892b66ddaab74bf2addaa31db9563..f5b7638edc134692fe0b4cacd7b865ffbc897be2 100644 (file)
--- a/d3d.py
+++ b/d3d.py
@@ -25,7 +25,7 @@
 
 """d3d.h"""
 
-from windows import *
+from winapi import *
 from d3dtypes import *
 from d3dcaps import *
 
index b9fa9f95857f5a0738be410fe057aa715578395c..14420da67ecbbed4be7b1c9bf8dc9d5ed00563d5 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3d10_1.h"""
 
-from windows import *
+from winapi import *
 
 ID3D10Blob = Interface("ID3D10Blob", IUnknown)
 LPD3D10BLOB = Pointer(ID3D10Blob)
index 9e81b513bd45977c221e1b6e553e00fa857d85b6..9396a56f99b54f84bb1ce1a7fdcd05f4bc21afec 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3d10misc.h"""
 
-from windows import *
+from winapi import *
 
 ID3D10Blob = Interface("ID3D10Blob", IUnknown)
 LPD3D10BLOB = Pointer(ID3D10Blob)
diff --git a/d3d8.py b/d3d8.py
index a4f1f348bfb7366b0ca62aecebdd271d822c3fc4..720455480d67fe267ff3f917144e5d1f4c335438 100644 (file)
--- a/d3d8.py
+++ b/d3d8.py
@@ -25,7 +25,7 @@
 
 """d3d8.h"""
 
-from windows import *
+from winapi import *
 from d3d8types import *
 from d3d8caps import *
 
index 36a332e189c746d00f94072a71c8c5f27462a889..87e762549262dc515bd4eb24ea07e9b7f93a6775 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3d8caps.h"""
 
-from windows import *
+from winapi import *
 from d3d8types import *
 
 D3DCAPS = Flags(DWORD, [
index 9f87b8255652e5eae09ee3b47edaf63bb6d72d8b..96e3d846e7b753562a3465b9f8120e3d8eafd946 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3d8types.h"""
 
-from windows import *
+from winapi import *
 
 D3DCOLOR = Alias("D3DCOLOR", DWORD)
 
diff --git a/d3d9.py b/d3d9.py
index 55f3dcd86d67fa9cdc683284a9c6315f69fd7480..4e1da90c1f974340441844874b11388da3b93ab0 100644 (file)
--- a/d3d9.py
+++ b/d3d9.py
@@ -25,7 +25,7 @@
 
 """d3d9.h"""
 
-from windows import *
+from winapi import *
 from d3dshader import *
 from d3d9types import *
 from d3d9caps import *
index 195052b74f17a298bf7b965a5228265deb491ee2..514051411f55c53ded640014a358c9f3d024f1ea 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3d9caps.h"""
 
-from windows import *
+from winapi import *
 from d3d9types import *
 
 D3DVS20CAPS = Flags(DWORD, [
index cef8bd73a840ecb3a63dc49b62f8276da6389b9b..239f750e4815deb5708f35eebce5252701afa393 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3d9types.h"""
 
-from windows import *
+from winapi import *
 
 D3DCOLOR = Alias("D3DCOLOR", DWORD)
 
index 50ca351904a2268ba55480c510264bceb3deb8e9..609682688f9174466a2db88601acc4e5036f6a60 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3dcaps.h"""
 
-from windows import *
+from winapi import *
 from d3dtypes import *
 
 D3DTRANSFORMCAPS = Flags(DWORD, [
index 2f51783aa68ac0fa83cfafa9c70e576444e189ab..07c70a36a059e6f227cccc9d3b770e31bcb5c599 100644 (file)
@@ -25,7 +25,7 @@
 
 """d3dtypes.h"""
 
-from windows import *
+from winapi import *
 from ddraw import *
 
 D3DVALUE = Float
index d04ae90217cb382d00d94e0d49804a1aa7c98732..bc1f8f2a6de5897b2f459ce20c1200341a55c22f 100644 (file)
--- a/ddraw.py
+++ b/ddraw.py
@@ -25,7 +25,7 @@
 
 """ddraw.h"""
 
-from windows import *
+from winapi import *
 
 IDirectDraw = Interface("IDirectDraw", IUnknown)
 IDirectDraw2 = Interface("IDirectDraw2", IUnknown)
index 79128ac33939f54e0cfcd9fc5d4c595c7afdf8e6..e5611b2d68217a68ac8810520256788562cf7591 100644 (file)
--- a/wglapi.py
+++ b/wglapi.py
@@ -25,7 +25,7 @@
 
 
 from glapi import *
-from windows import *
+from winapi import *
 
 
 wglapi = API("WGL")
diff --git a/winapi.py b/winapi.py
new file mode 100644 (file)
index 0000000..eec3fde
--- /dev/null
+++ b/winapi.py
@@ -0,0 +1,223 @@
+##########################################################################
+#
+# Copyright 2008-2009 VMware, Inc.
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+##########################################################################/
+
+"""Win32 API type description."""
+
+from base import *
+
+SHORT = Alias("SHORT", Short)
+USHORT = Alias("USHORT", UShort)
+INT = Alias("INT", Int)
+UINT = Alias("UINT", UInt)
+LONG = Alias("LONG", Long)
+ULONG = Alias("ULONG", ULong)
+LONGLONG = Alias("LONGLONG", LongLong)
+FLOAT = Alias("FLOAT", Float)
+
+INT32 = Literal("INT32", "UInt")
+UINT32 = Literal("UINT32", "UInt")
+
+BYTE = Literal("BYTE", "UInt", base=16)
+WORD = Literal("WORD", "UInt", base=16)
+DWORD = Literal("DWORD", "UInt", base=16)
+
+BOOL = Alias("BOOL", Bool)
+
+LPLONG = Pointer(LONG)
+LPWORD = Pointer(WORD)
+LPDWORD = Pointer(DWORD)
+LPBOOL = Pointer(BOOL)
+LPSIZE = LPDWORD
+
+LPSTR = CString
+LPCSTR = Const(CString)
+LPWSTR = WString
+LPCWSTR = Const(WString)
+
+LARGE_INTEGER = Struct("LARGE_INTEGER", [
+    (LONGLONG, 'QuadPart'),
+])
+
+SIZE_T = Alias("SIZE_T", SizeT)
+
+HRESULT = Alias("HRESULT", Int)
+
+VOID = Void
+PVOID = Opaque("PVOID")
+LPVOID = PVOID
+HANDLE = Opaque("HANDLE")
+HWND = Opaque("HWND")
+HDC = Opaque("HDC")
+HMONITOR = Opaque("HMONITOR")
+
+GUID = Struct("GUID", [
+    (DWORD, "Data1"),
+    (WORD, "Data2"),
+    (WORD, "Data3"),
+    (BYTE, "Data4[0]"),
+    (BYTE, "Data4[1]"),
+    (BYTE, "Data4[2]"),
+    (BYTE, "Data4[3]"),
+    (BYTE, "Data4[4]"),
+    (BYTE, "Data4[5]"),
+    (BYTE, "Data4[6]"),
+    (BYTE, "Data4[7]"),
+])
+LPGUID = Pointer(GUID)
+
+#REFGUID = Alias("REFGUID", Pointer(GUID))
+REFGUID = Alias("REFGUID", GUID)
+
+IID = Alias("IID", GUID)
+#REFIID = Alias("REFIID", Pointer(IID))
+REFIID = Alias("REFIID", IID)
+
+CLSID = Alias("CLSID", GUID)
+#REFCLSID = Alias("REFCLSID", Pointer(CLSID))
+REFCLSID = Alias("REFCLSID", CLSID)
+
+LUID = Struct("LUID", [
+    (DWORD, "LowPart"),
+    (LONG, "HighPart"),
+])
+
+POINT = Struct("POINT", (
+  (LONG, "x"),
+  (LONG, "y"),
+)) 
+LPPOINT = Pointer(POINT)
+
+RECT = Struct("RECT", (
+  (LONG, "left"),
+  (LONG, "top"),
+  (LONG, "right"), 
+  (LONG, "bottom"), 
+)) 
+LPRECT = Pointer(RECT)
+
+PALETTEENTRY = Struct("PALETTEENTRY", (
+  (BYTE, "peRed"),
+  (BYTE, "peGreen"),
+  (BYTE, "peBlue"), 
+  (BYTE, "peFlags"), 
+)) 
+LPPALETTEENTRY = Pointer(PALETTEENTRY)
+
+
+RGNDATAHEADER = Struct("RGNDATAHEADER", [
+    (DWORD, "dwSize"),
+    (DWORD, "iType"),
+    (DWORD, "nCount"),
+    (DWORD, "nRgnSize"),
+    (RECT, "rcBound"),
+])
+
+RGNDATA = Struct("RGNDATA", [
+    (RGNDATAHEADER, "rdh"),
+    #(Char, "Buffer[1]"),
+])
+LPRGNDATA = Pointer(RGNDATA)
+
+HMODULE = Opaque("HMODULE")
+
+IUnknown = Interface("IUnknown")
+
+IUnknown.methods = (
+       Method(HRESULT, "QueryInterface", ((REFIID, "riid"), (Pointer(OpaquePointer(Void)), "ppvObj"))),
+       Method(ULONG, "AddRef", ()),
+       Method(ULONG, "Release", ()),
+)
+
+
+class DllFunction(Function):
+
+    def get_true_pointer(self):
+        ptype = self.pointer_type()
+        pvalue = self.pointer_value()
+        print '    if(!g_hDll) {'
+        print '        g_hDll = LoadLibrary(g_szDll);'
+        print '        if(!g_hDll)'
+        self.fail_impl()
+        print '    }'
+        print '    if(!%s) {' % (pvalue,)
+        print '        %s = (%s)GetProcAddress(g_hDll, "%s");' % (pvalue, ptype, self.name)
+        print '        if(!%s)' % (pvalue,)
+        self.fail_impl()
+        print '    }'
+
+
+class Dll:
+
+    def __init__(self, name):
+        self.name = name
+        self.functions = []
+        if self not in towrap:
+            towrap.append(self)
+
+    def wrap_name(self):
+        return "Wrap" + self.name
+
+    def wrap_pre_decl(self):
+        pass
+
+    def wrap_decl(self):
+        print 'static HINSTANCE g_hDll = NULL;'
+        print 'static TCHAR g_szDll[MAX_PATH] = {0};'
+        print
+        print 'BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);'
+        print
+        for function in self.functions:
+            function.wrap_decl()
+        print
+
+    def wrap_impl(self):
+        print r'BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {'
+        print r'    switch(fdwReason) {'
+        print r'    case DLL_PROCESS_ATTACH:'
+        print r'        if(!GetSystemDirectory(g_szDll, MAX_PATH))'
+        print r'            return FALSE;'
+        print r'        _tcscat(g_szDll, TEXT("\\%s.dll"));' % self.name
+        print r'        Log::Open("%s");' % self.name
+        print r'    case DLL_THREAD_ATTACH:'
+        print r'        return TRUE;'
+        print r'    case DLL_THREAD_DETACH:'
+        print r'        return TRUE;'
+        print r'    case DLL_PROCESS_DETACH:'
+        print r'        Log::Close();'
+        print r'        if(g_hDll) {'
+        print r'            FreeLibrary(g_hDll);'
+        print r'            g_hDll = NULL;'
+        print r'        }'
+        print r'        return TRUE;'
+        print r'    }'
+        print r'    (void)hinstDLL;'
+        print r'    (void)lpvReserved;'
+        print r'    return TRUE;'
+        print r'}'
+        print
+        for function in self.functions:
+            function.wrap_impl()
+        print
+
diff --git a/windows.py b/windows.py
deleted file mode 100644 (file)
index 208961f..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-##########################################################################
-#
-# Copyright 2008-2009 VMware, Inc.
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-##########################################################################/
-
-"""windows.h"""
-
-from base import *
-
-SHORT = Alias("SHORT", Short)
-USHORT = Alias("USHORT", UShort)
-INT = Alias("INT", Int)
-UINT = Alias("UINT", UInt)
-LONG = Alias("LONG", Long)
-ULONG = Alias("ULONG", ULong)
-LONGLONG = Alias("LONGLONG", LongLong)
-FLOAT = Alias("FLOAT", Float)
-
-INT32 = Literal("INT32", "UInt")
-UINT32 = Literal("UINT32", "UInt")
-
-BYTE = Literal("BYTE", "UInt", base=16)
-WORD = Literal("WORD", "UInt", base=16)
-DWORD = Literal("DWORD", "UInt", base=16)
-
-BOOL = Alias("BOOL", Bool)
-
-LPLONG = Pointer(LONG)
-LPWORD = Pointer(WORD)
-LPDWORD = Pointer(DWORD)
-LPBOOL = Pointer(BOOL)
-LPSIZE = LPDWORD
-
-LPSTR = CString
-LPCSTR = Const(CString)
-LPWSTR = WString
-LPCWSTR = Const(WString)
-
-LARGE_INTEGER = Struct("LARGE_INTEGER", [
-    (LONGLONG, 'QuadPart'),
-])
-
-SIZE_T = Alias("SIZE_T", SizeT)
-
-HRESULT = Alias("HRESULT", Int)
-
-VOID = Void
-PVOID = Opaque("PVOID")
-LPVOID = PVOID
-HANDLE = Opaque("HANDLE")
-HWND = Opaque("HWND")
-HDC = Opaque("HDC")
-HMONITOR = Opaque("HMONITOR")
-
-GUID = Struct("GUID", [
-    (DWORD, "Data1"),
-    (WORD, "Data2"),
-    (WORD, "Data3"),
-    (BYTE, "Data4[0]"),
-    (BYTE, "Data4[1]"),
-    (BYTE, "Data4[2]"),
-    (BYTE, "Data4[3]"),
-    (BYTE, "Data4[4]"),
-    (BYTE, "Data4[5]"),
-    (BYTE, "Data4[6]"),
-    (BYTE, "Data4[7]"),
-])
-LPGUID = Pointer(GUID)
-
-#REFGUID = Alias("REFGUID", Pointer(GUID))
-REFGUID = Alias("REFGUID", GUID)
-
-IID = Alias("IID", GUID)
-#REFIID = Alias("REFIID", Pointer(IID))
-REFIID = Alias("REFIID", IID)
-
-CLSID = Alias("CLSID", GUID)
-#REFCLSID = Alias("REFCLSID", Pointer(CLSID))
-REFCLSID = Alias("REFCLSID", CLSID)
-
-LUID = Struct("LUID", [
-    (DWORD, "LowPart"),
-    (LONG, "HighPart"),
-])
-
-POINT = Struct("POINT", (
-  (LONG, "x"),
-  (LONG, "y"),
-)) 
-LPPOINT = Pointer(POINT)
-
-RECT = Struct("RECT", (
-  (LONG, "left"),
-  (LONG, "top"),
-  (LONG, "right"), 
-  (LONG, "bottom"), 
-)) 
-LPRECT = Pointer(RECT)
-
-PALETTEENTRY = Struct("PALETTEENTRY", (
-  (BYTE, "peRed"),
-  (BYTE, "peGreen"),
-  (BYTE, "peBlue"), 
-  (BYTE, "peFlags"), 
-)) 
-LPPALETTEENTRY = Pointer(PALETTEENTRY)
-
-
-RGNDATAHEADER = Struct("RGNDATAHEADER", [
-    (DWORD, "dwSize"),
-    (DWORD, "iType"),
-    (DWORD, "nCount"),
-    (DWORD, "nRgnSize"),
-    (RECT, "rcBound"),
-])
-
-RGNDATA = Struct("RGNDATA", [
-    (RGNDATAHEADER, "rdh"),
-    #(Char, "Buffer[1]"),
-])
-LPRGNDATA = Pointer(RGNDATA)
-
-HMODULE = Opaque("HMODULE")
-
-IUnknown = Interface("IUnknown")
-
-IUnknown.methods = (
-       Method(HRESULT, "QueryInterface", ((REFIID, "riid"), (Pointer(OpaquePointer(Void)), "ppvObj"))),
-       Method(ULONG, "AddRef", ()),
-       Method(ULONG, "Release", ()),
-)
-
-
-class DllFunction(Function):
-
-    def get_true_pointer(self):
-        ptype = self.pointer_type()
-        pvalue = self.pointer_value()
-        print '    if(!g_hDll) {'
-        print '        g_hDll = LoadLibrary(g_szDll);'
-        print '        if(!g_hDll)'
-        self.fail_impl()
-        print '    }'
-        print '    if(!%s) {' % (pvalue,)
-        print '        %s = (%s)GetProcAddress(g_hDll, "%s");' % (pvalue, ptype, self.name)
-        print '        if(!%s)' % (pvalue,)
-        self.fail_impl()
-        print '    }'
-
-
-class Dll:
-
-    def __init__(self, name):
-        self.name = name
-        self.functions = []
-        if self not in towrap:
-            towrap.append(self)
-
-    def wrap_name(self):
-        return "Wrap" + self.name
-
-    def wrap_pre_decl(self):
-        pass
-
-    def wrap_decl(self):
-        print 'static HINSTANCE g_hDll = NULL;'
-        print 'static TCHAR g_szDll[MAX_PATH] = {0};'
-        print
-        print 'BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);'
-        print
-        for function in self.functions:
-            function.wrap_decl()
-        print
-
-    def wrap_impl(self):
-        print r'BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {'
-        print r'    switch(fdwReason) {'
-        print r'    case DLL_PROCESS_ATTACH:'
-        print r'        if(!GetSystemDirectory(g_szDll, MAX_PATH))'
-        print r'            return FALSE;'
-        print r'        _tcscat(g_szDll, TEXT("\\%s.dll"));' % self.name
-        print r'        Log::Open("%s");' % self.name
-        print r'    case DLL_THREAD_ATTACH:'
-        print r'        return TRUE;'
-        print r'    case DLL_THREAD_DETACH:'
-        print r'        return TRUE;'
-        print r'    case DLL_PROCESS_DETACH:'
-        print r'        Log::Close();'
-        print r'        if(g_hDll) {'
-        print r'            FreeLibrary(g_hDll);'
-        print r'            g_hDll = NULL;'
-        print r'        }'
-        print r'        return TRUE;'
-        print r'    }'
-        print r'    (void)hinstDLL;'
-        print r'    (void)lpvReserved;'
-        print r'    return TRUE;'
-        print r'}'
-        print
-        for function in self.functions:
-            function.wrap_impl()
-        print
-