Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: how does "/regserver" register to windows' Registry


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Feb 26, 2014 5:08 PM Last Post By: Rafael Yu Threads: [ Previous | Next ]
Rafael Yu

Posts: 5
Registered: 4/29/13
how does "/regserver" register to windows' Registry  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 21, 2014 4:01 AM
we write a COM exe let another exe call it.
It done well on my develop machine, but when I copy it to my colleague's PC everything goes wrong.
So I make a virtual machine to test.

My operations are really simple.
1.copy a COM exe(this COM doing nothing) to virtual machine
2.open CMD in admin permission, do "C:\COMTest\COMTest.exe /regserver"

I have try 5 times in 5 virtual machines(those virtual machines are cloned from the same source virtual machine).
The interesting thing is there are 2 virtual machine have same Registry(call A) and 3 virtual machines have different Registry(call B).
compare A's registry and B's registry, B's registry are less 3, 6, 7 registry in different registry folder.

this confuse me a week, could anyone give me some inspiration

Rafael
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: how does "/regserver" register to windows' Registry  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 21, 2014 10:23 AM   in response to: Rafael Yu in response to: Rafael Yu
Joe wrote:

It done well on my develop machine, but when I copy it to my
colleague's PC everything goes wrong.

Can you be more specific?

So I make a virtual machine to test.

Which OS is installed in the VM? In your dev PC?

I have try 5 times in 5 virtual machines(those virtual machines are
cloned from the same source virtual machine).

The interesting thing is there are 2 virtual machine have same
Registry(call A) and 3 virtual machines have different Registry(call
B).

compare A's registry and B's registry, B's registry are less 3, 6, 7
registry in different registry folder.

What are the actual differences? Again, please be more specific.

--
Remy Lebeau (TeamB)
Rafael Yu

Posts: 5
Registered: 4/29/13
Re: how does "/regserver" register to windows' Registry  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2014 7:05 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Joe wrote:

It done well on my develop machine, but when I copy it to my
colleague's PC everything goes wrong.
Can you be more specific?
So I make a virtual machine to test.
Which OS is installed in the VM? In your dev PC?

I have try 5 times in 5 virtual machines(those virtual machines are
cloned from the same source virtual machine).

The interesting thing is there are 2 virtual machine have same
Registry(call A) and 3 virtual machines have different Registry(call
B).

compare A's registry and B's registry, B's registry are less 3, 6, 7
registry in different registry folder.

What are the actual differences? Again, please be more specific.

--
Remy Lebeau (TeamB)

Hi Lebeau, thanks for reply,
I am sorry for not enough information and have to apologize for my broken English.
My dev PC is win7 64bit with Delphi XE3, any my colleague's PC is win7 64bit.
We use ASP.NET call a DLL, then the DLL call our COM server.
Error message shows in web browser, "Retrieving the COM class factory for component… error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I trace into this situation in my colleague's PC, and found several registry are not exist. (I use regedit.exe to search registry)
So we started to test in VM, VMs' OS are all win7 64bit. (all machines' UAC is closed)

my ridl code
[
  uuid(EA25A37A-FA49-425B-A94E-EC23C58A02A5),
  version(1.0)
]
library Joe
{
  importlib("stdole2.tlb");
  importlib("stdvcl40.dll");
 
  interface Igg;
  coclass gg;
 
  [
    uuid(83C558A1-BA35-4D9D-B22C-5B63936EA72C),
    helpstring("Dispatch interface for gg Object"),
    dual,
    oleautomation
  ]
  interface Igg: IMethods
  {
  };
 
  [
    uuid(BF77D979-740F-4766-A068-A9ACC3F16712),
    helpstring("gg Object")
  ]
  coclass gg
  {
    [default] interface Igg;
  };
 
};


