I am trying to use an NT service to contain some COM objects and am running
into some problems. My problem is that whenever a program creates an
instance of my object when the service is running another copy of the server
is run instead of using the currently running instance. This is despite the
fact that the service registers the class object on startup.
Is there any special considerations that need to be taken when exporting COM
objects from a service that I don't know about?
Thanks
Brian
Do you think I should be looking at COM security issues or NT security
issues?
Paymaster <p...@paymaster.org> wrote in message
news:3796DD...@paymaster.org...
You must use the ROT (running object table) to allow multiple clients to connect
to an already running object. I have sent sample code to your mailbox.
--
Patrick Philippot (MainSoft sarl)
patrick....@mainsoft.fr
Besoin d'aide en développement Windows?
Cliquez ici: http://www.mainsoft.fr
tel/fax: +33 (0)1 69 40 94 85
--
===============================
Alexander Nickolov, MCP
Panasonic Technologies Inc.
Speech Technology Laboratory
email: agnic...@geocities.com
===============================
Brian Ross wrote in message ...
> Do you think I should be looking at COM security issues or NT security
> issues?
Both, but probably mostly Com. Listen, I wish I could be more specific,
but I simply can't remember much <g>. Somewhere where you create an
instance there's also a flag that specifies some object creation options
(but again I can't remember the specifics.) There's a very good book
from Wrox books, by Miller (or Schiller, some Germain-like name.) It's
good, and it covers absolutely all there is about NT Services, and
there's a good-size chapter on Com servers packaged as NT services. Or
maybe someone here will come up with the answer, there are some pretty
good guys around here.
Good luck.
--
len
if you must email, reply to:
len bel at world net dot att dot net (no spaces, ats2@, dots2.)
But I think you're wrong about the creation function. Or at least
it doesn't come to me what you're pointing at... The creation
function CoCreateInstanceEx accepts COSERVERINFO and
context (CLSCTX_XXX values). None of these deal specifically
with services. In fact the client never knows if the server is
NT service or not - only the OS knows that.
--
===============================
Alexander Nickolov, MCP
Panasonic Technologies Inc.
Speech Technology Laboratory
email: agnic...@geocities.com
===============================
Paymaster wrote in message <379710...@paymaster.org>...
> But I think you're wrong about the creation function. Or at least
> it doesn't come to me what you're pointing at...
Aaaah, you're pushing me to look it up <g>. I can't remember, perhaps
I'm making it up, but I seem to remember that there's a place somewhere
where you say if you want un-shared access (in which case a new server
will be launched for every new security entity), or hitting the same
thing is acceptable even by different accounts. I might be mixing it up
with Corba "strategies", but... eh... <g>. I can't remember.
> ...CoCreateInstanceEx accepts COSERVERINFO and
> context (CLSCTX_XXX values). None of these deal specifically
> with services.
No, no, services got nothing to do with it. I launches the same server
several times not because it's a service, it's a security thing. Well,
I'm over my head right now <g>.
> In fact the client never knows if the server is
> NT service or not - only the OS knows that.
Right.
Are you talking about the security Identity set as "Launching User"?
On Thu, 22 Jul 1999 21:49:30 +0600, Paymaster <p...@paymaster.org>
wrote:
Girish Bharadwaj [mvp].
Please do not email queries to me.
Post them in newsgroups.
Thank you.
It is all to do with your 'window station'. There is an excellent kb
article that describes your problem in detail. It is:
' INFO: COM Servers Activation and NT Windows Stations' - Article ID:
Q169321
You may also want to reference the following doc if you still get multiple
exe's being created:
'FILE: Bind to an object on a Remote Machine Using ROT' - article ID Q171974
HTH, Piers
I am still having a problem however. Now that it uses the same instance of
the object (or starts it if it isn't started already... this time properly
as a service)... I am getting an "Access Denied" error when the object is
created. I suspect this has to do with the DCOM permissions but I tried to
give everyone full access to my class using DCOMCFG and it still gives me
access denied....
Any ideas?
JD
Brian Ross wrote in message ...
Hmm.. I wonder if the access denied is being returned by the server when it
is trying to start and not a client side access problem.. Something to look
into on monday :)
> Perhaps the launching user does not have access to some critical system
> resource (like HKEY_LOCAL_MACHINE)?
> Brian Ross wrote in message ...
Do you use ConnectionPoints ?
If yes, which method returns Access denied : QueryInterface or Advise ?
Is your client written in VB or VC++ ?
I wasn't using connection points or anything else. I did find out what my
problem was though. It turns out that I have to specify an account for the
service to log in as. Using the system account doesn't allow other users to
have access to the component regardless of the permissions you explicitely
set for the component. Once I did this everything started to work as it
should.
Thanks to everyone who helped :)