我在 pascal 中调用EnumServicesStatus函数。但是如何声明它。这是OpenSCManager的示例
function OpenSCManager(lpMachineName, lpDatabaseName: string; dwDesiredAccess :cardinal): HANDLE;
external 'OpenSCManagerA@advapi32.dll stdcall';
谢谢。
我在 pascal 中调用EnumServicesStatus函数。但是如何声明它。这是OpenSCManager的示例
function OpenSCManager(lpMachineName, lpDatabaseName: string; dwDesiredAccess :cardinal): HANDLE;
external 'OpenSCManagerA@advapi32.dll stdcall';
谢谢。
看起来有人已经完成了将您可以使用的整个 API .pas 文件放在一起的艰苦工作。查看:
http://gr32ex.googlecode.com/svn/trunk/GR32Ex/Examples/DesktopSnow/GPSysHook/api/JwaWinSvc.pas
搜索EnumServicesStatusA
或EnumServicesStatusW
;ANSI 和 Unicode 都在那里。您可能会找到各种可以获取的结构、枚举和其他好东西。
万一该文件的 URL 发生变化,其中相关的行是:
function EnumServicesStatusA(hSCManager: SC_HANDLE; dwServiceType: DWORD;
dwServiceState: DWORD; lpServices: LPENUM_SERVICE_STATUSA; cbBufSize: DWORD;
var pcbBytesNeeded, lpServicesReturned, lpResumeHandle: DWORD): BOOL; stdcall;
{$EXTERNALSYM EnumServicesStatusA}
function EnumServicesStatusW(hSCManager: SC_HANDLE; dwServiceType: DWORD;
dwServiceState: DWORD; lpServices: LPENUM_SERVICE_STATUSW; cbBufSize: DWORD;
var pcbBytesNeeded, lpServicesReturned, lpResumeHandle: DWORD): BOOL; stdcall;
{$EXTERNALSYM EnumServicesStatusW}
function EnumServicesStatus(hSCManager: SC_HANDLE; dwServiceType: DWORD;
dwServiceState: DWORD; lpServices: LPENUM_SERVICE_STATUS; cbBufSize: DWORD;
var pcbBytesNeeded, lpServicesReturned, lpResumeHandle: DWORD): BOOL; stdcall;
{$EXTERNALSYM EnumServicesStatus}