Skip to main content

DLL Diagnostic Tools

The dlldiag command-line tool provides functionality to assist in identifying the DLL dependencies of an application or library and diagnosing dependency loading issues. It is primarily intended for use when migrating existing applications to Windows containers, where traditional GUI-based tools are unavailable. Identifying the minimal set of dependencies for an application facilitates a workflow where the required DLL files can be copied from the mcr.microsoft.com/windows base image into the mcr.microsoft.com/windows/servercore base image, thus maximising application compatibility whilst maintaining the minimum possible image size.

Contents

Requirements and installation

The dll-diagnostics Python package requires the following:

You can install the package by running the following command:

pip install dll-diagnostics

If you don't need the package on your host system then you can download a prebuilt container image from Docker Hub to start using the dlldiag command inside a Windows container.

Usage

The dlldiag command-line tool provides the following subcommands:

  • dlldiag deps: this subcommand lists the direct dependencies for a module (DLL/EXE) and checks if each one can be loaded. Delay-loaded dependencies are also listed, but indirect dependencies (i.e. dependencies of dependencies) are not.

  • dlldiag docker this subcommand generates a Dockerfile suitable for using the dlldiag command inside a Windows container, allowing the user to optionally specify the base image to be used in the Dockerfile's FROM clause. This is handy when you want to extend an existing image of your choice, rather than simply extending the Windows Server Core image as the prebuilt images from Docker Hub do.

  • dlldiag graph this subcommand runs executable modules with an injected DLL that uses Detours to instrument calls to LoadLibrary() so the call hierarchy can be reconstructed. This is handy when you want to see which indirect dependencies are being loaded by an executable's direct dependencies or want to identify dependencies that are loaded programmatically at runtime.

  • dlldiag trace: this subcommand uses the Windows debugger to trace a LoadLibrary() call for a module (DLL/EXE) and provide detailed reports of the results. The trace makes use of the Windows kernel loader snaps feature to obtain fine-grained information, as discussed in Junfeng Zhang's blog post "Debugging LoadLibrary Failures". The trace captures information about both indirect dependencies and delay-loaded dependencies.

Legal

Copyright © 2019-2021, Adam Rehn. Licensed under the MIT License, see the file LICENSE for details.

Binary distributions of this package include parts of Detours in object form. Detours is Copyright (c) Microsoft Corporation and is licensed under the MIT license.

Release files for dll-diagnostics 0.0.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for dll-diagnostics 0.0.18
File Interpreter ABI Platform
dll_diagnostics-0.0.18-py3-none-any.whl Python 3 none any Details

Release files / dll_diagnostics-0.0.18-py3-none-any.whl

Download URL dll_diagnostics-0.0.18-py3-none-any.whl
Size 687.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78648299fb948eb52017e354e7c450b3b73e7386295f4b3aaf453cc00736830e
BLAKE2b-256 checksum
How to use checksums
8ff7c540c36905b7595550cf9a2211d8cf1c65b8f324fe0531531f723349ba72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.0.18 This release

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page