windows-nt/Source/XPSP1/NT/ds/security/ntmarta/newsrc/svcctx.h

103 lines
1.8 KiB
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
//+---------------------------------------------------------------------------
//
// Microsoft Windows NT Security
// Copyright (C) Microsoft Corporation, 1997 - 1998
//
// File: svcctx.h
//
// Contents: NT Marta service context class
//
// History: 4-1-1999 kirtd Created
//
//----------------------------------------------------------------------------
#if !defined(__SVCCTX_H__)
#define __SVCCTX_H__
#include <windows.h>
#include <service.h>
#include <assert.h>
//
// CServiceContext. This represents a service object to the NT Marta
// infrastructure
//
class CServiceContext
{
public:
//
// Construction
//
CServiceContext ();
~CServiceContext ();
DWORD InitializeByName (LPCWSTR pObjectName, ACCESS_MASK AccessMask);
DWORD InitializeByHandle (HANDLE Handle);
//
// Dispatch methods
//
DWORD AddRef ();
DWORD Release ();
DWORD GetServiceProperties (
PMARTA_OBJECT_PROPERTIES pProperties
);
DWORD GetServiceRights (
SECURITY_INFORMATION SecurityInfo,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor
);
DWORD SetServiceRights (
SECURITY_INFORMATION SecurityInfo,
PSECURITY_DESCRIPTOR pSecurityDescriptor
);
private:
//
// Reference count
//
DWORD m_cRefs;
//
// Service handles
//
SC_HANDLE m_hService;
//
// Were we initialized by name or handle?
//
BOOL m_fNameInitialized;
};
//
// Private functions
//
DWORD
ServiceContextParseServiceName (
LPCWSTR pwszName,
LPWSTR* ppMachine,
LPWSTR* ppService
);
DWORD
StandardContextParseName (
LPCWSTR pwszName,
LPWSTR* ppMachine,
LPWSTR* ppRest
);
#endif