Hi,
I have some hardware which currently has an API in the form of a DLL and
Kernel Mode Driver. The DLL has uses a named Semaphore to prevent multiple
processes accessing the hardware at the same time.
The semaphore is created with the following code:
{
SECURITY_ATTRIBUTES saSecurity;
saSecurity.nLength = sizeof( SECURITY_ATTRIBUTES );
saSecurity.lpSecurityDescriptor = NULL;
saSecurity.bInheritHandle = TRUE;
hSemaphore = CreateSemaphore( &saSecurity, 1, 1,
“DK2DriverAccessSemaphore” );
if( hSemaphore == NULL )
{
return FALSE;
}
}
I have created a service to expose the hardware API across the network, the
service runs in the LocalSystem account. The service also loads the API
creating the semaphore as above to prevent multiple processes accessing the
hardware.
Problem:
If the service is started and an application is then run, the call to
CreateSemaphore fails, GetLastError returns 5 (ACCESS_DENIED). I changed the
service account to the same one I am logged into Win2K as, it still fails in
the same way.
Does anyone know how I can have a Named Semaphore available to both
application and service at the same time.
Alun Carp
Driver Development Team Leader
Data Encryption Systems Limited
Email: xxxxx@des.co.uk
Phone: 01823 352357
Fax: 01823 352358
Please email support queries to: xxxxx@des.co.uk
Visit our website at: http://www.des.co.uk
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com