Function signature
The signature of a function needs to be as follows:
void CALLBACK funcName(
HWND hwnd,
HINSTANCE hinst,
LPSTR lpszCmdLine,
int nCmdShow
);
Syntax
The syntax for using rundll32 is as follows
c:\> rundll32 nameOf.DLL,entryPoint
c:\> rundll32 nameOf.DLL,entryPoint optionalArgument1
c:\> rundll32 nameOf.DLL,entryPoint optionalArgument1 optionalArgument2
c:\> rundll32 nameOf.DLL,entryPoint optionalArgument1 optionalArgument2 …
When used that way, it loads
nameOf.DLL
with the
WinAPI function
LoadLibrary()
and determines the address of the function
entryPoint
with
GetProcAddress()
.
TODO
The following command is supposed to print a HTML document (in
PowerShell), but it isn't (at least when I tried to use it):
rundll32 C:\Windows\System32\mshtml.dll,PrintHTML "Microsoft Print to PDF" $pwd\languages.html