Ejemplo n.º 1
0
 def Detach(self):
     h = int(self)
     if h != -1:
         c_handle = self.c_handle
         self.c_handle = _INVALID_HANDLE_VALUE
         _ffi.gc(c_handle, None)
     return h
Ejemplo n.º 2
0
 def Detach(self):
     h = int(self)
     if h != -1:
         c_handle = self.c_handle
         self.c_handle = _INVALID_HANDLE_VALUE
         _ffi.gc(c_handle, None)
     return h
Ejemplo n.º 3
0
 def Close(self):
     if int(self) != -1:
         c_handle = self.c_handle
         self.c_handle = _INVALID_HANDLE_VALUE
         _ffi.gc(c_handle, None)
         _kernel32.CloseHandle(c_handle)
Ejemplo n.º 4
0
 def __init__(self, c_handle):
     # 'c_handle' is a cffi cdata of type HANDLE, which is basically 'void *'
     self.c_handle = c_handle
     if int(self) != -1:
         self.c_handle = _ffi.gc(self.c_handle, _kernel32.CloseHandle)
Ejemplo n.º 5
0
 def Close(self):
     if int(self) != -1:
         c_handle = self.c_handle
         self.c_handle = _INVALID_HANDLE_VALUE
         _ffi.gc(c_handle, None)
         _kernel32.CloseHandle(c_handle)
Ejemplo n.º 6
0
 def __init__(self, c_handle):
     # 'c_handle' is a cffi cdata of type HANDLE, which is basically 'void *'
     self.c_handle = c_handle
     if int(self) != -1:
         self.c_handle = _ffi.gc(self.c_handle, _kernel32.CloseHandle)