named_pipes.py 文件源码

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

项目:driverlib 作者: sam-b 项目源码 文件源码
def CreateFile(path, access=GENERIC_READ | GENERIC_WRITE, mode=0, security_attributes=NULL, creation=OPEN_EXISTING, flags=FILE_ATTRIBUTE_NORMAL, template_file = NULL):
    """See: CreateFile function
       http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx
    """
    CreateFile_Fn = windll.kernel32.CreateFileA
    CreateFile_Fn.argtypes = [
            wintypes.LPCSTR,                    # _In_          LPCTSTR lpFileName
            wintypes.DWORD,                     # _In_          DWORD dwDesiredAccess
            wintypes.DWORD,                     # _In_          DWORD dwShareMode
            LPSECURITY_ATTRIBUTES,              # _In_opt_      LPSECURITY_ATTRIBUTES lpSecurityAttributes
            wintypes.DWORD,                     # _In_          DWORD dwCreationDisposition
            wintypes.DWORD,                     # _In_          DWORD dwFlagsAndAttributes
            wintypes.HANDLE]                    # _In_opt_      HANDLE hTemplateFile
    CreateFile_Fn.restype = wintypes.HANDLE

    handle = wintypes.HANDLE(CreateFile_Fn(path,
                         access,
                         mode,
                         security_attributes,
                         creation,
                         flags,
                         template_file))
    return handle
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号