What is the difference if any?

Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

This in Windows 2000 SP3. What is the difference between these two
commands:

"C:\WINNT\System32\rundll32.exe"
"C:\WINNT\System32\divxdec.ax",DllRegisterServer

and

regsvr32 divxdec.ax

Thanks.

--
George Hester
_______________________________
8 answers Last reply
More about what difference
  1. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    George Hester wrote:
    > This in Windows 2000 SP3. What is the difference between
    > these two commands:
    >
    > "C:\WINNT\System32\rundll32.exe"
    > "C:\WINNT\System32\divxdec.ax",DllRegisterServer
    >
    > and
    >
    > regsvr32 divxdec.ax

    First is wrong and second is not. RunDll32.exe requires that
    function entry point will be with specific signature:

    void CALLBACK
    EntryPoint(
    HWND hwnd,
    HINSTANCE hinst,
    LPSTR lpszCmdLine,
    int nCmdShow);

    DllRegisterServer doesn't have such signature:

    STDAPI DllRegisterServer(void);

    RegSvr32.exe is documented way to register COM modules.
    RunDll32.exe is not.
  2. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    In addition, here's description of RunDll32:

    KB164787 - "INFO: Windows Rundll and Rundll32 Interface"
    http://support.microsoft.com/kb/q164787/
  3. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    Thank you very much Alex. Although the first was "wrong" that is what the
    installation of DivX 6 put in the resgistry for reboot. RunOnce. Windows
    2000 SP3. But I knew I could do what looked to be the same thing right in
    Run | regsvr32 divxdec.ax | OK. But I thought I'd ask about it first.

    --
    George Hester
    _______________________________
    "Alex Blekhman" <tkfx.N05P4M@yahoo.com> wrote in message
    news:uI2RN1HfFHA.1204@TK2MSFTNGP12.phx.gbl...
    > In addition, here's description of RunDll32:
    >
    > KB164787 - "INFO: Windows Rundll and Rundll32 Interface"
    > http://support.microsoft.com/kb/q164787/
    >
    >
  4. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    George Hester wrote:
    > Although the first was "wrong"
    > that is what the installation of DivX 6 put in the
    > resgistry for reboot.

    Yes, I think that Rundll32.exe is one of most abused
    programs in the world.

    > But I
    > knew I could do what looked to be the same thing right in
    > Run | regsvr32 divxdec.ax | OK.

    If you want to register silently, then there is /s flag for
    regsvr32.exe. Type "regsvr32.exe /?" in command prompt to
    see all options.
  5. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    "George Hester" <hesterloli@hotmail.com> wrote:
    >
    >Thank you very much Alex. Although the first was "wrong" that is what the
    >installation of DivX 6 put in the resgistry for reboot. RunOnce. Windows
    >2000 SP3. But I knew I could do what looked to be the same thing right in
    >Run | regsvr32 divxdec.ax | OK. But I thought I'd ask about it first.

    There is a very good reason for this. When an INF file puts rundll32 into
    a RunOnce key, the device manager runs the commands as soon as the
    installation ends, without a reboot. If an INF file puts anything other
    than rundll32 into a RunOnce key, a reboot is required.

    Because of that, ChkInf will fail any RunOnce command other than rundll32,
    which means the driver cannot be signed.

    The fact that the function signature doesn't match causes a general
    protection fault in rundll32 when the DLL function returns, but the
    exception is trapped and ignored. This is the "official" and approved
    method of registering DLLs in an INF.
    --
    - Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc
  6. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    Tim Roberts wrote:
    > The fact that the function signature doesn't match causes
    > a general protection fault in rundll32 when the DLL
    > function returns, but the exception is trapped and
    > ignored. This is the "official" and approved method of
    > registering DLLs in an INF.

    All that in order to prevent reboot? Why not to run
    "regsvr32 /s <filename>" during install?
  7. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    "Alex Blekhman" <tkfx.N05P4M@yahoo.com> wrote:

    >Tim Roberts wrote:
    >> The fact that the function signature doesn't match causes
    >> a general protection fault in rundll32 when the DLL
    >> function returns, but the exception is trapped and
    >> ignored. This is the "official" and approved method of
    >> registering DLLs in an INF.
    >
    >All that in order to prevent reboot? Why not to run
    >"regsvr32 /s <filename>" during install?

    If you have an installer, of course you can do that. But if you're trying
    to do an INF-only install, you have to use some tricks. There is no way to
    force an application to be run immediately during an INF install. RunOnce
    is the only opportunity to do so.

    We are lucky that it special-cases rundll32. Otherwise, it would be
    difficult to have ANY non-reboot installs.n
    --
    - Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc
  8. Archived from groups: microsoft.public.vc.language,microsoft.public.win2000.general (More info?)

    Tim Roberts wrote:
    > Alex Blekhman wrote:
    >> All that in order to prevent reboot? Why not to run
    >> "regsvr32 /s <filename>" during install?
    >
    > We are lucky that it special-cases rundll32. Otherwise,
    > it would be difficult to have ANY non-reboot installs.

    I can understand that. However, calling function with wrong
    signature in assumption that Rundll32 will catch exception
    looks quite dirty to me. I'd write a function with correct
    signature that will call DllRegisterServer in turn.
Ask a new question

Read More

Rundll32 Windows 2000 System32 Microsoft Windows