handle.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PythonForWindows 作者: hakril 项目源码 文件源码
def _get_object_type(self):
        lh = self.local_handle
        xxx = EPUBLIC_OBJECT_TYPE_INFORMATION()
        size_needed = DWORD()
        try:
            winproxy.NtQueryObject(lh, ObjectTypeInformation, ctypes.byref(xxx), ctypes.sizeof(xxx), ctypes.byref(size_needed))
        except WindowsError as e:
            if e.code != STATUS_INFO_LENGTH_MISMATCH:
                # print("ERROR WITH {0:x}".format(lh))
                raise
            size = size_needed.value
            buffer = ctypes.c_buffer(size)
            winproxy.NtQueryObject(lh, ObjectTypeInformation, buffer, size, ctypes.byref(size_needed))
            xxx = EPUBLIC_OBJECT_TYPE_INFORMATION.from_buffer_copy(buffer)
        return xxx.TypeName.str
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号