How do I find which Dlls contain specific W32 functions?

My app is a WPF application and it already has code for the older type of System DPI awareness that works well in every version of windows except 8.1. It turns out that Microsoft added a number of functions to Windows 8.1 as part of their implementation of per-monitor DPI awareness. I need to implement code in my program to support this type of DPI awareness.

I have documentation that lists the per-monitor DPI awareness functions and what their parameters are. I need to import those into C# and call them from my window class. But I don't know which DLLs contain those functions! The documentation for the GetProcessDpiAwareness function, for example, does not indicate which DLL it's in.

How do I find what the exports in the DLLs are?


Right out of head, a dumb method: a binary search in C:WindowsSystem32 for GetProcessDpiAwareness , then studying each occurrence with Dependency Walker for exports.

This produces the result: GetProcessDpiAwareness is exported by SHCore.dll .

One may also search the Windows SDK headers and libs, but in my case I haven't found GetProcessDpiAwareness , to my surprise.

Another idea, run the following from the command line prompt:

for %f in (%windir%system32*.dll) do dumpbin.exe /exports %f >>%temp%__exports

Then search %temp%__exports for the API.


Usually functions that work with the same resources are in the same dll's. Look at another dpi function like GetDpiForMonitor and you will see it is in Shcore.dll

Edit: After you find the dll this way you can double check using dependency walker to see what functions are exported from that dll.

链接地址: http://www.djcxy.com/p/18900.html

上一篇: PaperClip 4.0的女孩

下一篇: 我如何找到哪些Dll包含特定的W32函数?