📄 smsapi.h
字号:
#define SMS_PARENT_ALREADY_COMMITTED (OTT_END+ 14)
// Used in asynchronous folder retrieval.
// Indicates that there might be more
// data but it isn't available yet.
#define SMS_NOT_READY (OTT_END + 15)
#define SMS_FILTER_NO_MODIFY (OTT_END + 16)
#define SMS_FOLDER_ALREADY_DELETED (OTT_END + 17)
// Only allow one active connection.
// This is an SMS restriction.
#define SMS_ALREADY_CONNECTED (OTT_END + 18)
// Some failure in committing a folder
#define SMS_COMMIT_FAILED (OTT_END + 19)
// Specific failure in linking a folder
#define SMS_DUPLICATE_FOLDER (OTT_END + 20)
// ====================================================================
//
// Various manifests.
//
// ====================================================================
// The location of the SMS registry root.
#define SMS_REG_ROOT "SOFTWARE\\Microsoft\\SMS\\"
// The max size of character (string) data that we return.
#define SMS_DATA_BUFF_SIZE 255
// 'SMSBUFF' and 'OBJDESCRIPTOR' used in object type enumeration APIs.
// ===================================================================
// A character buffer.
// -------------------
typedef char SMSBUFF[SMS_DATA_BUFF_SIZE+1];
// Describes an object returned from SmsEnumObjects.
// -------------------------------------------------
typedef struct _OBJDESCRIPTOR {
DWORD objType; // Type of this object.
SMSBUFF szName; // Object name (eg 'Personal Computer')
SMSBUFF szFriendlyName; // Friendly name. Only used in groups
// where szName would be, eg,
// 'MICROSOFT|IDENTIFICATION|1.0', the
// friendly name would be 'Identification'.
BOOL bGotFriendlyName; // TRUE if we have a friendly name.
DWORD dwRelopMin; // For attributes, indicates range of
DWORD dwRelopMax; // relational operators that can be used
// for this attribute.
BOOL bGotRelops; // TRUE if we have the relops fields set.
} OBJDESCRIPTOR;
// Object types.
// =============
// This is the value that is inserted by the object
// enumeration APIs into the OBJDESCRIPTOR structure.
// --------------------------------------------------
#define OT_ARCHLIST 1
#define OT_ARCH 2
#define OT_GROUP 3
#define OT_ATTRIBUTE 4
#define OT_PLATFORMS 5
#define OT_PLATFORM_PDF 6
#define OT_PLATFORM_WINST 7
#define OT_PLATFORM_NAD 8
#define OT_UNKNOWN 100
// --------------------------------------------------------------------
// Flags for Populate options.
// --------------------------------------------------------------------
#define POP_SYNC 0x00000000
#define POP_ASYNC 0x00000001
#define POP_EVENT 0x00000010
#define POP_WINDOW 0x00000020
// --------------------------------------------------------------------
// Folder types supported by smsapi (MUST NOT BEGIN AT ZERO).
// --------------------------------------------------------------------
#define F_SITE 1 // Site folder.
#define F_MACHINE 2 // Machine folder.
#define F_GROUP 3 // Subfolder of machine
#define F_DOMAIN 4 // Domain folder, subfolder
// of a site.
// Jobs
#define F_SYSTEMJOB 5 // System (NAD/Site) job folder.
//#define F_MINIJOB 6 // Mini-job folder.
#define F_INSTALLJOB 7 // Job folder (wksta install).
#define F_SRVINSTALLJOB 8 // Job folder (server install).
#define F_REMPKGJOB 9 // Remove package Job folder.
#define F_PACKAGE 10 // Packages.
#define F_WCL 11 // Workstation command lines.
#define F_PROGITEM 12 // Program items.
#define F_INVENTORY 13 // Inventory rules.
#define F_MACHINEGROUP 14 // Machine group
#define F_SITEGROUP 15 // Site group folder
// --------------------------------------------------------------------
// Container types supported by smsapi (MUST NOT BEGIN AT ZERO).
// --------------------------------------------------------------------
#define C_SITE 1 // Site container.
#define C_JOB 2 // Job container.
#define C_MACHINE 3 // Machine container.
#define C_PACKAGE 4 // Package container.
#define C_MACHINEGROUP 5 // Machine group
#define C_SITEGROUP 6 // Site group
// ====================================================================
//
// Filter information.
//
// ====================================================================
// --------------------------------------------------------------------
// Filter types
// --------------------------------------------------------------------
#define SITE_FILTER 1
#define MACHINE_FILTER 2
#define GROUP_FILTER 3
#define JOB_FILTER 4
#define ARCHITECTURE_FILTER 5
#define PACKAGE_FILTER 6
#define ATTRIBUTE_FILTER 7
#define SITELIMIT_FILTER 8
// --------------------------------------------------------------------
// Token types.
// --------------------------------------------------------------------
#define TOKEN_USER 0x8 // 1000 bit 3 always set for user-token
#define TOKEN_OR 0x2 // 0010 bit 1 always set for AND/OR
#define TOKEN_AND 0x3 // 0011 bit 1 always set for AND/OR
#define TOKEN_OPENPAREN 0x4 // 0100 bit 2 always set for PAREN
#define TOKEN_CLOSEPAREN 0x5 // 0101 bit 2 always set for PAREN
#define TOKEN_NOTIN 0x20 //10100 bit 2 set for a PAREN plus bit 4 for an extra indicator.
#define TOKEN_OPERATOR 0x2 // Detects both AND or OR
#define TOKEN_PAREN 0x4 // Detects either open or close paren
// --------------------------------------------------------------------
// Manifests used in filter token APIs.
// --------------------------------------------------------------------
#define AT_START OTT_AT_START // Token will be inserted at start of
// expression.
#define AT_END OTT_AT_END // Token will be appended to end of
// expression.
//
// Flags field in SmsManipulateTokens.
//
#define TOK_GROUP 1
#define TOK_UNGROUP 2
#define TOK_DELETE 3
#define TOK_GROUP_NOT 4
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////// The APIs ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// **************************************************************************
//
// This DLL provides a "C" interface for accessing SMS objects.
//
//===========================================================================
//
// SmsAPIVer
//
// This API returns a version string to identify the SMS API version.
//
// Parameters:
// char **ppVersion The version string is returned
// in this pointer.
// The user must not free this memory,
// it is a static buffer inside the API
// dll.
//
// Returns:
// SMS_STATUS Always SMS_OK.
//
//===========================================================================
//
//===========================================================================
// 1. Connection APIs.
//===========================================================================
//
// SmsDataSourceConnect
//
// This API connects to the datasource as specified in the DATASOURCE
// parameter. The API returns a connection handle in the second
// parameter.
// This handle is passed to OpenContainer.
//
// Parameters:
// DATASOURCE *pd Pointer to DATASOURCE structure.
// The user must have already set up
// the appropriate parameters in this
// structure. For SQL this contains
// the server name, user name, password,
// database, public encryption key, and
// a pointer to a decryption function.
// See the description above.
// HANDLE *phConn Handle to a connection. This is
// filled in by the API.
//
// Returns:
// SMS_STATUS Status. Either SMS_OK or one of the
// error codes listed above.
//
//===========================================================================
//
// SmsDataSourceDisconnect
//
// This API releases a datasource connection that was established by
// DataSourceConnect.
//
// Parameters:
// HANDLE hConn Handle to the connection to be closed.
//
// Returns:
// SMS_STATUS Status. Either SMS_OK or one of the
// error codes listed above.
//
//===========================================================================
//
// 2. Engine APIs.
//
// These are straight "pass-through" APIs that just call the engine APIs
// (in objectty.dll) directly. Here for name conformance and so to ensure
// that smsapi.dll will get loaded before the engine.
//
//===========================================================================
//
// SmsEnumContainers
//
// This returns an array of pointers to FOLDER_INFO structures.
// If the pData parameter is NULL the API sets pCount to the number of
// containers registered. Thus, a user can call this API with a NULL
// buffer to get the count, which enables the application to allocate
// sufficient memory. If pData is non-NULL the API will copy up to
// pCount FOLDER_INFO pointers into the data buffer. If that number
// is less than the number of containers the count will be set as
// previously described.
// The data buffer is an array of pointers to FOLDER_INFO structures.
// These point to memory in the engine's address space, it should
// not be deallocated or modified.
//LATER: make this pointer to const.
//
//
// Parameters:
// FOLDER_INFO **pData Pointer to array of FOLDER_INFO structures.
// DWORD *pCount Pointer to count of containers.
//
// Returns:
// SMS_STATUS OTT_OK: success.
// OTT_MORE_DATA: passed buffer not
// big enough. *pCount says how
// many containers registered.
//
// ====================================================================
//
// SmsEnumFilters
//
// This API returns a list of all filters currently registered
// in the filter registry. This list is actually an array of
// FILTER_INFO structs.
//
// The memory for this array must be allocated by the caller.
// To determine the size of the array call this API with NULL as
// the first parameter. This will result in the number of filters
// being returned in pCount.
//
//
// Parameters:
// FILTER_INFO *paFI Pointer to an array of FILTER_INFO
// structures.
// The user is responsible for allocating
// (and deallocating) this memory.
// DWORD *pCount Pointer to count of filters.
//
// Returns:
// SMS_STATUS OTT_OK: success.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -