پ%ى Librarian I01-427Œحا­³©w(خا­³©4&5  (+ NTA_POST_PUBLIC/¬NTA_PRE_PUBLIC ­G³حا­³©/* MODULE nta_post_public.hO*********************************************************************************:** Copyright (c) Digital Equipment Corporation, 1992-19975** All Rights Reserved. Unpublished rights reserved2** under the copyright laws of the United States.**7** The software contained in this media is proprietary2** to and embodies the confidential technology of4** Digital Equipment Corporation. Possession, use,4** duplication or dissemination of the software and8** media is authorized only pursuant to a valid written/** license from Digital Equipment Corporation.**2** RESTRICTED RIGHTS LEGEND Use, duplication, or3** disclosure by the U.S. Government is subject to:** restrictions as set forth in Subparagraph (c) (1) (ii)2** of DFARS 252.227-7013, or in FAR 52.227-19, as** applicable.**N**********************************************************************************++!** FACILITY: OpenVMS NT Affinity**** MODULE DESCRIPTION:**E** This module contains all the definitions which must be made afterD** including any the various ASU header files; which must be public#** to the Win32 Support providers.** ** AUTHORS:**** L. Mark Pilant**** CREATION DATE: 17-Sep-1997**** MODIFICATION HISTORY:**4** X-11 LMP0610 L. Mark Pilant, 1-MAR-1999 13:32B** Make sure the event status block is defined properly for those*** files being built without NEW_STARLET.**4** X-10 LMP0610  L. Mark Pilant, 25-FEB-1999 14:18!** Add prototype for NTA$EVENTW.**3** X-9 LMP0596 L. Mark Pilant, 11-MAY-1998 13:13$** Add a missing routine prototype:)** NTA$RTLGETCONTROLSECURITYDESCRIPTOR.**3** X-8 LMP0592 L. Mark Pilant, 14-APR-1998 12:456** Change NTA$AufitStateTimer to NTA$AuditStateTimer.**3** X-7 LMP0582 L. Mark Pilant, 22-JAN-1998 12:45%** Add some new function prototypes.**3** X-6 LMP0574 L. Mark Pilant, 17-DEC-1997 10:26<** Add CreateProcess and CreateProcessAsUser support. Also+** correct ident/generation skew (no X-5).**(** X-4 SAL002 Scott LePage 09-Dec-19977** Moved some prototypes to NTA_POST.H. Changed error1** in function name for NTA$VMSCloseAccessToken.**3** X-3 LMP0571 L. Mark Pilant, 25-NOV-1997 14:45>** Change prototype definition for VMSSEPSINGLEPRIVILEGECHECK'** to accomodate SE_xxx privilege use.**5** X-1A3 LMP0570 L. Mark Pilant, 20-NOV-1997 14:55$** Incorporate code review changes.**5** X-1A2 LMP0569 L. Mark Pilant, 29-SEP-1997 16:09D** Change some of the actual routine names (to track the functional?** specification) and remove a number of #define statements to1** avoid conflicts with Win32 support providers.**.** X-1A1 LMP0568 L. Mark Pilant, 17-SEP-1997<** Split out the public definitions to make distribution to#** Win32 support providers easier.****--*/#ifndef _NTA_POST_PUBLIC_#define _NTA_POST_PUBLIC_#include /*K** Define the internal routine function prototypes. The function names areK** in all upper-case characters to make the OpenVMS linker happy. However,H** the mixed-case names have been defined (in a separate header file) to(** follow the Microsoft naming standard.*/voidNTA$EXALLOCATELOCALLYUNIQUEID ( LARGE_INTEGER *luidp);LONGNTA$MAPSATORPCSA ( LPSECURITY_ATTRIBUTES lpSA,% PRPC_SECURITY_ATTRIBUTES pRpcSA);LONGNTA$MAPSDTORPCSD ( PSECURITY_DESCRIPTOR lpSD,% PRPC_SECURITY_DESCRIPTOR pRpcSD);NTSTATUS"NTA$NETPCREATESECURITYDESCRIPTOR ( IN PACE_DATA AceData, IN ULONG AceCount, IN PSID OwnerSid OPTIONAL, IN PSID GroupSid OPTIONAL,+ OUT PSECURITY_DESCRIPTOR *NewDescriptor ); NTSTATUSHNTA$NTIMPORTSECURITYDESCRIPTORINPLACE ( /* Different from Microsoft */ IN SECURITY_DESCRIPTOR *sd, IN size_t Length );NTSTATUSNTAPINTA$RTLADDACCESSALLOWEDACE ( PACL Acl, unsigned long AceRevision, ACCESS_MASK AccessMask, PSID Sid );NTSTATUSNTAPINTA$RTLADDACCESSDENIEDACE ( PACL Acl, unsigned long AceRevision, ACCESS_MASK AccessMask, PSID Sid );NTSTATUSNTAPINTA$RTLADDACE ( PACL Acl, unsigned long AceRevision,# unsigned long StartingAceIndex, void * AceList, unsigned long AceListLength );NTSTATUSNTAPINTA$RTLADDAUDITACCESSACE ( PACL pAcl, DWORD dwAceRevision, DWORD dwAccessMask, PSID pSid, BOOL bAuditSuccess, BOOL bAuditFailure );NTSTATUSNTA$RTLADJUSTPRIVILEGE ( IN ULONG Privilege, IN BOOLEAN Enable, IN BOOLEAN Client, OUT PBOOLEAN WasEnabled);5#define NTA$RtlAdjustPrivilege NTA$RTLADJUSTPRIVILEGENTSTATUSNTAPI!NTA$RTLALLOCATEANDINITIALIZESID (5 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount,# IN unsigned long SubAuthority0,# IN unsigned long SubAuthority1,# IN unsigned long SubAuthority2,# IN unsigned long SubAuthority3,# IN unsigned long SubAuthority4,# IN unsigned long SubAuthority5,# IN unsigned long SubAuthority6,# IN unsigned long SubAuthority7, OUT PSID *Sid );NTSTATUSNTAPINTA$RTLCOPYSID (' unsigned long DestinationSidLength, PSID DestinationSid, PSID SourceSid );NTSTATUSNTAPINTA$RTLCREATEACL ( PACL Acl, unsigned long AclLength, unsigned long AclR'evision );NTSTATUSNTAPI!NTA$RTLCREATESECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, unsigned long Revision );NTSTATUSNTAPINTA$RTLDELETEACE ( IN OUT PACL Acl, IN ULONG AceIndex );BOOLEANNTAPINTA$RTLEQUALSID ( PSID Sid1, PSID Sid2 );void *NTAPINTA$RTLFREESID ( IN PSID Sid );NTSTATUSNTAPINTA$RTLGETACE ( PACL Acl, unsigned long AceIndex, void * *Ace );NTSTATUSNTAPI%NTA$RTLGETCONTROLSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor,) PSECURITY_DESCRIPTOR_CONTROL Control, unsigned long * Revision );NTSTATUSNTAPI"NTA$RTLGETDACLSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN DaclPresent, PACL *Dacl, PBOOLEAN DaclDefaulted );NTSTATUSNTAPI#NTA$RTLGETGROUPSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID *Group, PBOOLEAN GroupDefaulted );NTSTATUSNTAPI#NTA$RTLGETOWNERSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID *Owner, PBOOLEAN OwnerDefaulted );NTSTATUSNTAPI"NTA$RTLGETSACLSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN SaclPresent, PACL *Sacl, PBOOLEAN SaclDefaulted );NTSTATUSNTAPINTA$RTLINITIALIZESID ( IN PSID Sid,5 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount ); unsigned longNTAPI!NTA$RTLLENGTHSECURITYDESCRIPTOR (+ PSECURITY_DESCRIPTOR SecurityDescriptor );NTSTATUSNTAPINTA$RTLMAKESELFRELATIVESD (4 PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,8 PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, unsigned long * BufferLength );voidNTAPINTA$RTLMAPGENERICMASK ( PACCESS_MASK AccessMask,# PGENERIC_MAPPING GenericMapping );NTSTATUSNTAPINTA$RTLQUERYINFORMATIONACL (  PACL Acl, void * AclInformation,' unsigned long AclInformationLength,- ACL_INFORMATION_CLASS AclInformationClass );NTSTATUSNTAPI"NTA$RTLSETDACLSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN DaclPresent, PACL Dacl, BOOLEAN DaclDefaulted );NTSTATUSNTAPI#NTA$RTLSETGROUPSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Group, BOOLEAN GroupDefaulted );NTSTATUSNTAPINTA$RTLSETINFORMATIONACL ( IN PACL Acl, IN PVOID AclInformation," IN ULONG AclInformationLength,0 IN ACL_INFORMATION_CLASS AclInformationClass );NTSTATUSNTAPI#NTA$RTLSETOWNERSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Owner, BOOLEAN OwnerDefaulted );NTSTATUSNTAPI"NTA$RTLSETSACLSECURITYDESCRIPTOR (, PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN SaclPresent, PACL Sacl, BOOLEAN SaclDefaulted );BOOLEANNTA$RTLVALIDACL ( IN PACL Acl );BOOLEANNTAPI NTA$RTLVALIDSECURITYDESCRIPTOR (+ PSECURITY_DESCRIPTOR SecurityDescriptor );BOOLEANNTAPINTA$RTLVALIDSID ( PSID Sid );voidNTA$SEQUERYSECURITYACCESSMASK (0 IN SECURITY_INFORMATION SecurityInformation," OUT PACCESS_MASK DesiredAccess);voidNTA$SESETSECURITYACCESSMASK (0 IN SECURITY_INFORMATION SecurityInformation," OUT PACCESS_MASK DesiredAccess);NTSTATUSNTA$VMSC REATEPROCESSW (! IN LPUCS4STR ApplicationName, IN LPUCS4STR CommandLine,& IN LPSECURITY_ATTRIBUTES Procattr,% IN LPSECURITY_ATTRIBUTES ThdAttr, IN BOOL InheritHandles, IN DWORD CreationFlags, IN LPVOID Environment," IN LPUCS4STR CurrentDirectory,! IN LPSTARTUPINFO StartupInfo,0 OUT LPPROCESS_INFORMATION ProcessInformation );3#define NTA$VMSCreateProcessW NTA$VMSCREATEPROCESSWNTSTATUSNTA$VMSCREATEPROCESSASUSERW ( IN PPERID PersonaId,!! IN LPUCS4STR ApplicationName, IN LPUCS4STR CommandLine,& IN LPSECURITY_ATTRIBUTES Procattr,% IN LPSECURITY_ATTRIBUTES ThdAttr, IN BOOL InheritHandles, IN DWORD CreationFlags, IN LPVOID Environment," IN LPUCS4STR CurrentDirectory,! IN LPSTARTUPINFO StartupInfo,0 OUT LPPROCESS_INFORMATION ProcessInformation );?#define NTA$VMSCreateProcessAsUserW NTA$VMSCREATEPROCESSASUSERWNTSTATUSNTA$VMSCREATETHREAD (i LPSECURITY_ATTRIBUTES lpThreadAt "tributes, /* pointer to thread security attributes (must be zero) */D DWORD dwStackSize, /* initial thread stack size, in bytes */L LPTHREAD_START_ROUTINE lpStartAddress, /* pointer to thread function */9 LPVOID lpParameter, /* argument for new thread */A DWORD dwCreationFlags, /* creation flags (must be zero) */> LPDWORD lpThreadId /* pointer to returned thread id */ );/#define NTA$VMSCreateThread NTA$VMSCREATETHREADNTSTATUSNTA$VMSLOGONUSERW ( # IN LPUCS4STR Username, IN LPUCS4STR Domain, IN LPUCS4STR Password, IN DWORD LogonType, IN DWORD ProviderType, OUT PPERID PersonId);+#define NTA$VMSLogonUserW NTA$VMSLOGONUSERWNTSTATUSNTA$VMSLOOKUPACCOUNTNAMEW ( IN LPUCS4STR SystemName, IN LPUCS4STR Name, OUT PSID Sid, OUT LPDWORD cbSid, OUT LPUCS4STR Domain, OUT LPDWORD cbDomain, OUT PSID_NAME_USE pUse);;#define NTA$VMSLookupAccountNameW NTA$VMSLOOKUPACCOUNTNAMEWNTST$ATUSNTA$VMSLOOKUPACCOUNTSIDW ( IN LPUCS4STR SystemName, IN PSID Sid, OUT LPUCS4STR Name, OUT LPDWORD cbName, OUT LPUCS4STR Domain, OUT LPDWORD cbDomain, OUT PSID_NAME_USE pUse);9#define NTA$VMSLookupAccountSidW NTA$VMSLOOKUPACCOUNTSIDWNTSTATUSNTA$VMSCLOSEACCESSTOKEN ( IN PPERID PersonaId);7#define NTA$VMSCloseAccessToken NTA$VMSCLOSEACCESSTOKENNTSTATUSNTA$VMSNTDUPLICATETOKEN ( IN PPERID ExistingPersonaId,! IN ACCESS_MASK Des%iredAccess,+ IN POBJECT_ATTRIBUTES ObjectAttributes, IN BOOLEAN EffectiveOnly, IN TOKEN_TYPE TokenType, OUT PPERID NewPersonaId);7#define NTA$VMSNtDuplicateToken NTA$VMSNTDUPLICATETOKENNTSTATUSNTA$VMSNTOPENPROCESSTOKEN ( IN HANDLE ProcessHandle,! IN ACCESS_MASK DesiredAccess, OUT PPERID PersonaId);;#define NTA$VMSNtOpenProcessToken NTA$VMSNTOPENPROCESSTOKENNTSTATUSNTA$VMSNTOPENTHREADTOKEN ( IN HANDLE ThreadHandle,! IN ACCESS_MASK Des&iredAccess, IN BOOLEAN OpenAsSelf, OUT PPERID PersonaId);9#define NTA$VMSNtOpenThreadToken NTA$VMSNTOPENTHREADTOKENNTSTATUS&NTA$VMSNTPRIVILEGEDSERVICEAUDITALARM () IN PSECURITY_SUBJECT_CONTEXT Subject,% IN PMBSCHAR_STRING SubsystemName,# IN PMBSCHAR_STRING ServiceName,! IN PPRIVILEGE_SET Privileges, IN BOOLEAN AccessGranted );NTSTATUS NTA$VMSNTQUERYINFORMATIONTOKEN ( IN PPERID PersonaId,5 IN TOKEN_INFORMATION_CLASS TokenInformationClass, ' OUT PVOID TokenInfo, IN ULONG TokenInfoLen, OUT PULONG RetLen);E#define NTA$VMSNtQueryInformationToken NTA$VMSNTQUERYINFORMATIONTOKENNTSTATUSNTA$VMSNTSETINFORMATIONTHREAD (G HANDLE ThreadHandle, /* Thread whose information is to be set */g THREADINFOCLASS ThreadInformationClass, /* Information class about which to receive information */J PVOID ThreadInformation, /* Buffer containing information to set */B ULONG ThreadInfoLength /* Size of the inf(ormation to set */ );BOOLEAN NTA$VMSSEPSINGLEPRIVILEGECHECK ( TOKEN *token, ULONG privilege);:/* Functions to support OpenVMS specific functionality. */voidNTA$AUDITSTATETIMER ();/#define NTA$AuditStateTimer NTA$AUDITSTATETIMER#ifndef __NEW_STARLET#define EVSB evsb#endif /* __NEW_STARLET */ VMSSTATUS*NTA$EVENTW (unsigned int EventFlagNumber, unsigned int FunctionCode, void *ItemList, EVSB *EventStatusBlock);#define NT)A$EventW NTA$EVENTW VMSSTATUSNTA$INITIALIZE ();%#define NTA$Initialize NTA$INITIALIZE VMSSTATUSNTA$SETAUDITSTATE (; PADT_CONTROL new_audit_state /* Audit state vector */);+#define NTA$SetAuditState NTA$SETAUDITSTATE VMSSTATUSNTA$SETAUDITTIMERDELTA (6 char *delta_time_string /* Delta time string */);5#define NTA$SetAuditTimerDelta NTA$SETAUDITTIMERDELTA VMSSTATUSNTA$SETAUDITTIMER ();+#define NTA$SetAuditTimer NTA$SETAUDITTIMERNTSTATUSNTA$VMSN*TACCESSCHECK (0 IN PSECURITY_DESCRIPTOR pSecurityDescriptor, IN PPERID PersonaId, IN DWORD DesiredAccess,' IN PGENERIC_MAPPING GenericMapping,$ OUT PPRIVILEGE_SET PrivilegeSet,& IN OUT LPDWORD PrivilegeSetLength, OUT LPDWORD GrantedAccess, OUT PNTSTATUS AccessStatus );1#define NTA$VMSNtAccessCheck NTA$VMSNTACCESSCHECKNTSTATUS#NTA$VMSNTACCESSCHECKANDAUDITALARM ( IN PPERID PersonaId, IN LPUCS4STR SubsystemName, IN PVOID HandleId, IN+ LPUCS4STR ObjectTypeName, IN LPUCS4STR ObjectName,/ IN PSECURITY_DESCRIPTOR SecurityDescriptor,! IN ACCESS_MASK DesiredAccess,' IN PGENERIC_MAPPING GenericMapping,# OUT PACCESS_MASK GrantedAccess, OUT PNTSTATUS AccessStatus, OUT PBOOLEAN GenerateOnClose );K#define NTA$VMSNtAccessCheckAndAuditAlarm NTA$VMSNTACCESSCHECKANDAUDITALARMNTSTATUSNTA$VMSNTOPENOBJECTAUDITALARM ( IN PPERID PersonaId, IN LPUCS4STR SubsystemName, IN PVOID HandleId ,OPTIONAL, IN LPUCS4STR ObjectTypeName, IN LPUCS4STR ObjectName,8 IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL,! IN ACCESS_MASK DesiredAccess,! IN ACCESS_MASK GrantedAccess,* IN PPRIVILEGE_SET Privileges OPTIONAL, IN BOOLEAN AccessGranted, OUT PBOOLEAN GenerateOnClose );C#define NTA$VMSNtOpenObjectAuditAlarm NTA$VMSNTOPENOBJECTAUDITALARMNTSTATUSNTA$VMSPTHREADTODOSERROR (W int pthread_status, /* Pthread statu-s to convert */X int level /* Error code conversion flag */ );9#define NTA$VMSPthreadToDosError NTA$VMSPTHREADTODOSERRORBOOLEANNTA$VMSSEACCESSCHECK (/ IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN PPERID PersonaId,! IN ACCESS_MASK DesiredAccess,+ IN ACCESS_MASK PreviouslyGrantedAccess,' IN PGENERIC_MAPPING GenericMapping,# OUT PACCESS_MASK GrantedAccess, OUT PNTSTATUS AccessStatus );1#define NTA$VMSS.eAccessCheck NTA$VMSSEACCESSCHECKNTSTATUSNTA$VMSSEASSIGNSECURITY (6 IN PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL,8 IN PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL,, OUT PSECURITY_DESCRIPTOR *NewDescriptor,! IN BOOLEAN IsDirectoryObject, IN PPERID PersonaId,' IN PGENERIC_MAPPING GenericMapping,! IN BOOLEAN AssignCreatorOwner );7#define NTA$VMSSeAssignSecurity NTA$VMSSEASSIGNSECURITYNTSTATUS&NTA$VMSSEQUERYSECURITYDESCRIPTORINFO (0 IN SECUR/ITY_INFORMATION SecurityInformation,0 OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN OUT PULONG Length,6 IN PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor );Q#define NTA$VMSSeQuerySecurityDescriptorInfo NTA$VMSSEQUERYSECURITYDESCRIPTORINFONTSTATUS$NTA$VMSSESETSECURITYDESCRIPTORINFO ( IN PPERID PersonaId,0 IN SECURITY_INFORMATION SecurityInformation,3 IN PSECURITY_DESCRIPTOR ModificationDescriptor,; IN OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,&0 IN PGENERIC_MAPPING GenericMapping );M#define NTA$VMSSeSetSecurityDescriptorInfo NTA$VMSSESETSECURITYDESCRIPTORINFO#endif /* _NTA_POST_PUBLIC_ */ww­w(خا­³©/* MODULE nta_pre_public.hO*********************************************************************************:** Copyright (c) Digital Equipment Corporation, 1992-19975** All Rights Reserved. Unpublished rights reserved2** under the copyright laws of the United States.**7** The software contained in this 1 media is proprietary2** to and embodies the confidential technology of4** Digital Equipment Corporation. Possession, use,4** duplication or dissemination of the software and8** media is authorized only pursuant to a valid written/** license from Digital Equipment Corporation.**2** RESTRICTED RIGHTS LEGEND Use, duplication, or3** disclosure by the U.S. Government is subject to:** restrictions as set forth in Subparagraph (c) (1) (ii)2** of DFARS 252.227-7013, or in FAR 52.227-219, as** applicable.**N**********************************************************************************++!** FACILITY: OpenVMS NT Affinity**** MODULE DESCRIPTION:**H** This module contains all the definitions which must be made prior toH** including any of the various ASU header files; which must be public.L** (At least as far as the Win32 Support providers.) These are mostly dataJ** type definitions, although some function prototypes might appear. (InI** general, p3rototypes would go into the NTA_POST_PUBLIC.H header file.)** ** AUTHORS:**** L. Mark Pilant**** CREATION DATE: 17-Sep-1997**** MODIFICATION HISTORY:**3** X-5 LMP0574 L. Mark Pilant, 17-DEC-1997 10:26<** Add CreateProcess and CreateProcessAsUser support. Also/** add module header/modification information.**.** X-1A1 LMP0568 L. Mark Pilant, 17-SEP-1997<** Split out the public definitions to make distribution to#** Win32 support providers easier.****--*/4#ifndef _NTA_PRE_PUBLIC_#define _NTA_PRE_PUBLIC_#include /*?** Define some datatypes that are part of the calling interface*/Btypedef wchar_t UCS4CHAR, *LPUCS4STR; /* UCS4 wide character */9typedef unsigned int PERID, *PPERID; /* Persona id *//* From the MS sources. */,#define NORMAL_PRIORITY_CLASS 0x00000020*#define IDLE_PRIORITY_CLASS 0x00000040*#define HIGH_PRIORITY_CLASS 0x00000080.#define REALTIME_PRIORITY_CLASS 0x00000100#endif /* _NTA_PRE_PUBLIC_ */ww