Using Win32 functions in Visual FoxPro Image Gallery
Service
..msdn
CloseServiceHandle
ControlService
CreateService
DeleteService
EnumServicesStatus
GetUserObjectInformation
LockServiceDatabase
OpenSCManager
OpenService
StartService
UnlockServiceDatabase
Code examples:
Encapsulating access to the Windows Services in a class
LockServiceDatabase
..msdn    Add comment     W32 Constants      Translate this page
The LockServiceDatabase function requests ownership of the service control manager database lock. Only one process can own the lock at any given time.
Code examples:
Encapsulating access to the Windows Services in a class
Declaration:
SC_LOCK LockServiceDatabase(
  SC_HANDLE hSCManager
);
FoxPro declaration:
DECLARE INTEGER LockServiceDatabase IN advapi32;
    INTEGER hSCManager
Parameters:
hSCManager
[in] Handle to the service control manager database.
Return value:
If the function succeeds, the return value is a lock to the specified service control manager database.
My comment:
The hSCManager handle is returned by the OpenSCManager function, and must have the SC_MANAGER_LOCK access right.

A call to the StartService function to start a service in a locked database fails. No other service control manager functions are affected by a lock.

See also: UnlockServiceDatabase, OpenSCManager.
Word Index links for the LockServiceDatabase :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2004-12-14 21:53:12
Modified: 2004-12-15 12:12:01
Visited in last 7 days: 18
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.80.132.10)
14 sec.Function: 'LsaLookupSids'
27 sec.Function: 'CallWindowProc'
42 sec.Function: 'CertOpenSystemStore'
55 sec.
Function group: 'Raw Input'
1.18 min.Function: 'InternetCanonicalizeUrl'
1.42 min.Function: 'AVIStreamStart'
1.65 min.Function: 'GdipGetMatrixElements'
1.88 min.Function: 'StartService'
2.13 min.Function: 'waveInGetNumDevs'
2.37 min.
Function group: 'Extensible Storage Engine (ESE, Jet Blue)'
Google
Advertise here!