I search 3 GUID above in my dev PC's registry, and result are
電腦\HKEY_CLASSES_ROOT\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_CLASSES_ROOT\AppID\Joe.exe
電腦\HKEY_CLASSES_ROOT\Joe.gg\Clsid
電腦\HKEY_CLASSES_ROOT\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_CLASSES_ROOT\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_CLASSES_ROOT\Wow6432Node\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_CLASSES_ROOT\Wow6432Node\AppID\Joe.exe
電腦\HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{BF77D979-740F-4766-A068-A9ACC3F16712}\TypeLib
電腦\HKEY_CLASSES_ROOT\Wow6432Node\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_CLASSES_ROOT\Wow6432Node\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\Joe.exe
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Joe.gg\Clsid
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\AppID\Joe.exe
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{BF77D979-740F-4766-A068-A9ACC3F16712}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\AppID\Joe.exe
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{BF77D979-740F-4766-A068-A9ACC3F16712}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}

An easy way to check out the /regserver is right or wrong is to run windows' 32bit MMC (windows > run > mmc -32 > component service > computer\my computer\DCOM setting).
If "gg Object" is not exists in DCOM setting, our browser will return error message "Retrieving the COM class factory for component… error: 80070005 Access is denied."
My colleague's PC's registry can not find registry has "AppID" above, but his PC may not be clean and pure enough, so I started testing in VM installed win7 64bit only.
(In VM) when error message is appearing, I start to search GUIDs in registry, I found:
1) 電腦\HKEY_CLASSES_ROOT\AppID{BF77D979-740F-4766-A068-A9ACC3F16712} : registry don't have value in this entry. That registry should be "(Default Value) REG_SZ gg Object", but there is "(Default Value) REG_SZ (null)"
2) registries below are I can find in VM, other registry are not exists.
But that's strange. I can not reproduce this result every time. I try 5 times, 2 times are same as above registries, 3 times are like below.

電腦\HKEY_CLASSES_ROOT\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_CLASSES_ROOT\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_CLASSES_ROOT\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_CLASSES_ROOT\Wow6432Node\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{BF77D979-740F-4766-A068-A9ACC3F16712}\TypeLib
電腦\HKEY_CLASSES_ROOT\Wow6432Node\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_CLASSES_ROOT\Wow6432Node\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{BF77D979-740F-4766-A068-A9ACC3F16712}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\Interface\{83C558A1-BA35-4D9D-B22C-5B63936EA72C}\TypeLib
電腦\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\TypeLib\{EA25A37A-FA49-425B-A94E-EC23C58A02A5}

If need, I can provide my test COM exe

Edited by: Joe Tsai on Feb 24, 2014 3:27 PM
add infomation
Rafael Yu

Posts: 5
Registered: 4/29/13
Re: how does "/regserver" register to windows' Registry  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2014 11:36 PM   in response to: Rafael Yu in response to: Rafael Yu
I have read [Out-of-process COM server on Windows 7] https://forums.embarcadero.com/thread.jspa?threadID=54448&tstart=30&start=15
that's a little bit like my problem.
I will try another method to register COM server, wish me luck. :)
Rafael Yu

Posts: 5
Registered: 4/29/13
Re: how does "/regserver" register to windows' Registry  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 25, 2014 7:26 PM   in response to: Rafael Yu in response to: Rafael Yu
Our problem is solved, but the question is still there.
We use "ProcessMonitor" to check what does IIS do, and we find out HKCR\CLSID\object ID missing a value string.
After we added the value string, we got the expecting result!

If I want to keep finding answer of "/regserver", is there any method could trace into windows API ?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: how does "/regserver" register to windows' Registry
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2014 10:38 AM   in response to: Rafael Yu in response to: Rafael Yu
Joe wrote:

If I want to keep finding answer of "/regserver", is there any
method could trace into windows API ?

There are third-party tools for monitoring API calls, such as http://www.apimonitor.com
and http://www.rohitab.com/apimonitor.

--
Remy Lebeau (TeamB)
Rafael Yu

Posts: 5
Registered: 4/29/13
Re: how does "/regserver" register to windows' Registry  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2014 5:08 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

There are third-party tools for monitoring API calls, such as http://www.apimonitor.com
and http://www.rohitab.com/apimonitor.

--
Remy Lebeau (TeamB)

hi Lebeau, thanks for your help!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02