PyWin32ctypes Documentation

Similar documents
pyserial-asyncio Documentation

sptrans Documentation

Flask Gravatar. Release 0.5.0

RPly Documentation. Release Alex Gaynor

HALCoGen TMS570LS31x Help: example_sci_uart_9600.c

Flask-Sitemap Documentation

Open Source Used In TSP

Cassette Documentation

Mercantile Documentation

Static analysis for quality mobile applications

Navigator Documentation

ProgressBar Abstract

django-generic-filters Documentation

License, Rules, and Application Form

MUMPS IO Documentation

ColdFusion Builder 3.2 Third Party Software Notices and/or Additional Terms and Conditions

DoJSON Documentation. Release Invenio collaboration

ANZ TRANSACTIVE MOBILE for ipad

Ecma International Policy on Submission, Inclusion and Licensing of Software

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Open Source and Standards: A Proposal for Collaboration

Intel Stress Bitstreams and Encoder (Intel SBE) 2017 AVS2 Release Notes (Version 2.3)

User Manual. Date Aug 30, Enertrax DAS Download Client

Table of Contents Overview...2 Selecting Post-Processing: ColorMap...3 Overview of Options Copyright, license, warranty/disclaimer...

Definiens. Image Miner bit and 64-bit Editions. Release Notes

About This Guide. and with the Cisco Nexus 1010 Virtual Services Appliance: N1K-C1010

Preface. Audience. Cisco IOS Software Documentation. Organization

Open Source Used In Cisco Configuration Professional for Catalyst 1.0

Ecma International Policy on Submission, Inclusion and Licensing of Software

Definiens. Tissue Studio Release Notes

Definiens. Image Miner bit and 64-bit Edition. Release Notes

Open Source Used In c1101 and c1109 Cisco IOS XE Fuji

System Log NextAge Consulting Pete Halsted

The Cron service allows you to register STAF commands that will be executed at a specified time interval(s).

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

MagicInfo Express Content Creator

Documentation Roadmap for Cisco Prime LAN Management Solution 4.2

IETF TRUST. Legal Provisions Relating to IETF Documents. Approved November 6, Effective Date: November 10, 2008

Crypto Application. version 1.2

NemHandel Referenceklient 2.3.1

HYDRODESKTOP VERSION 1.4 QUICK START GUIDE

NemHandel Referenceklient 2.3.0

HYDROOBJECTS VERSION 1.1

Copyright PFU LIMITED 2016

FLAMEBOSS 300 MANUAL

Data Deduplication Metadata Extension

IETF TRUST. Legal Provisions Relating to IETF Documents. February 12, Effective Date: February 15, 2009

@list = bsd_glob('*.[ch]'); $homedir = bsd_glob('~gnat', GLOB_TILDE GLOB_ERR);

PageScope Box Operator Ver. 3.2 User s Guide

TWAIN driver User s Guide

Small Logger File System

Note: The version the Event service must be 1.10 or later (but less than 3.0.0).

DAP Controller FCO

LabVIEW Driver. User guide Version

FLAME BOSS 200V2 & 300 MANUAL. Version 2.6 Download latest at FlameBoss.com/manuals

Trimble. ecognition. Release Notes

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

monolith Documentation

Packet Trace Guide. Packet Trace Guide. Technical Note

Installation. List Wrangler - Mailing List Manager for GTK+ Part I. 1 Requirements. By Frank Cox. September 3,

AccuTerm 7 Internet Edition Connection Designer Help. Copyright Schellenbach & Assoc., Inc.

iwrite technical manual iwrite authors and contributors Revision: 0.00 (Draft/WIP)

Copyright PFU LIMITED

python-hl7 Documentation

SMS2CMDB Project Summary v1.6

notify2 Documentation

Enterprise Payment Solutions. Scanner Installation April EPS Scanner Installation: Quick Start for Remote Deposit Complete TM

calio / form-input-nginx-module

Business Rules NextAge Consulting Pete Halsted

SAM4 Reset Controller (RSTC)

Introduction. The Win32 OpenSSL Installation Group hopes that you enjoy this software and get many years of use out of it!

openresty / array-var-nginx-module

User Manual for Video Codec

NEC Display Solutions MultiProfiler for Linux x64 Versions Installation Guide

