---
name: "GetModuleFileNameA"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/GetModuleFileNameA"
---

# GetModuleFileNameA(3w)

## NAME

**GetModuleFileNameA** (KERNEL32.@)

## SYNOPSIS

DWORD GetModuleFileNameA\
  (\
   HMODULE *hModule*,\
   LPSTR   *lpFileName*,\
   DWORD   *size*\
  )

## PARAMS

*hModule* **\[In\]**  Module handle (**32** bit).

*lpFileName* **\[Out\]**  Destination for file name.

**\[In\]**  Size of *lpFileName* in characters.

## DESCRIPTION

Get the file name of a loaded module from its handle.

## RETURNS

**Success:** The length of the file name, excluding the terminating **NUL**.

**Failure:** **0.** Use **[GetLastError(3w)](/GetLastError/3w.md)** to determine the cause.

## NOTES

This function always returns the long path of *hModule* The function doesn't write a terminating **' '** if the buffer is too small.

## IMPLEMENTATION

Declared in **"winbase.h"**.

Implemented in **"dlls/kernel32/module.c"**.

Debug channel **"module"**.
