zoukankan      html  css  js  c++  java
  • To consume exported DLL functions 之一 Identifying Functions in DLLs

    Identifying Functions in DLLs

    The identity of a DLL function consists of the following elements:

    • Function name or ordinal

    • Name of the DLL file in which the implementation can be found

    For example, specifying the MessageBox function in the User32.dll identifies the function (MessageBox) and its location (User32.dll, User32, or user32). The Microsoft Windows application programming interface (Win32 API) can contain two versions of each function that handles characters and strings: a 1-byte character ANSI version and a 2-byte character Unicode version. When unspecified, the character set, represented by the CharSet field, defaults to ANSI. Some functions can have more than two versions.

    MessageBoxA is the ANSI entry point for the MessageBox function; MessageBoxW is the Unicode version. You can list function names for a specific DLL, such as user32.dll, by running a variety of command-line tools. For example, you can use dumpbin /exports user32.dll or link /dump /exports user32.dll to obtain function names.

    You can rename an unmanaged function to whatever you like within your code as long as you map the new name to the original entry point in the DLL. For instructions on renaming an unmanaged DLL function in managed source code, see the Specifying an Entry Point.

    Platform invoke enables you to control a significant portion of the operating system by calling functions in the Win32 API and other DLLs. In addition to the Win32 API, there are numerous other APIs and DLLs available to you through platform invoke.

    The following table describes several commonly used DLLs in the Win32 API.

    DLL

    Description of Contents

    GDI32.dll

    Graphics Device Interface (GDI) functions for device output, such as those for drawing and font management.

    Kernel32.dll

    Low-level operating system functions for memory management and resource handling.

    User32.dll

    Windows management functions for message handling, timers, menus, and communications.

    For complete documentation on the Win32 API, see the Platform SDK. For examples that demonstrate how to construct .NET-based declarations to be used with platform invoke, see Marshaling Data with Platform Invoke.

  • 相关阅读:
    OS__信号量(semaphore)PV操作
    c++ _宏与内联函数
    ubuntu_ root change to user
    联想Y450在Ubuntu下调节屏幕亮度
    AI—家庭组机器人平台环境配置,高级人工智能实验总结
    如何在ubuntu下使用windows下的程序(eg: .exe)
    Python_XML的三种解析方法
    Python学习资源汇总
    转:Emmet 学习之路
    sql入门
  • 原文地址:https://www.cnblogs.com/MayGarden/p/1642339.html
Copyright © 2011-2022 走看看