NT Service and COM

Duncan Booth duncan at NOSPAMrcp.co.uk
Fri Jun 22 12:04:28 EDT 2001


"Syver Enstad" <syver at NOSPAMcyberwatcher.com> wrote in
news:9gu4nf$553$1 at troll.powertech.no: 

> 
> "André" <arisen at start.no> wrote in message
> news:fed2e489.0106211103.3c894ab3 at posting.google.com...
>> Hi. I found this example in Python Programming on Win32, page 349.
>> I have not tested it. Am typing in a hurry, beware of tpyos:
> 
> Yes, but that ain't doesn't expose no COM server. If you ever find out
> Duncan I'd be really pleased to hear what you've figured out. I've only
> come so far as to look at the .py file that implements local servers
> for python. Take a look at win32com.server.localserver.py to see how
> vanilla pythoncom objects are exposed like a localserver.
> 
I have got a COM server working as a service now. The only problem left is 
security. If the service runs under my userid everything works fine, but if 
I install the service as the local system user (i.e. the default) then 
attempting to access the COM object throws a com error 'Access is denied'.

I'm not sure how to get round this. I can use DCOMCNFG to give access, but 
I feel I should be able to set the security from inside the process. 
Unfortunately I cannot find a combination of parameters to 
pythoncom.CoInitializeSecurity that doesn't either complain 'obAuthSvc must 
be None or an empty sequence' or GP fault (if I give it obAuthSvc set to 
None if complains, if I give it an empty sequence it dies).

I'll post my minimal COM service when I have tidied it up a bit.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list