Grouper UI csrf xsrf prevention

Package fst. December 18, 2017

CSCE Inspection Activity Name(s):

openresty / encrypted-session-nginx-module

Simba Cassandra ODBC Driver with SQL Connector

SW MAPS TEMPLATE BUILDER. User s Manual

xlwt Release April 15, 2015

VMware vcenter Log Insight Manager. Deployment Guide

QuarkXPress Server Manager 8.0 ReadMe

Fujitsu ScandAll PRO V2.1.5 README

Migration Tool. Migration Tool (Beta) Technical Note

Scott Auge

Conettix Universal Dual Path Communicator B465

User Guide. Calibrated Software, Inc.

NTLM NTLM. Feature Description

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

cs50.c /**************************************************************************** * CS50 Library 6 *

Denkh XML Reporter. Web Based Report Generation Software. Written By Scott Auge Amduus Information Works, Inc.

Explaining & Accessing the SPDX License List

Use in High-Safety Applications

Distinction Import Module User Guide. DISTINCTION.CO.UK

TheGreenBow VPN Client ios User Guide

KEMP Driver for Red Hat OpenStack. KEMP LBaaS Red Hat OpenStack Driver. Installation Guide

This file includes important notes on this product and also the additional information not included in the manuals.

Package fst. June 7, 2018

iphone/ipad Connection Manual

Transcription:

PyWin32ctypes Documentation Release 0.1.3.dev1 David Cournapeau, Ioannis Tziakos Sep 01, 2017

Contents 1 Usage 3 2 Development setup 5 3 Reference 7 3.1 PyWin32 Compatibility Layer...................................... 7 4 Change Log 13 4.1 Version 0.1.2............................................... 13 4.2 Version 0.1.1............................................... 13 4.3 Version 0.1.0............................................... 13 4.4 Version 0.0.1............................................... 14 5 LICENSE 15 6 Indices and tables 17 Python Module Index 19 i

ii

A reimplementation of pywin32 that is pure python. The default behaviour will try to use cffi (>= 1.3.0), if available, and fall back to using ctypes. Please note that there is no need to have a compiler available on installation or at runtime. Contents 1

2 Contents

CHAPTER 1 Usage Example: # Equivalent to 'import win32api' from pywin32. from win32ctypes.pywin32 import win32api win32api.loadlibraryex(sys.executable, 0, win32api.load_library_as_datafile) Note: Currently pywin32ctypes implements only a very small subset of pywin32, for internal needs at Enthought. We do welcome additional features and PRs, though. 3

4 Chapter 1. Usage

CHAPTER 2 Development setup The following should be good enough: pip install -r dev_requirements.txt python install -e Note: While pywin32-ctypes should regularly be tested on windows, you can also develop/test on unix by using wine (see travis-ci configuration to set it up). 5

6 Chapter 2. Development setup

CHAPTER 3 Reference PyWin32 Compatibility Layer The win32ctypes library provides a compatibility layer with PyWin32. We attempt to keep the signature of the Functions and their behaviour as close as possible to PyWin32. For details and behaviour please refer to the Pywin32 documentation and the related MSDN<https://msdn.microsoft.com>_ reference pages. win32ctypes.pywin32.win32api win32ctypes.pywin32.win32cred win32ctypes.pywin32.pywintypes A module, encapsulating the Windows Win32 API. Interface to credentials management functions. A module which supports common Windows types. win32api A module, encapsulating the Windows Win32 API. Functions BeginUpdateResource(filename, delete) Get a handle that can be used by the UpdateResource(). EndUpdateResource(handle, discard) End the update resource of the handle. EnumResourceLanguages(hModule, lptype, lp- List languages of a resource module. Name) EnumResourceNames(hModule, restype) Enumerates all the resources of the specified type within a module. EnumResourceTypes(hModule) Enumerates resource types within a module. FreeLibrary(hModule) Free the loaded dynamic-link library (DLL) module. GetSystemDirectory() Get the System directory. GetTickCount() The number of milliseconds that have elapsed since startup Continued on next page 7

Table 3.2 continued from previous page GetWindowsDirectory() Get the Windows directory. LoadLibraryEx(fileName, handle, flags) Loads the specified DLL, and returns the handle. LoadResource(hModule, type, name[, language]) Find and Load a resource component. UpdateResource(handle, type, name, data[,...]) Update a resource. win32ctypes.pywin32.win32api.beginupdateresource(filename, delete) Get a handle that can be used by the UpdateResource(). Parameters filename (unicode) The filename of the module to load. delete (bool) When true all existing resources are deleted Returns result (hmodule) Handle of the resource. win32ctypes.pywin32.win32api.endupdateresource(handle, discard) End the update resource of the handle. Parameters handle (hmodule) The handle of the resource as it is returned by BeginUpdateResource() discard (bool) When True all writes are discarded. win32ctypes.pywin32.win32api.enumresourcelanguages(hmodule, lptype, lpname) List languages of a resource module. Parameters hmodule (handle) Handle to the resource module. lptype (str or int) The type or id of resource to enumerate. lpname (str or int) The type or id of resource to enumerate. Returns resource_languages (list) List of the resource language ids. win32ctypes.pywin32.win32api.enumresourcenames(hmodule, restype) Enumerates all the resources of the specified type within a module. Parameters hmodule (handle) The handle to the module. restype (str or int) The type or id of resource to enumerate. Returns resource_names (list) The list of resource names (unicode strings) of the specific resource type in the module. win32ctypes.pywin32.win32api.enumresourcetypes(hmodule) Enumerates resource types within a module. Parameters hmodule (handle) The handle to the module. Returns resource_types (list) The list of resource types in the module. 8 Chapter 3. Reference

win32ctypes.pywin32.win32api.freelibrary(hmodule) Free the loaded dynamic-link library (DLL) module. If necessary, decrements its reference count. Parameters handle (hmodule) The handle to the library as returned by the LoadLibrary function. win32ctypes.pywin32.win32api.getsystemdirectory() Get the System directory. Returns result (str) The path to the System directory. win32ctypes.pywin32.win32api.gettickcount() The number of milliseconds that have elapsed since startup Returns counts (int) The millisecond counts since system startup. win32ctypes.pywin32.win32api.getwindowsdirectory() Get the Windows directory. See also Returns result (str) The path to the Windows directory. win32ctypes.pywin32.win32api.loadlibraryex(filename, handle, flags) Loads the specified DLL, and returns the handle. Parameters filename (unicode) The filename of the module to load. handle (int) Reserved, always zero. flags (int) The action to be taken when loading the module. Returns handle (hmodule) The handle of the loaded module win32ctypes.pywin32.win32api.loadresource(hmodule, type, name, language=0) Find and Load a resource component. Parameters handle (hmodule) The handle of the module containing the resource. Use None for current process executable. type (str or int) The type of resource to load. name (str or int) The name or Id of the resource to load. language (int) Language to use, default is LANG_NEUTRAL. Returns resource (bytes) The byte string blob of the resource win32ctypes.pywin32.win32api.updateresource(handle, type, name, data, language=0) Update a resource. Parameters handle (hmodule) The handle of the resource file as returned by BeginUpdateResource(). type (str or int) The type of resource to update. name (str or int) The name or Id of the resource to update. data (bytes) A bytes like object is expected. 3.1. PyWin32 Compatibility Layer 9

..note :: pipywin32219 on Python 2.7 can handle unicode inputs. However the data are stored as bytes and it is not really possible to convert the information back into the original unicode string. To be consistent with the Python 3 behaviour of pywin32 we raise an error if the input cannot be converted to bytes. language (int) Language to use, default is LANG_NEUTRAL. win32cred Interface to credentials management functions. Functions CredDelete(TargetName, Type[, Flags]) CredRead(TargetName, Type[, Flags]) CredWrite(Credential[, Flags]) Remove the given target name from the stored credentials. Retrieves a stored credential. Creates or updates a stored credential. win32ctypes.pywin32.win32cred.creddelete(targetname, Type, Flags=0) Remove the given target name from the stored credentials. Parameters TargetName (unicode) The target name to fetch from the keyring. Type (int) One of the CRED_TYPE_* constants. Flags (int) Reserved, always use 0. win32ctypes.pywin32.win32cred.credread(targetname, Type, Flags=0) Retrieves a stored credential. Parameters TargetName (unicode) The target name to fetch from the keyring. Type (int) One of the CRED_TYPE_* constants. Flags (int) Reserved, always use 0. Returns credentials (dict) None if the target name was not found or A dictionary corresponding to the PyWin32 PyCREDENTIAL structure. win32ctypes.pywin32.win32cred.credwrite(credential, Flags=0) Creates or updates a stored credential. Parameters Credential (dict) A dictionary corresponding to the PyWin32 PyCREDENTIAL structure. Flags (int) Always pass CRED_PRESERVE_CREDENTIAL_BLOB (i.e. 0). 10 Chapter 3. Reference

pywintypes A module which supports common Windows types. Functions pywin32error(*args, **kwds) win32ctypes.pywin32.pywintypes.pywin32error(*args, **kwds) Exceptions error(*args, **kw) class win32ctypes.pywin32.pywintypes.error(*args, **kw) 3.1. PyWin32 Compatibility Layer 11

12 Chapter 3. Reference

CHAPTER 4 Change Log Version 0.1.2 (bugfix release) Fix implementation for the deprecated api (#64). Version 0.1.1 (bugfix release) Update Manifest.in entries (#63) fix VERSION path in Manifest.in (#62 contributed by @MinchinWeb) Version 0.1.0 Update tests and provide better compatibility with pywin32 for Resource functions Fix: Python 3.5 and 3.6 support (#52). API additions to allow pywin32-ctypes to work with pyinstaller (#46 and #57 contributed by @virtuald). Fix: do not update the global copy of the windows dlls (#42) Add documentation and setup automatic builds in ReadTheDocs (#3, #36). Add cffi backend to be used when available (#31). Fix: EnumResourceTypes and EnumResourceNames would only return ints (#21, #30). Restructure package layout to split core wrapping modules from pywin32 emulation (#15, #17). 13

Version 0.0.1 7/04/2014 Python 2.6 support (#13) Python 3 support (#12) Basic maintenance work (#11, #7) Fix error raising to be pywin32 compatible (#8) Package rename mini_pywin32 -> pywin32-ctypes Add travis-ci integration using wine! (#2) Support basic library and resource loading (#1) mini_pywin32 is born 14 Chapter 4. Change Log

CHAPTER 5 LICENSE This software is OSI Certified Open Source Software. Initiative. Copyright (c) 2014, Enthought, Inc. All rights reserved. OSI Certified is a certification mark of the Open Source Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Enthought, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, IN- CIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSI- NESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CON- TRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM- AGE. 15

16 Chapter 5. LICENSE

CHAPTER 6 Indices and tables genindex modindex search 17

18 Chapter 6. Indices and tables

Python Module Index w win32ctypes.pywin32.pywintypes, 11 win32ctypes.pywin32.win32api, 7 win32ctypes.pywin32.win32cred, 10 19

20 Python Module Index

Index B BeginUpdateResource() (in module win32ctypes.pywin32.win32api), 8 C CredDelete() (in module win32ctypes.pywin32.win32cred), 10 CredRead() (in module win32ctypes.pywin32.win32cred), 10 CredWrite() (in module win32ctypes.pywin32.win32cred), 10 E EndUpdateResource() (in module win32ctypes.pywin32.win32api), 8 EnumResourceLanguages() (in module win32ctypes.pywin32.win32api), 8 EnumResourceNames() (in module win32ctypes.pywin32.win32api), 8 EnumResourceTypes() (in module win32ctypes.pywin32.win32api), 8 error (class in win32ctypes.pywin32.pywintypes), 11 F FreeLibrary() (in module win32ctypes.pywin32.win32api), 8 G GetSystemDirectory() (in module win32ctypes.pywin32.win32api), 9 GetTickCount() (in module win32ctypes.pywin32.win32api), 9 GetWindowsDirectory() (in module win32ctypes.pywin32.win32api), 9 L LoadLibraryEx() (in module win32ctypes.pywin32.win32api), 9 LoadResource() (in module win32ctypes.pywin32.win32api), 9 P pywin32error() (in module win32ctypes.pywin32.pywintypes), 11 U UpdateResource() (in module win32ctypes.pywin32.win32api), 9 W win32ctypes.pywin32.pywintypes (module), 11 win32ctypes.pywin32.win32api (module), 7 win32ctypes.pywin32.win32cred (module), 10 21