Sign in with
Sign up | Sign in
Your question

What is the difference if any?

Last response: in Windows 2000/NT
Share
Anonymous
June 28, 2005 11:45:45 PM

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
_______________________________

More about : difference

Anonymous
June 29, 2005 2:25:32 PM

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.
Anonymous
June 29, 2005 2:36:43 PM

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/
Related resources
Anonymous
June 29, 2005 2:36:44 PM

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/
>
>
Anonymous
June 29, 2005 10:32:57 PM

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.
Anonymous
June 30, 2005 3:25:04 AM

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
Anonymous
June 30, 2005 2:53:50 PM

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?
Anonymous
July 2, 2005 6:59:55 PM

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
Anonymous
July 3, 2005 11:07:05 PM

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.
!