Skip to content

Commit 9edf697

Browse files
author
Colin Robertson
committed
Add info to satisfy a question about ordinals
1 parent 5f56d98 commit 9edf697

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/build/reference/exports.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,20 @@ EXPORTS
3838
func2=func1
3939
```
4040

41-
If the name that you export is from other module, specify the export's name in the DLL by using *other_module.exported_name*. For example, if your DLL exports a function `other_module.func1` and you want callers to use it as `func2`, you would specify:
41+
If the name that you export is from some other module, specify the export's name in the DLL by using *other_module.exported_name*. For example, if your DLL exports a function `other_module.func1` and you want callers to use it as `func2`, you would specify:
4242

4343
```DEF
4444
EXPORTS
4545
func2=other_module.func1
4646
```
4747

48+
If the name that you export is from another module that exports by ordinal, specify the export's ordinal in the DLL by using *other_module.#ordinal_number*. For example, if your DLL exports a function from the other module where it is ordinal 42, and you want callers to use it as `func2`, you would specify:
49+
50+
```DEF
51+
EXPORTS
52+
func2=other_module.#42
53+
```
54+
4855
Because the Visual C++ compiler uses name decoration for C++ functions, you must either use the decorated name internal_name or define the exported functions by using extern "C" in the source code. The compiler also decorates C functions that use the [__stdcall](../../cpp/stdcall.md) calling convention with an underscore (_) prefix and a suffix composed of the at sign (@) followed by the number of bytes (in decimal) in the argument list.
4956

5057
To find the decorated names produced by the compiler, use the [DUMPBIN](../../build/reference/dumpbin-reference.md) tool or the linker [/MAP](../../build/reference/map-generate-mapfile.md) option. The decorated names are compiler-specific. If you export the decorated names in the .DEF file, executables that link to the DLL must also be built by using the same version of the compiler. This ensures that the decorated names in the caller match the exported names in the .DEF file.

0 commit comments

Comments
 (0)