about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2012-03-20 10:07:24 +0100
committerserpilliere <devnull@localhost>2012-03-20 10:07:24 +0100
commit1b1f0c2fb104b6ea9451d39bda6a2b3af808e011 (patch)
treefee78ccfb6df84057b10715687a3a6b9a2bb566c
parentd51620ef752fcf77726d2611235a86c3815aa09d (diff)
downloadmiasm-1b1f0c2fb104b6ea9451d39bda6a2b3af808e011.tar.gz
miasm-1b1f0c2fb104b6ea9451d39bda6a2b3af808e011.zip
miasm/win_api: fix api
-rw-r--r--miasm/tools/win_api.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/miasm/tools/win_api.py b/miasm/tools/win_api.py
index 13944051..95ff4d5d 100644
--- a/miasm/tools/win_api.py
+++ b/miasm/tools/win_api.py
@@ -102,7 +102,8 @@ class handle_generator():
 
     def __getitem__(self, item):
         return self.all_handles.__getitem__(item)
-
+    def __delitem__(self, item):
+        self.all_handles.__delitem__(item)
 
 
 class c_winobjs:
@@ -150,6 +151,7 @@ class c_winobjs:
         self.lastwin32error = 0
         self.mutex = {}
         self.env_variables = {}
+        self.events_pool = {}
 winobjs = c_winobjs()
 
 
@@ -1980,7 +1982,10 @@ def my_CreateEvent(funcname, get_str):
     lpname = vm_pop_uint32_t()
 
     print funcname, hex(lpeventattributes), hex(bmanualreset), hex(binitialstate), hex(lpname)
-    s = get_str(lpname)
+    if lpname:
+        s = get_str(lpname)
+    else:
+        s = None
     print repr(s)
     if not s in winobjs.events_pool:
         winobjs.events_pool[s] = (bmanualreset, binitialstate)