NetTalk Central
		The Rest Of NetTalk => The Rest - Ask For Help => Topic started by: Larry Sand on November 07, 2013, 08:26:43 AM
		
			
			- 
				Hi Bruce,
When checking the error returned creating a second global mutex i found that Windows will also return Access Denied "ErrNum = 5".  So the test in MyService.ManageInstances() needs something like this:
ErrorNum = ERROR_ALREADY_EXISTS Or Choose(self.TerminalServiceUsesGlobalMutex <> 0 And ErrorNum = 5)
Larry Sand
			 
			
			- 
				So, if I'm reading this correctly, you're saying that NewMutex can return an Access Denied Error (5).
so the line
elsif ErrorNum = ERROR_ALREADY_EXISTS
should become
elsif ErrorNum = ERROR_ALREADY_EXISTS or  ErrorNum = 5
I'm happy with that, but your construction with Choose doesn't look right. Can you confirm what's going on there?
cheers
Bruce
			 
			
			- 
				Bruce,
>>I'm happy with that, but your construction with Choose doesn't look right. Can you confirm what's going on there?
You mean the syntax or what my poor feeble mind was thinking? <g>  At the time I thought I would only test if the global option was enabled.  I suppose that if it returns access denied on the create then it more than likely already exists.  That was all.
Thanks,
Larry Sand