Headers diff for advapi32.dll between 6.1.7601.23418-Windows_7.0 and 6.3.9600.17415-Windows_8.1 versions



 aclapi.h (6.1.7601.23418-Windows_7.0)   aclapi.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 19 skipping to change at line 19
Abstract: Abstract:
Public Public
Structure/constant definitions and typedefines for the Win32 Access Structure/constant definitions and typedefines for the Win32 Access
Control APIs Control APIs
--*/ --*/
#ifndef __ACCESS_CONTROL_API__ #ifndef __ACCESS_CONTROL_API__
#define __ACCESS_CONTROL_API__ #define __ACCESS_CONTROL_API__
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <windows.h> #include <windows.h>
#include <accctrl.h> #include <accctrl.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// //
// Progress Function: // Progress Function:
// Caller of tree operation implements this Progress function, then // Caller of tree operation implements this Progress function, then
skipping to change at line 40 skipping to change at line 45
// Tree operation invokes Progress function to provide progress and error // Tree operation invokes Progress function to provide progress and error
// information to the caller during the potentially long execution // information to the caller during the potentially long execution
// of the tree operation. Tree operation provides the name of the object // of the tree operation. Tree operation provides the name of the object
// last processed and the error status of the operation on that object. // last processed and the error status of the operation on that object.
// Tree operation also passes the current InvokeSetting value. // Tree operation also passes the current InvokeSetting value.
// Caller may change the InvokeSetting value, for example, from "Always" // Caller may change the InvokeSetting value, for example, from "Always"
// to "Only On Error." // to "Only On Error."
// //
typedef VOID (*FN_PROGRESS) ( typedef VOID (*FN_PROGRESS) (
__in LPWSTR pObjectName, // name of object just proce _In_ LPWSTR pObjectName, // name of object just proce
ssed ssed
__in DWORD Status, // status of operation on ob _In_ DWORD Status, // status of operation on ob
ject ject
__inout PPROG_INVOKE_SETTING pInvokeSetting, // Never, always, _Inout_ PPROG_INVOKE_SETTING pInvokeSetting, // Never, always,
__in PVOID Args, // Caller specific data _In_ PVOID Args, // Caller specific data
__in BOOL SecuritySet // Whether security was set _In_ BOOL SecuritySet // Whether security was set
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetEntriesInAclA( SetEntriesInAclA(
__in ULONG cCountOfExplicitEntries, _In_ ULONG cCountOfExplicitEntries,
__in_ecount_opt(cCountOfExplicitEntries) PEXPLICIT_ACCESS_A pListOfExplici _In_reads_opt_(cCountOfExplicitEntries) PEXPLICIT_ACCESS_A pListOfExplicit
tEntries, Entries,
__in_opt PACL OldAcl, _In_opt_ PACL OldAcl,
__out PACL * NewAcl _Out_ PACL * NewAcl
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetEntriesInAclW( SetEntriesInAclW(
__in ULONG cCountOfExplicitEntries, _In_ ULONG cCountOfExplicitEntries,
__in_ecount_opt(cCountOfExplicitEntries) PEXPLICIT_ACCESS_W pListOfExplici _In_reads_opt_(cCountOfExplicitEntries) PEXPLICIT_ACCESS_W pListOfExplicit
tEntries, Entries,
__in_opt PACL OldAcl, _In_opt_ PACL OldAcl,
__out PACL * NewAcl _Out_ PACL * NewAcl
); );
#ifdef UNICODE #ifdef UNICODE
#define SetEntriesInAcl SetEntriesInAclW #define SetEntriesInAcl SetEntriesInAclW
#else #else
#define SetEntriesInAcl SetEntriesInAclA #define SetEntriesInAcl SetEntriesInAclA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetExplicitEntriesFromAclA( GetExplicitEntriesFromAclA(
__in PACL pacl, _In_ PACL pacl,
__out PULONG pcCountOfExplicitEntries, _Out_ PULONG pcCountOfExplicitEntries,
__deref_out_ecount(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_A * pListOfE _Outptr_result_buffer_(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_A * pLis
xplicitEntries tOfExplicitEntries
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetExplicitEntriesFromAclW( GetExplicitEntriesFromAclW(
__in PACL pacl, _In_ PACL pacl,
__out PULONG pcCountOfExplicitEntries, _Out_ PULONG pcCountOfExplicitEntries,
__deref_out_ecount(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_W * pListOfE _Outptr_result_buffer_(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_W * pLis
xplicitEntries tOfExplicitEntries
); );
#ifdef UNICODE #ifdef UNICODE
#define GetExplicitEntriesFromAcl GetExplicitEntriesFromAclW #define GetExplicitEntriesFromAcl GetExplicitEntriesFromAclW
#else #else
#define GetExplicitEntriesFromAcl GetExplicitEntriesFromAclA #define GetExplicitEntriesFromAcl GetExplicitEntriesFromAclA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetEffectiveRightsFromAclA( GetEffectiveRightsFromAclA(
__in PACL pacl, _In_ PACL pacl,
__in PTRUSTEE_A pTrustee, _In_ PTRUSTEE_A pTrustee,
__out PACCESS_MASK pAccessRights _Out_ PACCESS_MASK pAccessRights
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetEffectiveRightsFromAclW( GetEffectiveRightsFromAclW(
__in PACL pacl, _In_ PACL pacl,
__in PTRUSTEE_W pTrustee, _In_ PTRUSTEE_W pTrustee,
__out PACCESS_MASK pAccessRights _Out_ PACCESS_MASK pAccessRights
); );
#ifdef UNICODE #ifdef UNICODE
#define GetEffectiveRightsFromAcl GetEffectiveRightsFromAclW #define GetEffectiveRightsFromAcl GetEffectiveRightsFromAclW
#else #else
#define GetEffectiveRightsFromAcl GetEffectiveRightsFromAclA #define GetEffectiveRightsFromAcl GetEffectiveRightsFromAclA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetAuditedPermissionsFromAclA( GetAuditedPermissionsFromAclA(
__in PACL pacl, _In_ PACL pacl,
__in PTRUSTEE_A pTrustee, _In_ PTRUSTEE_A pTrustee,
__out PACCESS_MASK pSuccessfulAuditedRights, _Out_ PACCESS_MASK pSuccessfulAuditedRights,
__out PACCESS_MASK pFailedAuditRights _Out_ PACCESS_MASK pFailedAuditRights
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetAuditedPermissionsFromAclW( GetAuditedPermissionsFromAclW(
__in PACL pacl, _In_ PACL pacl,
__in PTRUSTEE_W pTrustee, _In_ PTRUSTEE_W pTrustee,
__out PACCESS_MASK pSuccessfulAuditedRights, _Out_ PACCESS_MASK pSuccessfulAuditedRights,
__out PACCESS_MASK pFailedAuditRights _Out_ PACCESS_MASK pFailedAuditRights
); );
#ifdef UNICODE #ifdef UNICODE
#define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclW #define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclW
#else #else
#define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclA #define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetNamedSecurityInfoA( GetNamedSecurityInfoA(
__in LPCSTR pObjectName, _In_ LPCSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__out_opt const PSID * ppsidOwner, _Out_opt_ PSID * ppsidOwner,
__out_opt const PSID * ppsidGroup, _Out_opt_ PSID * ppsidGroup,
__out_opt const PACL * ppDacl, _Out_opt_ PACL * ppDacl,
__out_opt const PACL * ppSacl, _Out_opt_ PACL * ppSacl,
__out PSECURITY_DESCRIPTOR * ppSecurityDescriptor _Out_ PSECURITY_DESCRIPTOR * ppSecurityDescriptor
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetNamedSecurityInfoW( GetNamedSecurityInfoW(
__in LPCWSTR pObjectName, _In_ LPCWSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__out_opt const PSID * ppsidOwner, _Out_opt_ PSID * ppsidOwner,
__out_opt const PSID * ppsidGroup, _Out_opt_ PSID * ppsidGroup,
__out_opt const PACL * ppDacl, _Out_opt_ PACL * ppDacl,
__out_opt const PACL * ppSacl, _Out_opt_ PACL * ppSacl,
__out PSECURITY_DESCRIPTOR * ppSecurityDescriptor _Out_ PSECURITY_DESCRIPTOR * ppSecurityDescriptor
); );
#ifdef UNICODE #ifdef UNICODE
#define GetNamedSecurityInfo GetNamedSecurityInfoW #define GetNamedSecurityInfo GetNamedSecurityInfoW
#else #else
#define GetNamedSecurityInfo GetNamedSecurityInfoA #define GetNamedSecurityInfo GetNamedSecurityInfoA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetSecurityInfo( GetSecurityInfo(
__in HANDLE handle, _In_ HANDLE handle,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__out_opt PSID * ppsidOwner, _Out_opt_ PSID * ppsidOwner,
__out_opt PSID * ppsidGroup, _Out_opt_ PSID * ppsidGroup,
__out_opt PACL * ppDacl, _Out_opt_ PACL * ppDacl,
__out_opt PACL * ppSacl, _Out_opt_ PACL * ppSacl,
__out_opt PSECURITY_DESCRIPTOR * ppSecurityDescriptor _Out_opt_ PSECURITY_DESCRIPTOR * ppSecurityDescriptor
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetNamedSecurityInfoA( SetNamedSecurityInfoA(
__in LPSTR pObjectName, _In_ LPSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID psidOwner, _In_opt_ PSID psidOwner,
__in_opt PSID psidGroup, _In_opt_ PSID psidGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl _In_opt_ PACL pSacl
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetNamedSecurityInfoW( SetNamedSecurityInfoW(
__in LPWSTR pObjectName, _In_ LPWSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID psidOwner, _In_opt_ PSID psidOwner,
__in_opt PSID psidGroup, _In_opt_ PSID psidGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl _In_opt_ PACL pSacl
); );
#ifdef UNICODE #ifdef UNICODE
#define SetNamedSecurityInfo SetNamedSecurityInfoW #define SetNamedSecurityInfo SetNamedSecurityInfoW
#else #else
#define SetNamedSecurityInfo SetNamedSecurityInfoA #define SetNamedSecurityInfo SetNamedSecurityInfoA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetSecurityInfo( SetSecurityInfo(
__in HANDLE handle, _In_ HANDLE handle,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID psidOwner, _In_opt_ PSID psidOwner,
__in_opt PSID psidGroup, _In_opt_ PSID psidGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl _In_opt_ PACL pSacl
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetInheritanceSourceA( GetInheritanceSourceA(
__in LPSTR pObjectName, _In_ LPSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in BOOL Container, _In_ BOOL Container,
__in_ecount_opt(GuidCount) GUID ** pObjectClassGuids, _In_reads_opt_(GuidCount) GUID ** pObjectClassGuids,
__in DWORD GuidCount, _In_ DWORD GuidCount,
__in PACL pAcl, _In_ PACL pAcl,
__in_opt PFN_OBJECT_MGR_FUNCTS pfnArray, _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray,
__in PGENERIC_MAPPING pGenericMapping, _In_ PGENERIC_MAPPING pGenericMapping,
__out PINHERITED_FROMA pInheritArray _Out_ PINHERITED_FROMA pInheritArray
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetInheritanceSourceW( GetInheritanceSourceW(
__in LPWSTR pObjectName, _In_ LPWSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in BOOL Container, _In_ BOOL Container,
__in_ecount_opt(GuidCount) GUID ** pObjectClassGuids, _In_reads_opt_(GuidCount) GUID ** pObjectClassGuids,
__in DWORD GuidCount, _In_ DWORD GuidCount,
__in PACL pAcl, _In_ PACL pAcl,
__in_opt PFN_OBJECT_MGR_FUNCTS pfnArray, _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray,
__in PGENERIC_MAPPING pGenericMapping, _In_ PGENERIC_MAPPING pGenericMapping,
__out PINHERITED_FROMW pInheritArray _Out_ PINHERITED_FROMW pInheritArray
); );
#ifdef UNICODE #ifdef UNICODE
#define GetInheritanceSource GetInheritanceSourceW #define GetInheritanceSource GetInheritanceSourceW
#else #else
#define GetInheritanceSource GetInheritanceSourceA #define GetInheritanceSource GetInheritanceSourceA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
FreeInheritedFromArray( FreeInheritedFromArray(
__in_ecount(AceCnt) PINHERITED_FROMW pInheritArray, _In_reads_(AceCnt) PINHERITED_FROMW pInheritArray,
__in USHORT AceCnt, _In_ USHORT AceCnt,
__in_opt PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL _In_opt_ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
TreeResetNamedSecurityInfoA( TreeResetNamedSecurityInfoA(
__in LPSTR pObjectName, _In_ LPSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID pOwner, _In_opt_ PSID pOwner,
__in_opt PSID pGroup, _In_opt_ PSID pGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl, _In_opt_ PACL pSacl,
__in BOOL KeepExplicit, _In_ BOOL KeepExplicit,
__in_opt FN_PROGRESS fnProgress, _In_opt_ FN_PROGRESS fnProgress,
__in PROG_INVOKE_SETTING ProgressInvokeSetting, _In_ PROG_INVOKE_SETTING ProgressInvokeSetting,
__in_opt PVOID Args _In_opt_ PVOID Args
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
TreeResetNamedSecurityInfoW( TreeResetNamedSecurityInfoW(
__in LPWSTR pObjectName, _In_ LPWSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID pOwner, _In_opt_ PSID pOwner,
__in_opt PSID pGroup, _In_opt_ PSID pGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl, _In_opt_ PACL pSacl,
__in BOOL KeepExplicit, _In_ BOOL KeepExplicit,
__in_opt FN_PROGRESS fnProgress, _In_opt_ FN_PROGRESS fnProgress,
__in PROG_INVOKE_SETTING ProgressInvokeSetting, _In_ PROG_INVOKE_SETTING ProgressInvokeSetting,
__in_opt PVOID Args _In_opt_ PVOID Args
); );
#ifdef UNICODE #ifdef UNICODE
#define TreeResetNamedSecurityInfo TreeResetNamedSecurityInfoW #define TreeResetNamedSecurityInfo TreeResetNamedSecurityInfoW
#else #else
#define TreeResetNamedSecurityInfo TreeResetNamedSecurityInfoA #define TreeResetNamedSecurityInfo TreeResetNamedSecurityInfoA
#endif // !UNICODE #endif // !UNICODE
#if (NTDDI_VERSION >= NTDDI_VISTA) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
TreeSetNamedSecurityInfoA( TreeSetNamedSecurityInfoA(
__in LPSTR pObjectName, _In_ LPSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID pOwner, _In_opt_ PSID pOwner,
__in_opt PSID pGroup, _In_opt_ PSID pGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl, _In_opt_ PACL pSacl,
__in DWORD dwAction, _In_ DWORD dwAction,
__in_opt FN_PROGRESS fnProgress, _In_opt_ FN_PROGRESS fnProgress,
__in PROG_INVOKE_SETTING ProgressInvokeSetting, _In_ PROG_INVOKE_SETTING ProgressInvokeSetting,
__in_opt PVOID Args _In_opt_ PVOID Args
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
TreeSetNamedSecurityInfoW( TreeSetNamedSecurityInfoW(
__in LPWSTR pObjectName, _In_ LPWSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType, _In_ SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo, _In_ SECURITY_INFORMATION SecurityInfo,
__in_opt PSID pOwner, _In_opt_ PSID pOwner,
__in_opt PSID pGroup, _In_opt_ PSID pGroup,
__in_opt PACL pDacl, _In_opt_ PACL pDacl,
__in_opt PACL pSacl, _In_opt_ PACL pSacl,
__in DWORD dwAction, _In_ DWORD dwAction,
__in_opt FN_PROGRESS fnProgress, _In_opt_ FN_PROGRESS fnProgress,
__in PROG_INVOKE_SETTING ProgressInvokeSetting, _In_ PROG_INVOKE_SETTING ProgressInvokeSetting,
__in_opt PVOID Args _In_opt_ PVOID Args
); );
#ifdef UNICODE #ifdef UNICODE
#define TreeSetNamedSecurityInfo TreeSetNamedSecurityInfoW #define TreeSetNamedSecurityInfo TreeSetNamedSecurityInfoW
#else #else
#define TreeSetNamedSecurityInfo TreeSetNamedSecurityInfoA #define TreeSetNamedSecurityInfo TreeSetNamedSecurityInfoA
#endif // !UNICODE #endif // !UNICODE
#endif // (NTDDI_VERSION >= NTDDI_VISTA) #endif // (NTDDI_VERSION >= NTDDI_VISTA)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// The following API are provided for trusted servers to use to // The following API are provided for trusted servers to use to
// implement access control on their own objects. // implement access control on their own objects.
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
BuildSecurityDescriptorA( BuildSecurityDescriptorA(
__in_opt PTRUSTEE_A pOwner, _In_opt_ PTRUSTEE_A pOwner,
__in_opt PTRUSTEE_A pGroup, _In_opt_ PTRUSTEE_A pGroup,
__in ULONG cCountOfAccessEntries, _In_ ULONG cCountOfAccessEntries,
__in_ecount_opt(cCountOfAccessEntries) PEXPLICIT_ACCESS_A pListOfAccess _In_reads_opt_(cCountOfAccessEntries) PEXPLICIT_ACCESS_A pListOfAccessE
Entries, ntries,
__in ULONG cCountOfAuditEntries, _In_ ULONG cCountOfAuditEntries,
__in_ecount_opt(cCountOfAuditEntries) PEXPLICIT_ACCESS_A pListOfAuditEn _In_reads_opt_(cCountOfAuditEntries) PEXPLICIT_ACCESS_A pListOfAuditEnt
tries, ries,
__in_opt PSECURITY_DESCRIPTOR pOldSD, _In_opt_ PSECURITY_DESCRIPTOR pOldSD,
__out PULONG pSizeNewSD, _Out_ PULONG pSizeNewSD,
__deref_out_bcount(*pSizeNewSD) PSECURITY_DESCRIPTOR * pNewSD _Outptr_result_bytebuffer_(*pSizeNewSD) PSECURITY_DESCRIPTOR * pNewSD
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
BuildSecurityDescriptorW( BuildSecurityDescriptorW(
__in_opt PTRUSTEE_W pOwner, _In_opt_ PTRUSTEE_W pOwner,
__in_opt PTRUSTEE_W pGroup, _In_opt_ PTRUSTEE_W pGroup,
__in ULONG cCountOfAccessEntries, _In_ ULONG cCountOfAccessEntries,
__in_ecount_opt(cCountOfAccessEntries) PEXPLICIT_ACCESS_W pListOfAccess _In_reads_opt_(cCountOfAccessEntries) PEXPLICIT_ACCESS_W pListOfAccessE
Entries, ntries,
__in ULONG cCountOfAuditEntries, _In_ ULONG cCountOfAuditEntries,
__in_ecount_opt(cCountOfAuditEntries) PEXPLICIT_ACCESS_W pListOfAuditEn _In_reads_opt_(cCountOfAuditEntries) PEXPLICIT_ACCESS_W pListOfAuditEnt
tries, ries,
__in_opt PSECURITY_DESCRIPTOR pOldSD, _In_opt_ PSECURITY_DESCRIPTOR pOldSD,
__out PULONG pSizeNewSD, _Out_ PULONG pSizeNewSD,
__deref_out_bcount(*pSizeNewSD) PSECURITY_DESCRIPTOR * pNewSD _Outptr_result_bytebuffer_(*pSizeNewSD) PSECURITY_DESCRIPTOR * pNewSD
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildSecurityDescriptor BuildSecurityDescriptorW #define BuildSecurityDescriptor BuildSecurityDescriptorW
#else #else
#define BuildSecurityDescriptor BuildSecurityDescriptorA #define BuildSecurityDescriptor BuildSecurityDescriptorA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
LookupSecurityDescriptorPartsA( LookupSecurityDescriptorPartsA(
__out_opt PTRUSTEE_A * ppOwner, _Out_opt_ PTRUSTEE_A * ppOwner,
__out_opt PTRUSTEE_A * ppGroup, _Out_opt_ PTRUSTEE_A * ppGroup,
__out_opt PULONG pcCountOfAccessEntries, _Out_opt_ PULONG pcCountOfAccessEntries,
__deref_out_ecount_opt(*pcCountOfAccessEntries) PEXPLICIT_ACCESS_A * ppListO _Outptr_result_buffer_maybenull_(*pcCountOfAccessEntries) PEXPLICIT_ACCESS_A
fAccessEntries, * ppListOfAccessEntries,
__out_opt PULONG pcCountOfAuditEntries, _Out_opt_ PULONG pcCountOfAuditEntries,
__deref_out_ecount_opt(*pcCountOfAuditEntries) PEXPLICIT_ACCESS_A * ppListOf _Outptr_result_buffer_maybenull_(*pcCountOfAuditEntries) PEXPLICIT_ACCESS_A
AuditEntries, * ppListOfAuditEntries,
__in PSECURITY_DESCRIPTOR pSD _In_ PSECURITY_DESCRIPTOR pSD
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
LookupSecurityDescriptorPartsW( LookupSecurityDescriptorPartsW(
__out_opt PTRUSTEE_W * ppOwner, _Out_opt_ PTRUSTEE_W * ppOwner,
__out_opt PTRUSTEE_W * ppGroup, _Out_opt_ PTRUSTEE_W * ppGroup,
__out_opt PULONG pcCountOfAccessEntries, _Out_opt_ PULONG pcCountOfAccessEntries,
__deref_out_ecount_opt(*pcCountOfAccessEntries) PEXPLICIT_ACCESS_W * ppListO _Outptr_result_buffer_maybenull_(*pcCountOfAccessEntries) PEXPLICIT_ACCESS_W
fAccessEntries, * ppListOfAccessEntries,
__out_opt PULONG pcCountOfAuditEntries, _Out_opt_ PULONG pcCountOfAuditEntries,
__deref_out_ecount_opt(*pcCountOfAuditEntries) PEXPLICIT_ACCESS_W * ppListOf _Outptr_result_buffer_maybenull_(*pcCountOfAuditEntries) PEXPLICIT_ACCESS_W
AuditEntries, * ppListOfAuditEntries,
__in PSECURITY_DESCRIPTOR pSD _In_ PSECURITY_DESCRIPTOR pSD
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupSecurityDescriptorParts LookupSecurityDescriptorPartsW #define LookupSecurityDescriptorParts LookupSecurityDescriptorPartsW
#else #else
#define LookupSecurityDescriptorParts LookupSecurityDescriptorPartsA #define LookupSecurityDescriptorParts LookupSecurityDescriptorPartsA
#endif // !UNICODE #endif // !UNICODE
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// The following helper API are provided for building // The following helper API are provided for building
// access control structures. // access control structures.
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildExplicitAccessWithNameA( BuildExplicitAccessWithNameA(
__inout PEXPLICIT_ACCESS_A pExplicitAccess, _Inout_ PEXPLICIT_ACCESS_A pExplicitAccess,
__in_opt LPSTR pTrusteeName, _In_opt_ LPSTR pTrusteeName,
__in DWORD AccessPermissions, _In_ DWORD AccessPermissions,
__in ACCESS_MODE AccessMode, _In_ ACCESS_MODE AccessMode,
__in DWORD Inheritance _In_ DWORD Inheritance
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildExplicitAccessWithNameW( BuildExplicitAccessWithNameW(
__inout PEXPLICIT_ACCESS_W pExplicitAccess, _Inout_ PEXPLICIT_ACCESS_W pExplicitAccess,
__in_opt LPWSTR pTrusteeName, _In_opt_ LPWSTR pTrusteeName,
__in DWORD AccessPermissions, _In_ DWORD AccessPermissions,
__in ACCESS_MODE AccessMode, _In_ ACCESS_MODE AccessMode,
__in DWORD Inheritance _In_ DWORD Inheritance
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildExplicitAccessWithName BuildExplicitAccessWithNameW #define BuildExplicitAccessWithName BuildExplicitAccessWithNameW
#else #else
#define BuildExplicitAccessWithName BuildExplicitAccessWithNameA #define BuildExplicitAccessWithName BuildExplicitAccessWithNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildImpersonateExplicitAccessWithNameA( BuildImpersonateExplicitAccessWithNameA(
__inout PEXPLICIT_ACCESS_A pExplicitAccess, _Inout_ PEXPLICIT_ACCESS_A pExplicitAccess,
__in_opt LPSTR pTrusteeName, _In_opt_ LPSTR pTrusteeName,
__in_opt PTRUSTEE_A pTrustee, _In_opt_ PTRUSTEE_A pTrustee,
__in DWORD AccessPermissions, _In_ DWORD AccessPermissions,
__in ACCESS_MODE AccessMode, _In_ ACCESS_MODE AccessMode,
__in DWORD Inheritance _In_ DWORD Inheritance
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildImpersonateExplicitAccessWithNameW( BuildImpersonateExplicitAccessWithNameW(
__inout PEXPLICIT_ACCESS_W pExplicitAccess, _Inout_ PEXPLICIT_ACCESS_W pExplicitAccess,
__in_opt LPWSTR pTrusteeName, _In_opt_ LPWSTR pTrusteeName,
__in_opt PTRUSTEE_W pTrustee, _In_opt_ PTRUSTEE_W pTrustee,
__in DWORD AccessPermissions, _In_ DWORD AccessPermissions,
__in ACCESS_MODE AccessMode, _In_ ACCESS_MODE AccessMode,
__in DWORD Inheritance _In_ DWORD Inheritance
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWi thNameW #define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWi thNameW
#else #else
#define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWi thNameA #define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWi thNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithNameA( BuildTrusteeWithNameA(
__inout PTRUSTEE_A pTrustee, _Inout_ PTRUSTEE_A pTrustee,
__in_opt LPSTR pName _In_opt_ LPSTR pName
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithNameW( BuildTrusteeWithNameW(
__inout PTRUSTEE_W pTrustee, _Inout_ PTRUSTEE_W pTrustee,
__in_opt LPWSTR pName _In_opt_ LPWSTR pName
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildTrusteeWithName BuildTrusteeWithNameW #define BuildTrusteeWithName BuildTrusteeWithNameW
#else #else
#define BuildTrusteeWithName BuildTrusteeWithNameA #define BuildTrusteeWithName BuildTrusteeWithNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildImpersonateTrusteeA( BuildImpersonateTrusteeA(
__inout PTRUSTEE_A pTrustee, _Inout_ PTRUSTEE_A pTrustee,
__in_opt PTRUSTEE_A pImpersonateTrustee _In_opt_ PTRUSTEE_A pImpersonateTrustee
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildImpersonateTrusteeW( BuildImpersonateTrusteeW(
__inout PTRUSTEE_W pTrustee, _Inout_ PTRUSTEE_W pTrustee,
__in_opt PTRUSTEE_W pImpersonateTrustee _In_opt_ PTRUSTEE_W pImpersonateTrustee
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildImpersonateTrustee BuildImpersonateTrusteeW #define BuildImpersonateTrustee BuildImpersonateTrusteeW
#else #else
#define BuildImpersonateTrustee BuildImpersonateTrusteeA #define BuildImpersonateTrustee BuildImpersonateTrusteeA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithSidA( BuildTrusteeWithSidA(
__inout PTRUSTEE_A pTrustee, _Inout_ PTRUSTEE_A pTrustee,
__in_opt PSID pSid _In_opt_ PSID pSid
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithSidW( BuildTrusteeWithSidW(
__inout PTRUSTEE_W pTrustee, _Inout_ PTRUSTEE_W pTrustee,
__in_opt PSID pSid _In_opt_ PSID pSid
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildTrusteeWithSid BuildTrusteeWithSidW #define BuildTrusteeWithSid BuildTrusteeWithSidW
#else #else
#define BuildTrusteeWithSid BuildTrusteeWithSidA #define BuildTrusteeWithSid BuildTrusteeWithSidA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithObjectsAndSidA( BuildTrusteeWithObjectsAndSidA(
__inout PTRUSTEE_A pTrustee, _Inout_ PTRUSTEE_A pTrustee,
__in_opt POBJECTS_AND_SID pObjSid, _In_opt_ POBJECTS_AND_SID pObjSid,
__in_opt GUID * pObjectGuid, _In_opt_ GUID * pObjectGuid,
__in_opt GUID * pInheritedObjectGuid, _In_opt_ GUID * pInheritedObjectGuid,
__in_opt PSID pSid _In_opt_ PSID pSid
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithObjectsAndSidW( BuildTrusteeWithObjectsAndSidW(
__inout PTRUSTEE_W pTrustee, _Inout_ PTRUSTEE_W pTrustee,
__in_opt POBJECTS_AND_SID pObjSid, _In_opt_ POBJECTS_AND_SID pObjSid,
__in_opt GUID * pObjectGuid, _In_opt_ GUID * pObjectGuid,
__in_opt GUID * pInheritedObjectGuid, _In_opt_ GUID * pInheritedObjectGuid,
__in_opt PSID pSid _In_opt_ PSID pSid
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildTrusteeWithObjectsAndSid BuildTrusteeWithObjectsAndSidW #define BuildTrusteeWithObjectsAndSid BuildTrusteeWithObjectsAndSidW
#else #else
#define BuildTrusteeWithObjectsAndSid BuildTrusteeWithObjectsAndSidA #define BuildTrusteeWithObjectsAndSid BuildTrusteeWithObjectsAndSidA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithObjectsAndNameA( BuildTrusteeWithObjectsAndNameA(
__inout PTRUSTEE_A pTrustee, _Inout_ PTRUSTEE_A pTrustee,
__in_opt POBJECTS_AND_NAME_A pObjName, _In_opt_ POBJECTS_AND_NAME_A pObjName,
__in_opt SE_OBJECT_TYPE ObjectType, _In_opt_ SE_OBJECT_TYPE ObjectType,
__in_opt LPSTR ObjectTypeName, _In_opt_ LPSTR ObjectTypeName,
__in_opt LPSTR InheritedObjectTypeName, _In_opt_ LPSTR InheritedObjectTypeName,
__in_opt LPSTR Name _In_opt_ LPSTR Name
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
BuildTrusteeWithObjectsAndNameW( BuildTrusteeWithObjectsAndNameW(
__inout PTRUSTEE_W pTrustee, _Inout_ PTRUSTEE_W pTrustee,
__in_opt POBJECTS_AND_NAME_W pObjName, _In_opt_ POBJECTS_AND_NAME_W pObjName,
__in_opt SE_OBJECT_TYPE ObjectType, _In_opt_ SE_OBJECT_TYPE ObjectType,
__in_opt LPWSTR ObjectTypeName, _In_opt_ LPWSTR ObjectTypeName,
__in_opt LPWSTR InheritedObjectTypeName, _In_opt_ LPWSTR InheritedObjectTypeName,
__in_opt LPWSTR Name _In_opt_ LPWSTR Name
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildTrusteeWithObjectsAndName BuildTrusteeWithObjectsAndNameW #define BuildTrusteeWithObjectsAndName BuildTrusteeWithObjectsAndNameW
#else #else
#define BuildTrusteeWithObjectsAndName BuildTrusteeWithObjectsAndNameA #define BuildTrusteeWithObjectsAndName BuildTrusteeWithObjectsAndNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LPSTR LPSTR
WINAPI WINAPI
GetTrusteeNameA( GetTrusteeNameA(
__in PTRUSTEE_A pTrustee _In_ PTRUSTEE_A pTrustee
); );
WINADVAPI WINADVAPI
LPWSTR LPWSTR
WINAPI WINAPI
GetTrusteeNameW( GetTrusteeNameW(
__in PTRUSTEE_W pTrustee _In_ PTRUSTEE_W pTrustee
); );
#ifdef UNICODE #ifdef UNICODE
#define GetTrusteeName GetTrusteeNameW #define GetTrusteeName GetTrusteeNameW
#else #else
#define GetTrusteeName GetTrusteeNameA #define GetTrusteeName GetTrusteeNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
TRUSTEE_TYPE TRUSTEE_TYPE
WINAPI WINAPI
GetTrusteeTypeA( GetTrusteeTypeA(
__in_opt PTRUSTEE_A pTrustee _In_opt_ PTRUSTEE_A pTrustee
); );
WINADVAPI WINADVAPI
TRUSTEE_TYPE TRUSTEE_TYPE
WINAPI WINAPI
GetTrusteeTypeW( GetTrusteeTypeW(
__in_opt PTRUSTEE_W pTrustee _In_opt_ PTRUSTEE_W pTrustee
); );
#ifdef UNICODE #ifdef UNICODE
#define GetTrusteeType GetTrusteeTypeW #define GetTrusteeType GetTrusteeTypeW
#else #else
#define GetTrusteeType GetTrusteeTypeA #define GetTrusteeType GetTrusteeTypeA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
TRUSTEE_FORM TRUSTEE_FORM
WINAPI WINAPI
GetTrusteeFormA( GetTrusteeFormA(
__in PTRUSTEE_A pTrustee _In_ PTRUSTEE_A pTrustee
); );
WINADVAPI WINADVAPI
TRUSTEE_FORM TRUSTEE_FORM
WINAPI WINAPI
GetTrusteeFormW( GetTrusteeFormW(
__in PTRUSTEE_W pTrustee _In_ PTRUSTEE_W pTrustee
); );
#ifdef UNICODE #ifdef UNICODE
#define GetTrusteeForm GetTrusteeFormW #define GetTrusteeForm GetTrusteeFormW
#else #else
#define GetTrusteeForm GetTrusteeFormA #define GetTrusteeForm GetTrusteeFormA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
MULTIPLE_TRUSTEE_OPERATION MULTIPLE_TRUSTEE_OPERATION
WINAPI WINAPI
GetMultipleTrusteeOperationA( GetMultipleTrusteeOperationA(
__in_opt PTRUSTEE_A pTrustee _In_opt_ PTRUSTEE_A pTrustee
); );
WINADVAPI WINADVAPI
MULTIPLE_TRUSTEE_OPERATION MULTIPLE_TRUSTEE_OPERATION
WINAPI WINAPI
GetMultipleTrusteeOperationW( GetMultipleTrusteeOperationW(
__in_opt PTRUSTEE_W pTrustee _In_opt_ PTRUSTEE_W pTrustee
); );
#ifdef UNICODE #ifdef UNICODE
#define GetMultipleTrusteeOperation GetMultipleTrusteeOperationW #define GetMultipleTrusteeOperation GetMultipleTrusteeOperationW
#else #else
#define GetMultipleTrusteeOperation GetMultipleTrusteeOperationA #define GetMultipleTrusteeOperation GetMultipleTrusteeOperationA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
PTRUSTEE_A PTRUSTEE_A
WINAPI WINAPI
GetMultipleTrusteeA( GetMultipleTrusteeA(
__in_opt PTRUSTEE_A pTrustee _In_opt_ PTRUSTEE_A pTrustee
); );
WINADVAPI WINADVAPI
PTRUSTEE_W PTRUSTEE_W
WINAPI WINAPI
GetMultipleTrusteeW( GetMultipleTrusteeW(
__in_opt PTRUSTEE_W pTrustee _In_opt_ PTRUSTEE_W pTrustee
); );
#ifdef UNICODE #ifdef UNICODE
#define GetMultipleTrustee GetMultipleTrusteeW #define GetMultipleTrustee GetMultipleTrusteeW
#else #else
#define GetMultipleTrustee GetMultipleTrusteeA #define GetMultipleTrustee GetMultipleTrusteeA
#endif // !UNICODE #endif // !UNICODE
// //
// Temporary requirement for the technology preview, no longer required // Temporary requirement for the technology preview, no longer required
// //
#define AccProvInit(err) #define AccProvInit(err)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // __ACCESS_CONTROL_API__ #endif // __ACCESS_CONTROL_API__
 End of changes. 52 change blocks. 
257 lines changed or deleted 265 lines changed or added


 evntcons.h (6.1.7601.23418-Windows_7.0)   evntcons.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 25 skipping to change at line 25
Insung Park (insungp) 26-Aug-2004 Insung Park (insungp) 26-Aug-2004
Created the file. Created the file.
--*/ --*/
#ifndef _EVNTCONS_H_ #ifndef _EVNTCONS_H_
#define _EVNTCONS_H_ #define _EVNTCONS_H_
#pragma once #pragma once
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <wmistr.h> #include <wmistr.h>
#include <evntrace.h> #include <evntrace.h>
#include <evntprov.h> #include <evntprov.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if defined (_MSC_VER) #if defined (_MSC_VER)
skipping to change at line 48 skipping to change at line 52
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/un ion #pragma warning(disable:4201) // nonstandard extension used : nameless struct/un ion
#pragma warning(disable:4214) // nonstandard extension used : bit field types ot her then int #pragma warning(disable:4214) // nonstandard extension used : bit field types ot her then int
#endif #endif
#define EVENT_HEADER_EXT_TYPE_RELATED_ACTIVITYID 0x0001 #define EVENT_HEADER_EXT_TYPE_RELATED_ACTIVITYID 0x0001
#define EVENT_HEADER_EXT_TYPE_SID 0x0002 #define EVENT_HEADER_EXT_TYPE_SID 0x0002
#define EVENT_HEADER_EXT_TYPE_TS_ID 0x0003 #define EVENT_HEADER_EXT_TYPE_TS_ID 0x0003
#define EVENT_HEADER_EXT_TYPE_INSTANCE_INFO 0x0004 #define EVENT_HEADER_EXT_TYPE_INSTANCE_INFO 0x0004
#define EVENT_HEADER_EXT_TYPE_STACK_TRACE32 0x0005 #define EVENT_HEADER_EXT_TYPE_STACK_TRACE32 0x0005
#define EVENT_HEADER_EXT_TYPE_STACK_TRACE64 0x0006 #define EVENT_HEADER_EXT_TYPE_STACK_TRACE64 0x0006
#define EVENT_HEADER_EXT_TYPE_MAX 0x0007 #define EVENT_HEADER_EXT_TYPE_PEBS_INDEX 0x0007
#define EVENT_HEADER_EXT_TYPE_PMC_COUNTERS 0x0008
#define EVENT_HEADER_EXT_TYPE_PSM_KEY 0x0009
#define EVENT_HEADER_EXT_TYPE_EVENT_SCHEMA_TL 0x000B
#define EVENT_HEADER_EXT_TYPE_PROV_TRAITS 0x000C
#define EVENT_HEADER_EXT_TYPE_PROCESS_START_KEY 0x000D
#define EVENT_HEADER_EXT_TYPE_MAX 0x000E
#ifndef EVENT_HEADER_EXTENDED_DATA_ITEM_DEF
#define EVENT_HEADER_EXTENDED_DATA_ITEM_DEF
typedef struct _EVENT_HEADER_EXTENDED_DATA_ITEM { typedef struct _EVENT_HEADER_EXTENDED_DATA_ITEM {
USHORT Reserved1; // Reserved for internal use USHORT Reserved1; // Reserved for internal use
USHORT ExtType; // Extended info type USHORT ExtType; // Extended info type
struct { struct {
USHORT Linkage : 1; // Indicates additional extended USHORT Linkage : 1; // Indicates additional extended
// data item // data item
USHORT Reserved2 : 15; USHORT Reserved2 : 15;
}; };
USHORT DataSize; // Size of extended info data USHORT DataSize; // Size of extended info data
ULONGLONG DataPtr; // Pointer to extended info data ULONGLONG DataPtr; // Pointer to extended info data
} EVENT_HEADER_EXTENDED_DATA_ITEM, *PEVENT_HEADER_EXTENDED_DATA_ITEM; } EVENT_HEADER_EXTENDED_DATA_ITEM, *PEVENT_HEADER_EXTENDED_DATA_ITEM;
#endif
// //
// Structures for extended items. // Structures for extended items.
// //
typedef struct _EVENT_EXTENDED_ITEM_INSTANCE { typedef struct _EVENT_EXTENDED_ITEM_INSTANCE {
ULONG InstanceId; ULONG InstanceId;
ULONG ParentInstanceId; ULONG ParentInstanceId;
GUID ParentGuid; GUID ParentGuid;
} EVENT_EXTENDED_ITEM_INSTANCE, *PEVENT_EXTENDED_ITEM_INSTANCE; } EVENT_EXTENDED_ITEM_INSTANCE, *PEVENT_EXTENDED_ITEM_INSTANCE;
typedef struct _EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID { typedef struct _EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID {
GUID RelatedActivityId; GUID RelatedActivityId;
} EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID, *PEVENT_EXTENDED_ITEM_RELATED_ACTIVITY ID; } EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID, *PEVENT_EXTENDED_ITEM_RELATED_ACTIVITY ID;
typedef struct _EVENT_EXTENDED_ITEM_TS_ID { typedef struct _EVENT_EXTENDED_ITEM_TS_ID {
ULONG SessionId; ULONG SessionId;
} EVENT_EXTENDED_ITEM_TS_ID, *PEVENT_EXTENDED_ITEM_TS_ID; } EVENT_EXTENDED_ITEM_TS_ID, *PEVENT_EXTENDED_ITEM_TS_ID;
typedef struct _EVENT_EXTENDED_ITEM_STACK_TRACE32 { typedef struct _EVENT_EXTENDED_ITEM_STACK_TRACE32 {
ULONG64 MatchId; ULONG64 MatchId;
ULONG Address[ANYSIZE_ARRAY]; ULONG Address[ANYSIZE_ARRAY];
} EVENT_EXTENDED_ITEM_STACK_TRACE32, *PEVENT_EXTENDED_ITEM_STACK_TRACE32; } EVENT_EXTENDED_ITEM_STACK_TRACE32, *PEVENT_EXTENDED_ITEM_STACK_TRACE32;
typedef struct _EVENT_EXTENDED_ITEM_STACK_TRACE64 { typedef struct _EVENT_EXTENDED_ITEM_STACK_TRACE64 {
ULONG64 MatchId; ULONG64 MatchId;
ULONG64 Address[ANYSIZE_ARRAY]; ULONG64 Address[ANYSIZE_ARRAY];
} EVENT_EXTENDED_ITEM_STACK_TRACE64, *PEVENT_EXTENDED_ITEM_STACK_TRACE64; } EVENT_EXTENDED_ITEM_STACK_TRACE64, *PEVENT_EXTENDED_ITEM_STACK_TRACE64;
typedef struct _EVENT_EXTENDED_ITEM_PEBS_INDEX {
ULONG64 PebsIndex;
} EVENT_EXTENDED_ITEM_PEBS_INDEX, *PEVENT_EXTENDED_ITEM_PEBS_INDEX;
typedef struct _EVENT_EXTENDED_ITEM_PMC_COUNTERS {
ULONG64 Counter[ANYSIZE_ARRAY];
} EVENT_EXTENDED_ITEM_PMC_COUNTERS, *PEVENT_EXTENDED_ITEM_PMC_COUNTERS;
typedef struct _EVENT_EXTENDED_ITEM_PROCESS_START_KEY {
ULONG64 ProcessStartKey;
} EVENT_EXTENDED_ITEM_PROCESS_START_KEY, *PEVENT_EXTENDED_ITEM_PROCESS_START_KEY
;
#define EVENT_HEADER_PROPERTY_XML 0x0001 #define EVENT_HEADER_PROPERTY_XML 0x0001
#define EVENT_HEADER_PROPERTY_FORWARDED_XML 0x0002 #define EVENT_HEADER_PROPERTY_FORWARDED_XML 0x0002
#define EVENT_HEADER_PROPERTY_LEGACY_EVENTLOG 0x0004 #define EVENT_HEADER_PROPERTY_LEGACY_EVENTLOG 0x0004
#define EVENT_HEADER_FLAG_EXTENDED_INFO 0x0001 #define EVENT_HEADER_FLAG_EXTENDED_INFO 0x0001
#define EVENT_HEADER_FLAG_PRIVATE_SESSION 0x0002 #define EVENT_HEADER_FLAG_PRIVATE_SESSION 0x0002
#define EVENT_HEADER_FLAG_STRING_ONLY 0x0004 #define EVENT_HEADER_FLAG_STRING_ONLY 0x0004
#define EVENT_HEADER_FLAG_TRACE_MESSAGE 0x0008 #define EVENT_HEADER_FLAG_TRACE_MESSAGE 0x0008
#define EVENT_HEADER_FLAG_NO_CPUTIME 0x0010 #define EVENT_HEADER_FLAG_NO_CPUTIME 0x0010
#define EVENT_HEADER_FLAG_32_BIT_HEADER 0x0020 #define EVENT_HEADER_FLAG_32_BIT_HEADER 0x0020
#define EVENT_HEADER_FLAG_64_BIT_HEADER 0x0040 #define EVENT_HEADER_FLAG_64_BIT_HEADER 0x0040
#define EVENT_HEADER_FLAG_CLASSIC_HEADER 0x0100 #define EVENT_HEADER_FLAG_CLASSIC_HEADER 0x0100
#define EVENT_HEADER_FLAG_PROCESSOR_INDEX 0x0200
#ifndef EVENT_HEADER_DEF
#define EVENT_HEADER_DEF
typedef struct _EVENT_HEADER { typedef struct _EVENT_HEADER {
USHORT Size; // Event Size USHORT Size; // Event Size
USHORT HeaderType; // Header Type USHORT HeaderType; // Header Type
USHORT Flags; // Flags USHORT Flags; // Flags
USHORT EventProperty; // User given event property USHORT EventProperty; // User given event property
ULONG ThreadId; // Thread Id ULONG ThreadId; // Thread Id
ULONG ProcessId; // Process Id ULONG ProcessId; // Process Id
LARGE_INTEGER TimeStamp; // Event Timestamp LARGE_INTEGER TimeStamp; // Event Timestamp
GUID ProviderId; // Provider Id GUID ProviderId; // Provider Id
skipping to change at line 127 skipping to change at line 155
struct { struct {
ULONG KernelTime; // Kernel Mode CPU ticks ULONG KernelTime; // Kernel Mode CPU ticks
ULONG UserTime; // User mode CPU ticks ULONG UserTime; // User mode CPU ticks
} DUMMYSTRUCTNAME; } DUMMYSTRUCTNAME;
ULONG64 ProcessorTime; // Processor Clock ULONG64 ProcessorTime; // Processor Clock
// for private session events // for private session events
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
GUID ActivityId; // Activity Id GUID ActivityId; // Activity Id
} EVENT_HEADER, *PEVENT_HEADER; } EVENT_HEADER, *PEVENT_HEADER;
#endif
#ifndef EVENT_RECORD_DEF
#define EVENT_RECORD_DEF
typedef struct _EVENT_RECORD { typedef struct _EVENT_RECORD {
EVENT_HEADER EventHeader; // Event header EVENT_HEADER EventHeader; // Event header
ETW_BUFFER_CONTEXT BufferContext; // Buffer context ETW_BUFFER_CONTEXT BufferContext; // Buffer context
USHORT ExtendedDataCount; // Number of extended USHORT ExtendedDataCount; // Number of extended
// data items // data items
USHORT UserDataLength; // User data length USHORT UserDataLength; // User data length
PEVENT_HEADER_EXTENDED_DATA_ITEM // Pointer to an array of PEVENT_HEADER_EXTENDED_DATA_ITEM // Pointer to an array of
ExtendedData; // extended data items ExtendedData; // extended data items
PVOID UserData; // Pointer to user data PVOID UserData; // Pointer to user data
PVOID UserContext; // Context from OpenTrace PVOID UserContext; // Context from OpenTrace
} EVENT_RECORD, *PEVENT_RECORD; } EVENT_RECORD, *PEVENT_RECORD;
typedef const EVENT_RECORD *PCEVENT_RECORD;
#endif
#define EVENT_ENABLE_PROPERTY_SID 0x00000001 #define EVENT_ENABLE_PROPERTY_SID 0x00000001
#define EVENT_ENABLE_PROPERTY_TS_ID 0x00000002 #define EVENT_ENABLE_PROPERTY_TS_ID 0x00000002
#define EVENT_ENABLE_PROPERTY_STACK_TRACE 0x00000004 #define EVENT_ENABLE_PROPERTY_STACK_TRACE 0x00000004
#define EVENT_ENABLE_PROPERTY_PSM_KEY 0x00000008
#define EVENT_ENABLE_PROPERTY_IGNORE_KEYWORD_0 0x00000010
#define EVENT_ENABLE_PROPERTY_PROVIDER_GROUP 0x00000020
#define EVENT_ENABLE_PROPERTY_ENABLE_KEYWORD_0 0x00000040
#define EVENT_ENABLE_PROPERTY_PROCESS_START_KEY 0x00000080
// //
// Consumer API // Consumer API
// //
#define PROCESS_TRACE_MODE_REAL_TIME 0x00000100 #define PROCESS_TRACE_MODE_REAL_TIME 0x00000100
#define PROCESS_TRACE_MODE_RAW_TIMESTAMP 0x00001000 #define PROCESS_TRACE_MODE_RAW_TIMESTAMP 0x00001000
#define PROCESS_TRACE_MODE_EVENT_RECORD 0x10000000 #define PROCESS_TRACE_MODE_EVENT_RECORD 0x10000000
FORCEINLINE
ULONG
GetEventProcessorIndex (
_In_ PCEVENT_RECORD EventRecord
)
{
if ((EventRecord->EventHeader.Flags & EVENT_HEADER_FLAG_PROCESSOR_INDEX) !=
0) {
return EventRecord->BufferContext.ProcessorIndex;
} else {
return EventRecord->BufferContext.ProcessorNumber;
}
}
//
// Provider Trait APIs
//
typedef enum {
EtwProviderTraitTypeGroup = 1,
EtwProviderTraitTypeMax
} ETW_PROVIDER_TRAIT_TYPE;
__inline
VOID
EtwGetTraitFromProviderTraits(
_In_ PVOID ProviderTraits,
_In_ UCHAR TraitType,
_Out_ PVOID* Trait,
_Out_ PUSHORT Size
)
{
USHORT const ByteCount = *(USHORT UNALIGNED*)ProviderTraits;
PUCHAR Ptr = (PUCHAR)ProviderTraits;
UCHAR const* PtrEnd = Ptr + ByteCount;
*Trait = NULL;
*Size = 0;
//
// Abort on invalid size.
//
if (ByteCount < 3) {
return;
}
//
// Skip byte counts
//
Ptr += 2;
//
// Skip the Provider Name, including the Null termination
//
Ptr += strnlen((PCSTR)Ptr, ByteCount - 3u);
Ptr += 1;
//
// Loop through the rest of the traits until one of the
// desired type is located.
//
while (Ptr < PtrEnd) {
USHORT const TraitByteCount = *(USHORT const UNALIGNED*)Ptr;
//
// Abort on invalid trait size.
//
if (TraitByteCount < 3) {
return;
}
if ((Ptr[2] == TraitType) &&
(Ptr + TraitByteCount <= PtrEnd)) {
*Trait = (PVOID)(Ptr + 3);
*Size = TraitByteCount - 3u;
return;
}
Ptr += TraitByteCount;
}
return;
}
// //
// Event Security APIs // Event Security APIs
// //
typedef enum { typedef enum {
EventSecuritySetDACL, EventSecuritySetDACL,
EventSecuritySetSACL, EventSecuritySetSACL,
EventSecurityAddDACL, EventSecurityAddDACL,
EventSecurityAddSACL, EventSecurityAddSACL,
EventSecurityMax EventSecurityMax
skipping to change at line 181 skipping to change at line 310
IN PSID Sid, IN PSID Sid,
IN ULONG Rights, IN ULONG Rights,
IN BOOLEAN AllowOrDeny IN BOOLEAN AllowOrDeny
); );
#endif #endif
#if (WINVER >= _WIN32_WINNT_LONGHORN) #if (WINVER >= _WIN32_WINNT_LONGHORN)
ULONG ULONG
EVNTAPI EVNTAPI
EventAccessQuery( EventAccessQuery(
__in LPGUID Guid, _In_ LPGUID Guid,
__out_bcount_opt(*BufferSize) PSECURITY_DESCRIPTOR Buffer, _Out_writes_bytes_opt_(*BufferSize) PSECURITY_DESCRIPTOR Buffer,
__inout PULONG BufferSize _Inout_ PULONG BufferSize
); );
#endif #endif
#if (WINVER >= _WIN32_WINNT_LONGHORN) #if (WINVER >= _WIN32_WINNT_LONGHORN)
ULONG ULONG
EVNTAPI EVNTAPI
EventAccessRemove( EventAccessRemove(
IN LPGUID Guid IN LPGUID Guid
); );
#endif #endif
skipping to change at line 207 skipping to change at line 336
#pragma warning(pop) // restore 4201,4214 #pragma warning(pop) // restore 4201,4214
#else #else
#pragma warning(default:4201) // nonstandard extension used : nameless struct/un ion #pragma warning(default:4201) // nonstandard extension used : nameless struct/un ion
#pragma warning(default:4214) // nonstandard extension used : bit field types ot her then int #pragma warning(default:4214) // nonstandard extension used : bit field types ot her then int
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif #endif
 End of changes. 16 change blocks. 
8 lines changed or deleted 143 lines changed or added


 evntprov.h (6.1.7601.23418-Windows_7.0)   evntprov.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 22 skipping to change at line 22
This defines the unified provider side user mode API. This defines the unified provider side user mode API.
Revision History: Revision History:
--*/ --*/
#ifndef _EVNTPROV_H_ #ifndef _EVNTPROV_H_
#define _EVNTPROV_H_ #define _EVNTPROV_H_
#pragma once #pragma once
#include <winapifamily.h>
#ifndef EVNTAPI #ifndef EVNTAPI
#ifndef MIDL_PASS #ifndef MIDL_PASS
#ifdef _EVNT_SOURCE_ #ifdef _EVNT_SOURCE_
#define EVNTAPI __stdcall #define EVNTAPI __stdcall
#else #else
#define EVNTAPI DECLSPEC_IMPORT __stdcall #define EVNTAPI DECLSPEC_IMPORT __stdcall
#endif // _EVNT_SOURCE_ #endif // _EVNT_SOURCE_
#endif // MIDL_PASS #endif // MIDL_PASS
#endif // EVNTAPI #endif // EVNTAPI
skipping to change at line 50 skipping to change at line 51
#define EVENT_ACTIVITY_CTRL_GET_ID (1) #define EVENT_ACTIVITY_CTRL_GET_ID (1)
#define EVENT_ACTIVITY_CTRL_SET_ID (2) #define EVENT_ACTIVITY_CTRL_SET_ID (2)
#define EVENT_ACTIVITY_CTRL_CREATE_ID (3) #define EVENT_ACTIVITY_CTRL_CREATE_ID (3)
#define EVENT_ACTIVITY_CTRL_GET_SET_ID (4) #define EVENT_ACTIVITY_CTRL_GET_SET_ID (4)
#define EVENT_ACTIVITY_CTRL_CREATE_SET_ID (5) #define EVENT_ACTIVITY_CTRL_CREATE_SET_ID (5)
typedef ULONGLONG REGHANDLE, *PREGHANDLE; typedef ULONGLONG REGHANDLE, *PREGHANDLE;
#define MAX_EVENT_DATA_DESCRIPTORS (128) #define MAX_EVENT_DATA_DESCRIPTORS (128)
#define MAX_EVENT_FILTER_DATA_SIZE (1024) #define MAX_EVENT_FILTER_DATA_SIZE (1024)
#define MAX_EVENT_FILTER_PAYLOAD_SIZE (4096)
//
// MAX_EVENT_FILTERS_COUNT is the maximum count of filters
// that can be provided.
//
#define MAX_EVENT_FILTERS_COUNT (8)
#define MAX_EVENT_FILTER_PID_COUNT (8)
#define MAX_EVENT_FILTER_EVENT_ID_COUNT (64)
#define EVENT_FILTER_TYPE_NONE (0x00000000)
#define EVENT_FILTER_TYPE_SCHEMATIZED (0x80000000) #define EVENT_FILTER_TYPE_SCHEMATIZED (0x80000000)
#define EVENT_FILTER_TYPE_SYSTEM_FLAGS (0x80000001)
#define EVENT_FILTER_TYPE_TRACEHANDLE (0x80000002)
#define EVENT_FILTER_TYPE_PID (0x80000004)
#define EVENT_FILTER_TYPE_EXECUTABLE_NAME (0x80000008)
#define EVENT_FILTER_TYPE_PACKAGE_ID (0x80000010)
#define EVENT_FILTER_TYPE_PACKAGE_APP_ID (0x80000020) // Package Relative A
pp Id (PRAID)
#define EVENT_FILTER_TYPE_PAYLOAD (0x80000100)
#define EVENT_FILTER_TYPE_EVENT_ID (0x80000200)
#define EVENT_FILTER_TYPE_STACKWALK (0x80001000)
#define EVENT_DATA_DESCRIPTOR_TYPE_NONE (0)
#define EVENT_DATA_DESCRIPTOR_TYPE_EVENT_METADATA (1)
#define EVENT_DATA_DESCRIPTOR_TYPE_PROVIDER_METADATA (2)
// #define EVENT_DATA_DESCRIPTOR_TYPE_TIMESTAMP_OVERRIDE (3) // Win10+ only
#pragma warning(push)
#pragma warning(disable:4201)
// //
// EVENT_DATA_DESCRIPTOR is used to pass in user data items // EVENT_DATA_DESCRIPTOR is used to pass in user data items
// in events. // in events.
// //
typedef struct _EVENT_DATA_DESCRIPTOR { typedef struct _EVENT_DATA_DESCRIPTOR {
ULONGLONG Ptr; // Pointer to data ULONGLONG Ptr; // Pointer to data
ULONG Size; // Size of data in bytes ULONG Size; // Size of data in bytes
ULONG Reserved; union {
ULONG Reserved;
struct {
UCHAR Type;
UCHAR Reserved1;
USHORT Reserved2;
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
} EVENT_DATA_DESCRIPTOR, *PEVENT_DATA_DESCRIPTOR; } EVENT_DATA_DESCRIPTOR, *PEVENT_DATA_DESCRIPTOR;
#pragma warning(pop)
#ifndef EVENT_DESCRIPTOR_DEF
#define EVENT_DESCRIPTOR_DEF
// //
// EVENT_DESCRIPTOR describes and categorizes an event. // EVENT_DESCRIPTOR describes and categorizes an event.
// //
typedef struct _EVENT_DESCRIPTOR { typedef struct _EVENT_DESCRIPTOR {
USHORT Id; USHORT Id;
UCHAR Version; UCHAR Version;
UCHAR Channel; UCHAR Channel;
UCHAR Level; UCHAR Level;
UCHAR Opcode; UCHAR Opcode;
USHORT Task; USHORT Task;
ULONGLONG Keyword; ULONGLONG Keyword;
} EVENT_DESCRIPTOR, *PEVENT_DESCRIPTOR; } EVENT_DESCRIPTOR, *PEVENT_DESCRIPTOR;
typedef const EVENT_DESCRIPTOR *PCEVENT_DESCRIPTOR; typedef const EVENT_DESCRIPTOR *PCEVENT_DESCRIPTOR;
#endif
// //
// EVENT_FILTER_DESCRIPTOR is used to pass in enable filter // EVENT_FILTER_DESCRIPTOR is used to pass in enable filter
// data item to a user callback function. // data item to a user callback function.
// //
typedef struct _EVENT_FILTER_DESCRIPTOR { typedef struct _EVENT_FILTER_DESCRIPTOR {
ULONGLONG Ptr; ULONGLONG Ptr;
ULONG Size; ULONG Size;
ULONG Type; ULONG Type;
skipping to change at line 105 skipping to change at line 145
USHORT Id; USHORT Id;
UCHAR Version; UCHAR Version;
UCHAR Reserved[5]; UCHAR Reserved[5];
ULONGLONG InstanceId; ULONGLONG InstanceId;
ULONG Size; ULONG Size;
ULONG NextOffset; ULONG NextOffset;
} EVENT_FILTER_HEADER, *PEVENT_FILTER_HEADER; } EVENT_FILTER_HEADER, *PEVENT_FILTER_HEADER;
//
// EVENT_FILTER_EVENT_ID is used to pass EventId filter for
// stack walk filters.
//
typedef struct _EVENT_FILTER_EVENT_ID {
BOOLEAN FilterIn;
UCHAR Reserved;
USHORT Count;
USHORT Events[ANYSIZE_ARRAY];
} EVENT_FILTER_EVENT_ID, *PEVENT_FILTER_EVENT_ID;
#ifndef MIDL_PASS
typedef enum _EVENT_INFO_CLASS {
EventProviderBinaryTrackInfo,
// Enum value 1 is an available reserved value. It was used
// temporarily in development but removed prior to release.
EventProviderSetTraits = 2,
EventProviderUseDescriptorType,
MaxEventInfo
} EVENT_INFO_CLASS;
#ifndef _ETW_KM_ #ifndef _ETW_KM_
// //
// Optional callback function that users provide // Optional callback function that users provide
// //
typedef typedef
VOID VOID
(NTAPI *PENABLECALLBACK) ( (NTAPI *PENABLECALLBACK) (
__in LPCGUID SourceId, _In_ LPCGUID SourceId,
__in ULONG IsEnabled, _In_ ULONG IsEnabled,
__in UCHAR Level, _In_ UCHAR Level,
__in ULONGLONG MatchAnyKeyword, _In_ ULONGLONG MatchAnyKeyword,
__in ULONGLONG MatchAllKeyword, _In_ ULONGLONG MatchAllKeyword,
__in_opt PEVENT_FILTER_DESCRIPTOR FilterData, _In_opt_ PEVENT_FILTER_DESCRIPTOR FilterData,
__inout_opt PVOID CallbackContext _Inout_opt_ PVOID CallbackContext
); );
#ifndef _APISET_EVENTING
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Registration APIs // Registration APIs
// //
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
ULONG ULONG
EVNTAPI EVNTAPI
EventRegister( EventRegister(
__in LPCGUID ProviderId, _In_ LPCGUID ProviderId,
__in_opt PENABLECALLBACK EnableCallback, _In_opt_ PENABLECALLBACK EnableCallback,
__in_opt PVOID CallbackContext, _In_opt_ PVOID CallbackContext,
__out PREGHANDLE RegHandle _Out_ PREGHANDLE RegHandle
); );
#endif #endif
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
ULONG ULONG
EVNTAPI EVNTAPI
EventUnregister( EventUnregister(
__in REGHANDLE RegHandle _In_ REGHANDLE RegHandle
);
#endif
#if (WINVER >= _WIN32_WINNT_WIN8)
ULONG
EVNTAPI
EventSetInformation(
_In_ REGHANDLE RegHandle,
_In_ EVENT_INFO_CLASS InformationClass,
_In_reads_bytes_(InformationLength) PVOID EventInformation,
_In_ ULONG InformationLength
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// //
// Control (Is Enabled) APIs // Control (Is Enabled) APIs
// //
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
BOOLEAN BOOLEAN
EVNTAPI EVNTAPI
EventEnabled( EventEnabled(
__in REGHANDLE RegHandle, _In_ REGHANDLE RegHandle,
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
); );
#endif #endif
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
BOOLEAN BOOLEAN
EVNTAPI EVNTAPI
EventProviderEnabled( EventProviderEnabled(
__in REGHANDLE RegHandle, _In_ REGHANDLE RegHandle,
__in UCHAR Level, _In_ UCHAR Level,
__in ULONGLONG Keyword _In_ ULONGLONG Keyword
); );
#endif #endif
// //
// Writing (Publishing/Logging) APIs // Writing (Publishing/Logging) APIs
// //
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
ULONG ULONG
EVNTAPI EVNTAPI
EventWrite( EventWrite(
__in REGHANDLE RegHandle, _In_ REGHANDLE RegHandle,
__in PCEVENT_DESCRIPTOR EventDescriptor, _In_ PCEVENT_DESCRIPTOR EventDescriptor,
__in ULONG UserDataCount, _In_ ULONG UserDataCount,
__in_ecount_opt(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData
); );
#endif #endif
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
ULONG ULONG
EVNTAPI EVNTAPI
EventWriteTransfer( EventWriteTransfer(
__in REGHANDLE RegHandle, _In_ REGHANDLE RegHandle,
__in PCEVENT_DESCRIPTOR EventDescriptor, _In_ PCEVENT_DESCRIPTOR EventDescriptor,
__in_opt LPCGUID ActivityId, _In_opt_ LPCGUID ActivityId,
__in_opt LPCGUID RelatedActivityId, _In_opt_ LPCGUID RelatedActivityId,
__in ULONG UserDataCount, _In_ ULONG UserDataCount,
__in_ecount_opt(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_WIN7) #if (WINVER >= _WIN32_WINNT_WIN7)
ULONG ULONG
EVNTAPI EVNTAPI
EventWriteEx( EventWriteEx(
__in REGHANDLE RegHandle, _In_ REGHANDLE RegHandle,
__in PCEVENT_DESCRIPTOR EventDescriptor, _In_ PCEVENT_DESCRIPTOR EventDescriptor,
__in ULONG64 Filter, _In_ ULONG64 Filter,
__in ULONG Flags, _In_ ULONG Flags,
__in_opt LPCGUID ActivityId, _In_opt_ LPCGUID ActivityId,
__in_opt LPCGUID RelatedActivityId, _In_opt_ LPCGUID RelatedActivityId,
__in ULONG UserDataCount, _In_ ULONG UserDataCount,
__in_ecount_opt(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData
); );
#endif #endif
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
ULONG ULONG
EVNTAPI EVNTAPI
EventWriteString( EventWriteString(
__in REGHANDLE RegHandle, _In_ REGHANDLE RegHandle,
__in UCHAR Level, _In_ UCHAR Level,
__in ULONGLONG Keyword, _In_ ULONGLONG Keyword,
__in PCWSTR String _In_ PCWSTR String
); );
#endif #endif
// //
// ActivityId Control APIs // ActivityId Control APIs
// //
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
ULONG ULONG
EVNTAPI EVNTAPI
EventActivityIdControl( EventActivityIdControl(
__in ULONG ControlCode, _In_ ULONG ControlCode,
__inout LPGUID ActivityId _Inout_ LPGUID ActivityId
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _APISET_EVENTING
#endif // _ETW_KM_ #endif // _ETW_KM_
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Macros to create Event and Event Data Descriptors // Macros to create Event and Event Data Descriptors
// //
FORCEINLINE FORCEINLINE
VOID VOID
EventDataDescCreate( EventDataDescCreate(
__out PEVENT_DATA_DESCRIPTOR EventDataDescriptor, _Out_ PEVENT_DATA_DESCRIPTOR EventDataDescriptor,
__in const VOID* DataPtr, _In_reads_bytes_(DataSize) const VOID* DataPtr,
__in ULONG DataSize _In_ ULONG DataSize
) )
{ {
EventDataDescriptor->Ptr = (ULONGLONG)(ULONG_PTR)DataPtr; EventDataDescriptor->Ptr = (ULONGLONG)(ULONG_PTR)DataPtr;
EventDataDescriptor->Size = DataSize; EventDataDescriptor->Size = DataSize;
EventDataDescriptor->Reserved = 0; EventDataDescriptor->Reserved = 0;
return; return;
} }
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
FORCEINLINE FORCEINLINE
VOID VOID
EventDescCreate( EventDescCreate(
__out PEVENT_DESCRIPTOR EventDescriptor, _Out_ PEVENT_DESCRIPTOR EventDescriptor,
__in USHORT Id, _In_ USHORT Id,
__in UCHAR Version, _In_ UCHAR Version,
__in UCHAR Channel, _In_ UCHAR Channel,
__in UCHAR Level, _In_ UCHAR Level,
__in USHORT Task, _In_ USHORT Task,
__in UCHAR Opcode, _In_ UCHAR Opcode,
__in ULONGLONG Keyword _In_ ULONGLONG Keyword
) )
{ {
EventDescriptor->Id = Id; EventDescriptor->Id = Id;
EventDescriptor->Version = Version; EventDescriptor->Version = Version;
EventDescriptor->Channel = Channel; EventDescriptor->Channel = Channel;
EventDescriptor->Level = Level; EventDescriptor->Level = Level;
EventDescriptor->Task = Task; EventDescriptor->Task = Task;
EventDescriptor->Opcode = Opcode; EventDescriptor->Opcode = Opcode;
EventDescriptor->Keyword = Keyword; EventDescriptor->Keyword = Keyword;
return; return;
} }
FORCEINLINE FORCEINLINE
VOID VOID
EventDescZero( EventDescZero(
__out PEVENT_DESCRIPTOR EventDescriptor _Out_ PEVENT_DESCRIPTOR EventDescriptor
) )
{ {
memset(EventDescriptor, 0, sizeof(EVENT_DESCRIPTOR)); memset(EventDescriptor, 0, sizeof(EVENT_DESCRIPTOR));
return; return;
} }
// //
// Macros to extract info from an Event Descriptor // Macros to extract info from an Event Descriptor
// //
FORCEINLINE FORCEINLINE
USHORT USHORT
EventDescGetId( EventDescGetId(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Id); return (EventDescriptor->Id);
} }
FORCEINLINE FORCEINLINE
UCHAR UCHAR
EventDescGetVersion( EventDescGetVersion(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Version); return (EventDescriptor->Version);
} }
FORCEINLINE FORCEINLINE
USHORT USHORT
EventDescGetTask( EventDescGetTask(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Task); return (EventDescriptor->Task);
} }
FORCEINLINE FORCEINLINE
UCHAR UCHAR
EventDescGetOpcode( EventDescGetOpcode(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Opcode); return (EventDescriptor->Opcode);
} }
FORCEINLINE FORCEINLINE
UCHAR UCHAR
EventDescGetChannel( EventDescGetChannel(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Channel); return (EventDescriptor->Channel);
} }
FORCEINLINE FORCEINLINE
UCHAR UCHAR
EventDescGetLevel( EventDescGetLevel(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Level); return (EventDescriptor->Level);
} }
FORCEINLINE FORCEINLINE
ULONGLONG ULONGLONG
EventDescGetKeyword( EventDescGetKeyword(
__in PCEVENT_DESCRIPTOR EventDescriptor _In_ PCEVENT_DESCRIPTOR EventDescriptor
) )
{ {
return (EventDescriptor->Keyword); return (EventDescriptor->Keyword);
} }
// //
// Macros to set info into an Event Descriptor // Macros to set info into an Event Descriptor
// //
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetId( EventDescSetId(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in USHORT Id _In_ USHORT Id
) )
{ {
EventDescriptor->Id = Id; EventDescriptor->Id = Id;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetVersion( EventDescSetVersion(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in UCHAR Version _In_ UCHAR Version
) )
{ {
EventDescriptor->Version = Version; EventDescriptor->Version = Version;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetTask( EventDescSetTask(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in USHORT Task _In_ USHORT Task
) )
{ {
EventDescriptor->Task = Task; EventDescriptor->Task = Task;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetOpcode( EventDescSetOpcode(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in UCHAR Opcode _In_ UCHAR Opcode
) )
{ {
EventDescriptor->Opcode = Opcode; EventDescriptor->Opcode = Opcode;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetLevel( EventDescSetLevel(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in UCHAR Level _In_ UCHAR Level
) )
{ {
EventDescriptor->Level = Level; EventDescriptor->Level = Level;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetChannel( EventDescSetChannel(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in UCHAR Channel _In_ UCHAR Channel
) )
{ {
EventDescriptor->Channel = Channel; EventDescriptor->Channel = Channel;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescSetKeyword( EventDescSetKeyword(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in ULONGLONG Keyword _In_ ULONGLONG Keyword
) )
{ {
EventDescriptor->Keyword = Keyword; EventDescriptor->Keyword = Keyword;
return (EventDescriptor); return (EventDescriptor);
} }
FORCEINLINE FORCEINLINE
PEVENT_DESCRIPTOR PEVENT_DESCRIPTOR
EventDescOrKeyword( EventDescOrKeyword(
__in PEVENT_DESCRIPTOR EventDescriptor, _In_ PEVENT_DESCRIPTOR EventDescriptor,
__in ULONGLONG Keyword _In_ ULONGLONG Keyword
) )
{ {
EventDescriptor->Keyword |= Keyword; EventDescriptor->Keyword |= Keyword;
return (EventDescriptor); return (EventDescriptor);
} }
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // MIDL_PASS
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 46 change blocks. 
79 lines changed or deleted 196 lines changed or added


 evntrace.h (6.1.7601.23418-Windows_7.0)   evntrace.h (6.3.9600.17415-Windows_8.1) 
#include <winapifamily.h>
/*++ /*++
Copyright (c) Microsoft Corporation. All rights reserved. Copyright (c) Microsoft Corporation. All rights reserved.
Module Name: Module Name:
EvnTrace.h EvnTrace.h
Abstract: Abstract:
skipping to change at line 22 skipping to change at line 24
consumers and providers consumers and providers
--*/ --*/
#ifndef _EVNTRACE_ #ifndef _EVNTRACE_
#define _EVNTRACE_ #define _EVNTRACE_
#pragma once #pragma once
#if defined(_WINNT_) || defined(WINNT) #if defined(_WINNT_) || defined(WINNT)
#if !defined(NO_ETW_APP_DEPRECATION_WARNINGS)
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WI
NAPI_PARTITION_DESKTOP)
#define ETW_APP_DECLSPEC_DEPRECATED __declspec(deprecated("This API is not recom
mended for general usage in Windows Store Apps and may not be supported in futur
e versions of Windows"))
#else
#define ETW_APP_DECLSPEC_DEPRECATED
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTIT
ION(WINAPI_PARTITION_DESKTOP)
#else
#define ETW_APP_DECLSPEC_DEPRECATED
#endif // NO_ETW_APP_DEPRECATION_WARNINGS
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#ifndef WMIAPI #ifndef WMIAPI
#ifndef MIDL_PASS #ifndef MIDL_PASS
#ifdef _WMI_SOURCE_ #ifdef _WMI_SOURCE_
#define WMIAPI __stdcall #define WMIAPI __stdcall
#else #else
#define WMIAPI DECLSPEC_IMPORT __stdcall #define WMIAPI DECLSPEC_IMPORT __stdcall
#endif // _WMI_SOURCE #endif // _WMI_SOURCE
#endif // MIDL_PASS #endif // MIDL_PASS
#endif // WMIAPI #endif // WMIAPI
#include <guiddef.h> #include <guiddef.h>
#if defined(_NTDDK_) || defined(_NTIFS_) || defined(_WMIKM_)
#define _EVNTRACE_KERNEL_MODE
#endif
#if !defined(_EVNTRACE_KERNEL_MODE)
#include <wmistr.h>
#endif
// //
// EventTraceGuid is used to identify a event tracing session // EventTraceGuid is used to identify a event tracing session
// //
DEFINE_GUID ( /* 68fdd900-4a3e-11d1-84f4-0000f80464e3 */ DEFINE_GUID ( /* 68fdd900-4a3e-11d1-84f4-0000f80464e3 */
EventTraceGuid, EventTraceGuid,
0x68fdd900, 0x68fdd900,
0x4a3e, 0x4a3e,
0x11d1, 0x11d1,
0x84, 0xf4, 0x00, 0x00, 0xf8, 0x04, 0x64, 0xe3 0x84, 0xf4, 0x00, 0x00, 0xf8, 0x04, 0x64, 0xe3
); );
skipping to change at line 96 skipping to change at line 127
#define EVENT_LOGGER_NAMEA "EventLog" #define EVENT_LOGGER_NAMEA "EventLog"
#define DIAG_LOGGER_NAMEA "DiagLog" #define DIAG_LOGGER_NAMEA "DiagLog"
#define MAX_MOF_FIELDS 16 // Limit of USE_MOF_PTR fields #define MAX_MOF_FIELDS 16 // Limit of USE_MOF_PTR fields
#ifndef _TRACEHANDLE_DEFINED #ifndef _TRACEHANDLE_DEFINED
#define _TRACEHANDLE_DEFINED #define _TRACEHANDLE_DEFINED
typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE; typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
#endif #endif
//types for event data going to System Event Logger //types for event data going to System Event Logger
#define SYSTEM_EVENT_TYPE 1 #define SYSTEM_EVENT_TYPE 1
// //
// predefined generic event types (0x00 to 0x09 reserved). // predefined generic event types (0x00 to 0x09 reserved).
// //
#define EVENT_TRACE_TYPE_INFO 0x00 // Info or point event #define EVENT_TRACE_TYPE_INFO 0x00 // Info or point event
#define EVENT_TRACE_TYPE_START 0x01 // Start event #define EVENT_TRACE_TYPE_START 0x01 // Start event
#define EVENT_TRACE_TYPE_END 0x02 // End event #define EVENT_TRACE_TYPE_END 0x02 // End event
#define EVENT_TRACE_TYPE_STOP 0x02 // Stop event (WinEvent compat ible) #define EVENT_TRACE_TYPE_STOP 0x02 // Stop event (WinEvent compat ible)
skipping to change at line 147 skipping to change at line 178
#define TRACE_LEVEL_RESERVED6 6 #define TRACE_LEVEL_RESERVED6 6
#define TRACE_LEVEL_RESERVED7 7 #define TRACE_LEVEL_RESERVED7 7
#define TRACE_LEVEL_RESERVED8 8 #define TRACE_LEVEL_RESERVED8 8
#define TRACE_LEVEL_RESERVED9 9 #define TRACE_LEVEL_RESERVED9 9
// //
// Event types for Process & Threads // Event types for Process & Threads
// //
#define EVENT_TRACE_TYPE_LOAD 0x0A // Load image #define EVENT_TRACE_TYPE_LOAD 0x0A // Load image
#define EVENT_TRACE_TYPE_TERMINATE 0x0B // Terminate Process
// //
// Event types for IO subsystem // Event types for IO subsystem
// //
#define EVENT_TRACE_TYPE_IO_READ 0x0A #define EVENT_TRACE_TYPE_IO_READ 0x0A
#define EVENT_TRACE_TYPE_IO_WRITE 0x0B #define EVENT_TRACE_TYPE_IO_WRITE 0x0B
#define EVENT_TRACE_TYPE_IO_READ_INIT 0x0C #define EVENT_TRACE_TYPE_IO_READ_INIT 0x0C
#define EVENT_TRACE_TYPE_IO_WRITE_INIT 0x0D #define EVENT_TRACE_TYPE_IO_WRITE_INIT 0x0D
#define EVENT_TRACE_TYPE_IO_FLUSH 0x0E #define EVENT_TRACE_TYPE_IO_FLUSH 0x0E
#define EVENT_TRACE_TYPE_IO_FLUSH_INIT 0x0F #define EVENT_TRACE_TYPE_IO_FLUSH_INIT 0x0F
#define EVENT_TRACE_TYPE_IO_REDIRECTED_INIT 0x10
// //
// Event types for Memory subsystem // Event types for Memory subsystem
// //
#define EVENT_TRACE_TYPE_MM_TF 0x0A // Transition fault #define EVENT_TRACE_TYPE_MM_TF 0x0A // Transition fault
#define EVENT_TRACE_TYPE_MM_DZF 0x0B // Demand Zero fault #define EVENT_TRACE_TYPE_MM_DZF 0x0B // Demand Zero fault
#define EVENT_TRACE_TYPE_MM_COW 0x0C // Copy on Write #define EVENT_TRACE_TYPE_MM_COW 0x0C // Copy on Write
#define EVENT_TRACE_TYPE_MM_GPF 0x0D // Guard Page fault #define EVENT_TRACE_TYPE_MM_GPF 0x0D // Guard Page fault
#define EVENT_TRACE_TYPE_MM_HPF 0x0E // Hard page fault #define EVENT_TRACE_TYPE_MM_HPF 0x0E // Hard page fault
skipping to change at line 196 skipping to change at line 229
#define EVENT_TRACE_TYPE_ACKDUP 0x16 // A Duplicate data ACK #define EVENT_TRACE_TYPE_ACKDUP 0x16 // A Duplicate data ACK
// //
// Event Types for the Header (to handle internal event headers) // Event Types for the Header (to handle internal event headers)
// //
#define EVENT_TRACE_TYPE_GUIDMAP 0x0A #define EVENT_TRACE_TYPE_GUIDMAP 0x0A
#define EVENT_TRACE_TYPE_CONFIG 0x0B #define EVENT_TRACE_TYPE_CONFIG 0x0B
#define EVENT_TRACE_TYPE_SIDINFO 0x0C #define EVENT_TRACE_TYPE_SIDINFO 0x0C
#define EVENT_TRACE_TYPE_SECURITY 0x0D #define EVENT_TRACE_TYPE_SECURITY 0x0D
#define EVENT_TRACE_TYPE_DBGID_RSDS 0x40
// //
// Event Types for Registry subsystem // Event Types for Registry subsystem
// //
#define EVENT_TRACE_TYPE_REGCREATE 0x0A // NtCreateKey #define EVENT_TRACE_TYPE_REGCREATE 0x0A // NtCreateKey
#define EVENT_TRACE_TYPE_REGOPEN 0x0B // NtOpenKey #define EVENT_TRACE_TYPE_REGOPEN 0x0B // NtOpenKey
#define EVENT_TRACE_TYPE_REGDELETE 0x0C // NtDeleteKey #define EVENT_TRACE_TYPE_REGDELETE 0x0C // NtDeleteKey
#define EVENT_TRACE_TYPE_REGQUERY 0x0D // NtQueryKey #define EVENT_TRACE_TYPE_REGQUERY 0x0D // NtQueryKey
#define EVENT_TRACE_TYPE_REGSETVALUE 0x0E // NtSetValueKey #define EVENT_TRACE_TYPE_REGSETVALUE 0x0E // NtSetValueKey
skipping to change at line 237 skipping to change at line 271
// Event types for system configuration records // Event types for system configuration records
// //
#define EVENT_TRACE_TYPE_CONFIG_CPU 0x0A // CPU Configuration #define EVENT_TRACE_TYPE_CONFIG_CPU 0x0A // CPU Configuration
#define EVENT_TRACE_TYPE_CONFIG_PHYSICALDISK 0x0B // Physical Disk Config uration #define EVENT_TRACE_TYPE_CONFIG_PHYSICALDISK 0x0B // Physical Disk Config uration
#define EVENT_TRACE_TYPE_CONFIG_LOGICALDISK 0x0C // Logical Disk Configu ration #define EVENT_TRACE_TYPE_CONFIG_LOGICALDISK 0x0C // Logical Disk Configu ration
#define EVENT_TRACE_TYPE_CONFIG_NIC 0x0D // NIC Configuration #define EVENT_TRACE_TYPE_CONFIG_NIC 0x0D // NIC Configuration
#define EVENT_TRACE_TYPE_CONFIG_VIDEO 0x0E // Video Adapter Config uration #define EVENT_TRACE_TYPE_CONFIG_VIDEO 0x0E // Video Adapter Config uration
#define EVENT_TRACE_TYPE_CONFIG_SERVICES 0x0F // Active Services #define EVENT_TRACE_TYPE_CONFIG_SERVICES 0x0F // Active Services
#define EVENT_TRACE_TYPE_CONFIG_POWER 0x10 // ACPI Configuration #define EVENT_TRACE_TYPE_CONFIG_POWER 0x10 // ACPI Configuration
#define EVENT_TRACE_TYPE_CONFIG_NETINFO 0x11 // Networking Configura tion #define EVENT_TRACE_TYPE_CONFIG_NETINFO 0x11 // Networking Configura tion
#define EVENT_TRACE_TYPE_CONFIG_OPTICALMEDIA 0x12 // Optical Media Config uration
#define EVENT_TRACE_TYPE_CONFIG_IRQ 0x15 // IRQ assigned to devi ces #define EVENT_TRACE_TYPE_CONFIG_IRQ 0x15 // IRQ assigned to devi ces
#define EVENT_TRACE_TYPE_CONFIG_PNP 0x16 // PnP device info #define EVENT_TRACE_TYPE_CONFIG_PNP 0x16 // PnP device info
#define EVENT_TRACE_TYPE_CONFIG_IDECHANNEL 0x17 // Primary/Secondary ID E channel Configuration #define EVENT_TRACE_TYPE_CONFIG_IDECHANNEL 0x17 // Primary/Secondary ID E channel Configuration
#define EVENT_TRACE_TYPE_CONFIG_NUMANODE 0x18 // Numa configuration
#define EVENT_TRACE_TYPE_CONFIG_PLATFORM 0x19 // Platform Configurati on #define EVENT_TRACE_TYPE_CONFIG_PLATFORM 0x19 // Platform Configurati on
#define EVENT_TRACE_TYPE_CONFIG_PROCESSORGROUP 0x1A // Processor Group Conf
iguration
#define EVENT_TRACE_TYPE_CONFIG_PROCESSORNUMBER 0x1B // ProcessorIndex -> Pr
ocNumber mapping
#define EVENT_TRACE_TYPE_CONFIG_DPI 0x1C // Display DPI Configur
ation
#define EVENT_TRACE_TYPE_CONFIG_CI_INFO 0x1D // Display System Code
Integrity Information
//
// Event types for Optical IO subsystem
//
#define EVENT_TRACE_TYPE_OPTICAL_IO_READ 0x37
#define EVENT_TRACE_TYPE_OPTICAL_IO_WRITE 0x38
#define EVENT_TRACE_TYPE_OPTICAL_IO_FLUSH 0x39
#define EVENT_TRACE_TYPE_OPTICAL_IO_READ_INIT 0x3a
#define EVENT_TRACE_TYPE_OPTICAL_IO_WRITE_INIT 0x3b
#define EVENT_TRACE_TYPE_OPTICAL_IO_FLUSH_INIT 0x3c
//
// Event types for Filter Manager
//
#define EVENT_TRACE_TYPE_FLT_PREOP_INIT 0x60 // Minifilter preop initi
ation
#define EVENT_TRACE_TYPE_FLT_POSTOP_INIT 0x61 // Minifilter postop init
iation
#define EVENT_TRACE_TYPE_FLT_PREOP_COMPLETION 0x62 // Minifilter preop compl
etion
#define EVENT_TRACE_TYPE_FLT_POSTOP_COMPLETION 0x63 // Minifilter postop comp
letion
#define EVENT_TRACE_TYPE_FLT_PREOP_FAILURE 0x64 // Minifilter failed preo
p
#define EVENT_TRACE_TYPE_FLT_POSTOP_FAILURE 0x65 // Minifilter failed post
op
// //
// Enable flags for Kernel Events // Enable flags for Kernel Events
// //
#define EVENT_TRACE_FLAG_PROCESS 0x00000001 // process start & end #define EVENT_TRACE_FLAG_PROCESS 0x00000001 // process start & end
#define EVENT_TRACE_FLAG_THREAD 0x00000002 // thread start & end #define EVENT_TRACE_FLAG_THREAD 0x00000002 // thread start & end
#define EVENT_TRACE_FLAG_IMAGE_LOAD 0x00000004 // image load #define EVENT_TRACE_FLAG_IMAGE_LOAD 0x00000004 // image load
#define EVENT_TRACE_FLAG_DISK_IO 0x00000100 // physical disk IO #define EVENT_TRACE_FLAG_DISK_IO 0x00000100 // physical disk IO
#define EVENT_TRACE_FLAG_DISK_FILE_IO 0x00000200 // requires disk IO #define EVENT_TRACE_FLAG_DISK_FILE_IO 0x00000200 // requires disk IO
skipping to change at line 287 skipping to change at line 348
#define EVENT_TRACE_FLAG_FILE_IO 0x02000000 // file IO #define EVENT_TRACE_FLAG_FILE_IO 0x02000000 // file IO
#define EVENT_TRACE_FLAG_FILE_IO_INIT 0x04000000 // file IO initiation #define EVENT_TRACE_FLAG_FILE_IO_INIT 0x04000000 // file IO initiation
// //
// Enable flags for Kernel Events on Win7 and above // Enable flags for Kernel Events on Win7 and above
// //
#define EVENT_TRACE_FLAG_DISPATCHER 0x00000800 // scheduler (ReadyThrea d) #define EVENT_TRACE_FLAG_DISPATCHER 0x00000800 // scheduler (ReadyThrea d)
#define EVENT_TRACE_FLAG_VIRTUAL_ALLOC 0x00004000 // VM operations #define EVENT_TRACE_FLAG_VIRTUAL_ALLOC 0x00004000 // VM operations
// //
// Enable flags for Kernel Events on Win8 and above
//
#define EVENT_TRACE_FLAG_VAMAP 0x00008000 // map/unmap (excluding
images)
#define EVENT_TRACE_FLAG_NO_SYSCONFIG 0x10000000 // Do not do sys config
rundown
//
// Pre-defined Enable flags for everybody else // Pre-defined Enable flags for everybody else
// //
#define EVENT_TRACE_FLAG_EXTENSION 0x80000000 // Indicates more flags #define EVENT_TRACE_FLAG_EXTENSION 0x80000000 // Indicates more flags
#define EVENT_TRACE_FLAG_FORWARD_WMI 0x40000000 // Can forward to WMI #define EVENT_TRACE_FLAG_FORWARD_WMI 0x40000000 // Can forward to WMI
#define EVENT_TRACE_FLAG_ENABLE_RESERVE 0x20000000 // Reserved #define EVENT_TRACE_FLAG_ENABLE_RESERVE 0x20000000 // Reserved
// //
// Logger Mode flags // Logger Mode flags
// //
#define EVENT_TRACE_FILE_MODE_NONE 0x00000000 // Logfile is off #define EVENT_TRACE_FILE_MODE_NONE 0x00000000 // Logfile is off
skipping to change at line 317 skipping to change at line 384
#define EVENT_TRACE_USE_GLOBAL_SEQUENCE 0x00004000 // Use global sequence n o. #define EVENT_TRACE_USE_GLOBAL_SEQUENCE 0x00004000 // Use global sequence n o.
#define EVENT_TRACE_USE_LOCAL_SEQUENCE 0x00008000 // Use local sequence no . #define EVENT_TRACE_USE_LOCAL_SEQUENCE 0x00008000 // Use local sequence no .
#define EVENT_TRACE_RELOG_MODE 0x00010000 // Relogger #define EVENT_TRACE_RELOG_MODE 0x00010000 // Relogger
#define EVENT_TRACE_USE_PAGED_MEMORY 0x01000000 // Use pageable buffers #define EVENT_TRACE_USE_PAGED_MEMORY 0x01000000 // Use pageable buffers
// //
// Logger Mode flags on XP and above // Logger Mode flags on XP and above
// //
#define EVENT_TRACE_FILE_MODE_NEWFILE 0x00000008 // Auto-switch log file #define EVENT_TRACE_FILE_MODE_NEWFILE 0x00000008 // Auto-switch log file
#define EVENT_TRACE_FILE_MODE_PREALLOCATE 0x00000020 // Pre-allocate mode #define EVENT_TRACE_FILE_MODE_PREALLOCATE 0x00000020 // Pre-allocate mode
// //
// Logger Mode flags on Vista and above // Logger Mode flags on Vista and above
// //
#define EVENT_TRACE_NONSTOPPABLE_MODE 0x00000040 // Session cannot be sto pped (Autologger only) #define EVENT_TRACE_NONSTOPPABLE_MODE 0x00000040 // Session cannot be sto pped (Autologger only)
#define EVENT_TRACE_SECURE_MODE 0x00000080 // Secure session #define EVENT_TRACE_SECURE_MODE 0x00000080 // Secure session
#define EVENT_TRACE_USE_KBYTES_FOR_SIZE 0x00002000 // Use KBytes as file si ze unit #define EVENT_TRACE_USE_KBYTES_FOR_SIZE 0x00002000 // Use KBytes as file si ze unit
#define EVENT_TRACE_PRIVATE_IN_PROC 0x00020000 // In process private lo gger #define EVENT_TRACE_PRIVATE_IN_PROC 0x00020000 // In process private lo gger
#define EVENT_TRACE_MODE_RESERVED 0x00100000 // Reserved bit, used to signal Heap/Critsec tracing #define EVENT_TRACE_MODE_RESERVED 0x00100000 // Reserved bit, used to signal Heap/Critsec tracing
// //
// Logger Mode flags on Win7 and above // Logger Mode flags on Win7 and above
// //
#define EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING 0x10000000 // Use this for l
ow frequency sessions. #define EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING 0x10000000 // Use this for low f
requency sessions.
//
// Logger Mode flags on Win8 and above
//
#define EVENT_TRACE_SYSTEM_LOGGER_MODE 0x02000000 // Receive events from S
ystemTraceProvider
#define EVENT_TRACE_ADDTO_TRIAGE_DUMP 0x80000000 // Add ETW buffers to tr
iage dumps
#define EVENT_TRACE_STOP_ON_HYBRID_SHUTDOWN 0x00400000 // Stop on hybrid shutdo
wn
#define EVENT_TRACE_PERSIST_ON_HYBRID_SHUTDOWN 0x00800000 // Persist on hybrid s
hutdown
//
// Logger Mode flags on Blue and above
//
#define EVENT_TRACE_INDEPENDENT_SESSION_MODE 0x08000000 // Independent logger
session
// //
// ControlTrace Codes // ControlTrace Codes
// //
#define EVENT_TRACE_CONTROL_QUERY 0 #define EVENT_TRACE_CONTROL_QUERY 0
#define EVENT_TRACE_CONTROL_STOP 1 #define EVENT_TRACE_CONTROL_STOP 1
#define EVENT_TRACE_CONTROL_UPDATE 2 #define EVENT_TRACE_CONTROL_UPDATE 2
// //
// Flush ControlTrace Codes for XP and above // Flush ControlTrace Codes for XP and above
// //
#define EVENT_TRACE_CONTROL_FLUSH 3 // Flushes all the buffers #define EVENT_TRACE_CONTROL_FLUSH 3 // Flushes all the buffers
// //
// Flags used by WMI Trace Message // Flags used by WMI Trace Message
// Note that the order or value of these flags should NOT be changed as they are processed // Note that the order or value of these flags should NOT be changed as they are processed
// in this order. // in this order.
// //
#define TRACE_MESSAGE_SEQUENCE 1 // Message should include a seque nce number #define TRACE_MESSAGE_SEQUENCE 1 // Message should include a seque nce number
#define TRACE_MESSAGE_GUID 2 // Message includes a GUID #define TRACE_MESSAGE_GUID 2 // Message includes a GUID
#define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Component ID instead #define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Component ID instead
skipping to change at line 362 skipping to change at line 450
#define TRACE_MESSAGE_GUID 2 // Message includes a GUID #define TRACE_MESSAGE_GUID 2 // Message includes a GUID
#define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Component ID instead #define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Component ID instead
#define TRACE_MESSAGE_TIMESTAMP 8 // Message includes a timestamp #define TRACE_MESSAGE_TIMESTAMP 8 // Message includes a timestamp
#define TRACE_MESSAGE_PERFORMANCE_TIMESTAMP 16 // *Obsolete* Clock type is contr olled by the logger #define TRACE_MESSAGE_PERFORMANCE_TIMESTAMP 16 // *Obsolete* Clock type is contr olled by the logger
#define TRACE_MESSAGE_SYSTEMINFO 32 // Message includes system inform ation TID,PID #define TRACE_MESSAGE_SYSTEMINFO 32 // Message includes system inform ation TID,PID
// //
// Vista flags set by system to indicate provider pointer size. // Vista flags set by system to indicate provider pointer size.
// //
#define TRACE_MESSAGE_POINTER32 0x0040 // Message logged by 32 bit #define TRACE_MESSAGE_POINTER32 0x0040 // Message logged by 32 bit pro
provider vider
#define TRACE_MESSAGE_POINTER64 0x0080 // Message logged by 64 bit #define TRACE_MESSAGE_POINTER64 0x0080 // Message logged by 64 bit pro
provider vider
#define TRACE_MESSAGE_FLAG_MASK 0xFFFF // Only the lower 16 bits of fl
ags are placed in the message
// those above 16 bits are rese
rved for local processing
//
// Maximum size allowed for a single TraceMessage message.
//
// N.B. This limit was increased from 8K to 64K in Win8.
//
#define TRACE_MESSAGE_MAXIMUM_SIZE (64 * 1024)
#define TRACE_MESSAGE_FLAG_MASK 0xFFFF // Only the lower 16 bits of fla
gs are placed in the message
// those above 16 bits are reser
ved for local processing
#define TRACE_MESSAGE_MAXIMUM_SIZE 8*1024 // the maximum size allowed for
a single trace message
// longer messages will return E
RROR_BUFFER_OVERFLOW
// //
// Flags to indicate to consumer which fields // Flags to indicate to consumer which fields
// in the EVENT_TRACE_HEADER are valid // in the EVENT_TRACE_HEADER are valid
// //
#define EVENT_TRACE_USE_PROCTIME 0x0001 // ProcessorTime field is va lid #define EVENT_TRACE_USE_PROCTIME 0x0001 // ProcessorTime field is va lid
#define EVENT_TRACE_USE_NOCPUTIME 0x0002 // No Kernel/User/Processor Times #define EVENT_TRACE_USE_NOCPUTIME 0x0002 // No Kernel/User/Processor Times
// //
// TRACE_HEADER_FLAG values are used in the Flags field of EVENT_TRACE_HEADER // TRACE_HEADER_FLAG values are used in the Flags field of EVENT_TRACE_HEADER
skipping to change at line 532 skipping to change at line 626
(MOF)->DataPtr = (ULONG64)(ULONG_PTR) ptr; \ (MOF)->DataPtr = (ULONG64)(ULONG_PTR) ptr; \
(MOF)->Length = (ULONG) length; \ (MOF)->Length = (ULONG) length; \
(MOF)->DataType = (ULONG) type; (MOF)->DataType = (ULONG) type;
typedef struct _MOF_FIELD { typedef struct _MOF_FIELD {
ULONG64 DataPtr; // Pointer to the field. Up to 64-bits only ULONG64 DataPtr; // Pointer to the field. Up to 64-bits only
ULONG Length; // Length of the MOF field ULONG Length; // Length of the MOF field
ULONG DataType; // Type of data ULONG DataType; // Type of data
} MOF_FIELD, *PMOF_FIELD; } MOF_FIELD, *PMOF_FIELD;
#if !(defined(_NTDDK_) || defined(_NTIFS_)) || defined(_WMIKM_) #if !defined(_EVNTRACE_KERNEL_MODE) || defined(_WMIKM_)
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(push) #pragma warning(push)
#endif #endif
#pragma warning (disable:4201) /* nonstandard extension used : nameless struct/u nion */ #pragma warning (disable:4201) /* nonstandard extension used : nameless struct/u nion */
// //
// This is the header for every logfile. The memory for LoggerName // This is the header for every logfile. The memory for LoggerName
// and LogFileName must be contiguous adjacent to this structure // and LogFileName must be contiguous adjacent to this structure
// Allows both user-mode and kernel-mode to understand the header. // Allows both user-mode and kernel-mode to understand the header.
skipping to change at line 682 skipping to change at line 776
LARGE_INTEGER PerfFreq; // Reserved LARGE_INTEGER PerfFreq; // Reserved
LARGE_INTEGER StartTime; // Reserved LARGE_INTEGER StartTime; // Reserved
ULONG ReservedFlags; // ClockType ULONG ReservedFlags; // ClockType
ULONG BuffersLost; ULONG BuffersLost;
} TRACE_LOGFILE_HEADER64, *PTRACE_LOGFILE_HEADER64; } TRACE_LOGFILE_HEADER64, *PTRACE_LOGFILE_HEADER64;
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#endif // !_NTDDK_ || _WMIKM_ #endif // !_EVNTRACE_KERNEL_MODE || _WMIKM_
// //
// Instance Information to track parent child relationship of Instances. // Instance Information to track parent child relationship of Instances.
// //
typedef struct EVENT_INSTANCE_INFO { typedef struct EVENT_INSTANCE_INFO {
HANDLE RegHandle; HANDLE RegHandle;
ULONG InstanceId; ULONG InstanceId;
} EVENT_INSTANCE_INFO, *PEVENT_INSTANCE_INFO; } EVENT_INSTANCE_INFO, *PEVENT_INSTANCE_INFO;
#if !defined(_WMIKM_) && !defined(_NTDDK_) && !defined(_NTIFS_) #if !defined(_EVNTRACE_KERNEL_MODE)
// //
// Structures that have UNICODE and ANSI versions are defined here // Structures that have UNICODE and ANSI versions are defined here
// //
// //
// Logger configuration and running statistics. This structure is used // Logger configuration and running statistics. This structure is used
// by user-mode callers, such as PDH library // by user-mode callers, such as PDH library
// //
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning (disable:4201) /* nonstandard extension used : nameless struct/u
nion */
typedef struct _EVENT_TRACE_PROPERTIES { typedef struct _EVENT_TRACE_PROPERTIES {
WNODE_HEADER Wnode; WNODE_HEADER Wnode;
// //
// data provided by caller // data provided by caller
ULONG BufferSize; // buffer size for logging (kbytes) ULONG BufferSize; // buffer size for logging (kbytes)
ULONG MinimumBuffers; // minimum to preallocate ULONG MinimumBuffers; // minimum to preallocate
ULONG MaximumBuffers; // maximum buffers allowed ULONG MaximumBuffers; // maximum buffers allowed
ULONG MaximumFileSize; // maximum logfile size (in MBytes) ULONG MaximumFileSize; // maximum logfile size (in MBytes)
ULONG LogFileMode; // sequential, circular ULONG LogFileMode; // sequential, circular
ULONG FlushTimer; // buffer flush timer, in seconds ULONG FlushTimer; // buffer flush timer, in seconds
ULONG EnableFlags; // trace enable flags ULONG EnableFlags; // trace enable flags
LONG AgeLimit; // unused union {
LONG AgeLimit; // unused
LONG FlushThreshold; // Number of buffers to fill before flus
hing
} DUMMYUNIONNAME;
// data returned to caller // data returned to caller
ULONG NumberOfBuffers; // no of buffers in use ULONG NumberOfBuffers; // no of buffers in use
ULONG FreeBuffers; // no of buffers free ULONG FreeBuffers; // no of buffers free
ULONG EventsLost; // event records lost ULONG EventsLost; // event records lost
ULONG BuffersWritten; // no of buffers written to file ULONG BuffersWritten; // no of buffers written to file
ULONG LogBuffersLost; // no of logfile write failures ULONG LogBuffersLost; // no of logfile write failures
ULONG RealTimeBuffersLost; // no of rt delivery failures ULONG RealTimeBuffersLost; // no of rt delivery failures
HANDLE LoggerThreadId; // thread id of Logger HANDLE LoggerThreadId; // thread id of Logger
ULONG LogFileNameOffset; // Offset to LogFileName ULONG LogFileNameOffset; // Offset to LogFileName
ULONG LoggerNameOffset; // Offset to LoggerName ULONG LoggerNameOffset; // Offset to LoggerName
} EVENT_TRACE_PROPERTIES, *PEVENT_TRACE_PROPERTIES; } EVENT_TRACE_PROPERTIES, *PEVENT_TRACE_PROPERTIES;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
// //
// Data Provider structures // Data Provider structures
// //
// Used by RegisterTraceGuids() // Used by RegisterTraceGuids()
// //
typedef struct _TRACE_GUID_REGISTRATION { typedef struct _TRACE_GUID_REGISTRATION {
LPCGUID Guid; // Guid of data block being registered or updated. LPCGUID Guid; // Guid of data block being registered or updated.
HANDLE RegHandle; // Guid Registration Handle is returned. HANDLE RegHandle; // Guid Registration Handle is returned.
} TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION; } TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION;
// //
// Data consumer structures // Data consumer structures
// //
#endif // !_NTDDK_ || _WMIKM_ #endif // !_EVNTRACE_KERNEL_MODE
typedef struct _TRACE_GUID_PROPERTIES { typedef struct _TRACE_GUID_PROPERTIES {
GUID Guid; GUID Guid;
ULONG GuidType; ULONG GuidType;
ULONG LoggerId; ULONG LoggerId;
ULONG EnableLevel; ULONG EnableLevel;
ULONG EnableFlags; ULONG EnableFlags;
BOOLEAN IsEnable; BOOLEAN IsEnable;
} TRACE_GUID_PROPERTIES, *PTRACE_GUID_PROPERTIES; } TRACE_GUID_PROPERTIES, *PTRACE_GUID_PROPERTIES;
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning (disable:4201) /* nonstandard extension used : nameless struct/u
nion */
#ifndef ETW_BUFFER_CONTEXT_DEF
#define ETW_BUFFER_CONTEXT_DEF
typedef struct _ETW_BUFFER_CONTEXT { typedef struct _ETW_BUFFER_CONTEXT {
UCHAR ProcessorNumber; union {
UCHAR Alignment; struct {
UCHAR ProcessorNumber;
UCHAR Alignment;
} DUMMYSTRUCTNAME;
USHORT ProcessorIndex;
} DUMMYUNIONNAME;
USHORT LoggerId; USHORT LoggerId;
} ETW_BUFFER_CONTEXT, *PETW_BUFFER_CONTEXT; } ETW_BUFFER_CONTEXT, *PETW_BUFFER_CONTEXT;
#endif
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
// //
// Provider Information Flags used on Vista and above. // Provider Information Flags used on Vista and above.
// //
#define TRACE_PROVIDER_FLAG_LEGACY (0x00000001) #define TRACE_PROVIDER_FLAG_LEGACY (0x00000001)
#define TRACE_PROVIDER_FLAG_PRE_ENABLE (0x00000002) #define TRACE_PROVIDER_FLAG_PRE_ENABLE (0x00000002)
// //
// Enable Information for Provider Instance // Enable Information for Provider Instance
// Used on Vista and above // Used on Vista and above
skipping to change at line 802 skipping to change at line 925
} TRACE_PROVIDER_INSTANCE_INFO, *PTRACE_PROVIDER_INSTANCE_INFO; } TRACE_PROVIDER_INSTANCE_INFO, *PTRACE_PROVIDER_INSTANCE_INFO;
// //
// GUID Information Used on Vista and above // GUID Information Used on Vista and above
// //
typedef struct _TRACE_GUID_INFO { typedef struct _TRACE_GUID_INFO {
ULONG InstanceCount; ULONG InstanceCount;
ULONG Reserved; ULONG Reserved;
} TRACE_GUID_INFO, *PTRACE_GUID_INFO; } TRACE_GUID_INFO, *PTRACE_GUID_INFO;
typedef struct _PROFILE_SOURCE_INFO {
ULONG NextEntryOffset;
ULONG Source;
ULONG MinInterval;
ULONG MaxInterval;
ULONG64 Reserved;
WCHAR Description[ANYSIZE_ARRAY];
} PROFILE_SOURCE_INFO, *PPROFILE_SOURCE_INFO;
// //
// An EVENT_TRACE consists of a fixed header (EVENT_TRACE_HEADER) and // An EVENT_TRACE consists of a fixed header (EVENT_TRACE_HEADER) and
// optionally a variable portion pointed to by MofData. The datablock // optionally a variable portion pointed to by MofData. The datablock
// layout of the variable portion is unknown to the Logger and must // layout of the variable portion is unknown to the Logger and must
// be obtained from WBEM CIMOM database. // be obtained from WBEM CIMOM database.
// //
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(push) #pragma warning(push)
#endif #endif
skipping to change at line 833 skipping to change at line 965
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
} EVENT_TRACE, *PEVENT_TRACE; } EVENT_TRACE, *PEVENT_TRACE;
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#define EVENT_CONTROL_CODE_DISABLE_PROVIDER 0 #define EVENT_CONTROL_CODE_DISABLE_PROVIDER 0
#define EVENT_CONTROL_CODE_ENABLE_PROVIDER 1 #define EVENT_CONTROL_CODE_ENABLE_PROVIDER 1
#define EVENT_CONTROL_CODE_CAPTURE_STATE 2 #define EVENT_CONTROL_CODE_CAPTURE_STATE 2
#if !defined(_WMIKM_) && !defined(_NTDDK_) && !defined(_NTIFS_) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#if !defined(_EVNTRACE_KERNEL_MODE)
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
typedef struct _EVENT_RECORD typedef struct _EVENT_RECORD
EVENT_RECORD, *PEVENT_RECORD; EVENT_RECORD, *PEVENT_RECORD;
typedef struct _EVENT_TRACE_LOGFILEW typedef struct _EVENT_TRACE_LOGFILEW
EVENT_TRACE_LOGFILEW, *PEVENT_TRACE_LOGFILEW; EVENT_TRACE_LOGFILEW, *PEVENT_TRACE_LOGFILEW;
typedef struct _EVENT_TRACE_LOGFILEA typedef struct _EVENT_TRACE_LOGFILEA
EVENT_TRACE_LOGFILEA, *PEVENT_TRACE_LOGFILEA; EVENT_TRACE_LOGFILEA, *PEVENT_TRACE_LOGFILEA;
skipping to change at line 864 skipping to change at line 1002
// //
// Prototype for service request callback. Data providers register with WMI // Prototype for service request callback. Data providers register with WMI
// by passing a service request callback function that is called for all // by passing a service request callback function that is called for all
// wmi requests. // wmi requests.
typedef ULONG ( typedef ULONG (
#ifndef MIDL_PASS #ifndef MIDL_PASS
WINAPI WINAPI
#endif #endif
*WMIDPREQUEST)( *WMIDPREQUEST)(
__in WMIDPREQUESTCODE RequestCode, _In_ WMIDPREQUESTCODE RequestCode,
__in PVOID RequestContext, _In_ PVOID RequestContext,
__inout ULONG *BufferSize, _Inout_ ULONG *BufferSize,
__inout PVOID Buffer _Inout_ PVOID Buffer
); );
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(push) #pragma warning(push)
#endif #endif
#pragma warning (disable:4201) /* nonstandard extension used : nameless struct/u nion */ #pragma warning (disable:4201) /* nonstandard extension used : nameless struct/u nion */
struct _EVENT_TRACE_LOGFILEW { struct _EVENT_TRACE_LOGFILEW {
LPWSTR LogFileName; // Logfile Name LPWSTR LogFileName; // Logfile Name
LPWSTR LoggerName; // LoggerName LPWSTR LoggerName; // LoggerName
skipping to change at line 971 skipping to change at line 1109
#define PEVENT_TRACE_BUFFER_CALLBACK PEVENT_TRACE_BUFFER_CALLBACKA #define PEVENT_TRACE_BUFFER_CALLBACK PEVENT_TRACE_BUFFER_CALLBACKA
#define EVENT_TRACE_LOGFILE EVENT_TRACE_LOGFILEA #define EVENT_TRACE_LOGFILE EVENT_TRACE_LOGFILEA
#define PEVENT_TRACE_LOGFILE PEVENT_TRACE_LOGFILEA #define PEVENT_TRACE_LOGFILE PEVENT_TRACE_LOGFILEA
#define KERNEL_LOGGER_NAME KERNEL_LOGGER_NAMEA #define KERNEL_LOGGER_NAME KERNEL_LOGGER_NAMEA
#define GLOBAL_LOGGER_NAME GLOBAL_LOGGER_NAMEA #define GLOBAL_LOGGER_NAME GLOBAL_LOGGER_NAMEA
#define EVENT_LOGGER_NAME EVENT_LOGGER_NAMEA #define EVENT_LOGGER_NAME EVENT_LOGGER_NAMEA
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _APISET_EVENTING
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Logger control APIs // Logger control APIs
// //
// //
// Use the routine below to start an event trace session // Use the routine below to start an event trace session
// //
// ULONG // ULONG
// StartTrace( // StartTrace(
// __out PTRACEHANDLE TraceHandle, // _Out_ PTRACEHANDLE TraceHandle,
// __in LPTSTR InstanceName, // _In_ LPTSTR InstanceName,
// __inout PEVENT_TRACE_PROPERTIES Properties // _Inout_ PEVENT_TRACE_PROPERTIES Properties
// ); // );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
StartTraceW( StartTraceW (
__out PTRACEHANDLE TraceHandle, _Out_ PTRACEHANDLE TraceHandle,
__in LPCWSTR InstanceName, _In_ LPCWSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
StartTraceA( StartTraceA (
__out PTRACEHANDLE TraceHandle, _Out_ PTRACEHANDLE TraceHandle,
__in LPCSTR InstanceName, _In_ LPCSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Use the routine below to stop an event trace session // Use the routine below to stop an event trace session
// //
// //
// ULONG // ULONG
// StopTrace( // StopTrace(
// __in TRACEHANDLE TraceHandle, // _In_ TRACEHANDLE TraceHandle,
// __in_opt LPTSTR InstanceName, // _In_opt_ LPTSTR InstanceName,
// __inout PEVENT_TRACE_PROPERTIES Properties // _Inout_ PEVENT_TRACE_PROPERTIES Properties
// ); // );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
StopTraceW( StopTraceW (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCWSTR InstanceName, _In_opt_ LPCWSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
StopTraceA( StopTraceA (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCSTR InstanceName, _In_opt_ LPCSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Use the routine below to query the properties of an event trace session // Use the routine below to query the properties of an event trace session
// //
// ULONG // ULONG
// QueryTrace( // QueryTrace(
// __in TRACEHANDLE TraceHandle, // _In_ TRACEHANDLE TraceHandle,
// __in_opt LPTSTR InstanceName, // _In_opt_ LPTSTR InstanceName,
// __inout PEVENT_TRACE_PROPERTIES Properties // _Inout_ PEVENT_TRACE_PROPERTIES Properties
// ); // );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
QueryTraceW( QueryTraceW (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCWSTR InstanceName, _In_opt_ LPCWSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
QueryTraceA( QueryTraceA (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCSTR InstanceName, _In_opt_ LPCSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
// //
// Use the routine below to update certain properties of an event trace session // Use the routine below to update certain properties of an event trace session
// //
// ULONG // ULONG
// UpdateTrace( // UpdateTrace(
// __in PTRACEHANDLE TraceHandle, // _In_ PTRACEHANDLE TraceHandle,
// __in_opt LPTSTR InstanceName, // _In_opt_ LPTSTR InstanceName,
// __inout PEVENT_TRACE_PROPERTIES Properties // _Inout_ PEVENT_TRACE_PROPERTIES Properties
// ); // );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
UpdateTraceW( UpdateTraceW (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCWSTR InstanceName, _In_opt_ LPCWSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
UpdateTraceA( UpdateTraceA (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCSTR InstanceName, _In_opt_ LPCSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
// //
// Use the routine below to request that all active buffers an event trace // Use the routine below to request that all active buffers an event trace
// session be "flushed", or written out. // session be "flushed", or written out.
// //
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// ULONG // ULONG
// FlushTrace( // FlushTrace(
// __in TRACEHANDLE TraceHandle, // _In_ TRACEHANDLE TraceHandle,
// __in_opt LPTSTR InstanceName, // _In_opt_ LPTSTR InstanceName,
// __inout PEVENT_TRACE_PROPERTIES Properties // _Inout_ PEVENT_TRACE_PROPERTIES Properties
// ); // );
#if (WINVER >= _WIN32_WINNT_WINXP) #if (WINVER >= _WIN32_WINNT_WINXP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
FlushTraceW( FlushTraceW (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCWSTR InstanceName, _In_opt_ LPCWSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_WINXP) #if (WINVER >= _WIN32_WINNT_WINXP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
FlushTraceA( FlushTraceA (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCSTR InstanceName, _In_opt_ LPCSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties _Inout_ PEVENT_TRACE_PROPERTIES Properties
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Generic trace control routine // Generic trace control routine
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
ControlTraceW( ControlTraceW (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCWSTR InstanceName, _In_opt_ LPCWSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties, _Inout_ PEVENT_TRACE_PROPERTIES Properties,
__in ULONG ControlCode _In_ ULONG ControlCode
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
ControlTraceA( ControlTraceA (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in_opt LPCSTR InstanceName, _In_opt_ LPCSTR InstanceName,
__inout PEVENT_TRACE_PROPERTIES Properties, _Inout_ PEVENT_TRACE_PROPERTIES Properties,
__in ULONG ControlCode _In_ ULONG ControlCode
); );
// //
// ULONG // ULONG
// QueryAllTraces( // QueryAllTraces(
// __out_ecount(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray, // _Out_writes_(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray,
// __in ULONG PropertyArrayCount, // _In_ ULONG PropertyArrayCount,
// __out PULONG LoggerCount // _Out_ PULONG LoggerCount
// ); // );
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
QueryAllTracesW( QueryAllTracesW (
__out_ecount(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray, _Out_writes_(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray,
__in ULONG PropertyArrayCount, _In_ ULONG PropertyArrayCount,
__out PULONG LoggerCount _Out_ PULONG LoggerCount
); );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
QueryAllTracesA( QueryAllTracesA (
__out_ecount(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray, _Out_writes_(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray,
__in ULONG PropertyArrayCount, _In_ ULONG PropertyArrayCount,
__out PULONG LoggerCount _Out_ PULONG LoggerCount
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Data Provider Enable APIs // Data Provider Enable APIs
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
EnableTrace( EnableTrace (
__in ULONG Enable, _In_ ULONG Enable,
__in ULONG EnableFlag, _In_ ULONG EnableFlag,
__in ULONG EnableLevel, _In_ ULONG EnableLevel,
__in LPCGUID ControlGuid, _In_ LPCGUID ControlGuid,
__in TRACEHANDLE TraceHandle _In_ TRACEHANDLE TraceHandle
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#endif // _APISET_EVENTING
typedef struct _EVENT_FILTER_DESCRIPTOR typedef struct _EVENT_FILTER_DESCRIPTOR
EVENT_FILTER_DESCRIPTOR, *PEVENT_FILTER_DESCRIPTOR; EVENT_FILTER_DESCRIPTOR, *PEVENT_FILTER_DESCRIPTOR;
#ifndef _APISET_EVENTING
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
EnableTraceEx( EnableTraceEx (
__in LPCGUID ProviderId, _In_ LPCGUID ProviderId,
__in_opt LPCGUID SourceId, _In_opt_ LPCGUID SourceId,
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in ULONG IsEnabled, _In_ ULONG IsEnabled,
__in UCHAR Level, _In_ UCHAR Level,
__in ULONGLONG MatchAnyKeyword, _In_ ULONGLONG MatchAnyKeyword,
__in ULONGLONG MatchAllKeyword, _In_ ULONGLONG MatchAllKeyword,
__in ULONG EnableProperty, _In_ ULONG EnableProperty,
__in_opt PEVENT_FILTER_DESCRIPTOR EnableFilterDesc _In_opt_ PEVENT_FILTER_DESCRIPTOR EnableFilterDesc
); );
#endif #endif
#define ENABLE_TRACE_PARAMETERS_VERSION 1 #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _APISET_EVENTING
#define ENABLE_TRACE_PARAMETERS_VERSION 1
#define ENABLE_TRACE_PARAMETERS_VERSION_2 2
typedef struct _ENABLE_TRACE_PARAMETERS_V1 {
ULONG Version;
ULONG EnableProperty;
ULONG ControlFlags;
GUID SourceId;
PEVENT_FILTER_DESCRIPTOR EnableFilterDesc;
} ENABLE_TRACE_PARAMETERS_V1, *PENABLE_TRACE_PARAMETERS_V1;
typedef struct _ENABLE_TRACE_PARAMETERS { typedef struct _ENABLE_TRACE_PARAMETERS {
ULONG Version; ULONG Version;
ULONG EnableProperty; ULONG EnableProperty;
ULONG ControlFlags; ULONG ControlFlags;
GUID SourceId; GUID SourceId;
PEVENT_FILTER_DESCRIPTOR EnableFilterDesc; PEVENT_FILTER_DESCRIPTOR EnableFilterDesc;
ULONG FilterDescCount;
} ENABLE_TRACE_PARAMETERS, *PENABLE_TRACE_PARAMETERS; } ENABLE_TRACE_PARAMETERS, *PENABLE_TRACE_PARAMETERS;
#ifndef _APISET_EVENTING
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_WIN7) #if (WINVER >= _WIN32_WINNT_WIN7)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
EnableTraceEx2( EnableTraceEx2 (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in LPCGUID ProviderId, _In_ LPCGUID ProviderId,
__in ULONG ControlCode, _In_ ULONG ControlCode,
__in UCHAR Level, _In_ UCHAR Level,
__in ULONGLONG MatchAnyKeyword, _In_ ULONGLONG MatchAnyKeyword,
__in ULONGLONG MatchAllKeyword, _In_ ULONGLONG MatchAllKeyword,
__in ULONG Timeout, _In_ ULONG Timeout,
__in_opt PENABLE_TRACE_PARAMETERS EnableParameters _In_opt_ PENABLE_TRACE_PARAMETERS EnableParameters
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _APISET_EVENTING
typedef enum _TRACE_QUERY_INFO_CLASS { typedef enum _TRACE_QUERY_INFO_CLASS {
TraceGuidQueryList, TraceGuidQueryList,
TraceGuidQueryInfo, TraceGuidQueryInfo,
TraceGuidQueryProcess, TraceGuidQueryProcess,
TraceStackTracingInfo, // Win7 TraceStackTracingInfo, // Win7
TraceSystemTraceEnableFlagsInfo,
TraceSampledProfileIntervalInfo,
TraceProfileSourceConfigInfo,
TraceProfileSourceListInfo,
TracePmcEventListInfo,
TracePmcCounterListInfo,
TraceSetDisallowList,
MaxTraceSetInfoClass MaxTraceSetInfoClass
} TRACE_QUERY_INFO_CLASS, TRACE_INFO_CLASS; } TRACE_QUERY_INFO_CLASS, TRACE_INFO_CLASS;
#ifndef _APISET_EVENTING
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_VISTA) #if (WINVER >= _WIN32_WINNT_VISTA)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
EnumerateTraceGuidsEx( EnumerateTraceGuidsEx (
__in TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, _In_ TRACE_QUERY_INFO_CLASS TraceQueryInfoClass,
__in_bcount_opt(InBufferSize) PVOID InBuffer, _In_reads_bytes_opt_(InBufferSize) PVOID InBuffer,
__in ULONG InBufferSize, _In_ ULONG InBufferSize,
__out_bcount_opt(OutBufferSize) PVOID OutBuffer, _Out_writes_bytes_opt_(OutBufferSize) PVOID OutBuffer,
__in ULONG OutBufferSize, _In_ ULONG OutBufferSize,
__out PULONG ReturnLength _Out_ PULONG ReturnLength
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _APISET_EVENTING
typedef struct _CLASSIC_EVENT_ID { typedef struct _CLASSIC_EVENT_ID {
GUID EventGuid; GUID EventGuid;
UCHAR Type; UCHAR Type;
UCHAR Reserved[7]; UCHAR Reserved[7];
} CLASSIC_EVENT_ID, *PCLASSIC_EVENT_ID; } CLASSIC_EVENT_ID, *PCLASSIC_EVENT_ID;
typedef struct _TRACE_PROFILE_INTERVAL {
ULONG Source;
ULONG Interval;
} TRACE_PROFILE_INTERVAL, *PTRACE_PROFILE_INTERVAL;
#ifndef _APISET_EVENTING
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (WINVER >= _WIN32_WINNT_WIN7) #if (WINVER >= _WIN32_WINNT_WIN7)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
TraceSetInformation( TraceSetInformation (
__in TRACEHANDLE SessionHandle, _In_ TRACEHANDLE SessionHandle,
__in TRACE_INFO_CLASS InformationClass, _In_ TRACE_INFO_CLASS InformationClass,
__in_bcount(InformationLength) PVOID TraceInformation, _In_reads_bytes_(InformationLength) PVOID TraceInformation,
__in ULONG InformationLength _In_ ULONG InformationLength
);
#endif
#if (WINVER >= _WIN32_WINNT_WIN8)
EXTERN_C
ULONG
WMIAPI
TraceQueryInformation (
_In_ TRACEHANDLE SessionHandle,
_In_ TRACE_INFO_CLASS InformationClass,
_Out_writes_bytes_(InformationLength) PVOID TraceInformation,
_In_ ULONG InformationLength,
_Out_opt_ PULONG ReturnLength
); );
#endif #endif
// //
// Data Provider APIs // Data Provider APIs
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
CreateTraceInstanceId( CreateTraceInstanceId (
__in HANDLE RegHandle, _In_ HANDLE RegHandle,
__inout PEVENT_INSTANCE_INFO InstInfo _Inout_ PEVENT_INSTANCE_INFO InstInfo
); );
// //
// Use the routine below to generate and record an event trace // Use the routine below to generate and record an event trace
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
TraceEvent( TraceEvent (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in PEVENT_TRACE_HEADER EventTrace _In_ PEVENT_TRACE_HEADER EventTrace
); );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
TraceEventInstance( TraceEventInstance (
__in TRACEHANDLE TraceHandle, _In_ TRACEHANDLE TraceHandle,
__in PEVENT_INSTANCE_HEADER EventTrace, _In_ PEVENT_INSTANCE_HEADER EventTrace,
__in PEVENT_INSTANCE_INFO InstInfo, _In_ PEVENT_INSTANCE_INFO InstInfo,
__in_opt PEVENT_INSTANCE_INFO ParentInstInfo _In_opt_ PEVENT_INSTANCE_INFO ParentInstInfo
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
// //
// Use the routine below to register a guid for tracing. // Use the routine below to register a guid for tracing.
// //
// //
// ULONG // ULONG
// RegisterTraceGuids( // RegisterTraceGuids(
// __in WMIDPREQUEST RequestAddress, // _In_ WMIDPREQUEST RequestAddress,
// __in_opt PVOID RequestContext, // _In_opt_ PVOID RequestContext,
// __in LPCGUID ControlGuid, // _In_ LPCGUID ControlGuid,
// __in ULONG GuidCount, // _In_ ULONG GuidCount,
// __in_ecount_opt(GuidCount) PTRACE_GUID_REGISTRATION TraceGuidReg, // _In_reads_opt_(GuidCount) PTRACE_GUID_REGISTRATION TraceGuidReg,
// __in_opt LPCTSTR MofImagePath, // _In_opt_ LPCTSTR MofImagePath,
// __in_opt LPCTSTR MofResourceName, // _In_opt_ LPCTSTR MofResourceName,
// __out PTRACEHANDLE RegistrationHandle // _Out_ PTRACEHANDLE RegistrationHandle
// ); // );
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
RegisterTraceGuidsW( RegisterTraceGuidsW (
__in WMIDPREQUEST RequestAddress, _In_ WMIDPREQUEST RequestAddress,
__in_opt PVOID RequestContext, _In_opt_ PVOID RequestContext,
__in LPCGUID ControlGuid, _In_ LPCGUID ControlGuid,
__in ULONG GuidCount, _In_ ULONG GuidCount,
__in_ecount_opt(GuidCount) PTRACE_GUID_REGISTRATION TraceGuidReg, _In_reads_opt_(GuidCount) PTRACE_GUID_REGISTRATION TraceGuidReg,
__in_opt LPCWSTR MofImagePath, _In_opt_ LPCWSTR MofImagePath,
__in_opt LPCWSTR MofResourceName, _In_opt_ LPCWSTR MofResourceName,
__out PTRACEHANDLE RegistrationHandle _Out_ PTRACEHANDLE RegistrationHandle
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
RegisterTraceGuidsA( RegisterTraceGuidsA (
__in WMIDPREQUEST RequestAddress, _In_ WMIDPREQUEST RequestAddress,
__in_opt PVOID RequestContext, _In_opt_ PVOID RequestContext,
__in LPCGUID ControlGuid, _In_ LPCGUID ControlGuid,
__in ULONG GuidCount, _In_ ULONG GuidCount,
__in_ecount_opt(GuidCount) PTRACE_GUID_REGISTRATION TraceGuidReg, _In_reads_opt_(GuidCount) PTRACE_GUID_REGISTRATION TraceGuidReg,
__in_opt LPCSTR MofImagePath, _In_opt_ LPCSTR MofImagePath,
__in_opt LPCSTR MofResourceName, _In_opt_ LPCSTR MofResourceName,
__out PTRACEHANDLE RegistrationHandle _Out_ PTRACEHANDLE RegistrationHandle
); );
#if (WINVER >= _WIN32_WINNT_WINXP) #if (WINVER >= _WIN32_WINNT_WINXP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
EnumerateTraceGuids( EnumerateTraceGuids (
__inout_ecount(PropertyArrayCount) PTRACE_GUID_PROPERTIES *GuidPropertiesArr _Inout_updates_(PropertyArrayCount) PTRACE_GUID_PROPERTIES *GuidPropertiesAr
ay, ray,
__in ULONG PropertyArrayCount, _In_ ULONG PropertyArrayCount,
__out PULONG GuidCount _Out_ PULONG GuidCount
); );
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
UnregisterTraceGuids( UnregisterTraceGuids (
__in TRACEHANDLE RegistrationHandle _In_ TRACEHANDLE RegistrationHandle
); );
EXTERN_C EXTERN_C
TRACEHANDLE TRACEHANDLE
WMIAPI WMIAPI
GetTraceLoggerHandle( GetTraceLoggerHandle (
__in PVOID Buffer _In_ PVOID Buffer
); );
EXTERN_C EXTERN_C
UCHAR UCHAR
WMIAPI WMIAPI
GetTraceEnableLevel( GetTraceEnableLevel (
__in TRACEHANDLE TraceHandle _In_ TRACEHANDLE TraceHandle
); );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
GetTraceEnableFlags( GetTraceEnableFlags (
__in TRACEHANDLE TraceHandle _In_ TRACEHANDLE TraceHandle
); );
// //
// Data Consumer APIs and structures start here // Data Consumer APIs and structures start here
// //
// //
// TRACEHANDLE // TRACEHANDLE
// OpenTrace( // OpenTrace(
// __inout PEVENT_TRACE_LOGFILE Logfile // _Inout_ PEVENT_TRACE_LOGFILE Logfile
// ); // );
// //
ETW_APP_DECLSPEC_DEPRECATED
EXTERN_C EXTERN_C
TRACEHANDLE TRACEHANDLE
WMIAPI WMIAPI
OpenTraceA( OpenTraceW (
__inout PEVENT_TRACE_LOGFILEA Logfile _Inout_ PEVENT_TRACE_LOGFILEW Logfile
); );
ETW_APP_DECLSPEC_DEPRECATED
EXTERN_C EXTERN_C
TRACEHANDLE ULONG
WMIAPI WMIAPI
OpenTraceW( ProcessTrace (
__inout PEVENT_TRACE_LOGFILEW Logfile _In_reads_(HandleCount) PTRACEHANDLE HandleArray,
_In_ ULONG HandleCount,
_In_opt_ LPFILETIME StartTime,
_In_opt_ LPFILETIME EndTime
); );
ETW_APP_DECLSPEC_DEPRECATED
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
ProcessTrace( CloseTrace (
__in_ecount(HandleCount) PTRACEHANDLE HandleArray, _In_ TRACEHANDLE TraceHandle
__in ULONG HandleCount,
__in_opt LPFILETIME StartTime,
__in_opt LPFILETIME EndTime
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
//
// Data Consumer APIs and structures start here
//
//
// TRACEHANDLE
// OpenTrace(
// _Inout_ PEVENT_TRACE_LOGFILE Logfile
// );
//
EXTERN_C EXTERN_C
ULONG TRACEHANDLE
WMIAPI WMIAPI
CloseTrace( OpenTraceA (
__in TRACEHANDLE TraceHandle _Inout_ PEVENT_TRACE_LOGFILEA Logfile
); );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
SetTraceCallback( SetTraceCallback (
__in LPCGUID pGuid, _In_ LPCGUID pGuid,
__in PEVENT_CALLBACK EventCallback _In_ PEVENT_CALLBACK EventCallback
); );
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
RemoveTraceCallback ( RemoveTraceCallback (
__in LPCGUID pGuid _In_ LPCGUID pGuid
); );
// //
// The routines for tracing Messages follow // The routines for tracing Messages follow
// //
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
EXTERN_C EXTERN_C
ULONG ULONG
__cdecl __cdecl
TraceMessage( TraceMessage (
__in TRACEHANDLE LoggerHandle, _In_ TRACEHANDLE LoggerHandle,
__in ULONG MessageFlags, _In_ ULONG MessageFlags,
__in LPCGUID MessageGuid, _In_ LPCGUID MessageGuid,
__in USHORT MessageNumber, _In_ USHORT MessageNumber,
... ...
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
EXTERN_C EXTERN_C
ULONG ULONG
TraceMessageVa( TraceMessageVa (
__in TRACEHANDLE LoggerHandle, _In_ TRACEHANDLE LoggerHandle,
__in ULONG MessageFlags, _In_ ULONG MessageFlags,
__in LPCGUID MessageGuid, _In_ LPCGUID MessageGuid,
__in USHORT MessageNumber, _In_ USHORT MessageNumber,
__in va_list MessageArgList _In_ va_list MessageArgList
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _APISET_EVENTING
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define INVALID_PROCESSTRACE_HANDLE ((TRACEHANDLE)INVALID_HANDLE_VALUE) #define INVALID_PROCESSTRACE_HANDLE ((TRACEHANDLE)INVALID_HANDLE_VALUE)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#ifndef _APISET_EVENTING
// //
// //
// Define the encoding independent routines // Define the encoding independent routines
// //
#if defined(UNICODE) || defined(_UNICODE) #if defined(UNICODE) || defined(_UNICODE)
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define RegisterTraceGuids RegisterTraceGuidsW #define RegisterTraceGuids RegisterTraceGuidsW
#define StartTrace StartTraceW #define StartTrace StartTraceW
#define ControlTrace ControlTraceW #define ControlTrace ControlTraceW
#if defined(__TRACE_W2K_COMPATIBLE) #if defined(__TRACE_W2K_COMPATIBLE)
#define StopTrace(a,b,c) ControlTraceW((a),(b),(c), \ #define StopTrace(a,b,c) ControlTraceW((a),(b),(c), \
EVENT_TRACE_CONTROL_STOP) EVENT_TRACE_CONTROL_STOP)
#define QueryTrace(a,b,c) ControlTraceW((a),(b),(c), \ #define QueryTrace(a,b,c) ControlTraceW((a),(b),(c), \
EVENT_TRACE_CONTROL_QUERY) EVENT_TRACE_CONTROL_QUERY)
#define UpdateTrace(a,b,c) ControlTraceW((a),(b),(c), \ #define UpdateTrace(a,b,c) ControlTraceW((a),(b),(c), \
EVENT_TRACE_CONTROL_UPDATE) EVENT_TRACE_CONTROL_UPDATE)
#else #else
#define StopTrace StopTraceW #define StopTrace StopTraceW
#define QueryTrace QueryTraceW #define QueryTrace QueryTraceW
#define UpdateTrace UpdateTraceW #define UpdateTrace UpdateTraceW
#endif #endif
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
#define FlushTrace FlushTraceW #define FlushTrace FlushTraceW
#endif // NTDDI_VERSION >= NTDDI_WINXP #endif // NTDDI_VERSION >= NTDDI_WINXP
#define QueryAllTraces QueryAllTracesW #define QueryAllTraces QueryAllTracesW
#define OpenTrace OpenTraceW #define OpenTrace OpenTraceW
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#else #else
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define RegisterTraceGuids RegisterTraceGuidsA #define RegisterTraceGuids RegisterTraceGuidsA
#define StartTrace StartTraceA #define StartTrace StartTraceA
#define ControlTrace ControlTraceA #define ControlTrace ControlTraceA
#if defined(__TRACE_W2K_COMPATIBLE) #if defined(__TRACE_W2K_COMPATIBLE)
#define StopTrace(a,b,c) ControlTraceA((a),(b),(c), \ #define StopTrace(a,b,c) ControlTraceA((a),(b),(c), \
EVENT_TRACE_CONTROL_STOP) EVENT_TRACE_CONTROL_STOP)
#define QueryTrace(a,b,c) ControlTraceA((a),(b),(c), \ #define QueryTrace(a,b,c) ControlTraceA((a),(b),(c), \
EVENT_TRACE_CONTROL_QUERY) EVENT_TRACE_CONTROL_QUERY)
#define UpdateTrace(a,b,c) ControlTraceA((a),(b),(c), \ #define UpdateTrace(a,b,c) ControlTraceA((a),(b),(c), \
EVENT_TRACE_CONTROL_UPDATE) EVENT_TRACE_CONTROL_UPDATE)
#else #else
#define StopTrace StopTraceA #define StopTrace StopTraceA
#define QueryTrace QueryTraceA #define QueryTrace QueryTraceA
#define UpdateTrace UpdateTraceA #define UpdateTrace UpdateTraceA
#endif #endif
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
#define FlushTrace FlushTraceA #define FlushTrace FlushTraceA
#endif // NTDDI_VERSION >= NTDDI_WINXP #endif // NTDDI_VERSION >= NTDDI_WINXP
#define QueryAllTraces QueryAllTracesA #define QueryAllTraces QueryAllTracesA
#define OpenTrace OpenTraceA #define OpenTrace OpenTraceA
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // UNICODE #endif // UNICODE
#endif /* _WMIKM_ && _NTDDK_ */ #endif // _APISET_EVENTING
#endif // !_EVNTRACE_KERNEL_MODE
#endif // WINNT #endif // WINNT
#endif /* _EVNTRACE_ */ #endif /* _EVNTRACE_ */
 End of changes. 120 change blocks. 
222 lines changed or deleted 608 lines changed or added


 lmserver.h (6.1.7601.23418-Windows_7.0)   lmserver.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 33 skipping to change at line 33
on values defined in NETCONS.H. on values defined in NETCONS.H.
--*/ --*/
#ifndef _LMSERVER_ #ifndef _LMSERVER_
#define _LMSERVER_ #define _LMSERVER_
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif #endif
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <winsvc.h> // SERVICE_STATUS_HANDLE #include <winsvc.h> // SERVICE_STATUS_HANDLE
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <lmcons.h> #include <lmcons.h>
// //
// Function Prototypes - SERVER // Function Prototypes - SERVER
// //
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerEnum ( NetServerEnum (
__in_opt IN LMCSTR servername OPTIONAL, _In_opt_ IN LMCSTR servername OPTIONAL,
__in IN DWORD level, _In_ IN DWORD level,
__out OUT LPBYTE *bufptr, _Outptr_result_buffer_(_Inexpressible_(entriesread)) OUT LPBYTE *bufptr,
__in IN DWORD prefmaxlen, _In_ IN DWORD prefmaxlen,
__out OUT LPDWORD entriesread, _Out_ OUT LPDWORD entriesread,
__out OUT LPDWORD totalentries, _Out_ OUT LPDWORD totalentries,
__in IN DWORD servertype, _In_ IN DWORD servertype,
__in_opt IN LMCSTR domain OPTIONAL, _In_opt_ IN LMCSTR domain OPTIONAL,
__out_opt IN OUT LPDWORD resume_handle OPTIONAL _Out_opt_ IN OUT LPDWORD resume_handle OPTIONAL
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerEnumEx ( NetServerEnumEx (
__in_opt IN LMCSTR ServerName OPTIONAL, _In_opt_ IN LMCSTR ServerName OPTIONAL,
__in IN DWORD Level, _In_ IN DWORD Level,
__deref_out OUT LPBYTE *Bufptr, _Outptr_result_buffer_(_Inexpressible_(*EntriesRead))
__in IN DWORD PrefMaxlen, LPBYTE *Bufptr,
__out OUT LPDWORD EntriesRead, _In_ IN DWORD PrefMaxlen,
__out OUT LPDWORD totalentries, _Out_ OUT LPDWORD EntriesRead,
__in IN DWORD servertype, _Out_ OUT LPDWORD totalentries,
__in_opt IN LMCSTR domain OPTIONAL, _In_ IN DWORD servertype,
__in_opt IN LMCSTR FirstNameToReturn OPTIONAL _In_opt_ IN LMCSTR domain OPTIONAL,
_In_opt_ IN LMCSTR FirstNameToReturn OPTIONAL
); );
_Check_return_
_Success_( return == 0 )
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerGetInfo ( NetServerGetInfo (
__in_opt IN LMSTR servername OPTIONAL, _In_opt_ LMSTR servername,
IN DWORD level, _In_ DWORD level,
__out OUT LPBYTE *bufptr _When_( level == 100, _Outptr_result_bytebuffer_(sizeof(SERVER_INFO_100)) )
_When_( level == 101, _Outptr_result_bytebuffer_(sizeof(SERVER_INFO_101)) )
_When_( level == 102, _Outptr_result_bytebuffer_(sizeof(SERVER_INFO_102)) )
LPBYTE *bufptr
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerSetInfo ( NetServerSetInfo(
__in_opt IN LMSTR servername OPTIONAL, _In_opt_ LMSTR servername,
IN DWORD level, _In_ DWORD level,
IN LPBYTE buf, _When_( level == 102, _In_reads_bytes_(sizeof(SERVER_INFO_101)) )
__out_opt OUT LPDWORD ParmError OPTIONAL _When_( level == 402, _In_reads_bytes_(sizeof(SERVER_INFO_402)) )
_When_( level == 403, _In_reads_bytes_(sizeof(SERVER_INFO_403)) )
_When_( level == 1001, _In_reads_bytes_(sizeof(SERVER_INFO_1001)) )
_When_( level == 1002, _In_reads_bytes_(sizeof(SERVER_INFO_1002)) )
_When_( level == 1003, _In_reads_bytes_(sizeof(SERVER_INFO_1003)) )
_When_( level == 1004, _In_reads_bytes_(sizeof(SERVER_INFO_1004)) )
_When_( level == 1005, _In_reads_bytes_(sizeof(SERVER_INFO_1005)) )
_When_( level == 1006, _In_reads_bytes_(sizeof(SERVER_INFO_1006)) )
_When_( level == 1009, _In_reads_bytes_(sizeof(SERVER_INFO_1009)) )
_When_( level == 1010, _In_reads_bytes_(sizeof(SERVER_INFO_1010)) )
_When_( level == 1011, _In_reads_bytes_(sizeof(SERVER_INFO_1011)) )
_When_( level == 1016, _In_reads_bytes_(sizeof(SERVER_INFO_1016)) )
_When_( level == 1017, _In_reads_bytes_(sizeof(SERVER_INFO_1017)) )
_When_( level == 1018, _In_reads_bytes_(sizeof(SERVER_INFO_1018)) )
_When_( level == 1021, _In_reads_bytes_(sizeof(SERVER_INFO_1021)) )
_When_( level == 1022, _In_reads_bytes_(sizeof(SERVER_INFO_1022)) )
_When_( level == 1028, _In_reads_bytes_(sizeof(SERVER_INFO_1028)) )
_When_( level == 1029, _In_reads_bytes_(sizeof(SERVER_INFO_1029)) )
_When_( level == 1037, _In_reads_bytes_(sizeof(SERVER_INFO_1037)) )
_When_( level == 1043, _In_reads_bytes_(sizeof(SERVER_INFO_1043)) )
LPBYTE buf,
_Out_opt_ LPDWORD ParmError
); );
// //
// Temporary hack function. // Temporary hack function.
// //
NET_API_STATUS NET_API_STATUS
NetServerSetInfoCommandLine ( NetServerSetInfoCommandLine (
__in WORD argc, _In_ WORD argc,
__in_ecount(argc) LMSTR argv[] _In_reads_(argc) LMSTR argv[]
); );
_Check_return_
_Success_( return == 0 || return == ERROR_MORE_DATA )
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerDiskEnum ( NetServerDiskEnum (
__in_opt IN LMSTR servername OPTIONAL, _In_opt_ LMSTR servername,
IN DWORD level, _In_ DWORD level,
__out OUT LPBYTE *bufptr, _Outptr_result_bytebuffer_((sizeof(TCHAR) * 3 * (*entriesread)) + sizeof(TCH
IN DWORD prefmaxlen, AR)) LPBYTE *bufptr,
__out OUT LPDWORD entriesread, _In_ DWORD prefmaxlen,
__out OUT LPDWORD totalentries, _Out_ LPDWORD entriesread,
IN OUT LPDWORD resume_handle OPTIONAL _Out_ LPDWORD totalentries,
_Inout_opt_ LPDWORD resume_handle
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerComputerNameAdd( NetServerComputerNameAdd(
__in_opt IN LMSTR ServerName OPTIONAL, _In_opt_ LMSTR ServerName,
__in_opt IN LMSTR EmulatedDomainName OPTIONAL, _In_opt_ LMSTR EmulatedDomainName,
__in IN LMSTR EmulatedServerName _In_ LMSTR EmulatedServerName
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerComputerNameDel ( NetServerComputerNameDel(
__in_opt IN LMSTR ServerName OPTIONAL, _In_opt_ LMSTR ServerName,
__in IN LMSTR EmulatedServerName _In_ LMSTR EmulatedServerName
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportAdd ( NetServerTransportAdd (
__in_opt IN LMSTR servername, _In_opt_ LMSTR servername,
IN DWORD level, _In_ DWORD level,
__in_bcount(sizeof(SERVER_TRANSPORT_INFO_0)) IN LPBYTE bufptr _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_0)) LPBYTE bufptr
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportAddEx ( NetServerTransportAddEx(
__in_opt IN LMSTR servername OPTIONAL, _In_opt_ LMSTR servername,
IN DWORD level, _In_ DWORD level,
__in IN LPBYTE bufptr _When_( level == 0, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_0)) )
_When_( level == 1, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_1)) )
_When_( level == 2, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_2)) )
_When_( level == 3, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_3)) )
LPBYTE bufptr
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportDel ( NetServerTransportAddForInstance(
__in_opt LMSTR servername, _In_opt_ LMSTR servername,
__in DWORD level, _In_ DWORD level,
__in_xcount(level == 0 ? sizeof(SERVER_TRANSPORT_INFO_0) : sizeof(SERVER_TRA _When_( level == 0, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_0)) )
NSPORT_INFO_1)) LPBYTE bufptr _When_( level == 1, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_1)) )
_When_( level == 2, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_2)) )
_When_( level == 3, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_3)) )
LPBYTE bufptr,
_In_ LPDWORD InstanceHandle
); );
_Check_return_
NET_API_STATUS NET_API_FUNCTION
NetServerTransportDel(
_In_opt_ LMSTR servername,
_In_ DWORD level,
_When_( level == 0, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_0)) )
_When_( level == 1, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_1)) )
LPBYTE bufptr
);
_Check_return_
NET_API_STATUS NET_API_FUNCTION
NetServerTransportDelForInstance(
_In_opt_ LMSTR servername,
_In_ DWORD level,
_When_( level == 0, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_0)) )
_When_( level == 1, _In_reads_bytes_(sizeof(SERVER_TRANSPORT_INFO_1)) )
LPBYTE bufptr,
_In_ LPDWORD InstanceHandle
);
_Check_return_
_Success_( return == 0 || return == ERROR_MORE_DATA )
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportEnum ( NetServerTransportEnum (
__in_opt IN LMSTR servername, _In_opt_ LMSTR servername,
IN DWORD level, _In_ DWORD level,
__out OUT LPBYTE *bufptr, _When_( level == 0, _Outptr_result_bytebuffer_(*entriesread * sizeof(SERVER_
IN DWORD prefmaxlen, TRANSPORT_INFO_0)) )
__out OUT LPDWORD entriesread, _When_( level == 1, _Outptr_result_bytebuffer_(*entriesread * sizeof(SERVER_
__out OUT LPDWORD totalentries, TRANSPORT_INFO_1)) )
__inout_opt IN OUT LPDWORD resumehandle _When_( level == 2, _Outptr_result_bytebuffer_(*entriesread * sizeof(SERVER_
TRANSPORT_INFO_2)) )
LPBYTE *bufptr,
_In_ DWORD prefmaxlen,
_Out_ LPDWORD entriesread,
_Out_ LPDWORD totalentries,
_Inout_opt_ LPDWORD resume_handle
); );
// //
// The following function can be called by Win NT services to register // The following function can be called by Win NT services to register
// their service type. This function is exported from advapi32.dll. // their service type. This function is exported from advapi32.dll.
// Therefore, if this is the only function called by that service, then // Therefore, if this is the only function called by that service, then
// it is not necessary to link to netapi32.lib. // it is not necessary to link to netapi32.lib.
// //
BOOL NET_API_FUNCTION BOOL NET_API_FUNCTION
SetServiceBits( SetServiceBits(
skipping to change at line 1377 skipping to change at line 1451
// //
// Equate for use with sv102_licenses. // Equate for use with sv102_licenses.
// //
#define SV_USERS_PER_LICENSE 5 #define SV_USERS_PER_LICENSE 5
// //
// Equate for use with svti2_flags in NetServerTransportAddEx. // Equate for use with svti2_flags in NetServerTransportAddEx.
// //
#define SVTI2_REMAP_PIPE_NAMES 0x2 #define SVTI2_REMAP_PIPE_NAMES 0x02
#define SVTI2_SCOPED_NAME 0x4 #define SVTI2_SCOPED_NAME 0x04
#define SVTI2_VALID_FLAGS (SVTI2_REMAP_PIPE_NAMES|SVTI2_SCOPED_NAME)
// new Win8 flags for clustering
// the values should be changed once new sscore functionality is impelmented
// SVTI2_CLUSTER_NAME means that scope belongs to clustering
#define SVTI2_CLUSTER_NAME 0x08
// SVTI2_CLUSTER_DNN_NAME means that scope belongs to scale-out clustering
#define SVTI2_CLUSTER_DNN_NAME 0x10
//
// Means that transport address field passed with the server transport info
// struct contains a unicode string.
//
#define SVTI2_UNICODE_TRANSPORT_ADDRESS 0x20
//
// Reserved for Internal Use
//
#define SVTI2_RESERVED1 0x1000
#define SVTI2_RESERVED2 0x2000
#define SVTI2_RESERVED3 0x4000
#define SVTI2_VALID_FLAGS ( SVTI2_REMAP_PIPE_NAMES | \
SVTI2_SCOPED_NAME | \
SVTI2_CLUSTER_NAME | \
SVTI2_CLUSTER_DNN_NAME | \
SVTI2_UNICODE_TRANSPORT_ADDRESS )
// //
// Server capability information // Server capability information
// //
#define SRV_SUPPORT_HASH_GENERATION 0x0001 #define SRV_SUPPORT_HASH_GENERATION 0x0001
#define SRV_HASH_GENERATION_ACTIVE 0x0002 #define SRV_HASH_GENERATION_ACTIVE 0x0002
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _LMSERVER_ #endif // _LMSERVER_
 End of changes. 25 change blocks. 
65 lines changed or deleted 171 lines changed or added


 ntsecapi.h (6.1.7601.23418-Windows_7.0)   ntsecapi.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 17 skipping to change at line 17
ntsecapi.h ntsecapi.h
Abstract: Abstract:
This module defines the Local Security Authority APIs. This module defines the Local Security Authority APIs.
Revision History: Revision History:
--*/ --*/
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// //
// All the subcategories are named as <Audit_CategoryName_SubCategoryName> // All the subcategories are named as <Audit_CategoryName_SubCategoryName>
// //
#ifdef DEFINE_GUID #ifdef DEFINE_GUID
/* 0cce9210-69ae-11d9-bed3-505054503030 */ /* 0cce9210-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_SecurityStateChange_defined) #if !defined(INITGUID) || !defined(Audit_System_SecurityStateChange_defined)
DEFINE_GUID( DEFINE_GUID(
Audit_System_SecurityStateChange, Audit_System_SecurityStateChange,
skipping to change at line 667 skipping to change at line 672
DEFINE_GUID( DEFINE_GUID(
Audit_ObjectAccess_DetailedFileShare, Audit_ObjectAccess_DetailedFileShare,
0x0cce9244, 0x0cce9244,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
); );
#ifdef INITGUID #ifdef INITGUID
#define Audit_ObjectAccess_DetailedFileShare_defined #define Audit_ObjectAccess_DetailedFileShare_defined
#endif #endif
#endif #endif
/* 0cce9245-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_RemovableStorage_defined)
DEFINE_GUID(
Audit_ObjectAccess_RemovableStorage,
0x0cce9245,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_RemovableStorage_defined
#endif
#endif
/* 0cce9246-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_CbacStaging_defined)
DEFINE_GUID(
Audit_ObjectAccess_CbacStaging,
0x0cce9246,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_CbacStaging_defined
#endif
#endif
/* 0cce9247-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_Claims_defined)
DEFINE_GUID(
Audit_Logon_Claims,
0x0cce9247,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_Claims_defined
#endif
#endif
#endif // DEFINE_GUID #endif // DEFINE_GUID
// //
// All categories are named as <Audit_CategoryName> // All categories are named as <Audit_CategoryName>
// //
#ifdef DEFINE_GUID #ifdef DEFINE_GUID
/* 69979848-797a-11d9-bed3-505054503030 */ /* 69979848-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_defined) #if !defined(INITGUID) || !defined(Audit_System_defined)
skipping to change at line 1226 skipping to change at line 1267
// //
// Everything below this exists only in Windows Server 2008 and greater // Everything below this exists only in Windows Server 2008 and greater
// //
SeAdtParmTypeSD, // Produces 1 parameters SeAdtParmTypeSD, // Produces 1 parameters
// //
// Received value: // Received value:
// //
// pointer to SECURITY_DESCRIPTOR // pointer to SECURITY_DESCRIPTOR
// structure // structure. This HAS to appear in pairs.
// The first parameter will represent the
// old SD and the second parameter will
// represent the New SD
// //
// Results in: // Results in:
// //
// SDDL string representation of SD // SDDL string representation of SD
// //
SeAdtParmTypeLogonHours, // Produces 1 parameters SeAdtParmTypeLogonHours, // Produces 1 parameters
// //
// Received value: // Received value:
// //
skipping to change at line 1264 skipping to change at line 1308
// param 3: Logon ID (Luid) string // param 3: Logon ID (Luid) string
SeAdtParmTypeUlongNoConv, // Produces 1 parameter. SeAdtParmTypeUlongNoConv, // Produces 1 parameter.
// Received Value: // Received Value:
// Ulong // Ulong
// //
//Results in: //Results in:
// Not converted to string // Not converted to string
// //
SeAdtParmTypeSockAddrNoPort, // Produces 1 parameter SeAdtParmTypeSockAddrNoPort, // Produces 1 parameter
// //
// Received value: // Received value:
// //
// pointer to SOCKADDR_IN/SOCKADDR_IN6 // pointer to SOCKADDR_IN/SOCKADDR_IN6
// structure // structure
// //
// Results in: // Results in:
// //
// param 1: IPv4/IPv6 address string // param 1: IPv4/IPv6 address string
// //
// //
// Everything below this exists only in Windows Server 2008 and greater // Everything below this exists only in Windows Server 2008 and greater
// //
SeAdtParmTypeAccessReason // Produces 1 parameters SeAdtParmTypeAccessReason, // Produces 1 parameters
// //
// Received value: // Received value:
// //
// pointer to SECURITY_DESCRIPTOR // pointer to SE_ADT_ACCESS_REASON structure
// structure followed by the reason code.
// The reason code could be the index
// of the ACE in the SD or privilege ID or
// other reason codes.
// //
// Results in: // Results in:
// //
// String representation of the access reaso n. // String representation of the access reaso n.
// //
//
// Everything below this exists only in Windows Server 2012 and greater?
//
SeAdtParmTypeStagingReason, // Produces 1 parameters
//
// Received value:
//
// pointer to SE_ADT_ACCESS_REASON structure
//
// Results in:
//
// String representation of Staging policy's
// access reason.
//
SeAdtParmTypeResourceAttribute, // Produces 1 parameters
//
// Received value:
//
// pointer to SECURITY_DESCRIPTOR
// structure
//
// Results in:
//
// SDDL string representation of the
// Resource Attribute ACEs in the SD
//
SeAdtParmTypeClaims, // Produces 1 parameters
//
// Received value:
//
// pointer to the structure -
// CLAIM_SECURITY_ATTRIBUTES_INFORMATION
// structure
//
// Results in:
//
// Claims information as attributes, value
// pairs
//
SeAdtParmTypeLogonIdAsSid, // Produces 4 parameters.
// Received Value:
//
// SID (variable length)
//
//Results in:
//
// param 1: Sid string (based on SID and no
t derived from the LUID)
// param 2: -
// param 3: -
// param 4: -
} SE_ADT_PARAMETER_TYPE, *PSE_ADT_PARAMETER_TYPE; } SE_ADT_PARAMETER_TYPE, *PSE_ADT_PARAMETER_TYPE;
#ifndef GUID_DEFINED #ifndef GUID_DEFINED
#include <guiddef.h> #include <guiddef.h>
#endif /* GUID_DEFINED */ #endif /* GUID_DEFINED */
typedef struct _SE_ADT_OBJECT_TYPE { typedef struct _SE_ADT_OBJECT_TYPE {
GUID ObjectType; GUID ObjectType;
USHORT Flags; USHORT Flags;
skipping to change at line 1325 skipping to change at line 1419
} SE_ADT_PARAMETER_ARRAY_ENTRY, *PSE_ADT_PARAMETER_ARRAY_ENTRY; } SE_ADT_PARAMETER_ARRAY_ENTRY, *PSE_ADT_PARAMETER_ARRAY_ENTRY;
typedef struct _SE_ADT_ACCESS_REASON{ typedef struct _SE_ADT_ACCESS_REASON{
ACCESS_MASK AccessMask; ACCESS_MASK AccessMask;
ULONG AccessReasons[32]; ULONG AccessReasons[32];
ULONG ObjectTypeIndex; ULONG ObjectTypeIndex;
ULONG AccessGranted; ULONG AccessGranted;
PSECURITY_DESCRIPTOR SecurityDescriptor; // multple SDs may be stored her e in self-relative way. PSECURITY_DESCRIPTOR SecurityDescriptor; // multple SDs may be stored her e in self-relative way.
} SE_ADT_ACCESS_REASON, *PSE_ADT_ACCESS_REASON; } SE_ADT_ACCESS_REASON, *PSE_ADT_ACCESS_REASON;
typedef struct _SE_ADT_CLAIMS {
ULONG Length;
PCLAIMS_BLOB Claims; // one claim blob will be stored here in self-relative
way
} SE_ADT_CLAIMS, *PSE_ADT_CLAIMS;
// //
// Structure that will be passed between the Reference Monitor and LSA // Structure that will be passed between the Reference Monitor and LSA
// to transmit auditing information. // to transmit auditing information.
// //
#define SE_MAX_AUDIT_PARAMETERS 32 #define SE_MAX_AUDIT_PARAMETERS 32
#define SE_MAX_GENERIC_AUDIT_PARAMETERS 28 #define SE_MAX_GENERIC_AUDIT_PARAMETERS 28
typedef struct _SE_ADT_PARAMETER_ARRAY { typedef struct _SE_ADT_PARAMETER_ARRAY {
skipping to change at line 1441 skipping to change at line 1542
// //
// Macro for determining whether an API succeeded. // Macro for determining whether an API succeeded.
// //
#define LSA_SUCCESS(Error) ((LONG)(Error) >= 0) #define LSA_SUCCESS(Error) ((LONG)(Error) >= 0)
#ifndef _NTLSA_IFS_ #ifndef _NTLSA_IFS_
// begin_ntifs // begin_ntifs
__drv_sameIRQL _IRQL_requires_same_
__drv_maxIRQL(PASSIVE_LEVEL) _IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaRegisterLogonProcess ( LsaRegisterLogonProcess (
__in PLSA_STRING LogonProcessName, _In_ PLSA_STRING LogonProcessName,
__out PHANDLE LsaHandle, _Out_ PHANDLE LsaHandle,
__out PLSA_OPERATIONAL_MODE SecurityMode _Out_ PLSA_OPERATIONAL_MODE SecurityMode
); );
// //
// The function below did not exist in NTIFS before windows XP // The function below did not exist in NTIFS before windows XP
// However, the function has always been there, so it is okay to use // However, the function has always been there, so it is okay to use
// even on w2k // even on w2k
// //
__drv_sameIRQL _IRQL_requires_same_
__drv_maxIRQL(PASSIVE_LEVEL) _IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaLogonUser ( LsaLogonUser (
__in HANDLE LsaHandle, _In_ HANDLE LsaHandle,
__in PLSA_STRING OriginName, _In_ PLSA_STRING OriginName,
__in SECURITY_LOGON_TYPE LogonType, _In_ SECURITY_LOGON_TYPE LogonType,
__in ULONG AuthenticationPackage, _In_ ULONG AuthenticationPackage,
__in_bcount(AuthenticationInformationLength) PVOID AuthenticationInformation _In_reads_bytes_(AuthenticationInformationLength) PVOID AuthenticationInform
, ation,
__in ULONG AuthenticationInformationLength, _In_ ULONG AuthenticationInformationLength,
__in_opt PTOKEN_GROUPS LocalGroups, _In_opt_ PTOKEN_GROUPS LocalGroups,
__in PTOKEN_SOURCE SourceContext, _In_ PTOKEN_SOURCE SourceContext,
__out PVOID *ProfileBuffer, _Out_ PVOID *ProfileBuffer,
__out PULONG ProfileBufferLength, _Out_ PULONG ProfileBufferLength,
__out PLUID LogonId, _Inout_ PLUID LogonId,
__out PHANDLE Token, _Out_ PHANDLE Token,
__out PQUOTA_LIMITS Quotas, _Out_ PQUOTA_LIMITS Quotas,
__out PNTSTATUS SubStatus _Out_ PNTSTATUS SubStatus
); );
// end_ntifs // end_ntifs
__drv_sameIRQL _IRQL_requires_same_
__drv_maxIRQL(PASSIVE_LEVEL) _IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaLookupAuthenticationPackage ( LsaLookupAuthenticationPackage (
__in HANDLE LsaHandle, _In_ HANDLE LsaHandle,
__in PLSA_STRING PackageName, _In_ PLSA_STRING PackageName,
__out PULONG AuthenticationPackage _Out_ PULONG AuthenticationPackage
); );
// begin_ntifs // begin_ntifs
__drv_sameIRQL _IRQL_requires_same_
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaFreeReturnBuffer ( LsaFreeReturnBuffer (
__in PVOID Buffer _In_ PVOID Buffer
); );
// end_ntifs // end_ntifs
__drv_sameIRQL _IRQL_requires_same_
__drv_maxIRQL(PASSIVE_LEVEL) _IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaCallAuthenticationPackage ( LsaCallAuthenticationPackage (
__in HANDLE LsaHandle, _In_ HANDLE LsaHandle,
__in ULONG AuthenticationPackage, _In_ ULONG AuthenticationPackage,
__in_bcount(SubmitBufferLength) PVOID ProtocolSubmitBuffer, _In_reads_bytes_(SubmitBufferLength) PVOID ProtocolSubmitBuffer,
__in ULONG SubmitBufferLength, _In_ ULONG SubmitBufferLength,
__out_opt PVOID *ProtocolReturnBuffer, _Out_opt_ PVOID *ProtocolReturnBuffer,
__out_opt PULONG ReturnBufferLength, _Out_opt_ PULONG ReturnBufferLength,
__out_opt PNTSTATUS ProtocolStatus _Out_opt_ PNTSTATUS ProtocolStatus
); );
__drv_sameIRQL _IRQL_requires_same_
__drv_maxIRQL(PASSIVE_LEVEL) _IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaDeregisterLogonProcess ( LsaDeregisterLogonProcess (
__in HANDLE LsaHandle _In_ HANDLE LsaHandle
); );
__drv_sameIRQL _IRQL_requires_same_
__drv_maxIRQL(PASSIVE_LEVEL) _IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaConnectUntrusted ( LsaConnectUntrusted (
__out PHANDLE LsaHandle _Out_ PHANDLE LsaHandle
);
__drv_sameIRQL
NTSTATUS
LsaInsertProtectedProcessAddress (
__in PVOID BufferAddress,
__in ULONG BufferSize
);
__drv_sameIRQL
NTSTATUS
LsaRemoveProtectedProcessAddress (
__in PVOID BufferAddress,
__in ULONG BufferSize
); );
#endif // _NTLSA_IFS_ #endif // _NTLSA_IFS_
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// // // //
// Local Security Policy Administration API datatypes and defines // // Local Security Policy Administration API datatypes and defines //
// // // //
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// //
skipping to change at line 2228 skipping to change at line 2343
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
#define TRUST_ATTRIBUTE_FOREST_TRANSITIVE 0x00000008 // This link m ay contain forest trust information #define TRUST_ATTRIBUTE_FOREST_TRANSITIVE 0x00000008 // This link m ay contain forest trust information
#if (_WIN32_WINNT >= 0x0502) #if (_WIN32_WINNT >= 0x0502)
#define TRUST_ATTRIBUTE_CROSS_ORGANIZATION 0x00000010 // This trust is to a domain/forest which is not part of this enterprise #define TRUST_ATTRIBUTE_CROSS_ORGANIZATION 0x00000010 // This trust is to a domain/forest which is not part of this enterprise
#define TRUST_ATTRIBUTE_WITHIN_FOREST 0x00000020 // Trust is in ternal to this forest #define TRUST_ATTRIBUTE_WITHIN_FOREST 0x00000020 // Trust is in ternal to this forest
#define TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL 0x00000040 // Trust is to be treated as external for trust boundary purposes #define TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL 0x00000040 // Trust is to be treated as external for trust boundary purposes
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION 0x00000080 // MIT trust w ith RC4 #define TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION 0x00000080 // MIT trust w ith RC4
#define TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS 0x00000100 // Use AES key s to encrypte KRB TGTs #define TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS 0x00000100 // Use AES key s to encrypte KRB TGTs
#endif #endif
#if (_WIN32_WINNT >= 0x0602)
#define TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION 0x00000200 // do n
ot forward TGT to the other side of the trust which is not part of this enterpri
se
#endif
// Trust attributes 0x00000040 through 0x00200000 are reserved for future use // Trust attributes 0x00000040 through 0x00200000 are reserved for future use
#else #else
// Trust attributes 0x00000010 through 0x00200000 are reserved for future use // Trust attributes 0x00000010 through 0x00200000 are reserved for future use
#endif #endif
// Trust attributes 0x00400000 through 0x00800000 were used previously (up to W2 K) and should not be re-used // Trust attributes 0x00400000 through 0x00800000 were used previously (up to W2 K) and should not be re-used
// Trust attributes 0x01000000 through 0x80000000 are reserved for user // Trust attributes 0x01000000 through 0x80000000 are reserved for user
#define TRUST_ATTRIBUTES_VALID 0xFF03FFFF #define TRUST_ATTRIBUTES_VALID 0xFF03FFFF
#endif #endif
#define TRUST_ATTRIBUTES_USER 0xFF000000 #define TRUST_ATTRIBUTES_USER 0xFF000000
skipping to change at line 2481 skipping to change at line 2599
} LSA_ENUMERATION_INFORMATION, *PLSA_ENUMERATION_INFORMATION; } LSA_ENUMERATION_INFORMATION, *PLSA_ENUMERATION_INFORMATION;
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// // // //
// Local Security Policy - Miscellaneous API function prototypes // // Local Security Policy - Miscellaneous API function prototypes //
// // // //
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaFreeMemory( LsaFreeMemory(
__in_opt PVOID Buffer _In_opt_ PVOID Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaClose( LsaClose(
__in LSA_HANDLE ObjectHandle _In_ LSA_HANDLE ObjectHandle
); );
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
typedef struct _LSA_LAST_INTER_LOGON_INFO { typedef struct _LSA_LAST_INTER_LOGON_INFO {
LARGE_INTEGER LastSuccessfulLogon; LARGE_INTEGER LastSuccessfulLogon;
LARGE_INTEGER LastFailedLogon; LARGE_INTEGER LastFailedLogon;
ULONG FailedAttemptCountSinceLastSuccessfulLogon; ULONG FailedAttemptCountSinceLastSuccessfulLogon;
} LSA_LAST_INTER_LOGON_INFO, *PLSA_LAST_INTER_LOGON_INFO; } LSA_LAST_INTER_LOGON_INFO, *PLSA_LAST_INTER_LOGON_INFO;
skipping to change at line 2546 skipping to change at line 2664
LARGE_INTEGER PasswordLastSet; LARGE_INTEGER PasswordLastSet;
LARGE_INTEGER PasswordCanChange; LARGE_INTEGER PasswordCanChange;
LARGE_INTEGER PasswordMustChange; LARGE_INTEGER PasswordMustChange;
#endif #endif
} SECURITY_LOGON_SESSION_DATA, * PSECURITY_LOGON_SESSION_DATA; } SECURITY_LOGON_SESSION_DATA, * PSECURITY_LOGON_SESSION_DATA;
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaEnumerateLogonSessions( LsaEnumerateLogonSessions(
__out PULONG LogonSessionCount, _Out_ PULONG LogonSessionCount,
__out PLUID * LogonSessionList _Out_ PLUID * LogonSessionList
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaGetLogonSessionData( LsaGetLogonSessionData(
__in PLUID LogonId, _In_ PLUID LogonId,
__out PSECURITY_LOGON_SESSION_DATA * ppLogonSessionData _Out_ PSECURITY_LOGON_SESSION_DATA * ppLogonSessionData
); );
#endif #endif
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaOpenPolicy( LsaOpenPolicy(
__in_opt PLSA_UNICODE_STRING SystemName, _In_opt_ PLSA_UNICODE_STRING SystemName,
__in PLSA_OBJECT_ATTRIBUTES ObjectAttributes, _In_ PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
__in ACCESS_MASK DesiredAccess, _In_ ACCESS_MASK DesiredAccess,
__out PLSA_HANDLE PolicyHandle _Out_ PLSA_HANDLE PolicyHandle
);
//
// Keep the following in sync with LSA_MAXIMUM_PER_CAP_CAPE_COUNT
// TBD: Reduce these multiple macros to one
//
#define MAXIMUM_CAPES_PER_CAP 0x7F
//
// The 32-bit flag in CAP are CAPE are segmented as follows
//
// +----------------+---------------+-----------------+--------------------+
// | Reserved Flags | Control Flags | Staged Policy's | Effective Policy's |
// | | | Flags | Flags |
// +----------------+---------------+-----------------+--------------------+
// | 8-bits | 8-bits | 8-bits | 8-bits |
// +----------------+---------------+-----------------+--------------------+
//
// Only the LSB of Control Flags, Staged and Effective Policy Flags are used
// All other bits are reserved and MUST be zero
//
//
// Effective Policy's Flags
//
#define CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG 0x00000001
//
// Staging Policy's Flags
//
#define CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG 0x00000100
#define STAGING_FLAG(Effective) ((Effective & 0xF) << 8)
//
// Control Flags
//
#define CENTRAL_ACCESS_POLICY_STAGED_FLAG 0x00010000
#define CENTRAL_ACCESS_POLICY_VALID_FLAG_MASK \
( \
CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG | \
CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG | \
CENTRAL_ACCESS_POLICY_STAGED_FLAG \
)
//
// LsaSetCAPs Flags
//
#define LSASETCAPS_RELOAD_FLAG 0x00000001
#define LSASETCAPS_VALID_FLAG_MASK \
( \
LSASETCAPS_RELOAD_FLAG \
)
//
// CAPE structure that specifies the access policy and when it is applicable
//
// WARNING !
// Keep the fields of the following struct in sync with LSAPR_CENTRAL_ACCESS_POL
ICY_ENTRY
// struct in lsarpc.idl
//
//
typedef struct _CENTRAL_ACCESS_POLICY_ENTRY {
LSA_UNICODE_STRING Name; // Unique name as in AD
LSA_UNICODE_STRING Description;
LSA_UNICODE_STRING ChangeId;
ULONG LengthAppliesTo;
_Field_size_bytes_(LengthAppliesTo)
PUCHAR AppliesTo; // Must satisfy to enforce CAPE
ULONG LengthSD;
_Field_size_bytes_(LengthSD)
PSECURITY_DESCRIPTOR SD; // Effective policy
ULONG LengthStagedSD;
_Field_size_bytes_(LengthStagedSD)
PSECURITY_DESCRIPTOR StagedSD; // Staged policy
ULONG Flags; // Reserved
}
CENTRAL_ACCESS_POLICY_ENTRY, *PCENTRAL_ACCESS_POLICY_ENTRY;
typedef const CENTRAL_ACCESS_POLICY_ENTRY *PCCENTRAL_ACCESS_POLICY_ENTRY;
//
// CAP structure that is a collection of CAPEs. Resources that are subject to
// Central Access Policies are associated with a CAP by a CAP ID placed in the S
ACL
// of the Resource. Applicable CAPEs of a CAP are enforced during access check.
//
// WARNING !
// Keep the fields of the following struct in sync with LSAPR_CENTRAL_ACCESS_POL
ICY
// struct in lsarpc.idl
//
//
typedef struct _CENTRAL_ACCESS_POLICY {
PSID CAPID;
LSA_UNICODE_STRING Name;
LSA_UNICODE_STRING Description;
LSA_UNICODE_STRING ChangeId;
ULONG Flags;
ULONG CAPECount;
_Field_size_(CAPECount)
PCENTRAL_ACCESS_POLICY_ENTRY *CAPEs;
}
CENTRAL_ACCESS_POLICY, *PCENTRAL_ACCESS_POLICY;
typedef const CENTRAL_ACCESS_POLICY *PCCENTRAL_ACCESS_POLICY;
NTSTATUS
NTAPI
LsaSetCAPs(
_In_reads_opt_(CAPDNCount) PLSA_UNICODE_STRING CAPDNs,
_In_ ULONG CAPDNCount,
_In_ ULONG Flags
);
NTSTATUS
NTAPI
LsaGetAppliedCAPIDs(
_In_opt_ PLSA_UNICODE_STRING SystemName,
_Outptr_result_buffer_(*CAPIDCount) PSID **CAPIDs,
_Out_ PULONG CAPIDCount
);
NTSTATUS
NTAPI
LsaQueryCAPs(
_In_reads_opt_(CAPIDCount) PSID *CAPIDs,
_In_ ULONG CAPIDCount,
_Outptr_result_buffer_(*CAPCount) PCENTRAL_ACCESS_POLICY *CAPs,
_Out_ PULONG CAPCount
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaQueryInformationPolicy( LsaQueryInformationPolicy(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in POLICY_INFORMATION_CLASS InformationClass, _In_ POLICY_INFORMATION_CLASS InformationClass,
__out PVOID *Buffer _Out_ PVOID *Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaSetInformationPolicy( LsaSetInformationPolicy(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in POLICY_INFORMATION_CLASS InformationClass, _In_ POLICY_INFORMATION_CLASS InformationClass,
__in PVOID Buffer _In_ PVOID Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaQueryDomainInformationPolicy( LsaQueryDomainInformationPolicy(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in POLICY_DOMAIN_INFORMATION_CLASS InformationClass, _In_ POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
__out PVOID *Buffer _Out_ PVOID *Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaSetDomainInformationPolicy( LsaSetDomainInformationPolicy(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in POLICY_DOMAIN_INFORMATION_CLASS InformationClass, _In_ POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
__in_opt PVOID Buffer _In_opt_ PVOID Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaRegisterPolicyChangeNotification( LsaRegisterPolicyChangeNotification(
__in POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, _In_ POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass,
__in HANDLE NotificationEventHandle _In_ HANDLE NotificationEventHandle
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaUnregisterPolicyChangeNotification( LsaUnregisterPolicyChangeNotification(
__in POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass, _In_ POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass,
__in HANDLE NotificationEventHandle _In_ HANDLE NotificationEventHandle
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaEnumerateTrustedDomains( LsaEnumerateTrustedDomains(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__inout PLSA_ENUMERATION_HANDLE EnumerationContext, _Inout_ PLSA_ENUMERATION_HANDLE EnumerationContext,
__out PVOID *Buffer, _Out_ PVOID *Buffer,
__in ULONG PreferedMaximumLength, _In_ ULONG PreferedMaximumLength,
__out PULONG CountReturned _Out_ PULONG CountReturned
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaLookupNames( LsaLookupNames(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in ULONG Count, _In_ ULONG Count,
__in PLSA_UNICODE_STRING Names, _In_ PLSA_UNICODE_STRING Names,
__out PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, _Out_ PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
__out PLSA_TRANSLATED_SID *Sids _Out_ PLSA_TRANSLATED_SID *Sids
); );
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaLookupNames2( LsaLookupNames2(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in ULONG Flags, // Reserved _In_ ULONG Flags, // Reserved
__in ULONG Count, _In_ ULONG Count,
__in PLSA_UNICODE_STRING Names, _In_ PLSA_UNICODE_STRING Names,
__out PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, _Out_ PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
__out PLSA_TRANSLATED_SID2 *Sids _Out_ PLSA_TRANSLATED_SID2 *Sids
); );
#endif #endif
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaLookupSids( LsaLookupSids(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in ULONG Count, _In_ ULONG Count,
__in PSID *Sids, _In_ PSID *Sids,
__out PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains, _Out_ PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
__out PLSA_TRANSLATED_NAME *Names _Out_ PLSA_TRANSLATED_NAME *Names
);
NTSTATUS
LsaLookupSids2(
_In_ LSA_HANDLE PolicyHandle,
_In_ ULONG LookupOptions,
_In_ ULONG Count,
_In_ PSID *Sids,
_Out_ PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
_Out_ PLSA_TRANSLATED_NAME *Names
); );
#define SE_INTERACTIVE_LOGON_NAME TEXT("SeInteractiveLogonRight") #define SE_INTERACTIVE_LOGON_NAME TEXT("SeInteractiveLogonRight")
#define SE_NETWORK_LOGON_NAME TEXT("SeNetworkLogonRight") #define SE_NETWORK_LOGON_NAME TEXT("SeNetworkLogonRight")
#define SE_BATCH_LOGON_NAME TEXT("SeBatchLogonRight") #define SE_BATCH_LOGON_NAME TEXT("SeBatchLogonRight")
#define SE_SERVICE_LOGON_NAME TEXT("SeServiceLogonRight") #define SE_SERVICE_LOGON_NAME TEXT("SeServiceLogonRight")
#define SE_DENY_INTERACTIVE_LOGON_NAME TEXT("SeDenyInteractiveLogonRight") #define SE_DENY_INTERACTIVE_LOGON_NAME TEXT("SeDenyInteractiveLogonRight")
#define SE_DENY_NETWORK_LOGON_NAME TEXT("SeDenyNetworkLogonRight") #define SE_DENY_NETWORK_LOGON_NAME TEXT("SeDenyNetworkLogonRight")
#define SE_DENY_BATCH_LOGON_NAME TEXT("SeDenyBatchLogonRight") #define SE_DENY_BATCH_LOGON_NAME TEXT("SeDenyBatchLogonRight")
#define SE_DENY_SERVICE_LOGON_NAME TEXT("SeDenyServiceLogonRight") #define SE_DENY_SERVICE_LOGON_NAME TEXT("SeDenyServiceLogonRight")
skipping to change at line 2676 skipping to change at line 2936
#define SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME TEXT("SeDenyRemoteInteractiveLogon Right") #define SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME TEXT("SeDenyRemoteInteractiveLogon Right")
#endif #endif
// //
// This new API returns all the accounts with a certain privilege // This new API returns all the accounts with a certain privilege
// //
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaEnumerateAccountsWithUserRight( LsaEnumerateAccountsWithUserRight(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in_opt PLSA_UNICODE_STRING UserRight, _In_opt_ PLSA_UNICODE_STRING UserRight,
__out PVOID *Buffer, _Out_ PVOID *Buffer,
__out PULONG CountReturned _Out_ PULONG CountReturned
); );
// //
// These new APIs differ by taking a SID instead of requiring the caller // These new APIs differ by taking a SID instead of requiring the caller
// to open the account first and passing in an account handle // to open the account first and passing in an account handle
// //
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaEnumerateAccountRights( LsaEnumerateAccountRights(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PSID AccountSid, _In_ PSID AccountSid,
__deref_out_ecount(*CountOfRights) PLSA_UNICODE_STRING *UserRights, _Outptr_result_buffer_(*CountOfRights) PLSA_UNICODE_STRING *UserRights,
__out PULONG CountOfRights _Out_ PULONG CountOfRights
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaAddAccountRights( LsaAddAccountRights(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PSID AccountSid, _In_ PSID AccountSid,
__in_ecount(CountOfRights) PLSA_UNICODE_STRING UserRights, _In_reads_(CountOfRights) PLSA_UNICODE_STRING UserRights,
__in ULONG CountOfRights _In_ ULONG CountOfRights
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaRemoveAccountRights( LsaRemoveAccountRights(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PSID AccountSid, _In_ PSID AccountSid,
__in BOOLEAN AllRights, _In_ BOOLEAN AllRights,
__in_ecount_opt(CountOfRights) PLSA_UNICODE_STRING UserRights, _In_reads_opt_(CountOfRights) PLSA_UNICODE_STRING UserRights,
__in ULONG CountOfRights _In_ ULONG CountOfRights
); );
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// // // //
// Local Security Policy - Trusted Domain Object API function prototypes // // Local Security Policy - Trusted Domain Object API function prototypes //
// // // //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaOpenTrustedDomainByName( LsaOpenTrustedDomainByName(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING TrustedDomainName, _In_ PLSA_UNICODE_STRING TrustedDomainName,
__in ACCESS_MASK DesiredAccess, _In_ ACCESS_MASK DesiredAccess,
__out PLSA_HANDLE TrustedDomainHandle _Out_ PLSA_HANDLE TrustedDomainHandle
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaQueryTrustedDomainInfo( LsaQueryTrustedDomainInfo(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PSID TrustedDomainSid, _In_ PSID TrustedDomainSid,
__in TRUSTED_INFORMATION_CLASS InformationClass, _In_ TRUSTED_INFORMATION_CLASS InformationClass,
__out PVOID *Buffer _Out_ PVOID *Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaSetTrustedDomainInformation( LsaSetTrustedDomainInformation(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PSID TrustedDomainSid, _In_ PSID TrustedDomainSid,
__in TRUSTED_INFORMATION_CLASS InformationClass, _In_ TRUSTED_INFORMATION_CLASS InformationClass,
__in PVOID Buffer _In_ PVOID Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaDeleteTrustedDomain( LsaDeleteTrustedDomain(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PSID TrustedDomainSid _In_ PSID TrustedDomainSid
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaQueryTrustedDomainInfoByName( LsaQueryTrustedDomainInfoByName(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING TrustedDomainName, _In_ PLSA_UNICODE_STRING TrustedDomainName,
__in TRUSTED_INFORMATION_CLASS InformationClass, _In_ TRUSTED_INFORMATION_CLASS InformationClass,
__out PVOID *Buffer _Out_ PVOID *Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaSetTrustedDomainInfoByName( LsaSetTrustedDomainInfoByName(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING TrustedDomainName, _In_ PLSA_UNICODE_STRING TrustedDomainName,
__in TRUSTED_INFORMATION_CLASS InformationClass, _In_ TRUSTED_INFORMATION_CLASS InformationClass,
__in PVOID Buffer _In_ PVOID Buffer
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaEnumerateTrustedDomainsEx( LsaEnumerateTrustedDomainsEx(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__inout PLSA_ENUMERATION_HANDLE EnumerationContext, _Inout_ PLSA_ENUMERATION_HANDLE EnumerationContext,
__out PVOID *Buffer, _Out_ PVOID *Buffer,
__in ULONG PreferedMaximumLength, _In_ ULONG PreferedMaximumLength,
__out PULONG CountReturned _Out_ PULONG CountReturned
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaCreateTrustedDomainEx( LsaCreateTrustedDomainEx(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PTRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation, _In_ PTRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
__in PTRUSTED_DOMAIN_AUTH_INFORMATION AuthenticationInformation, _In_ PTRUSTED_DOMAIN_AUTH_INFORMATION AuthenticationInformation,
__in ACCESS_MASK DesiredAccess, _In_ ACCESS_MASK DesiredAccess,
__out PLSA_HANDLE TrustedDomainHandle _Out_ PLSA_HANDLE TrustedDomainHandle
); );
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaQueryForestTrustInformation( LsaQueryForestTrustInformation(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING TrustedDomainName, _In_ PLSA_UNICODE_STRING TrustedDomainName,
__out PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo _Out_ PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaSetForestTrustInformation( LsaSetForestTrustInformation(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING TrustedDomainName, _In_ PLSA_UNICODE_STRING TrustedDomainName,
__in PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo, _In_ PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo,
__in BOOLEAN CheckOnly, _In_ BOOLEAN CheckOnly,
__out PLSA_FOREST_TRUST_COLLISION_INFORMATION * CollisionInfo _Out_ PLSA_FOREST_TRUST_COLLISION_INFORMATION * CollisionInfo
); );
// #define TESTING_MATCHING_ROUTINE // #define TESTING_MATCHING_ROUTINE
#ifdef TESTING_MATCHING_ROUTINE #ifdef TESTING_MATCHING_ROUTINE
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaForestTrustFindMatch( LsaForestTrustFindMatch(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in ULONG Type, _In_ ULONG Type,
__in PLSA_UNICODE_STRING Name, _In_ PLSA_UNICODE_STRING Name,
__out PLSA_UNICODE_STRING * Match _Out_ PLSA_UNICODE_STRING * Match
); );
#endif #endif
#endif #endif
// //
// This API sets the workstation password (equivalent of setting/getting // This API sets the workstation password (equivalent of setting/getting
// the SSI_SECRET_NAME secret) // the SSI_SECRET_NAME secret)
// //
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaStorePrivateData( LsaStorePrivateData(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING KeyName, _In_ PLSA_UNICODE_STRING KeyName,
__in_opt PLSA_UNICODE_STRING PrivateData _In_opt_ PLSA_UNICODE_STRING PrivateData
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
LsaRetrievePrivateData( LsaRetrievePrivateData(
__in LSA_HANDLE PolicyHandle, _In_ LSA_HANDLE PolicyHandle,
__in PLSA_UNICODE_STRING KeyName, _In_ PLSA_UNICODE_STRING KeyName,
__out PLSA_UNICODE_STRING * PrivateData _Out_ PLSA_UNICODE_STRING * PrivateData
); );
ULONG ULONG
NTAPI NTAPI
LsaNtStatusToWinError( LsaNtStatusToWinError(
__in NTSTATUS Status _In_ NTSTATUS Status
); );
// //
// Define a symbol so we can tell if ntifs.h has been included. // Define a symbol so we can tell if ntifs.h has been included.
// //
// begin_ntifs // begin_ntifs
#ifndef _NTLSA_IFS_ #ifndef _NTLSA_IFS_
#define _NTLSA_IFS_ #define _NTLSA_IFS_
#endif #endif
// end_ntifs // end_ntifs
// //
// SPNEGO package stuff // SPNEGO package stuff
// //
enum NEGOTIATE_MESSAGES { enum NEGOTIATE_MESSAGES {
NegEnumPackagePrefixes = 0, NegEnumPackagePrefixes = 0,
NegGetCallerName = 1, NegGetCallerName = 1,
NegTransferCredentials = 2,
NegCallPackageMax NegCallPackageMax
}; };
#define NEGOTIATE_MAX_PREFIX 32 #define NEGOTIATE_MAX_PREFIX 32
typedef struct _NEGOTIATE_PACKAGE_PREFIX { typedef struct _NEGOTIATE_PACKAGE_PREFIX {
ULONG_PTR PackageId; ULONG_PTR PackageId;
PVOID PackageDataA; PVOID PackageDataA;
PVOID PackageDataW; PVOID PackageDataW;
ULONG_PTR PrefixLen; ULONG_PTR PrefixLen;
skipping to change at line 2959 skipping to change at line 3220
#define SAM_PASSWORD_CHANGE_NOTIFY_ROUTINE "PasswordChangeNotify" #define SAM_PASSWORD_CHANGE_NOTIFY_ROUTINE "PasswordChangeNotify"
typedef BOOLEAN (*PSAM_INIT_NOTIFICATION_ROUTINE) ( typedef BOOLEAN (*PSAM_INIT_NOTIFICATION_ROUTINE) (
); );
#define SAM_INIT_NOTIFICATION_ROUTINE "InitializeChangeNotify" #define SAM_INIT_NOTIFICATION_ROUTINE "InitializeChangeNotify"
#define SAM_PASSWORD_FILTER_ROUTINE "PasswordFilter" #define SAM_PASSWORD_FILTER_ROUTINE "PasswordFilter"
typedef BOOLEAN (*PSAM_PASSWORD_FILTER_ROUTINE) ( typedef BOOLEAN (*PSAM_PASSWORD_FILTER_ROUTINE) (
__in PUNICODE_STRING AccountName, _In_ PUNICODE_STRING AccountName,
__in PUNICODE_STRING FullName, _In_ PUNICODE_STRING FullName,
__in PUNICODE_STRING Password, _In_ PUNICODE_STRING Password,
__in BOOLEAN SetOperation _In_ BOOLEAN SetOperation
); );
#endif // _PASSWORD_NOTIFICATION_DEFINED #endif // _PASSWORD_NOTIFICATION_DEFINED
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// // // //
// Name of the MSV1_0 authentication package // // Name of the MSV1_0 authentication package //
// // // //
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
skipping to change at line 3015 skipping to change at line 3276
// //
typedef enum _MSV1_0_LOGON_SUBMIT_TYPE { typedef enum _MSV1_0_LOGON_SUBMIT_TYPE {
MsV1_0InteractiveLogon = 2, MsV1_0InteractiveLogon = 2,
MsV1_0Lm20Logon, MsV1_0Lm20Logon,
MsV1_0NetworkLogon, MsV1_0NetworkLogon,
MsV1_0SubAuthLogon, MsV1_0SubAuthLogon,
MsV1_0WorkstationUnlockLogon = 7, MsV1_0WorkstationUnlockLogon = 7,
// defined in Windows Server 2008 and up // defined in Windows Server 2008 and up
MsV1_0S4ULogon = 12, MsV1_0S4ULogon = 12,
MsV1_0VirtualLogon = 82 MsV1_0VirtualLogon = 82,
// defined in Windows 8 and up
MsV1_0NoElevationLogon = 83,
// defined in Windows 8.1 and up
MsV1_0LuidLogon = 84,
} MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE; } MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE;
// //
// MSV1.0 LsaLogonUser() profile buffer types. // MSV1.0 LsaLogonUser() profile buffer types.
// //
typedef enum _MSV1_0_PROFILE_BUFFER_TYPE { typedef enum _MSV1_0_PROFILE_BUFFER_TYPE {
MsV1_0InteractiveProfile = 2, MsV1_0InteractiveProfile = 2,
MsV1_0Lm20LogonProfile, MsV1_0Lm20LogonProfile,
MsV1_0SmartCardProfile MsV1_0SmartCardProfile
skipping to change at line 3173 skipping to change at line 3438
#endif #endif
#define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000 #define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000
// Defined in Windows Server 2003 SP1 and above // Defined in Windows Server 2003 SP1 and above
#define MSV1_0_ALLOW_MSVCHAPV2 0x00010000 #define MSV1_0_ALLOW_MSVCHAPV2 0x00010000
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
//Defined in Windows Server 2008 and up //Defined in Windows Server 2008 and up
#define MSV1_0_S4U2SELF 0x00020000 // no password is needed #define MSV1_0_S4U2SELF 0x00020000 // no password is needed
#define MSV1_0_CHECK_LOGONHOURS_FOR_S4U 0x00040000 // check logon hours for S4U logon #define MSV1_0_CHECK_LOGONHOURS_FOR_S4U 0x00040000 // check logon hours for S4U logon
#endif
#if (_WIN32_WINNT >= 0x0602)
// Logon for internet users. To be used by calls from auth package
// directly, not from netlogon.
#define MSV1_0_INTERNET_DOMAIN 0x00080000
#endif #endif
// //
// The high order byte is a value indicating the SubAuthentication DLL. // The high order byte is a value indicating the SubAuthentication DLL.
// Zero indicates no SubAuthentication DLL. // Zero indicates no SubAuthentication DLL.
// //
#define MSV1_0_SUBAUTHENTICATION_DLL 0xFF000000 #define MSV1_0_SUBAUTHENTICATION_DLL 0xFF000000
#define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT 24 #define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT 24
#define MSV1_0_MNS_LOGON 0x01000000 #define MSV1_0_MNS_LOGON 0x01000000
skipping to change at line 3268 skipping to change at line 3538
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define LOGON_OPTIMIZED 0x4000 // this is an optimized logon #define LOGON_OPTIMIZED 0x4000 // this is an optimized logon
#define LOGON_WINLOGON 0x8000 // the logon session was created for winlogon #define LOGON_WINLOGON 0x8000 // the logon session was created for winlogon
#define LOGON_PKINIT 0x10000 // Kerberos PKINIT extension was use d to authenticate the user #define LOGON_PKINIT 0x10000 // Kerberos PKINIT extension was use d to authenticate the user
#define LOGON_NO_OPTIMIZED 0x20000 // optimized logon has been disabled for this account #define LOGON_NO_OPTIMIZED 0x20000 // optimized logon has been disabled for this account
#endif #endif
#if (_WIN32_WINNT >= 0x0602)
#define LOGON_NO_ELEVATION 0x40000 // Do not allow elevation for this l
ogon
#define LOGON_MANAGED_SERVICE 0x80000 // Managed service account
#endif
// //
// The high order byte is reserved for return by SubAuthentication DLLs. // The high order byte is reserved for return by SubAuthentication DLLs.
// //
#define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000 #define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000
// Values returned by the MSV1_0_MNS_LOGON SubAuthentication DLL // Values returned by the MSV1_0_MNS_LOGON SubAuthentication DLL
#define LOGON_GRACE_LOGON 0x01000000 #define LOGON_GRACE_LOGON 0x01000000
typedef struct _MSV1_0_LM20_LOGON_PROFILE { typedef struct _MSV1_0_LM20_LOGON_PROFILE {
skipping to change at line 3297 skipping to change at line 3574
} MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE; } MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE;
// //
// Supplemental credentials structure used for passing credentials into // Supplemental credentials structure used for passing credentials into
// MSV1_0 from other packages // MSV1_0 from other packages
// //
#define MSV1_0_OWF_PASSWORD_LENGTH 16 #define MSV1_0_OWF_PASSWORD_LENGTH 16
#define MSV1_0_CRED_LM_PRESENT 0x1 #define MSV1_0_CRED_LM_PRESENT 0x1
#define MSV1_0_CRED_NT_PRESENT 0x2 #define MSV1_0_CRED_NT_PRESENT 0x2
#define MSV1_0_CRED_REMOVED 0x4
#define MSV1_0_CRED_VERSION 0 #define MSV1_0_CRED_VERSION 0
typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL { typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL {
ULONG Version; ULONG Version;
ULONG Flags; ULONG Flags;
UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH]; UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH];
UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH]; UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH];
} MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL; } MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
// //
skipping to change at line 3335 skipping to change at line 3613
// //
// MsvAvFlags bit values // MsvAvFlags bit values
// //
// Exists only after Windows 2000 // Exists only after Windows 2000
// //
#define MSV1_0_AV_FLAG_FORCE_GUEST 0x00000001 #define MSV1_0_AV_FLAG_FORCE_GUEST 0x00000001
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES 0x00000002 // the client sup ports #define MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES 0x00000002 // the client sup ports
// hand-shake mes sages integrity // hand-shake mes sages integrity
#if (_WIN32_WINNT >= 0x0601)
#define MSV1_0_AV_FLAG_UNVERIFIED_TARGET 0x00000004
#endif
#endif #endif
#endif #endif
// this is an MSV1_0 private data structure, defining the layout of an NTLM3 res ponse, as sent by a // this is an MSV1_0 private data structure, defining the layout of an NTLM3 res ponse, as sent by a
// client in the NtChallengeResponse field of the NETLOGON_NETWORK_INFO structu re. If can be differentiated // client in the NtChallengeResponse field of the NETLOGON_NETWORK_INFO structu re. If can be differentiated
// from an old style NT response by its length. This is crude, but it needs to pass through servers and // from an old style NT response by its length. This is crude, but it needs to pass through servers and
// the servers' DCs that do not understand NTLM3 but that are willing to pass l onger responses. // the servers' DCs that do not understand NTLM3 but that are willing to pass l onger responses.
typedef struct _MSV1_0_NTLM3_RESPONSE { typedef struct _MSV1_0_NTLM3_RESPONSE {
UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH]; // hash of OWF of password wit h all the following fields UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH]; // hash of OWF of password wit h all the following fields
UCHAR RespType; // id number of response; current is 1 UCHAR RespType; // id number of response; current is 1
skipping to change at line 3415 skipping to change at line 3697
MsV1_0SubAuth, // Both submission and response MsV1_0SubAuth, // Both submission and response
MsV1_0DeriveCredential, // Both submission and response MsV1_0DeriveCredential, // Both submission and response
MsV1_0CacheLookup, // Both submission and response MsV1_0CacheLookup, // Both submission and response
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
MsV1_0SetProcessOption, // Submission only, no response MsV1_0SetProcessOption, // Submission only, no response
#endif #endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
MsV1_0ConfigLocalAliases, MsV1_0ConfigLocalAliases,
MsV1_0ClearCachedCredentials, MsV1_0ClearCachedCredentials,
#endif #endif
#if (_WIN32_WINNT >= 0x0601)
MsV1_0LookupToken, // Both submission and response
#endif
#if (_WIN32_WINNT >= 0x0602)
MsV1_0ValidateAuth,
MsV1_0CacheLookupEx, // Both submission and response
MsV1_0GetCredentialKey, // Both submission and response
MsV1_0SetThreadOption, // Submission only
#endif
} MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE; } MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE;
typedef struct _MSV1_0_CHANGEPASSWORD_REQUEST { typedef struct _MSV1_0_CHANGEPASSWORD_REQUEST {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING DomainName; UNICODE_STRING DomainName;
UNICODE_STRING AccountName; UNICODE_STRING AccountName;
UNICODE_STRING OldPassword; UNICODE_STRING OldPassword;
UNICODE_STRING NewPassword; UNICODE_STRING NewPassword;
BOOLEAN Impersonating; BOOLEAN Impersonating;
} MSV1_0_CHANGEPASSWORD_REQUEST, *PMSV1_0_CHANGEPASSWORD_REQUEST; } MSV1_0_CHANGEPASSWORD_REQUEST, *PMSV1_0_CHANGEPASSWORD_REQUEST;
skipping to change at line 3489 skipping to change at line 3780
#define RtlGenRandom SystemFunction036 #define RtlGenRandom SystemFunction036
#endif #endif
#if(_WIN32_WINNT >= 0x0500) #if(_WIN32_WINNT >= 0x0500)
#define RtlEncryptMemory SystemFunction040 #define RtlEncryptMemory SystemFunction040
#define RtlDecryptMemory SystemFunction041 #define RtlDecryptMemory SystemFunction041
#endif #endif
#if(_WIN32_WINNT >= 0x0501) #if(_WIN32_WINNT >= 0x0501)
BOOLEAN BOOLEAN
RtlGenRandom( RtlGenRandom(
__out_bcount(RandomBufferLength) PVOID RandomBuffer, _Out_writes_bytes_(RandomBufferLength) PVOID RandomBuffer,
__in ULONG RandomBufferLength _In_ ULONG RandomBufferLength
); );
#endif #endif
/* /*
* #if(_WIN32_WINNT >= 0x0500) -- Disabled until WinHTTP fixes their target vers ion. * #if(_WIN32_WINNT >= 0x0500) -- Disabled until WinHTTP fixes their target vers ion.
*/ */
// //
// The buffer passed into RtlEncryptMemory and RtlDecryptMemory // The buffer passed into RtlEncryptMemory and RtlDecryptMemory
// must be a multiple of this length. // must be a multiple of this length.
skipping to change at line 3521 skipping to change at line 3812
// //
// Allow Encrypt/Decrypt across callers with same LogonId. // Allow Encrypt/Decrypt across callers with same LogonId.
// eg: encrypted buffer passed across LPC to another process which calls RtlDecr yptMemory whilst impersonating. // eg: encrypted buffer passed across LPC to another process which calls RtlDecr yptMemory whilst impersonating.
// //
#define RTL_ENCRYPT_OPTION_SAME_LOGON 0x02 #define RTL_ENCRYPT_OPTION_SAME_LOGON 0x02
NTSTATUS NTSTATUS
RtlEncryptMemory( RtlEncryptMemory(
__inout_bcount(MemorySize) PVOID Memory, _Inout_updates_bytes_(MemorySize) PVOID Memory,
__in ULONG MemorySize, _In_ ULONG MemorySize,
__in ULONG OptionFlags _In_ ULONG OptionFlags
); );
NTSTATUS NTSTATUS
RtlDecryptMemory( RtlDecryptMemory(
__inout_bcount(MemorySize) PVOID Memory, _Inout_updates_bytes_(MemorySize) PVOID Memory,
__in ULONG MemorySize, _In_ ULONG MemorySize,
__in ULONG OptionFlags _In_ ULONG OptionFlags
); );
//#endif //#endif
// Revision of the Kerberos Protocol. MS uses Version 5, Revision 6 // Revision of the Kerberos Protocol. MS uses Version 5, Revision 6
#define KERBEROS_VERSION 5 #define KERBEROS_VERSION 5
#define KERBEROS_REVISION 6 #define KERBEROS_REVISION 6
// Encryption Types: // Encryption Types:
// These encryption types are supported by the default MS KERBSUPP DLL // These encryption types are supported by the default MS KERBSUPP DLL
skipping to change at line 3686 skipping to change at line 3977
#define KERB_TICKET_FLAGS_invalid 0x01000000 #define KERB_TICKET_FLAGS_invalid 0x01000000
#define KERB_TICKET_FLAGS_renewable 0x00800000 #define KERB_TICKET_FLAGS_renewable 0x00800000
#define KERB_TICKET_FLAGS_initial 0x00400000 #define KERB_TICKET_FLAGS_initial 0x00400000
#define KERB_TICKET_FLAGS_pre_authent 0x00200000 #define KERB_TICKET_FLAGS_pre_authent 0x00200000
#define KERB_TICKET_FLAGS_hw_authent 0x00100000 #define KERB_TICKET_FLAGS_hw_authent 0x00100000
#define KERB_TICKET_FLAGS_ok_as_delegate 0x00040000 #define KERB_TICKET_FLAGS_ok_as_delegate 0x00040000
#define KERB_TICKET_FLAGS_name_canonicalize 0x00010000 #define KERB_TICKET_FLAGS_name_canonicalize 0x00010000
#if (_WIN32_WINNT == 0x0501) #if (_WIN32_WINNT == 0x0501)
#define KERB_TICKET_FLAGS_cname_in_pa_data 0x00040000 #define KERB_TICKET_FLAGS_cname_in_pa_data 0x00040000
#endif #endif
#define KERB_TICKET_FLAGS_enc_pa_rep 0x00010000
#define KERB_TICKET_FLAGS_reserved1 0x00000001 #define KERB_TICKET_FLAGS_reserved1 0x00000001
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
// //
// Name types // Name types
// //
#define KRB_NT_UNKNOWN 0 // Name type not known #define KRB_NT_UNKNOWN 0 // Name type not known
#define KRB_NT_PRINCIPAL 1 // Just the name of the principal as i n DCE, or for users #define KRB_NT_PRINCIPAL 1 // Just the name of the principal as i n DCE, or for users
#define KRB_NT_PRINCIPAL_AND_ID -131 // Name of the principal and its SID. #define KRB_NT_PRINCIPAL_AND_ID -131 // Name of the principal and its SID.
#define KRB_NT_SRV_INST 2 // Service and other unique instance ( krbtgt) #define KRB_NT_SRV_INST 2 // Service and other unique instance ( krbtgt)
#define KRB_NT_SRV_INST_AND_ID -132 // SPN and SID #define KRB_NT_SRV_INST_AND_ID -132 // SPN and SID
#define KRB_NT_SRV_HST 3 // Service with host name as instance (telnet, rcommands) #define KRB_NT_SRV_HST 3 // Service with host name as instance (telnet, rcommands)
#define KRB_NT_SRV_XHST 4 // Service with host as remaining comp onents #define KRB_NT_SRV_XHST 4 // Service with host as remaining comp onents
#define KRB_NT_UID 5 // Unique ID #define KRB_NT_UID 5 // Unique ID
#define KRB_NT_ENTERPRISE_PRINCIPAL 10 // UPN **ONLY** #define KRB_NT_ENTERPRISE_PRINCIPAL 10 // UPN **ONLY**
#define KRB_NT_WELLKNOWN 11 // Well-known principal names
#define KRB_NT_ENT_PRINCIPAL_AND_ID -130 // UPN and SID #define KRB_NT_ENT_PRINCIPAL_AND_ID -130 // UPN and SID
// //
// MS extensions, negative according to the RFC // MS extensions, negative according to the RFC
// //
#define KRB_NT_MS_PRINCIPAL -128 // NT4 style name #define KRB_NT_MS_PRINCIPAL -128 // NT4 style name
#define KRB_NT_MS_PRINCIPAL_AND_ID -129 // nt4 style name with sid #define KRB_NT_MS_PRINCIPAL_AND_ID -129 // nt4 style name with sid
#define KRB_NT_MS_BRANCH_ID -133 // Branch ID #define KRB_NT_MS_BRANCH_ID -133 // Branch ID
#define KERB_IS_MS_PRINCIPAL(_x_) (((_x_) <= KRB_NT_MS_PRINCIPAL) || ((_x_) >= K RB_NT_ENTERPRISE_PRINCIPAL)) #define KERB_IS_MS_PRINCIPAL(_x_) (((_x_) <= KRB_NT_MS_PRINCIPAL) || ((_x_) >= K RB_NT_ENTERPRISE_PRINCIPAL))
#endif #endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define KRB_NT_X500_PRINCIPAL 6 // Encoded X.500 Distingished name [RF C 2253] #define KRB_NT_X500_PRINCIPAL 6 // Encoded X.500 Distingished name [RF C 2253]
#endif #endif
#define KRB_WELLKNOWN_STRING L"WELLKNOWN"
#define KRB_ANONYMOUS_STRING L"ANONYMOUS"
#ifndef MICROSOFT_KERBEROS_NAME_A #ifndef MICROSOFT_KERBEROS_NAME_A
#define MICROSOFT_KERBEROS_NAME_A "Kerberos" #define MICROSOFT_KERBEROS_NAME_A "Kerberos"
#define MICROSOFT_KERBEROS_NAME_W L"Kerberos" #define MICROSOFT_KERBEROS_NAME_W L"Kerberos"
#ifdef WIN32_CHICAGO #ifdef WIN32_CHICAGO
#define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_A #define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_A
#else #else
#define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_W #define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_W
#endif // WIN32_CHICAGO #endif // WIN32_CHICAGO
#endif // MICROSOFT_KERBEROS_NAME_A #endif // MICROSOFT_KERBEROS_NAME_A
skipping to change at line 3767 skipping to change at line 4063
KerbTicketLogon = 10, KerbTicketLogon = 10,
KerbTicketUnlockLogon = 11, KerbTicketUnlockLogon = 11,
//#if (_WIN32_WINNT >= 0x0501) -- Disabled until IIS fixes their target version. //#if (_WIN32_WINNT >= 0x0501) -- Disabled until IIS fixes their target version.
KerbS4ULogon = 12, KerbS4ULogon = 12,
//#endif //#endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
KerbCertificateLogon = 13, KerbCertificateLogon = 13,
KerbCertificateS4ULogon = 14, KerbCertificateS4ULogon = 14,
KerbCertificateUnlockLogon = 15, KerbCertificateUnlockLogon = 15,
#endif #endif
#if (_WIN32_WINNT >= 0x0602)
KerbNoElevationLogon = 83,
KerbLuidLogon = 84,
#endif
} KERB_LOGON_SUBMIT_TYPE, *PKERB_LOGON_SUBMIT_TYPE; } KERB_LOGON_SUBMIT_TYPE, *PKERB_LOGON_SUBMIT_TYPE;
typedef struct _KERB_INTERACTIVE_LOGON { typedef struct _KERB_INTERACTIVE_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType; KERB_LOGON_SUBMIT_TYPE MessageType;
UNICODE_STRING LogonDomainName; UNICODE_STRING LogonDomainName;
UNICODE_STRING UserName; UNICODE_STRING UserName;
UNICODE_STRING Password; UNICODE_STRING Password;
} KERB_INTERACTIVE_LOGON, *PKERB_INTERACTIVE_LOGON; } KERB_INTERACTIVE_LOGON, *PKERB_INTERACTIVE_LOGON;
typedef struct _KERB_INTERACTIVE_UNLOCK_LOGON { typedef struct _KERB_INTERACTIVE_UNLOCK_LOGON {
skipping to change at line 3799 skipping to change at line 4099
KERB_SMART_CARD_LOGON Logon; KERB_SMART_CARD_LOGON Logon;
LUID LogonId; LUID LogonId;
} KERB_SMART_CARD_UNLOCK_LOGON, *PKERB_SMART_CARD_UNLOCK_LOGON; } KERB_SMART_CARD_UNLOCK_LOGON, *PKERB_SMART_CARD_UNLOCK_LOGON;
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
// //
// let the KDC detect account mapping conflicts for the same certificate. // let the KDC detect account mapping conflicts for the same certificate.
// //
#define KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES 0x1 #define KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES 0x1
#define KERB_CERTIFICATE_LOGON_FLAG_USE_CERTIFICATE_INFO 0x2
typedef struct _KERB_CERTIFICATE_LOGON { typedef struct _KERB_CERTIFICATE_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType; // KerbCertificateLogon KERB_LOGON_SUBMIT_TYPE MessageType; // KerbCertificateLogon
UNICODE_STRING DomainName; // OPTIONAL, if supplied, used to locate the acco unt forest UNICODE_STRING DomainName; // OPTIONAL, if supplied, used to locate the acco unt forest
UNICODE_STRING UserName; // OPTIONAL, if supplied, used to locate the acco unt UNICODE_STRING UserName; // OPTIONAL, if supplied, used to locate the acco unt
UNICODE_STRING Pin; UNICODE_STRING Pin;
ULONG Flags; // additional flags ULONG Flags; // additional flags
ULONG CspDataLength; ULONG CspDataLength;
PUCHAR CspData; // contains the smartcard CSP data PUCHAR CspData; // contains the smartcard CSP data
} KERB_CERTIFICATE_LOGON, *PKERB_CERTIFICATE_LOGON; } KERB_CERTIFICATE_LOGON, *PKERB_CERTIFICATE_LOGON;
skipping to change at line 3823 skipping to change at line 4124
LUID LogonId; LUID LogonId;
} KERB_CERTIFICATE_UNLOCK_LOGON, *PKERB_CERTIFICATE_UNLOCK_LOGON; } KERB_CERTIFICATE_UNLOCK_LOGON, *PKERB_CERTIFICATE_UNLOCK_LOGON;
// //
// let the KDC detect account mapping conflicts for the same certificate. // let the KDC detect account mapping conflicts for the same certificate.
// //
#define KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_DUPLICATES 0x1 #define KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_DUPLICATES 0x1
#define KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2 #define KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2
#define KERB_CERTIFICATE_S4U_LOGON_FLAG_FAIL_IF_NT_AUTH_POLICY_REQUIRED 0x4 #define KERB_CERTIFICATE_S4U_LOGON_FLAG_FAIL_IF_NT_AUTH_POLICY_REQUIRED 0x4
#define KERB_CERTIFICATE_S4U_LOGON_FLAG_IDENTIFY 0x8 // request for iden tify token, must have the same value as KERB_S4U_LOGON_FLAG_IDENTIFY
typedef struct _KERB_CERTIFICATE_S4U_LOGON { typedef struct _KERB_CERTIFICATE_S4U_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType; KERB_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags; ULONG Flags;
UNICODE_STRING UserPrincipalName; UNICODE_STRING UserPrincipalName;
// OPTIONAL, certificate mapping hints: username or username@domain // OPTIONAL, certificate mapping hints: username or username@domain
UNICODE_STRING DomainName; // used to locate the forest UNICODE_STRING DomainName; // used to locate the forest
// OPTIONAL, certificate mapping hints: if missing, using the local machine's domain // OPTIONAL, certificate mapping hints: if missing, using the local machine's domain
ULONG CertificateLength; // for the client certificate ULONG CertificateLength; // for the client certificate
PUCHAR Certificate; // for the client certificate, BER encoded PUCHAR Certificate; // for the client certificate, BER encoded
skipping to change at line 3874 skipping to change at line 4176
// //
// //
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
// //
// request to enforce logon hours policy // request to enforce logon hours policy
// //
#define KERB_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2 #define KERB_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2
#define KERB_S4U_LOGON_FLAG_IDENTIFY 0x8 // request for identify token
#endif #endif
typedef struct _KERB_S4U_LOGON { typedef struct _KERB_S4U_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType; KERB_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags; ULONG Flags;
UNICODE_STRING ClientUpn; // REQUIRED: UPN for client UNICODE_STRING ClientUpn; // REQUIRED: UPN for client
UNICODE_STRING ClientRealm; // Optional: Client Realm, if known UNICODE_STRING ClientRealm; // Optional: Client Realm, if known
} KERB_S4U_LOGON, *PKERB_S4U_LOGON; } KERB_S4U_LOGON, *PKERB_S4U_LOGON;
//#endif //#endif
skipping to change at line 3978 skipping to change at line 4281
KerbRefreshSmartcardCredentialsMessage, KerbRefreshSmartcardCredentialsMessage,
KerbAddExtraCredentialsMessage, KerbAddExtraCredentialsMessage,
KerbQuerySupplementalCredentialsMessage, KerbQuerySupplementalCredentialsMessage,
#endif #endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
KerbTransferCredentialsMessage, KerbTransferCredentialsMessage,
KerbQueryTicketCacheEx2Message, KerbQueryTicketCacheEx2Message,
KerbSubmitTicketMessage, KerbSubmitTicketMessage,
KerbAddExtraCredentialsExMessage, KerbAddExtraCredentialsExMessage,
#endif #endif
#if (_WIN32_WINNT >= 0x0602)
KerbQueryKdcProxyCacheMessage,
KerbPurgeKdcProxyCacheMessage,
KerbQueryTicketCacheEx3Message,
KerbCleanupMachinePkinitCredsMessage,
KerbAddBindingCacheEntryExMessage,
KerbQueryBindingCacheMessage,
KerbPurgeBindingCacheMessage,
KerbPinKdcMessage,
KerbUnpinAllKdcsMessage,
KerbQueryDomainExtendedPoliciesMessage,
KerbQueryS4U2ProxyCacheMessage,
#endif
} KERB_PROTOCOL_MESSAGE_TYPE, *PKERB_PROTOCOL_MESSAGE_TYPE; } KERB_PROTOCOL_MESSAGE_TYPE, *PKERB_PROTOCOL_MESSAGE_TYPE;
// //
// Used both for retrieving tickets and for querying ticket cache // Used both for retrieving tickets and for querying ticket cache
// //
typedef struct _KERB_QUERY_TKT_CACHE_REQUEST { typedef struct _KERB_QUERY_TKT_CACHE_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId; LUID LogonId;
} KERB_QUERY_TKT_CACHE_REQUEST, *PKERB_QUERY_TKT_CACHE_REQUEST; } KERB_QUERY_TKT_CACHE_REQUEST, *PKERB_QUERY_TKT_CACHE_REQUEST;
skipping to change at line 4031 skipping to change at line 4347
LONG EncryptionType; LONG EncryptionType;
ULONG TicketFlags; ULONG TicketFlags;
// //
// the following are new in KERB_TICKET_CACHE_INFO_EX2 // the following are new in KERB_TICKET_CACHE_INFO_EX2
// //
ULONG SessionKeyType; ULONG SessionKeyType;
ULONG BranchId; ULONG BranchId;
} KERB_TICKET_CACHE_INFO_EX2, *PKERB_TICKET_CACHE_INFO_EX2; } KERB_TICKET_CACHE_INFO_EX2, *PKERB_TICKET_CACHE_INFO_EX2;
#if (_WIN32_WINNT >= 0x0602)
typedef struct _KERB_TICKET_CACHE_INFO_EX3 {
UNICODE_STRING ClientName;
UNICODE_STRING ClientRealm;
UNICODE_STRING ServerName;
UNICODE_STRING ServerRealm;
LARGE_INTEGER StartTime;
LARGE_INTEGER EndTime;
LARGE_INTEGER RenewTime;
LONG EncryptionType;
ULONG TicketFlags;
ULONG SessionKeyType;
ULONG BranchId;
//
// the following are new in KERB_TICKET_CACHE_INFO_EX3
//
ULONG CacheFlags;
UNICODE_STRING KdcCalled;
} KERB_TICKET_CACHE_INFO_EX3, *PKERB_TICKET_CACHE_INFO_EX3;
#endif
typedef struct _KERB_QUERY_TKT_CACHE_RESPONSE { typedef struct _KERB_QUERY_TKT_CACHE_RESPONSE {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfTickets; ULONG CountOfTickets;
KERB_TICKET_CACHE_INFO Tickets[ANYSIZE_ARRAY]; KERB_TICKET_CACHE_INFO Tickets[ANYSIZE_ARRAY];
} KERB_QUERY_TKT_CACHE_RESPONSE, *PKERB_QUERY_TKT_CACHE_RESPONSE; } KERB_QUERY_TKT_CACHE_RESPONSE, *PKERB_QUERY_TKT_CACHE_RESPONSE;
#if (_WIN32_WINNT >= 0x0502) #if (_WIN32_WINNT >= 0x0502)
typedef struct _KERB_QUERY_TKT_CACHE_EX_RESPONSE { typedef struct _KERB_QUERY_TKT_CACHE_EX_RESPONSE {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfTickets; ULONG CountOfTickets;
KERB_TICKET_CACHE_INFO_EX Tickets[ANYSIZE_ARRAY]; KERB_TICKET_CACHE_INFO_EX Tickets[ANYSIZE_ARRAY];
} KERB_QUERY_TKT_CACHE_EX_RESPONSE, *PKERB_QUERY_TKT_CACHE_EX_RESPONSE; } KERB_QUERY_TKT_CACHE_EX_RESPONSE, *PKERB_QUERY_TKT_CACHE_EX_RESPONSE;
#endif #endif
typedef struct _KERB_QUERY_TKT_CACHE_EX2_RESPONSE { typedef struct _KERB_QUERY_TKT_CACHE_EX2_RESPONSE {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfTickets; ULONG CountOfTickets;
KERB_TICKET_CACHE_INFO_EX2 Tickets[ANYSIZE_ARRAY]; KERB_TICKET_CACHE_INFO_EX2 Tickets[ANYSIZE_ARRAY];
} KERB_QUERY_TKT_CACHE_EX2_RESPONSE, *PKERB_QUERY_TKT_CACHE_EX2_RESPONSE; } KERB_QUERY_TKT_CACHE_EX2_RESPONSE, *PKERB_QUERY_TKT_CACHE_EX2_RESPONSE;
#if (_WIN32_WINNT >= 0x0602)
typedef struct _KERB_QUERY_TKT_CACHE_EX3_RESPONSE {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfTickets;
KERB_TICKET_CACHE_INFO_EX3 Tickets[ANYSIZE_ARRAY];
} KERB_QUERY_TKT_CACHE_EX3_RESPONSE, *PKERB_QUERY_TKT_CACHE_EX3_RESPONSE;
#endif
// //
// Types for retrieving encoded ticket from the cache // Types for retrieving encoded ticket from the cache
// //
#ifndef __SECHANDLE_DEFINED__ #ifndef __SECHANDLE_DEFINED__
typedef struct _SecHandle typedef struct _SecHandle
{ {
ULONG_PTR dwLower ; ULONG_PTR dwLower ;
ULONG_PTR dwUpper ; ULONG_PTR dwUpper ;
} SecHandle, * PSecHandle ; } SecHandle, * PSecHandle ;
skipping to change at line 4187 skipping to change at line 4534
typedef struct _KERB_SUBMIT_TKT_REQUEST { typedef struct _KERB_SUBMIT_TKT_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId; LUID LogonId;
ULONG Flags; ULONG Flags;
KERB_CRYPTO_KEY32 Key; // key to decrypt KERB_CRED KERB_CRYPTO_KEY32 Key; // key to decrypt KERB_CRED
ULONG KerbCredSize; ULONG KerbCredSize;
ULONG KerbCredOffset; ULONG KerbCredOffset;
} KERB_SUBMIT_TKT_REQUEST, *PKERB_SUBMIT_TKT_REQUEST; } KERB_SUBMIT_TKT_REQUEST, *PKERB_SUBMIT_TKT_REQUEST;
#if (_WIN32_WINNT >= 0x0602)
typedef struct _KERB_QUERY_KDC_PROXY_CACHE_REQUEST
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG Flags; // reserved, must be 0
LUID LogonId;
} KERB_QUERY_KDC_PROXY_CACHE_REQUEST, *PKERB_QUERY_KDC_PROXY_CACHE_REQUEST;
typedef struct _KDC_PROXY_CACHE_ENTRY_DATA
{
ULONG64 SinceLastUsed; // milliseconds since lastly used
UNICODE_STRING DomainName;
UNICODE_STRING ProxyServerName;
UNICODE_STRING ProxyServerVdir;
USHORT ProxyServerPort;
LUID LogonId; // per-credential cache
UNICODE_STRING CredUserName; // per-credential cache using supplied cred
UNICODE_STRING CredDomainName; // per-credential cache using supplied cred
BOOLEAN GlobalCache;
} KDC_PROXY_CACHE_ENTRY_DATA, *PKDC_PROXY_CACHE_ENTRY_DATA;
typedef struct _KERB_QUERY_KDC_PROXY_CACHE_RESPONSE
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfEntries;
PKDC_PROXY_CACHE_ENTRY_DATA Entries;
} KERB_QUERY_KDC_PROXY_CACHE_RESPONSE, *PKERB_QUERY_KDC_PROXY_CACHE_RESPONSE;
typedef struct _KERB_PURGE_KDC_PROXY_CACHE_REQUEST
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG Flags; // reserved, must be 0
LUID LogonId;
} KERB_PURGE_KDC_PROXY_CACHE_REQUEST, *PKERB_PURGE_KDC_PROXY_CACHE_REQUEST;
typedef struct _KERB_PURGE_KDC_PROXY_CACHE_RESPONSE
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfPurged;
} KERB_PURGE_KDC_PROXY_CACHE_RESPONSE, *PKERB_PURGE_KDC_PROXY_CACHE_RESPONSE;
//
// S4U2Proxy Cache Info
//
#define KERB_S4U2PROXY_CACHE_ENTRY_INFO_FLAG_NEGATIVE 0x1
typedef struct _KERB_S4U2PROXY_CACHE_ENTRY_INFO
{
UNICODE_STRING ServerName;
ULONG Flags;
NTSTATUS LastStatus;
LARGE_INTEGER Expiry;
} KERB_S4U2PROXY_CACHE_ENTRY_INFO, *PKERB_S4U2PROXY_CACHE_ENTRY_INFO;
#define KERB_S4U2PROXY_CRED_FLAG_NEGATIVE 0x1
typedef struct _KERB_S4U2PROXY_CRED
{
UNICODE_STRING UserName;
UNICODE_STRING DomainName;
ULONG Flags;
NTSTATUS LastStatus;
LARGE_INTEGER Expiry;
ULONG CountOfEntries;
PKERB_S4U2PROXY_CACHE_ENTRY_INFO Entries;
} KERB_S4U2PROXY_CRED, *PKERB_S4U2PROXY_CRED;
typedef struct _KERB_QUERY_S4U2PROXY_CACHE_REQUEST
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG Flags; // reserved, must be 0
LUID LogonId;
} KERB_QUERY_S4U2PROXY_CACHE_REQUEST, *PKERB_QUERY_S4U2PROXY_CACHE_REQUEST;
typedef struct _KERB_QUERY_S4U2PROXY_CACHE_RESPONSE
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfCreds;
PKERB_S4U2PROXY_CRED Creds;
} KERB_QUERY_S4U2PROXY_CACHE_RESPONSE, *PKERB_QUERY_S4U2PROXY_CACHE_RESPONSE;
#endif
// //
// KerbChangePassword // KerbChangePassword
// //
// KerbChangePassword changes the password on the KDC account plus // KerbChangePassword changes the password on the KDC account plus
// the password cache and logon credentials if applicable. // the password cache and logon credentials if applicable.
// //
// //
typedef struct _KERB_CHANGEPASSWORD_REQUEST { typedef struct _KERB_CHANGEPASSWORD_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
skipping to change at line 4350 skipping to change at line 4782
// Requires TCB. // Requires TCB.
// //
typedef struct _KERB_TRANSFER_CRED_REQUEST { typedef struct _KERB_TRANSFER_CRED_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID OriginLogonId; LUID OriginLogonId;
LUID DestinationLogonId; LUID DestinationLogonId;
ULONG Flags; ULONG Flags;
} KERB_TRANSFER_CRED_REQUEST, *PKERB_TRANSFER_CRED_REQUEST; } KERB_TRANSFER_CRED_REQUEST, *PKERB_TRANSFER_CRED_REQUEST;
#define KERB_TRANSFER_CRED_WITH_TICKETS 0x1 #define KERB_TRANSFER_CRED_WITH_TICKETS 0x1
#define KERB_TRANSFER_CRED_CLEANUP_CREDENTIALS 0x2
#if (_WIN32_WINNT >= 0x0602)
typedef struct _KERB_CLEANUP_MACHINE_PKINIT_CREDS_REQUEST
{
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId;
} KERB_CLEANUP_MACHINE_PKINIT_CREDS_REQUEST, *PKERB_CLEANUP_MACHINE_PKINIT_CREDS
_REQUEST;
#endif
#if (_WIN32_WINNT >= 0x0602)
typedef struct _KERB_BINDING_CACHE_ENTRY_DATA {
ULONG64 DiscoveryTime;
UNICODE_STRING RealmName;
UNICODE_STRING KdcAddress;
ULONG AddressType;
ULONG Flags;
ULONG DcFlags;
ULONG CacheFlags;
UNICODE_STRING KdcName;
} KERB_BINDING_CACHE_ENTRY_DATA, *PKERB_BINDING_CACHE_ENTRY_DATA;
typedef struct _KERB_QUERY_BINDING_CACHE_RESPONSE {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG CountOfEntries;
PKERB_BINDING_CACHE_ENTRY_DATA Entries;
} KERB_QUERY_BINDING_CACHE_RESPONSE, *PKERB_QUERY_BINDING_CACHE_RESPONSE;
typedef struct _KERB_ADD_BINDING_CACHE_ENTRY_EX_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING RealmName;
UNICODE_STRING KdcAddress;
ULONG AddressType; // DS_NETBIOS_ADDRESS / DS_INET_AD
DRESS
ULONG DcFlags;
} KERB_ADD_BINDING_CACHE_ENTRY_EX_REQUEST, *PKERB_ADD_BINDING_CACHE_ENTRY_EX_REQ
UEST;
typedef struct _KERB_QUERY_BINDING_CACHE_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
} KERB_QUERY_BINDING_CACHE_REQUEST, *PKERB_QUERY_BINDING_CACHE_REQUEST;
typedef struct _KERB_PURGE_BINDING_CACHE_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
} KERB_PURGE_BINDING_CACHE_REQUEST, *PKERB_PURGE_BINDING_CACHE_REQUEST;
typedef struct _KERB_QUERY_DOMAIN_EXTENDED_POLICIES_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG Flags; // reserved, must be 0
UNICODE_STRING DomainName;
} KERB_QUERY_DOMAIN_EXTENDED_POLICIES_REQUEST, *PKERB_QUERY_DOMAIN_EXTENDED_POLI
CIES_REQUEST;
#define KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE_FLAG_DAC_DISABLED 0x1
typedef struct _KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG Flags;
ULONG ExtendedPolicies;
ULONG DsFlags;
} KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE, *PKERB_QUERY_DOMAIN_EXTENDED_POL
ICIES_RESPONSE;
#endif
//
#if (_WIN32_WINNT >= 0x0602)
//
// Marshaled KERB_CERTIFICATE_INFO
//
typedef enum _KERB_CERTIFICATE_INFO_TYPE
{
CertHashInfo = 1,
} KERB_CERTIFICATE_INFO_TYPE, *PKERB_CERTIFICATE_INFO_TYPE;
typedef struct _KERB_CERTIFICATE_HASHINFO
{
USHORT StoreNameLength; // length in bytes, if not 0, must inclue L'\0', i
f 0, default to L"MY"
USHORT HashLength; // length in bytes
// payload starts, store name followed by cert hash
} KERB_CERTIFICATE_HASHINFO, *PKERB_CERTIFICATE_HASHINFO;
typedef struct _KERB_CERTIFICATE_INFO
{
ULONG CertInfoSize; // size of this structure w/ payload
ULONG InfoType; // info type, currently CertHashInfo
// payload starts, marshaled structure of InfoType
} KERB_CERTIFICATE_INFO, *PKERB_CERTIFICATE_INFO;
#endif
typedef struct _POLICY_AUDIT_SID_ARRAY { typedef struct _POLICY_AUDIT_SID_ARRAY {
ULONG UsersCount; ULONG UsersCount;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[size_is(UsersCount)] PAUDIT_SID_RPC* UserSidArray; [size_is(UsersCount)] PAUDIT_SID_RPC* UserSidArray;
#else #else
PSID* UserSidArray; PSID* UserSidArray;
#endif #endif
skipping to change at line 4406 skipping to change at line 4933
#define AUDIT_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ #define AUDIT_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\
AUDIT_SET_USER_POLICY |\ AUDIT_SET_USER_POLICY |\
AUDIT_SET_MISC_POLICY |\ AUDIT_SET_MISC_POLICY |\
AUDIT_SET_SYSTEM_POLICY) AUDIT_SET_SYSTEM_POLICY)
#define AUDIT_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE) #define AUDIT_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE)
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditSetSystemPolicy( AuditSetSystemPolicy(
__in_ecount(dwPolicyCount) PCAUDIT_POLICY_INFORMATION pAuditPolicy, _In_reads_(dwPolicyCount) PCAUDIT_POLICY_INFORMATION pAuditPolicy,
__in ULONG dwPolicyCount _In_ ULONG dwPolicyCount
); );
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditSetPerUserPolicy( AuditSetPerUserPolicy(
__in const PSID pSid, _In_ const PSID pSid,
__in_ecount(dwPolicyCount) PCAUDIT_POLICY_INFORMATION pAuditPolicy, _In_reads_(dwPolicyCount) PCAUDIT_POLICY_INFORMATION pAuditPolicy,
__in ULONG dwPolicyCount _In_ ULONG dwPolicyCount
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditQuerySystemPolicy( AuditQuerySystemPolicy(
__in_ecount(dwPolicyCount) const GUID* pSubCategoryGuids, _In_reads_(dwPolicyCount) const GUID* pSubCategoryGuids,
__in ULONG dwPolicyCount, _In_ ULONG dwPolicyCount,
__deref_out_ecount(dwPolicyCount) _Outptr_result_buffer_(dwPolicyCount)
__drv_when(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* _When_(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* ppAu
ppAuditPolicy ditPolicy
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditQueryPerUserPolicy( AuditQueryPerUserPolicy(
__in const PSID pSid, _In_ const PSID pSid,
__in_ecount(dwPolicyCount) const GUID* pSubCategoryGuids, _In_reads_(dwPolicyCount) const GUID* pSubCategoryGuids,
__in ULONG dwPolicyCount, _In_ ULONG dwPolicyCount,
__deref_out_ecount(dwPolicyCount) _Outptr_result_buffer_(dwPolicyCount)
__drv_when(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* _When_(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* ppAu
ppAuditPolicy ditPolicy
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditEnumeratePerUserPolicy( AuditEnumeratePerUserPolicy(
__out __drv_when(return != 0, __drv_allocatesMem(Mem)) PPOLICY_AUDIT_SID_ARR AY* ppAuditSidArray _Out_ _When_(return != 0, __drv_allocatesMem(Mem)) PPOLICY_AUDIT_SID_ARRAY* ppAuditSidArray
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditComputeEffectivePolicyBySid( AuditComputeEffectivePolicyBySid(
__in const PSID pSid, _In_ const PSID pSid,
__in_ecount(dwPolicyCount) const GUID* pSubCategoryGuids, _In_reads_(dwPolicyCount) const GUID* pSubCategoryGuids,
__in ULONG dwPolicyCount, _In_ ULONG dwPolicyCount,
__deref_out_ecount(dwPolicyCount) _Outptr_result_buffer_(dwPolicyCount)
__drv_when(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* _When_(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* ppAu
ppAuditPolicy ditPolicy
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditComputeEffectivePolicyByToken( AuditComputeEffectivePolicyByToken(
__in HANDLE hTokenHandle, _In_ HANDLE hTokenHandle,
__in_ecount(dwPolicyCount) const GUID* pSubCategoryGuids, _In_reads_(dwPolicyCount) const GUID* pSubCategoryGuids,
__in ULONG dwPolicyCount, _In_ ULONG dwPolicyCount,
__deref_out_ecount(dwPolicyCount) _Outptr_result_buffer_(dwPolicyCount)
__drv_when(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* _When_(return != 0, __drv_allocatesMem(Mem)) PAUDIT_POLICY_INFORMATION* ppAu
ppAuditPolicy ditPolicy
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditEnumerateCategories( AuditEnumerateCategories(
__deref_out_ecount(*pdwCountReturned) _Outptr_result_buffer_(*pdwCountReturned)
__drv_when(return != 0, __drv_allocatesMem(Mem)) GUID** ppAuditCategoriesArr _When_(return != 0, __drv_allocatesMem(Mem)) GUID** ppAuditCategoriesArray,
ay, _Out_ PULONG pdwCountReturned
__out PULONG pdwCountReturned
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditEnumerateSubCategories( AuditEnumerateSubCategories(
__in_opt const GUID* pAuditCategoryGuid, _In_opt_ const GUID* pAuditCategoryGuid,
__in BOOLEAN bRetrieveAllSubCategories, _In_ BOOLEAN bRetrieveAllSubCategories,
__deref_out_ecount(*pdwCountReturned) _Outptr_result_buffer_(*pdwCountReturned)
__drv_when(return != 0, __drv_allocatesMem(Mem)) GUID** ppAuditSubCategories _When_(return != 0, __drv_allocatesMem(Mem)) GUID** ppAuditSubCategoriesArra
Array, y,
__out PULONG pdwCountReturned _Out_ PULONG pdwCountReturned
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditLookupCategoryNameW( AuditLookupCategoryNameW(
__in const GUID* pAuditCategoryGuid, _In_ const GUID* pAuditCategoryGuid,
__deref_out __drv_when(return != 0, __drv_allocatesMem(Mem)) PWSTR* ppszCate _Outptr_ _When_(return != 0, __drv_allocatesMem(Mem)) PWSTR* ppszCategoryNam
goryName e
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditLookupCategoryNameA( AuditLookupCategoryNameA(
__in const GUID* pAuditCategoryGuid, _In_ const GUID* pAuditCategoryGuid,
__deref_out __drv_when(return != 0, __drv_allocatesMem(Mem)) PSTR* ppszCateg _Outptr_ _When_(return != 0, __drv_allocatesMem(Mem)) PSTR* ppszCategoryName
oryName
); );
#ifdef UNICODE #ifdef UNICODE
#define AuditLookupCategoryName AuditLookupCategoryNameW #define AuditLookupCategoryName AuditLookupCategoryNameW
#else #else
#define AuditLookupCategoryName AuditLookupCategoryNameA #define AuditLookupCategoryName AuditLookupCategoryNameA
#endif #endif
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditLookupSubCategoryNameW( AuditLookupSubCategoryNameW(
__in const GUID* pAuditSubCategoryGuid, _In_ const GUID* pAuditSubCategoryGuid,
__deref_out __drv_when(return != 0, __drv_allocatesMem(Mem)) PWSTR* ppszSubC _Outptr_ _When_(return != 0, __drv_allocatesMem(Mem)) PWSTR* ppszSubCategory
ategoryName Name
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditLookupSubCategoryNameA( AuditLookupSubCategoryNameA(
__in const GUID* pAuditSubCategoryGuid, _In_ const GUID* pAuditSubCategoryGuid,
__deref_out __drv_when(return != 0, __drv_allocatesMem(Mem)) PSTR* ppszSubCa _Outptr_ _When_(return != 0, __drv_allocatesMem(Mem)) PSTR* ppszSubCategoryN
tegoryName ame
); );
#ifdef UNICODE #ifdef UNICODE
#define AuditLookupSubCategoryName AuditLookupSubCategoryNameW #define AuditLookupSubCategoryName AuditLookupSubCategoryNameW
#else #else
#define AuditLookupSubCategoryName AuditLookupSubCategoryNameA #define AuditLookupSubCategoryName AuditLookupSubCategoryNameA
#endif #endif
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditLookupCategoryIdFromCategoryGuid( AuditLookupCategoryIdFromCategoryGuid(
__in const GUID* pAuditCategoryGuid, _In_ const GUID* pAuditCategoryGuid,
__out PPOLICY_AUDIT_EVENT_TYPE pAuditCategoryId _Out_ PPOLICY_AUDIT_EVENT_TYPE pAuditCategoryId
); );
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditLookupCategoryGuidFromCategoryId( AuditLookupCategoryGuidFromCategoryId(
__in POLICY_AUDIT_EVENT_TYPE AuditCategoryId, _In_ POLICY_AUDIT_EVENT_TYPE AuditCategoryId,
__out GUID* pAuditCategoryGuid _Out_ GUID* pAuditCategoryGuid
); );
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditSetSecurity( AuditSetSecurity(
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor _In_ PSECURITY_DESCRIPTOR pSecurityDescriptor
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditQuerySecurity( AuditQuerySecurity(
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__deref_out __drv_when(return != 0, __drv_allocatesMem(Mem)) PSECURITY_DESCR _Outptr_ _When_(return != 0, __drv_allocatesMem(Mem)) PSECURITY_DESCRIPTOR *
IPTOR *ppSecurityDescriptor ppSecurityDescriptor
); );
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditSetGlobalSaclW( AuditSetGlobalSaclW(
__in PCWSTR ObjectTypeName, _In_ PCWSTR ObjectTypeName,
__in_opt PACL Acl _In_opt_ PACL Acl
); );
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditSetGlobalSaclA( AuditSetGlobalSaclA(
__in PCSTR ObjectTypeName, _In_ PCSTR ObjectTypeName,
__in_opt PACL Acl _In_opt_ PACL Acl
); );
#ifdef UNICODE #ifdef UNICODE
#define AuditSetGlobalSacl AuditSetGlobalSaclW #define AuditSetGlobalSacl AuditSetGlobalSaclW
#else #else
#define AuditSetGlobalSacl AuditSetGlobalSaclA #define AuditSetGlobalSacl AuditSetGlobalSaclA
#endif #endif
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditQueryGlobalSaclW( AuditQueryGlobalSaclW(
__in PCWSTR ObjectTypeName, _In_ PCWSTR ObjectTypeName,
__out __drv_when(return != 0, __drv_allocatesMem(Mem)) PACL *Acl _Out_ _When_(return != 0, __drv_allocatesMem(Mem)) PACL *Acl
); );
__checkReturn _Check_return_
BOOLEAN BOOLEAN
NTAPI NTAPI
AuditQueryGlobalSaclA( AuditQueryGlobalSaclA(
__in PCSTR ObjectTypeName, _In_ PCSTR ObjectTypeName,
__out __drv_when(return != 0, __drv_allocatesMem(Mem)) PACL *Acl _Out_ _When_(return != 0, __drv_allocatesMem(Mem)) PACL *Acl
); );
#ifdef UNICODE #ifdef UNICODE
#define AuditQueryGlobalSacl AuditQueryGlobalSaclW #define AuditQueryGlobalSacl AuditQueryGlobalSaclW
#else #else
#define AuditQueryGlobalSacl AuditQueryGlobalSaclA #define AuditQueryGlobalSacl AuditQueryGlobalSaclA
#endif #endif
VOID VOID
NTAPI NTAPI
AuditFree( AuditFree(
__in __drv_freesMem(Mem) __post __notvalid PVOID Buffer _In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer
); );
#if (_WIN32_WINNT >= 0x0601) #if (_WIN32_WINNT >= 0x0601)
// //
// Pku2u package name // Pku2u package name
// //
#define PKU2U_PACKAGE_NAME_A "pku2u" #define PKU2U_PACKAGE_NAME_A "pku2u"
#define PKU2U_PACKAGE_NAME L"pku2u" #define PKU2U_PACKAGE_NAME L"pku2u"
skipping to change at line 4653 skipping to change at line 5180
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
typedef enum _PKU2U_LOGON_SUBMIT_TYPE { typedef enum _PKU2U_LOGON_SUBMIT_TYPE {
Pku2uCertificateS4ULogon = 14, Pku2uCertificateS4ULogon = 14,
} PKU2U_LOGON_SUBMIT_TYPE, *PPKU2U_LOGON_SUBMIT_TYPE; } PKU2U_LOGON_SUBMIT_TYPE, *PPKU2U_LOGON_SUBMIT_TYPE;
typedef struct _PKU2U_CERTIFICATE_S4U_LOGON { typedef struct _PKU2U_CERTIFICATE_S4U_LOGON {
PKU2U_LOGON_SUBMIT_TYPE MessageType; PKU2U_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags; ULONG Flags;
UNICODE_STRING UserPrincipalName; UNICODE_STRING UserPrincipalName;
__reserved UNICODE_STRING DomainName; _Reserved_ UNICODE_STRING DomainName;
ULONG CertificateLength; // for the client certificate ULONG CertificateLength; // for the client certificate
__field_bcount(CertificateLength) PUCHAR Certificate; // for the client cert ificate, BER encoded _Field_size_bytes_(CertificateLength) PUCHAR Certificate; // for the client certificate, BER encoded
} PKU2U_CERTIFICATE_S4U_LOGON, *PPKU2U_CERTIFICATE_S4U_LOGON; } PKU2U_CERTIFICATE_S4U_LOGON, *PPKU2U_CERTIFICATE_S4U_LOGON;
#endif // _WIN32_WINNT #endif // _WIN32_WINNT
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _NTSECAPI_ */ #endif /* _NTSECAPI_ */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
 End of changes. 119 change blocks. 
267 lines changed or deleted 806 lines changed or added


 perflib.h (6.1.7601.23418-Windows_7.0)   perflib.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 17 skipping to change at line 17
Abstract: Abstract:
Public headers for PERFLIB provider APIs, Public headers for PERFLIB provider APIs,
--*/ --*/
#ifndef _PERFLIB_H_ #ifndef _PERFLIB_H_
#define _PERFLIB_H_ #define _PERFLIB_H_
#pragma once #pragma once
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// PERFLIB V2 provider side published literals, data structures and APIs. // PERFLIB V2 provider side published literals, data structures and APIs.
// //
// This is used in generated PERF_COUNTERSET_INFO structure to declare provider type. // This is used in generated PERF_COUNTERSET_INFO structure to declare provider type.
// Kernel provider is reserved for Microsoft internal use. // Kernel provider is reserved for Microsoft internal use.
skipping to change at line 148 skipping to change at line 152
IN ULONG RequestCode, IN ULONG RequestCode,
IN PVOID Buffer, IN PVOID Buffer,
IN ULONG BufferSize IN ULONG BufferSize
); );
// Usually PerfSetCounterSetInfo() calls is automatically generated PerfAutoStar tUp() function (generated // Usually PerfSetCounterSetInfo() calls is automatically generated PerfAutoStar tUp() function (generated
// by schema generation/parsing tool) to inform PERFLIB the layout of specific c ounterset. // by schema generation/parsing tool) to inform PERFLIB the layout of specific c ounterset.
// //
ULONG __stdcall ULONG __stdcall
PerfStartProvider( PerfStartProvider(
__in LPGUID ProviderGuid, _In_ LPGUID ProviderGuid,
__in_opt PERFLIBREQUEST ControlCallback, _In_opt_ PERFLIBREQUEST ControlCallback,
__out HANDLE * phProvider _Out_ HANDLE * phProvider
); );
// Start PERFLIB V2 provider with customized memory allocation/free routines. // Start PERFLIB V2 provider with customized memory allocation/free routines.
// //
typedef LPVOID (* PERF_MEM_ALLOC)(IN SIZE_T AllocSize, IN LPVOID pContext); typedef LPVOID (* PERF_MEM_ALLOC)(IN SIZE_T AllocSize, IN LPVOID pContext);
typedef void (* PERF_MEM_FREE)(IN LPVOID pBuffer, IN LPVOID pContext); typedef void (* PERF_MEM_FREE)(IN LPVOID pBuffer, IN LPVOID pContext);
typedef struct _PROVIDER_CONTEXT { typedef struct _PROVIDER_CONTEXT {
DWORD ContextSize; // should be sizeof(PERF_PROVIDER_CONTEXT) DWORD ContextSize; // should be sizeof(PERF_PROVIDER_CONTEXT)
DWORD Reserved; DWORD Reserved;
PERFLIBREQUEST ControlCallback; PERFLIBREQUEST ControlCallback;
PERF_MEM_ALLOC MemAllocRoutine; PERF_MEM_ALLOC MemAllocRoutine;
PERF_MEM_FREE MemFreeRoutine; PERF_MEM_FREE MemFreeRoutine;
LPVOID pMemContext; LPVOID pMemContext;
} PERF_PROVIDER_CONTEXT, * PPERF_PROVIDER_CONTEXT; } PERF_PROVIDER_CONTEXT, * PPERF_PROVIDER_CONTEXT;
ULONG WINAPI ULONG WINAPI
PerfStartProviderEx( PerfStartProviderEx(
__in LPGUID ProviderGuid, _In_ LPGUID ProviderGuid,
__in_opt PPERF_PROVIDER_CONTEXT ProviderContext, _In_opt_ PPERF_PROVIDER_CONTEXT ProviderContext,
__out PHANDLE Provider _Out_ PHANDLE Provider
); );
ULONG WINAPI ULONG WINAPI
PerfStartProvider( PerfStartProvider(
__in LPGUID ProviderGuid, _In_ LPGUID ProviderGuid,
__in_opt PERFLIBREQUEST ControlCallback, _In_opt_ PERFLIBREQUEST ControlCallback,
__out PHANDLE Provider _Out_ PHANDLE Provider
); );
ULONG WINAPI ULONG WINAPI
PerfStopProvider( PerfStopProvider(
__in HANDLE ProviderHandle _In_ HANDLE ProviderHandle
); );
ULONG WINAPI ULONG WINAPI
PerfSetCounterSetInfo( PerfSetCounterSetInfo(
__in HANDLE ProviderHandle, _In_ HANDLE ProviderHandle,
__inout_bcount(TemplateSize) PPERF_COUNTERSET_INFO Template, _Inout_updates_bytes_(TemplateSize) PPERF_COUNTERSET_INFO Template,
__in ULONG TemplateSize _In_ ULONG TemplateSize
); );
PPERF_COUNTERSET_INSTANCE WINAPI PPERF_COUNTERSET_INSTANCE WINAPI
PerfCreateInstance( PerfCreateInstance(
__in HANDLE ProviderHandle, _In_ HANDLE ProviderHandle,
__in LPCGUID CounterSetGuid, _In_ LPCGUID CounterSetGuid,
__in PCWSTR Name, _In_ PCWSTR Name,
__in ULONG Id _In_ ULONG Id
); );
ULONG WINAPI ULONG WINAPI
PerfDeleteInstance( PerfDeleteInstance(
__in HANDLE Provider, _In_ HANDLE Provider,
__in PPERF_COUNTERSET_INSTANCE InstanceBlock _In_ PPERF_COUNTERSET_INSTANCE InstanceBlock
); );
PPERF_COUNTERSET_INSTANCE WINAPI PPERF_COUNTERSET_INSTANCE WINAPI
PerfQueryInstance( PerfQueryInstance(
__in HANDLE ProviderHandle, _In_ HANDLE ProviderHandle,
__in LPCGUID CounterSetGuid, _In_ LPCGUID CounterSetGuid,
__in PCWSTR Name, _In_ PCWSTR Name,
__in ULONG Id _In_ ULONG Id
); );
ULONG WINAPI ULONG WINAPI
PerfSetCounterRefValue( PerfSetCounterRefValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in PVOID Address _In_ PVOID Address
); );
ULONG WINAPI ULONG WINAPI
PerfSetULongCounterValue( PerfSetULongCounterValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in ULONG Value _In_ ULONG Value
); );
ULONG WINAPI ULONG WINAPI
PerfSetULongLongCounterValue( PerfSetULongLongCounterValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in ULONGLONG Value _In_ ULONGLONG Value
); );
ULONG WINAPI ULONG WINAPI
PerfIncrementULongCounterValue( PerfIncrementULongCounterValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in ULONG Value _In_ ULONG Value
); );
ULONG WINAPI ULONG WINAPI
PerfIncrementULongLongCounterValue( PerfIncrementULongLongCounterValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in ULONGLONG Value _In_ ULONGLONG Value
); );
ULONG WINAPI ULONG WINAPI
PerfDecrementULongCounterValue( PerfDecrementULongCounterValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in ULONG Value _In_ ULONG Value
); );
ULONG WINAPI ULONG WINAPI
PerfDecrementULongLongCounterValue( PerfDecrementULongLongCounterValue(
__in HANDLE Provider, _In_ HANDLE Provider,
__inout PPERF_COUNTERSET_INSTANCE Instance, _Inout_ PPERF_COUNTERSET_INSTANCE Instance,
__in ULONG CounterId, _In_ ULONG CounterId,
__in ULONGLONG Value _In_ ULONGLONG Value
); );
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif /* _PERFLIB_H_ */ #endif /* _PERFLIB_H_ */
 End of changes. 17 change blocks. 
51 lines changed or deleted 58 lines changed or added


 sddl.h (6.1.7601.23418-Windows_7.0)   sddl.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 17 skipping to change at line 18
sddl.w sddl.w
Abstract: Abstract:
This module defines the support and conversions routines necessary for SDDL. This module defines the support and conversions routines necessary for SDDL.
Revision History: Revision History:
--*/ --*/
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef __SDDL_H__ #ifndef __SDDL_H__
#define __SDDL_H__ #define __SDDL_H__
#include <apiset.h>
#include <apisetcconv.h>
#ifdef _CONTRACT_GEN
#include <minwindef.h>
#endif
/* APISET_NAME: api-ms-win-security-sddl-l1 */
#ifndef _APISET_SDDL_VER
#ifdef _APISET_MINWIN_VERSION
#if _APISET_MINWIN_VERSION >= 0x0100
#define _APISET_SDDL_VER 0x0100
#endif
#endif // _APISET_MINWIN_VERSION
#endif // _APISET_SDDL_VER
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// //
// SDDL Version information // SDDL Version information
// //
#define SDDL_REVISION_1 1 #define SDDL_REVISION_1 1
#define SDDL_REVISION SDDL_REVISION_1 #define SDDL_REVISION SDDL_REVISION_1
// //
// SDDL Component tags // SDDL Component tags
// //
#define SDDL_OWNER TEXT("O") // Owner tag #define SDDL_OWNER TEXT("O") // Owner tag
skipping to change at line 58 skipping to change at line 84
// //
#define SDDL_ACCESS_ALLOWED TEXT("A") // Access allowed #define SDDL_ACCESS_ALLOWED TEXT("A") // Access allowed
#define SDDL_ACCESS_DENIED TEXT("D") // Access denied #define SDDL_ACCESS_DENIED TEXT("D") // Access denied
#define SDDL_OBJECT_ACCESS_ALLOWED TEXT("OA") // Object access allowed #define SDDL_OBJECT_ACCESS_ALLOWED TEXT("OA") // Object access allowed
#define SDDL_OBJECT_ACCESS_DENIED TEXT("OD") // Object access denied #define SDDL_OBJECT_ACCESS_DENIED TEXT("OD") // Object access denied
#define SDDL_AUDIT TEXT("AU") // Audit #define SDDL_AUDIT TEXT("AU") // Audit
#define SDDL_ALARM TEXT("AL") // Alarm #define SDDL_ALARM TEXT("AL") // Alarm
#define SDDL_OBJECT_AUDIT TEXT("OU") // Object audit #define SDDL_OBJECT_AUDIT TEXT("OU") // Object audit
#define SDDL_OBJECT_ALARM TEXT("OL") // Object alarm #define SDDL_OBJECT_ALARM TEXT("OL") // Object alarm
#define SDDL_MANDATORY_LABEL TEXT("ML") // Integrity label #define SDDL_MANDATORY_LABEL TEXT("ML") // Integrity label
#define SDDL_CALLBACK_ACCESS_ALLOWED TEXT("XA") // callback Ac #define SDDL_PROCESS_TRUST_LABEL TEXT("TL") // Process trust label
cess allowed #define SDDL_CALLBACK_ACCESS_ALLOWED TEXT("XA") // Callback access allow
#define SDDL_CALLBACK_ACCESS_DENIED TEXT("XD") // callback Ac ed
cess denied #define SDDL_CALLBACK_ACCESS_DENIED TEXT("XD") // Callback access denie
d
#define SDDL_RESOURCE_ATTRIBUTE TEXT("RA") // Resource attribute
#define SDDL_SCOPED_POLICY_ID TEXT("SP") // Scoped policy
#define SDDL_CALLBACK_AUDIT TEXT("XU") // Callback audit
#define SDDL_CALLBACK_OBJECT_ACCESS_ALLOWED TEXT("ZA") // Callback object acces
s allowed
//
// SDDL Resource attribute ace data types
//
#define SDDL_INT TEXT("TI") // Signed integer
#define SDDL_UINT TEXT("TU") // Unsigned integer
#define SDDL_WSTRING TEXT("TS") // Wide string
#define SDDL_SID TEXT("TD") // SID
#define SDDL_BLOB TEXT("TX") // Octet String
#define SDDL_BOOLEAN TEXT("TB") // Boolean
// //
// SDDL Ace flags // SDDL Ace flags
// //
#define SDDL_CONTAINER_INHERIT TEXT("CI") // Container inherit #define SDDL_CONTAINER_INHERIT TEXT("CI") // Container inherit
#define SDDL_OBJECT_INHERIT TEXT("OI") // Object inherit #define SDDL_OBJECT_INHERIT TEXT("OI") // Object inherit
#define SDDL_NO_PROPAGATE TEXT("NP") // Inherit no propagate #define SDDL_NO_PROPAGATE TEXT("NP") // Inherit no propagate
#define SDDL_INHERIT_ONLY TEXT("IO") // Inherit only #define SDDL_INHERIT_ONLY TEXT("IO") // Inherit only
#define SDDL_INHERITED TEXT("ID") // Inherited #define SDDL_INHERITED TEXT("ID") // Inherited
#define SDDL_AUDIT_SUCCESS TEXT("SA") // Audit success #define SDDL_AUDIT_SUCCESS TEXT("SA") // Audit success
skipping to change at line 162 skipping to change at line 204
#define SDDL_REMOTE_DESKTOP TEXT("RD") // Remote desktop us ers (for terminal server) #define SDDL_REMOTE_DESKTOP TEXT("RD") // Remote desktop us ers (for terminal server)
#define SDDL_NETWORK_CONFIGURATION_OPS TEXT("NO") // Network configura tion operators ( to manage configuration of networking features) #define SDDL_NETWORK_CONFIGURATION_OPS TEXT("NO") // Network configura tion operators ( to manage configuration of networking features)
#define SDDL_PERFMON_USERS TEXT("MU") // Performance Monit or Users #define SDDL_PERFMON_USERS TEXT("MU") // Performance Monit or Users
#define SDDL_PERFLOG_USERS TEXT("LU") // Performance Log U sers #define SDDL_PERFLOG_USERS TEXT("LU") // Performance Log U sers
#define SDDL_IIS_USERS TEXT("IS") // Anonymous Interne t Users #define SDDL_IIS_USERS TEXT("IS") // Anonymous Interne t Users
#define SDDL_CRYPTO_OPERATORS TEXT("CY") // Crypto Operators #define SDDL_CRYPTO_OPERATORS TEXT("CY") // Crypto Operators
#define SDDL_OWNER_RIGHTS TEXT("OW") // Owner Rights SID #define SDDL_OWNER_RIGHTS TEXT("OW") // Owner Rights SID
#define SDDL_EVENT_LOG_READERS TEXT("ER") // Event log readers #define SDDL_EVENT_LOG_READERS TEXT("ER") // Event log readers
#define SDDL_ENTERPRISE_RO_DCs TEXT("RO") // Enterprise Read-o nly domain controllers #define SDDL_ENTERPRISE_RO_DCs TEXT("RO") // Enterprise Read-o nly domain controllers
#define SDDL_CERTSVC_DCOM_ACCESS TEXT("CD") // Users who can con nect to certification authorities using DCOM #define SDDL_CERTSVC_DCOM_ACCESS TEXT("CD") // Users who can con nect to certification authorities using DCOM
#define SDDL_ALL_APP_PACKAGES TEXT("AC") // All applications
running in an app package context
#define SDDL_RDS_REMOTE_ACCESS_SERVERS TEXT("RA") // Servers in this g
roup enable users of RemoteApp programs and personal virtual desktops access to
these resources.
#define SDDL_RDS_ENDPOINT_SERVERS TEXT("ES") // Servers in this g
roup run virtual machines and host sessions where users RemoteApp programs and p
ersonal virtual desktops run.
#define SDDL_RDS_MANAGEMENT_SERVERS TEXT("MS") // Servers in this g
roup can perform routine administrative actions on servers running Remote Deskto
p Services.
#define SDDL_USER_MODE_DRIVERS TEXT("UD") // UserMode driver
#define SDDL_HYPER_V_ADMINS TEXT("HA") // Members of this g
roup have complete and unrestricted access to all features of Hyper-V.
#define SDDL_CLONEABLE_CONTROLLERS TEXT("CN") // Members of this g
roup that are domain controllers may be cloned.
#define SDDL_ACCESS_CONTROL_ASSISTANCE_OPS TEXT("AA") // Members of this g
roup can remotely query authorization attributes and permissions for resources o
n this computer.
#define SDDL_REMOTE_MANAGEMENT_USERS TEXT("RM") // Members of this g
roup can access WMI resources over management protocols (such as WS-Management v
ia the Windows Remote Management service). This applies only to WMI namespaces t
hat grant access to the user.
#define SDDL_AUTHORITY_ASSERTED TEXT("AS") // Authentication Au
thority Asserted
#define SDDL_SERVICE_ASSERTED TEXT("SS") // Authentication Se
rvice Asserted
#define SDDL_PROTECTED_USERS TEXT("AP") // Members of this g
roup are afforded additional protections against authentication security threats
.
//
// Note !! While making the above changes check if ScepReplaceNewAcronymsInSDDL
// needs to be updated to allow the new SIDs to be translated on downlevel OS.
//
// //
// Integrity Labels // Integrity Labels
// //
#define SDDL_ML_LOW TEXT("LW") // Low mandatory lev el #define SDDL_ML_LOW TEXT("LW") // Low mandatory lev el
#define SDDL_ML_MEDIUM TEXT("ME") // Medium mandatory level #define SDDL_ML_MEDIUM TEXT("ME") // Medium mandatory level
#define SDDL_ML_MEDIUM_PLUS TEXT("MP") // Medium Plus manda tory level #define SDDL_ML_MEDIUM_PLUS TEXT("MP") // Medium Plus manda tory level
#define SDDL_ML_HIGH TEXT("HI") // High mandatory le vel #define SDDL_ML_HIGH TEXT("HI") // High mandatory le vel
#define SDDL_ML_SYSTEM TEXT("SI") // System mandatory level #define SDDL_ML_SYSTEM TEXT("SI") // System mandatory level
// //
skipping to change at line 202 skipping to change at line 262
// //
#define SDDL_SEPERATOR TEXT(";") #define SDDL_SEPERATOR TEXT(";")
#define SDDL_DELIMINATOR TEXT(":") #define SDDL_DELIMINATOR TEXT(":")
#define SDDL_ACE_BEGIN TEXT("(") #define SDDL_ACE_BEGIN TEXT("(")
#define SDDL_ACE_END TEXT(")") #define SDDL_ACE_END TEXT(")")
#define SDDL_ACE_COND_BEGIN TEXT("(") #define SDDL_ACE_COND_BEGIN TEXT("(")
#define SDDL_ACE_COND_END TEXT(")") #define SDDL_ACE_COND_END TEXT(")")
#define SDDL_SPACE TEXT(" ") #define SDDL_SPACE TEXT(" ")
#define SDDL_ACE_COND_BLOB_PREFIX TEXT("#") #define SDDL_ACE_COND_BLOB_PREFIX TEXT("#")
#define SDDL_ACE_COND_SID_PREFIX TEXT("SID") #define SDDL_ACE_COND_SID_PREFIX TEXT("SID")
#define SDDL_ACE_COND_ATTRIBUTE_PREFIX TEXT("@")
#define SDDL_ACE_COND_USER_ATTRIBUTE_PREFIX TEXT("@USER.")
#define SDDL_ACE_COND_RESOURCE_ATTRIBUTE_PREFIX TEXT("@RESOURCE.")
#define SDDL_ACE_COND_DEVICE_ATTRIBUTE_PREFIX TEXT("@DEVICE.")
#if !defined(_NTDDK_) #if !defined(_NTDDK_)
#if(_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
BOOL BOOL
WINAPI WINAPI
ConvertSidToStringSidA( ConvertSidToStringSidA(
__in PSID Sid, _In_ PSID Sid,
__deref_out LPSTR *StringSid _Outptr_ LPSTR *StringSid
); );
BOOL BOOL
WINAPI WINAPI
ConvertSidToStringSidW( ConvertSidToStringSidW(
__in PSID Sid, _In_ PSID Sid,
__deref_out LPWSTR *StringSid _Outptr_ LPWSTR * StringSid
); );
#ifdef UNICODE #ifdef UNICODE
#define ConvertSidToStringSid ConvertSidToStringSidW #define ConvertSidToStringSid ConvertSidToStringSidW
#else #else
#define ConvertSidToStringSid ConvertSidToStringSidA #define ConvertSidToStringSid ConvertSidToStringSidA
#endif // !UNICODE #endif // !UNICODE
BOOL BOOL
WINAPI WINAPI
ConvertStringSidToSidA( ConvertStringSidToSidA(
__in LPCSTR StringSid, _In_ LPCSTR StringSid,
__deref_out PSID *Sid _Outptr_ PSID *Sid
); );
BOOL BOOL
WINAPI WINAPI
ConvertStringSidToSidW( ConvertStringSidToSidW(
__in LPCWSTR StringSid, _In_ LPCWSTR StringSid,
__deref_out PSID *Sid _Outptr_ PSID * Sid
); );
#ifdef UNICODE #ifdef UNICODE
#define ConvertStringSidToSid ConvertStringSidToSidW #define ConvertStringSidToSid ConvertStringSidToSidW
#else #else
#define ConvertStringSidToSid ConvertStringSidToSidA #define ConvertStringSidToSid ConvertStringSidToSidA
#endif // !UNICODE #endif // !UNICODE
BOOL BOOL
WINAPI WINAPI
ConvertStringSecurityDescriptorToSecurityDescriptorA( ConvertStringSecurityDescriptorToSecurityDescriptorA(
__in LPCSTR StringSecurityDescriptor, _In_ LPCSTR StringSecurityDescriptor,
__in DWORD StringSDRevision, _In_ DWORD StringSDRevision,
__deref_out PSECURITY_DESCRIPTOR *SecurityDescriptor, _Outptr_ PSECURITY_DESCRIPTOR *SecurityDescriptor,
__out_opt PULONG SecurityDescriptorSize _Out_opt_ PULONG SecurityDescriptorSize
); );
BOOL BOOL
WINAPI WINAPI
ConvertStringSecurityDescriptorToSecurityDescriptorW( ConvertStringSecurityDescriptorToSecurityDescriptorW(
__in LPCWSTR StringSecurityDescriptor, _In_ LPCWSTR StringSecurityDescriptor,
__in DWORD StringSDRevision, _In_ DWORD StringSDRevision,
__deref_out PSECURITY_DESCRIPTOR *SecurityDescriptor, _Outptr_ PSECURITY_DESCRIPTOR * SecurityDescriptor,
__out_opt PULONG SecurityDescriptorSize _Out_opt_ PULONG SecurityDescriptorSize
); );
#ifdef UNICODE #ifdef UNICODE
#define ConvertStringSecurityDescriptorToSecurityDescriptor ConvertStringSecuri tyDescriptorToSecurityDescriptorW #define ConvertStringSecurityDescriptorToSecurityDescriptor ConvertStringSecuri tyDescriptorToSecurityDescriptorW
#else #else
#define ConvertStringSecurityDescriptorToSecurityDescriptor ConvertStringSecuri tyDescriptorToSecurityDescriptorA #define ConvertStringSecurityDescriptorToSecurityDescriptor ConvertStringSecuri tyDescriptorToSecurityDescriptorA
#endif // !UNICODE #endif // !UNICODE
BOOL BOOL
WINAPI WINAPI
ConvertSecurityDescriptorToStringSecurityDescriptorA( ConvertSecurityDescriptorToStringSecurityDescriptorA(
__in PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
__in DWORD RequestedStringSDRevision, _In_ DWORD RequestedStringSDRevision,
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__deref_out LPSTR *StringSecurityDescriptor, _Outptr_ LPSTR *StringSecurityDescriptor,
__out_opt PULONG StringSecurityDescriptorLen _Out_opt_ PULONG StringSecurityDescriptorLen
); );
BOOL BOOL
WINAPI WINAPI
ConvertSecurityDescriptorToStringSecurityDescriptorW( ConvertSecurityDescriptorToStringSecurityDescriptorW(
__in PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
__in DWORD RequestedStringSDRevision, _In_ DWORD RequestedStringSDRevision,
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__deref_out LPWSTR *StringSecurityDescriptor, _Outptr_ LPWSTR * StringSecurityDescriptor,
__out_opt PULONG StringSecurityDescriptorLen _Out_opt_ PULONG StringSecurityDescriptorLen
); );
#ifdef UNICODE #ifdef UNICODE
#define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorW #define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorW
#else #else
#define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorA #define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorA
#endif // !UNICODE #endif // !UNICODE
#endif /* _WIN32_WINNT >= 0x0500 */ #endif /* _WIN32_WINNT >= 0x0500 */
#endif /* !defined(_NTDDK_) */ #endif /* !defined(_NTDDK_) */
skipping to change at line 293 skipping to change at line 365
#ifdef UNICODE #ifdef UNICODE
#define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorW #define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorW
#else #else
#define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorA #define ConvertSecurityDescriptorToStringSecurityDescriptor ConvertSecurityDesc riptorToStringSecurityDescriptorA
#endif // !UNICODE #endif // !UNICODE
#endif /* _WIN32_WINNT >= 0x0500 */ #endif /* _WIN32_WINNT >= 0x0500 */
#endif /* !defined(_NTDDK_) */ #endif /* !defined(_NTDDK_) */
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#pragma endregion
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // endif __SDDL_H__ #endif // endif __SDDL_H__
 End of changes. 24 change blocks. 
31 lines changed or deleted 124 lines changed or added


 wct.h (6.1.7601.23418-Windows_7.0)   wct.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 22 skipping to change at line 22
History: History:
12/01/2004 sdoll Created. 12/01/2004 sdoll Created.
--*/ --*/
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif #endif
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef enum _WCT_OBJECT_TYPE typedef enum _WCT_OBJECT_TYPE
{ {
WctCriticalSectionType = 1, WctCriticalSectionType = 1,
WctSendMessageType, WctSendMessageType,
WctMutexType, WctMutexType,
skipping to change at line 100 skipping to change at line 104
DWORD_PTR Context, DWORD_PTR Context,
DWORD CallbackStatus, DWORD CallbackStatus,
LPDWORD NodeCount, LPDWORD NodeCount,
PWAITCHAIN_NODE_INFO NodeInfoArray, PWAITCHAIN_NODE_INFO NodeInfoArray,
LPBOOL IsCycle LPBOOL IsCycle
); );
#define WCT_ASYNC_OPEN_FLAG 0x1 #define WCT_ASYNC_OPEN_FLAG 0x1
#define WCTP_OPEN_ALL_FLAGS (WCT_ASYNC_OPEN_FLAG) #define WCTP_OPEN_ALL_FLAGS (WCT_ASYNC_OPEN_FLAG)
__checkReturn _Check_return_
WINADVAPI WINADVAPI
HWCT WINAPI HWCT WINAPI
OpenThreadWaitChainSession ( OpenThreadWaitChainSession (
__in DWORD Flags, _In_ DWORD Flags,
__in_opt PWAITCHAINCALLBACK callback _In_opt_ PWAITCHAINCALLBACK callback
); );
WINADVAPI WINADVAPI
VOID WINAPI VOID WINAPI
CloseThreadWaitChainSession ( CloseThreadWaitChainSession (
__in HWCT WctHandle _In_ HWCT WctHandle
); );
#define WCT_OUT_OF_PROC_FLAG 0x1 #define WCT_OUT_OF_PROC_FLAG 0x1
#define WCT_OUT_OF_PROC_COM_FLAG 0x2 #define WCT_OUT_OF_PROC_COM_FLAG 0x2
#define WCT_OUT_OF_PROC_CS_FLAG 0x4 #define WCT_OUT_OF_PROC_CS_FLAG 0x4
#define WCT_NETWORK_IO_FLAG 0x8 #define WCT_NETWORK_IO_FLAG 0x8
#define WCTP_GETINFO_ALL_FLAGS (WCT_OUT_OF_PROC_FLAG|WCT_OUT_OF_PROC_COM_FLAG|WC T_OUT_OF_PROC_CS_FLAG) #define WCTP_GETINFO_ALL_FLAGS (WCT_OUT_OF_PROC_FLAG|WCT_OUT_OF_PROC_COM_FLAG|WC T_OUT_OF_PROC_CS_FLAG)
__checkReturn _Check_return_
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
GetThreadWaitChain ( GetThreadWaitChain (
__in HWCT WctHandle, _In_ HWCT WctHandle,
__in_opt DWORD_PTR Context, _In_opt_ DWORD_PTR Context,
__in DWORD Flags, _In_ DWORD Flags,
__in DWORD ThreadId, _In_ DWORD ThreadId,
__inout LPDWORD NodeCount, _Inout_ LPDWORD NodeCount,
__out_ecount(*NodeCount) PWAITCHAIN_NODE_INFO NodeInfoArray, _Out_writes_(*NodeCount) PWAITCHAIN_NODE_INFO NodeInfoArray,
__out LPBOOL IsCycle _Out_ LPBOOL IsCycle
); );
typedef HRESULT (*PCOGETCALLSTATE)(int, PULONG); typedef HRESULT (*PCOGETCALLSTATE)(int, PULONG);
typedef HRESULT (*PCOGETACTIVATIONSTATE)(GUID, DWORD, DWORD*); typedef HRESULT (*PCOGETACTIVATIONSTATE)(GUID, DWORD, DWORD*);
WINADVAPI WINADVAPI
VOID WINAPI VOID WINAPI
RegisterWaitChainCOMCallback ( RegisterWaitChainCOMCallback (
__in PCOGETCALLSTATE CallStateCallback, _In_ PCOGETCALLSTATE CallStateCallback,
__in PCOGETACTIVATIONSTATE ActivationStateCallback _In_ PCOGETACTIVATIONSTATE ActivationStateCallback
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
 End of changes. 8 change blocks. 
14 lines changed or deleted 18 lines changed or added


 winbase.h (6.1.7601.23418-Windows_7.0)   winbase.h (6.3.9600.17415-Windows_8.1) 
#include <winapifamily.h>
/************************************************************************ /************************************************************************
* * * *
* winbase.h -- This module defines the 32-Bit Windows Base APIs * * winbase.h -- This module defines the 32-Bit Windows Base APIs *
* * * *
* Copyright (c) Microsoft Corp. All rights reserved. * * Copyright (c) Microsoft Corp. All rights reserved. *
* * * *
************************************************************************/ ************************************************************************/
#ifndef _WINBASE_ #ifndef _WINBASE_
#define _WINBASE_ #define _WINBASE_
#if defined(_MSC_VER)
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif #endif
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4001) /* nonstandard extension : single line comment */
#pragma warning(disable:4201) /* nonstandard extension used : nameless struct/un
ion */
#pragma warning(disable:4214) /* nonstandard extension used : bit field types ot
her then int */
#endif // defined(_MSC_VER)
#ifdef _MAC #ifdef _MAC
#include <macwin32.h> #include <macwin32.h>
#endif //_MAC #endif //_MAC
#include <apisetcconv.h>
#include <minwinbase.h>
// //
// Define API decoration for direct importing of DLL references. // APISET contracts
// //
#if !defined(_ADVAPI32_) #include <processenv.h>
#define WINADVAPI DECLSPEC_IMPORT #include <fileapi.h>
#else #include <debugapi.h>
#define WINADVAPI #include <utilapiset.h>
#endif #include <handleapi.h>
#include <errhandlingapi.h>
#if !defined(_KERNEL32_) #include <fibersapi.h>
#define WINBASEAPI DECLSPEC_IMPORT #include <namedpipeapi.h>
#else #include <profileapi.h>
#define WINBASEAPI #include <heapapi.h>
#endif #include <ioapiset.h>
#include <synchapi.h>
#if !defined(_ZAWPROXY_) #include <interlockedapi.h>
#define ZAWPROXYAPI DECLSPEC_IMPORT #include <processthreadsapi.h>
#else #include <sysinfoapi.h>
#define ZAWPROXYAPI #include <memoryapi.h>
#endif #include <threadpoollegacyapiset.h>
#include <threadpoolapiset.h>
#include <bemapiset.h>
#include <jobapi.h>
#include <wow64apiset.h>
#include <libloaderapi.h>
#include <securitybaseapi.h>
#include <namespaceapi.h>
#include <systemtopologyapi.h>
#include <processtopologyapi.h>
#include <securityappcontainer.h>
#include <realtimeapiset.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
/* /*
* Compatibility macros * Compatibility macros
*/ */
#define DefineHandleTable(w) ((w),TRUE) #define DefineHandleTable(w) ((w),TRUE)
#define LimitEmsPages(dw) #define LimitEmsPages(dw)
#define SetSwapAreaSize(w) (w) #define SetSwapAreaSize(w) (w)
#define LockSegment(w) GlobalFix((HANDLE)(w)) #define LockSegment(w) GlobalFix((HANDLE)(w))
#define UnlockSegment(w) GlobalUnfix((HANDLE)(w)) #define UnlockSegment(w) GlobalUnfix((HANDLE)(w))
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define GetCurrentTime() GetTickCount() #define GetCurrentTime() GetTickCount()
#define Yield() #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1) #pragma region Application Family
#define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF) #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define INVALID_SET_FILE_POINTER ((DWORD)-1)
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) #define Yield()
#define FILE_BEGIN 0 #define FILE_BEGIN 0
#define FILE_CURRENT 1 #define FILE_CURRENT 1
#define FILE_END 2 #define FILE_END 2
#define TIME_ZONE_ID_INVALID ((DWORD)0xFFFFFFFF)
#define WAIT_FAILED ((DWORD)0xFFFFFFFF) #define WAIT_FAILED ((DWORD)0xFFFFFFFF)
#define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 )
#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
#define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0 ) + 0 )
#define WAIT_IO_COMPLETION STATUS_USER_APC #define WAIT_IO_COMPLETION STATUS_USER_APC
#define STILL_ACTIVE STATUS_PENDING
#define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
#define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
#define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
#define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED STATUS_ARRAY_BOUNDS_EXCEEDED
#define EXCEPTION_FLT_DENORMAL_OPERAND STATUS_FLOAT_DENORMAL_OPERAND
#define EXCEPTION_FLT_DIVIDE_BY_ZERO STATUS_FLOAT_DIVIDE_BY_ZERO
#define EXCEPTION_FLT_INEXACT_RESULT STATUS_FLOAT_INEXACT_RESULT
#define EXCEPTION_FLT_INVALID_OPERATION STATUS_FLOAT_INVALID_OPERATION
#define EXCEPTION_FLT_OVERFLOW STATUS_FLOAT_OVERFLOW
#define EXCEPTION_FLT_STACK_CHECK STATUS_FLOAT_STACK_CHECK
#define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
#define EXCEPTION_INT_DIVIDE_BY_ZERO STATUS_INTEGER_DIVIDE_BY_ZERO
#define EXCEPTION_INT_OVERFLOW STATUS_INTEGER_OVERFLOW
#define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
#define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
#define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION
#define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION
#define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW
#define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION
#define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION
#define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
#define EXCEPTION_POSSIBLE_DEADLOCK STATUS_POSSIBLE_DEADLOCK
#define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
#define MoveMemory RtlMoveMemory
#define CopyMemory RtlCopyMemory
#define FillMemory RtlFillMemory
#define ZeroMemory RtlZeroMemory
#define SecureZeroMemory RtlSecureZeroMemory #define SecureZeroMemory RtlSecureZeroMemory
#define CaptureStackBackTrace RtlCaptureStackBackTrace #define CaptureStackBackTrace RtlCaptureStackBackTrace
// //
// File creation flags must start at the high end since they // File creation flags must start at the high end since they
// are combined with the attributes // are combined with the attributes
// //
//
// These are flags supported through CreateFile (W7) and CreateFile2 (W8 and be
yond)
//
#define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_WRITE_THROUGH 0x80000000
#define FILE_FLAG_OVERLAPPED 0x40000000 #define FILE_FLAG_OVERLAPPED 0x40000000
#define FILE_FLAG_NO_BUFFERING 0x20000000 #define FILE_FLAG_NO_BUFFERING 0x20000000
#define FILE_FLAG_RANDOM_ACCESS 0x10000000 #define FILE_FLAG_RANDOM_ACCESS 0x10000000
#define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000 #define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
#define FILE_FLAG_DELETE_ON_CLOSE 0x04000000 #define FILE_FLAG_DELETE_ON_CLOSE 0x04000000
#define FILE_FLAG_BACKUP_SEMANTICS 0x02000000 #define FILE_FLAG_BACKUP_SEMANTICS 0x02000000
#define FILE_FLAG_POSIX_SEMANTICS 0x01000000 #define FILE_FLAG_POSIX_SEMANTICS 0x01000000
#define FILE_FLAG_SESSION_AWARE 0x00800000
#define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000
#define FILE_FLAG_OPEN_NO_RECALL 0x00100000 #define FILE_FLAG_OPEN_NO_RECALL 0x00100000
#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000 #define FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000
#define CREATE_NEW 1 #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define CREATE_ALWAYS 2
#define OPEN_EXISTING 3 //
#define OPEN_ALWAYS 4 // These are flags supported only through CreateFile2 (W8 and beyond)
#define TRUNCATE_EXISTING 5 //
// Due to the multiplexing of file creation flags, file attribute flags and
// security QoS flags into a single DWORD (dwFlagsAndAttributes) parameter for
// CreateFile, there is no way to add any more flags to CreateFile. Additional
// flags for the create operation must be added to CreateFile2 only
//
#define FILE_FLAG_OPEN_REQUIRING_OPLOCK 0x00040000
#endif
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
// //
// Define possible return codes from the CopyFileEx callback routine // Define possible return codes from the CopyFileEx callback routine
// //
#define PROGRESS_CONTINUE 0 #define PROGRESS_CONTINUE 0
#define PROGRESS_CANCEL 1 #define PROGRESS_CANCEL 1
#define PROGRESS_STOP 2 #define PROGRESS_STOP 2
#define PROGRESS_QUIET 3 #define PROGRESS_QUIET 3
skipping to change at line 166 skipping to change at line 184
#define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008 #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
// //
// Gap for private copyfile flags // Gap for private copyfile flags
// //
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define COPY_FILE_COPY_SYMLINK 0x00000800 #define COPY_FILE_COPY_SYMLINK 0x00000800
#define COPY_FILE_NO_BUFFERING 0x00001000 #define COPY_FILE_NO_BUFFERING 0x00001000
#endif #endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
//
// CopyFile2 flags
//
#define COPY_FILE_REQUEST_SECURITY_PRIVILEGES 0x00002000
#define COPY_FILE_RESUME_FROM_PAUSE 0x00004000
#define COPY_FILE_NO_OFFLOAD 0x00040000
#endif
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
// //
// Define ReplaceFile option flags // Define ReplaceFile option flags
// //
#define REPLACEFILE_WRITE_THROUGH 0x00000001 #define REPLACEFILE_WRITE_THROUGH 0x00000001
#define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002 #define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
skipping to change at line 237 skipping to change at line 269
#define SECURITY_IMPERSONATION ( SecurityImpersonation << 16 ) #define SECURITY_IMPERSONATION ( SecurityImpersonation << 16 )
#define SECURITY_DELEGATION ( SecurityDelegation << 16 ) #define SECURITY_DELEGATION ( SecurityDelegation << 16 )
#define SECURITY_CONTEXT_TRACKING 0x00040000 #define SECURITY_CONTEXT_TRACKING 0x00040000
#define SECURITY_EFFECTIVE_ONLY 0x00080000 #define SECURITY_EFFECTIVE_ONLY 0x00080000
#define SECURITY_SQOS_PRESENT 0x00100000 #define SECURITY_SQOS_PRESENT 0x00100000
#define SECURITY_VALID_SQOS_FLAGS 0x001F0000 #define SECURITY_VALID_SQOS_FLAGS 0x001F0000
// //
// File structures // Fiber structures
//
typedef struct _OVERLAPPED {
ULONG_PTR Internal;
ULONG_PTR InternalHigh;
union {
struct {
DWORD Offset;
DWORD OffsetHigh;
} DUMMYSTRUCTNAME;
PVOID Pointer;
} DUMMYUNIONNAME;
HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED;
typedef struct _OVERLAPPED_ENTRY {
ULONG_PTR lpCompletionKey;
LPOVERLAPPED lpOverlapped;
ULONG_PTR Internal;
DWORD dwNumberOfBytesTransferred;
} OVERLAPPED_ENTRY, *LPOVERLAPPED_ENTRY;
typedef struct _SECURITY_ATTRIBUTES {
DWORD nLength;
LPVOID lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef struct _PROCESS_INFORMATION {
HANDLE hProcess;
HANDLE hThread;
DWORD dwProcessId;
DWORD dwThreadId;
} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
//
// File System time stamps are represented with the following structure:
//
#ifndef _FILETIME_
#define _FILETIME_
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME, *LPFILETIME;
#endif
//
// System time is represented with the following structure:
// //
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(
LPVOID lpThreadParameter
);
typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
typedef VOID (WINAPI *PFIBER_START_ROUTINE)( typedef VOID (WINAPI *PFIBER_START_ROUTINE)(
LPVOID lpFiberParameter LPVOID lpFiberParameter
); );
typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE; typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
#endif /* _WIN32_WINNT >= 0x0400 */
typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
#if (_WIN32_WINNT >= 0x0600)
//
// Define one-time initialization primitive
//
typedef RTL_RUN_ONCE INIT_ONCE;
typedef PRTL_RUN_ONCE PINIT_ONCE;
typedef PRTL_RUN_ONCE LPINIT_ONCE;
#define INIT_ONCE_STATIC_INIT RTL_RUN_ONCE_INIT
// typedef LPVOID (WINAPI *PFIBER_CALLOUT_ROUTINE)(
// Run once flags LPVOID lpParameter
// );
#endif /* _WIN32_WINNT >= 0x0400 */
#define INIT_ONCE_CHECK_ONLY RTL_RUN_ONCE_CHECK_ONLY
#define INIT_ONCE_ASYNC RTL_RUN_ONCE_ASYNC
#define INIT_ONCE_INIT_FAILED RTL_RUN_ONCE_INIT_FAILED
//
// The context stored in the run once structure must leave the following number
// of low order bits unused.
//
#define INIT_ONCE_CTX_RESERVED_BITS RTL_RUN_ONCE_CTX_RESERVED_BITS
// //
// FailFast Exception Flags // FailFast Exception Flags
// //
#define FAIL_FAST_GENERATE_EXCEPTION_ADDRESS 0x1 #define FAIL_FAST_GENERATE_EXCEPTION_ADDRESS 0x1
#define FAIL_FAST_NO_HARD_ERROR_DLG 0x2 #define FAIL_FAST_NO_HARD_ERROR_DLG 0x2
typedef
BOOL
(WINAPI *PINIT_ONCE_FN) (
__inout PINIT_ONCE InitOnce,
__inout_opt PVOID Parameter,
__deref_opt_out_opt PVOID *Context
);
WINBASEAPI
VOID
WINAPI
InitOnceInitialize (
__out PINIT_ONCE InitOnce
);
WINBASEAPI
BOOL
WINAPI
InitOnceExecuteOnce (
__inout PINIT_ONCE InitOnce,
__in __callback PINIT_ONCE_FN InitFn,
__inout_opt PVOID Parameter,
__deref_opt_out_opt LPVOID *Context
);
WINBASEAPI
BOOL
WINAPI
InitOnceBeginInitialize (
__inout LPINIT_ONCE lpInitOnce,
__in DWORD dwFlags,
__out PBOOL fPending,
__deref_opt_out_opt LPVOID *lpContext
);
WINBASEAPI
BOOL
WINAPI
InitOnceComplete (
__inout LPINIT_ONCE lpInitOnce,
__in DWORD dwFlags,
__in_opt LPVOID lpContext
);
#endif
//
// Define the slim r/w lock
//
typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
#define SRWLOCK_INIT RTL_SRWLOCK_INIT
WINBASEAPI
VOID
WINAPI
InitializeSRWLock (
__out PSRWLOCK SRWLock
);
WINBASEAPI
VOID
WINAPI
ReleaseSRWLockExclusive (
__inout PSRWLOCK SRWLock
);
WINBASEAPI
VOID
WINAPI
ReleaseSRWLockShared (
__inout PSRWLOCK SRWLock
);
WINBASEAPI
VOID
WINAPI
AcquireSRWLockExclusive (
__inout PSRWLOCK SRWLock
);
WINBASEAPI
VOID
WINAPI
AcquireSRWLockShared (
__inout PSRWLOCK SRWLock
);
WINBASEAPI
BOOLEAN
WINAPI
TryAcquireSRWLockExclusive (
__inout PSRWLOCK SRWLock
);
WINBASEAPI
BOOLEAN
WINAPI
TryAcquireSRWLockShared (
__inout PSRWLOCK SRWLock
);
//
// Define condition variable
//
typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
WINBASEAPI
VOID
WINAPI
InitializeConditionVariable (
__out PCONDITION_VARIABLE ConditionVariable
);
WINBASEAPI
VOID
WINAPI
WakeConditionVariable (
__inout PCONDITION_VARIABLE ConditionVariable
);
WINBASEAPI
VOID
WINAPI
WakeAllConditionVariable (
__inout PCONDITION_VARIABLE ConditionVariable
);
WINBASEAPI
BOOL
WINAPI
SleepConditionVariableCS (
__inout PCONDITION_VARIABLE ConditionVariable,
__inout PCRITICAL_SECTION CriticalSection,
__in DWORD dwMilliseconds
);
WINBASEAPI
BOOL
WINAPI
SleepConditionVariableSRW (
__inout PCONDITION_VARIABLE ConditionVariable,
__inout PSRWLOCK SRWLock,
__in DWORD dwMilliseconds,
__in ULONG Flags
);
//
// Static initializer for the condition variable
//
#define CONDITION_VARIABLE_INIT RTL_CONDITION_VARIABLE_INIT
//
// Flags for condition variables
//
#define CONDITION_VARIABLE_LOCKMODE_SHARED RTL_CONDITION_VARIABLE_LOCKMODE_SHARE
D
WINBASEAPI
__out_opt
PVOID
WINAPI
EncodePointer (
__in_opt PVOID Ptr
);
WINBASEAPI
__out_opt
PVOID
WINAPI
DecodePointer (
__in_opt PVOID Ptr
);
WINBASEAPI
__out_opt
PVOID
WINAPI
EncodeSystemPointer (
__in_opt PVOID Ptr
);
WINBASEAPI
__out_opt
PVOID
WINAPI
DecodeSystemPointer (
__in_opt PVOID Ptr
);
#if defined(_X86_) #if defined(_X86_)
typedef PLDT_ENTRY LPLDT_ENTRY; typedef PLDT_ENTRY LPLDT_ENTRY;
#else #else
typedef LPVOID LPLDT_ENTRY; typedef LPVOID LPLDT_ENTRY;
#endif #endif
#define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
#define MUTEX_ALL_ACCESS MUTANT_ALL_ACCESS
// //
// Serial provider type. // Serial provider type.
// //
#define SP_SERIALCOMM ((DWORD)0x00000001) #define SP_SERIALCOMM ((DWORD)0x00000001)
// //
// Provider SubTypes // Provider SubTypes
// //
skipping to change at line 763 skipping to change at line 503
WORD wReserved; /* alignment */ WORD wReserved; /* alignment */
DCB dcb; /* device control block */ DCB dcb; /* device control block */
DWORD dwProviderSubType; /* ordinal value for identifying DWORD dwProviderSubType; /* ordinal value for identifying
provider-defined data structure format*/ provider-defined data structure format*/
DWORD dwProviderOffset; /* Specifies the offset of provider specific DWORD dwProviderOffset; /* Specifies the offset of provider specific
data field in bytes from the start */ data field in bytes from the start */
DWORD dwProviderSize; /* size of the provider-specific data field */ DWORD dwProviderSize; /* size of the provider-specific data field */
WCHAR wcProviderData[1]; /* provider-specific data */ WCHAR wcProviderData[1]; /* provider-specific data */
} COMMCONFIG,*LPCOMMCONFIG; } COMMCONFIG,*LPCOMMCONFIG;
typedef struct _SYSTEM_INFO {
union {
DWORD dwOemId; // Obsolete field...do not use
struct {
WORD wProcessorArchitecture;
WORD wReserved;
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
DWORD_PTR dwActiveProcessorMask;
DWORD dwNumberOfProcessors;
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
WORD wProcessorLevel;
WORD wProcessorRevision;
} SYSTEM_INFO, *LPSYSTEM_INFO;
// //
// //
#define FreeModule(hLibModule) FreeLibrary((hLibModule)) #define FreeModule(hLibModule) FreeLibrary((hLibModule))
#define MakeProcInstance(lpProc,hInstance) (lpProc) #define MakeProcInstance(lpProc,hInstance) (lpProc)
#define FreeProcInstance(lpProc) (lpProc) #define FreeProcInstance(lpProc) (lpProc)
/* Global Memory Flags */ /* Global Memory Flags */
#define GMEM_FIXED 0x0000 #define GMEM_FIXED 0x0000
#define GMEM_MOVEABLE 0x0002 #define GMEM_MOVEABLE 0x0002
skipping to change at line 827 skipping to change at line 548
DWORD dwLength; DWORD dwLength;
DWORD dwMemoryLoad; DWORD dwMemoryLoad;
SIZE_T dwTotalPhys; SIZE_T dwTotalPhys;
SIZE_T dwAvailPhys; SIZE_T dwAvailPhys;
SIZE_T dwTotalPageFile; SIZE_T dwTotalPageFile;
SIZE_T dwAvailPageFile; SIZE_T dwAvailPageFile;
SIZE_T dwTotalVirtual; SIZE_T dwTotalVirtual;
SIZE_T dwAvailVirtual; SIZE_T dwAvailVirtual;
} MEMORYSTATUS, *LPMEMORYSTATUS; } MEMORYSTATUS, *LPMEMORYSTATUS;
/* Local Memory Flags */
#define LMEM_FIXED 0x0000
#define LMEM_MOVEABLE 0x0002
#define LMEM_NOCOMPACT 0x0010
#define LMEM_NODISCARD 0x0020
#define LMEM_ZEROINIT 0x0040
#define LMEM_MODIFY 0x0080
#define LMEM_DISCARDABLE 0x0F00
#define LMEM_VALID_FLAGS 0x0F72
#define LMEM_INVALID_HANDLE 0x8000
#define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
#define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
#define NONZEROLHND (LMEM_MOVEABLE)
#define NONZEROLPTR (LMEM_FIXED)
#define LocalDiscard( h ) LocalReAlloc( (h), 0, LMEM_MOVEABLE )
/* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */
#define LMEM_DISCARDED 0x4000
#define LMEM_LOCKCOUNT 0x00FF
// //
// NUMA values // NUMA values
// //
#define NUMA_NO_PREFERRED_NODE ((DWORD) -1) #define NUMA_NO_PREFERRED_NODE ((DWORD) -1)
// //
// Process dwCreationFlag values // Process dwCreationFlag values
// //
#define DEBUG_PROCESS 0x00000001 #define DEBUG_PROCESS 0x00000001
skipping to change at line 935 skipping to change at line 633
#define VOLUME_NAME_DOS 0x0 //default #define VOLUME_NAME_DOS 0x0 //default
#define VOLUME_NAME_GUID 0x1 #define VOLUME_NAME_GUID 0x1
#define VOLUME_NAME_NT 0x2 #define VOLUME_NAME_NT 0x2
#define VOLUME_NAME_NONE 0x4 #define VOLUME_NAME_NONE 0x4
#define FILE_NAME_NORMALIZED 0x0 //default #define FILE_NAME_NORMALIZED 0x0 //default
#define FILE_NAME_OPENED 0x8 #define FILE_NAME_OPENED 0x8
// //
// Debug APIs
//
#define EXCEPTION_DEBUG_EVENT 1
#define CREATE_THREAD_DEBUG_EVENT 2
#define CREATE_PROCESS_DEBUG_EVENT 3
#define EXIT_THREAD_DEBUG_EVENT 4
#define EXIT_PROCESS_DEBUG_EVENT 5
#define LOAD_DLL_DEBUG_EVENT 6
#define UNLOAD_DLL_DEBUG_EVENT 7
#define OUTPUT_DEBUG_STRING_EVENT 8
#define RIP_EVENT 9
typedef struct _EXCEPTION_DEBUG_INFO {
EXCEPTION_RECORD ExceptionRecord;
DWORD dwFirstChance;
} EXCEPTION_DEBUG_INFO, *LPEXCEPTION_DEBUG_INFO;
typedef struct _CREATE_THREAD_DEBUG_INFO {
HANDLE hThread;
LPVOID lpThreadLocalBase;
LPTHREAD_START_ROUTINE lpStartAddress;
} CREATE_THREAD_DEBUG_INFO, *LPCREATE_THREAD_DEBUG_INFO;
typedef struct _CREATE_PROCESS_DEBUG_INFO {
HANDLE hFile;
HANDLE hProcess;
HANDLE hThread;
LPVOID lpBaseOfImage;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
LPVOID lpThreadLocalBase;
LPTHREAD_START_ROUTINE lpStartAddress;
LPVOID lpImageName;
WORD fUnicode;
} CREATE_PROCESS_DEBUG_INFO, *LPCREATE_PROCESS_DEBUG_INFO;
typedef struct _EXIT_THREAD_DEBUG_INFO {
DWORD dwExitCode;
} EXIT_THREAD_DEBUG_INFO, *LPEXIT_THREAD_DEBUG_INFO;
typedef struct _EXIT_PROCESS_DEBUG_INFO {
DWORD dwExitCode;
} EXIT_PROCESS_DEBUG_INFO, *LPEXIT_PROCESS_DEBUG_INFO;
typedef struct _LOAD_DLL_DEBUG_INFO {
HANDLE hFile;
LPVOID lpBaseOfDll;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
LPVOID lpImageName;
WORD fUnicode;
} LOAD_DLL_DEBUG_INFO, *LPLOAD_DLL_DEBUG_INFO;
typedef struct _UNLOAD_DLL_DEBUG_INFO {
LPVOID lpBaseOfDll;
} UNLOAD_DLL_DEBUG_INFO, *LPUNLOAD_DLL_DEBUG_INFO;
typedef struct _OUTPUT_DEBUG_STRING_INFO {
LPSTR lpDebugStringData;
WORD fUnicode;
WORD nDebugStringLength;
} OUTPUT_DEBUG_STRING_INFO, *LPOUTPUT_DEBUG_STRING_INFO;
typedef struct _RIP_INFO {
DWORD dwError;
DWORD dwType;
} RIP_INFO, *LPRIP_INFO;
typedef struct _DEBUG_EVENT {
DWORD dwDebugEventCode;
DWORD dwProcessId;
DWORD dwThreadId;
union {
EXCEPTION_DEBUG_INFO Exception;
CREATE_THREAD_DEBUG_INFO CreateThread;
CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
EXIT_THREAD_DEBUG_INFO ExitThread;
EXIT_PROCESS_DEBUG_INFO ExitProcess;
LOAD_DLL_DEBUG_INFO LoadDll;
UNLOAD_DLL_DEBUG_INFO UnloadDll;
OUTPUT_DEBUG_STRING_INFO DebugString;
RIP_INFO RipInfo;
} u;
} DEBUG_EVENT, *LPDEBUG_EVENT;
//
// JIT Debugging Info. This structure is defined to have constant size in // JIT Debugging Info. This structure is defined to have constant size in
// both the emulated and native environment. // both the emulated and native environment.
// //
typedef struct _JIT_DEBUG_INFO { typedef struct _JIT_DEBUG_INFO {
DWORD dwSize; DWORD dwSize;
DWORD dwProcessorArchitecture; DWORD dwProcessorArchitecture;
DWORD dwThreadID; DWORD dwThreadID;
DWORD dwReserved0; DWORD dwReserved0;
ULONG64 lpExceptionAddress; ULONG64 lpExceptionAddress;
ULONG64 lpExceptionRecord; ULONG64 lpExceptionRecord;
ULONG64 lpContextRecord; ULONG64 lpContextRecord;
} JIT_DEBUG_INFO, *LPJIT_DEBUG_INFO; } JIT_DEBUG_INFO, *LPJIT_DEBUG_INFO;
typedef JIT_DEBUG_INFO JIT_DEBUG_INFO32, *LPJIT_DEBUG_INFO32; typedef JIT_DEBUG_INFO JIT_DEBUG_INFO32, *LPJIT_DEBUG_INFO32;
typedef JIT_DEBUG_INFO JIT_DEBUG_INFO64, *LPJIT_DEBUG_INFO64; typedef JIT_DEBUG_INFO JIT_DEBUG_INFO64, *LPJIT_DEBUG_INFO64;
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
typedef PCONTEXT LPCONTEXT;
typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD; typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS; typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
#endif #endif
#define DRIVE_UNKNOWN 0 #define DRIVE_UNKNOWN 0
#define DRIVE_NO_ROOT_DIR 1 #define DRIVE_NO_ROOT_DIR 1
#define DRIVE_REMOVABLE 2 #define DRIVE_REMOVABLE 2
#define DRIVE_FIXED 3 #define DRIVE_FIXED 3
#define DRIVE_REMOTE 4 #define DRIVE_REMOTE 4
#define DRIVE_CDROM 5 #define DRIVE_CDROM 5
#define DRIVE_RAMDISK 6 #define DRIVE_RAMDISK 6
#ifndef _MAC #ifndef _MAC
#define GetFreeSpace(w) (0x100000L) #define GetFreeSpace(w) (0x100000L)
#else #else
WINBASEAPI DWORD WINAPI GetFreeSpace(__in UINT); WINBASEAPI DWORD WINAPI GetFreeSpace(_In_ UINT);
#endif #endif
#define FILE_TYPE_UNKNOWN 0x0000 #define FILE_TYPE_UNKNOWN 0x0000
#define FILE_TYPE_DISK 0x0001 #define FILE_TYPE_DISK 0x0001
#define FILE_TYPE_CHAR 0x0002 #define FILE_TYPE_CHAR 0x0002
#define FILE_TYPE_PIPE 0x0003 #define FILE_TYPE_PIPE 0x0003
#define FILE_TYPE_REMOTE 0x8000 #define FILE_TYPE_REMOTE 0x8000
#define STD_INPUT_HANDLE ((DWORD)-10) #define STD_INPUT_HANDLE ((DWORD)-10)
#define STD_OUTPUT_HANDLE ((DWORD)-11) #define STD_OUTPUT_HANDLE ((DWORD)-11)
skipping to change at line 1234 skipping to change at line 845
#define NMPWAIT_USE_DEFAULT_WAIT 0x00000000 #define NMPWAIT_USE_DEFAULT_WAIT 0x00000000
#define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES #define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
#define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH #define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
#define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK #define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
#define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS #define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS
#define FS_VOL_IS_COMPRESSED FILE_VOLUME_IS_COMPRESSED #define FS_VOL_IS_COMPRESSED FILE_VOLUME_IS_COMPRESSED
#define FS_FILE_COMPRESSION FILE_FILE_COMPRESSION #define FS_FILE_COMPRESSION FILE_FILE_COMPRESSION
#define FS_FILE_ENCRYPTION FILE_SUPPORTS_ENCRYPTION #define FS_FILE_ENCRYPTION FILE_SUPPORTS_ENCRYPTION
#define FILE_MAP_COPY SECTION_QUERY
#define FILE_MAP_WRITE SECTION_MAP_WRITE
#define FILE_MAP_READ SECTION_MAP_READ
#define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
#define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT // not included in F
ILE_MAP_ALL_ACCESS
#define OF_READ 0x00000000 #define OF_READ 0x00000000
#define OF_WRITE 0x00000001 #define OF_WRITE 0x00000001
#define OF_READWRITE 0x00000002 #define OF_READWRITE 0x00000002
#define OF_SHARE_COMPAT 0x00000000 #define OF_SHARE_COMPAT 0x00000000
#define OF_SHARE_EXCLUSIVE 0x00000010 #define OF_SHARE_EXCLUSIVE 0x00000010
#define OF_SHARE_DENY_WRITE 0x00000020 #define OF_SHARE_DENY_WRITE 0x00000020
#define OF_SHARE_DENY_READ 0x00000030 #define OF_SHARE_DENY_READ 0x00000030
#define OF_SHARE_DENY_NONE 0x00000040 #define OF_SHARE_DENY_NONE 0x00000040
#define OF_PARSE 0x00000100 #define OF_PARSE 0x00000100
#define OF_DELETE 0x00000200 #define OF_DELETE 0x00000200
skipping to change at line 1267 skipping to change at line 872
#define OFS_MAXPATHNAME 128 #define OFS_MAXPATHNAME 128
typedef struct _OFSTRUCT { typedef struct _OFSTRUCT {
BYTE cBytes; BYTE cBytes;
BYTE fFixedDisk; BYTE fFixedDisk;
WORD nErrCode; WORD nErrCode;
WORD Reserved1; WORD Reserved1;
WORD Reserved2; WORD Reserved2;
CHAR szPathName[OFS_MAXPATHNAME]; CHAR szPathName[OFS_MAXPATHNAME];
} OFSTRUCT, *LPOFSTRUCT, *POFSTRUCT; } OFSTRUCT, *LPOFSTRUCT, *POFSTRUCT;
#ifndef NOWINBASEINTERLOCK
#ifndef _NTOS_
#if defined(_M_IA64) && !defined(RC_INVOKED)
#define InterlockedIncrement _InterlockedIncrement
#define InterlockedIncrementAcquire _InterlockedIncrement_acq
#define InterlockedIncrementRelease _InterlockedIncrement_rel
#define InterlockedDecrement _InterlockedDecrement
#define InterlockedDecrementAcquire _InterlockedDecrement_acq
#define InterlockedDecrementRelease _InterlockedDecrement_rel
#define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd
#define InterlockedCompareExchange _InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq
#define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel
#define InterlockedExchangePointer _InterlockedExchangePointer
#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePoin
ter_rel
#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePoin
ter_acq
#define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq
#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel
#define InterlockedCompare64Exchange128 _InterlockedCompare64Exchange128
#define InterlockedCompare64ExchangeAcquire128 _InterlockedCompare64Exchange128
_acq
#define InterlockedCompare64ExchangeRelease128 _InterlockedCompare64Exchange128
_rel
#define InterlockedOr _InterlockedOr
#define InterlockedOrAcquire _InterlockedOr_acq
#define InterlockedOrRelease _InterlockedOr_rel
#define InterlockedOr8 _InterlockedOr8
#define InterlockedOr8Acquire _InterlockedOr8_acq
#define InterlockedOr8Release _InterlockedOr8_rel
#define InterlockedOr16 _InterlockedOr16
#define InterlockedOr16Acquire _InterlockedOr16_acq
#define InterlockedOr16Release _InterlockedOr16_rel
#define InterlockedOr64 _InterlockedOr64
#define InterlockedOr64Acquire _InterlockedOr64_acq
#define InterlockedOr64Release _InterlockedOr64_rel
#define InterlockedXor _InterlockedXor
#define InterlockedXorAcquire _InterlockedXor_acq
#define InterlockedXorRelease _InterlockedXor_rel
#define InterlockedXor8 _InterlockedXor8
#define InterlockedXor8Acquire _InterlockedXor8_acq
#define InterlockedXor8Release _InterlockedXor8_rel
#define InterlockedXor16 _InterlockedXor16
#define InterlockedXor16Acquire _InterlockedXor16_acq
#define InterlockedXor16Release _InterlockedXor16_rel
#define InterlockedXor64 _InterlockedXor64
#define InterlockedXor64Acquire _InterlockedXor64_acq
#define InterlockedXor64Release _InterlockedXor64_rel
#define InterlockedAnd _InterlockedAnd
#define InterlockedAndAcquire _InterlockedAnd_acq
#define InterlockedAndRelease _InterlockedAnd_rel
#define InterlockedAnd8 _InterlockedAnd8
#define InterlockedAnd8Acquire _InterlockedAnd8_acq
#define InterlockedAnd8Release _InterlockedAnd8_rel
#define InterlockedAnd16 _InterlockedAnd16
#define InterlockedAnd16Acquire _InterlockedAnd16_acq
#define InterlockedAnd16Release _InterlockedAnd16_rel
#define InterlockedAnd64 _InterlockedAnd64
#define InterlockedAnd64Acquire _InterlockedAnd64_acq
#define InterlockedAnd64Release _InterlockedAnd64_rel
LONG
__cdecl
InterlockedOr (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
__cdecl
InterlockedOrAcquire (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
__cdecl
InterlockedOrRelease (
__inout LONG volatile *Destination,
__in LONG Value
);
char
__cdecl
InterlockedOr8 (
__inout char volatile *Destination,
__in char Value
);
char
__cdecl
InterlockedOr8Acquire (
__inout char volatile *Destination,
__in char Value
);
char
__cdecl
InterlockedOr8Release (
__inout char volatile *Destination,
__in char Value
);
SHORT
__cdecl
InterlockedOr16(
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
__cdecl
InterlockedOr16Acquire (
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
__cdecl
InterlockedOr16Release (
__inout SHORT volatile *Destination,
__in SHORT Value
);
LONGLONG
__cdecl
InterlockedOr64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedOr64Acquire (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedOr64Release (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONG
__cdecl
InterlockedXor (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
__cdecl
InterlockedXorAcquire (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
__cdecl
InterlockedXorRelease (
__inout LONG volatile *Destination,
__in LONG Value
);
char
__cdecl
InterlockedXor8 (
__inout char volatile *Destination,
__in char Value
);
char
__cdecl
InterlockedXor8Acquire (
__inout char volatile *Destination,
__in char Value
);
char
__cdecl
InterlockedXor8Release (
__inout char volatile *Destination,
__in char Value
);
SHORT
__cdecl
InterlockedXor16(
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
__cdecl
InterlockedXor16Acquire (
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
__cdecl
InterlockedXor16Release (
__inout SHORT volatile *Destination,
__in SHORT Value
);
LONGLONG
__cdecl
InterlockedXor64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedXor64Acquire (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedXor64Release (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONG
__cdecl
InterlockedAnd (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
__cdecl
InterlockedAndAcquire (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
__cdecl
InterlockedAndRelease (
__inout LONG volatile *Destination,
__in LONG Value
);
char
__cdecl
InterlockedAnd8 (
__inout char volatile *Destination,
__in char Value
);
char
__cdecl
InterlockedAnd8Acquire (
__inout char volatile *Destination,
__in char Value
);
char
__cdecl
InterlockedAnd8Release (
__inout char volatile *Destination,
__in char Value
);
SHORT
__cdecl
InterlockedAnd16(
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
__cdecl
InterlockedAnd16Acquire (
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
__cdecl
InterlockedAnd16Release (
__inout SHORT volatile *Destination,
__in SHORT Value
);
LONGLONG
__cdecl
InterlockedAnd64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedAnd64Acquire (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedAnd64Release (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedIncrement64 (
__inout LONGLONG volatile *Addend
);
LONGLONG
__cdecl
InterlockedDecrement64 (
__inout LONGLONG volatile *Addend
);
LONG
__cdecl
InterlockedIncrementAcquire (
__inout LONG volatile *Addend
);
LONG
__cdecl
InterlockedDecrementAcquire (
__inout LONG volatile *Addend
);
LONG
__cdecl
InterlockedIncrementRelease (
__inout LONG volatile *Addend
);
LONG
__cdecl
InterlockedDecrementRelease (
__inout LONG volatile *Addend
);
LONGLONG
__cdecl
InterlockedExchange64 (
__inout LONGLONG volatile *Target,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedExchangeAcquire64 (
__inout LONGLONG volatile *Target,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedExchangeAdd64 (
__inout LONGLONG volatile *Addend,
__in LONGLONG Value
);
LONGLONG
__cdecl
InterlockedCompareExchange64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG ExChange,
__in LONGLONG Comperand
);
LONGLONG
__cdecl
InterlockedCompareExchangeAcquire64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG ExChange,
__in LONGLONG Comperand
);
LONGLONG
__cdecl
InterlockedCompareExchangeRelease64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG ExChange,
__in LONGLONG Comperand
);
LONG64
__cdecl
InterlockedCompare64Exchange128(
__inout LONG64 volatile * Destination,
__in LONG64 ExchangeHigh,
__in LONG64 ExchangeLow,
__in LONG64 Comperand
);
LONG64
__cdecl
InterlockedCompare64ExchangeAcquire128(
__inout LONG64 volatile * Destination,
__in LONG64 ExchangeHigh,
__in LONG64 ExchangeLow,
__in LONG64 Comperand
);
LONG64
__cdecl
InterlockedCompare64ExchangeRelease128(
__inout LONG64 volatile * Destination,
__in LONG64 ExchangeHigh,
__in LONG64 ExchangeLow,
__in LONG64 Comperand
);
LONG
__cdecl
InterlockedIncrement (
__inout LONG volatile *lpAddend
);
LONG
__cdecl
InterlockedDecrement (
__inout LONG volatile *lpAddend
);
LONG
__cdecl
InterlockedExchange (
__inout LONG volatile *Target,
__in LONG Value
);
LONG
__cdecl
InterlockedExchangeAdd (
__inout LONG volatile *Addend,
__in LONG Value
);
LONG
__cdecl
InterlockedCompareExchange (
__inout LONG volatile *Destination,
__in LONG ExChange,
__in LONG Comperand
);
LONG
__cdecl
InterlockedCompareExchangeRelease (
__inout LONG volatile *Destination,
__in LONG ExChange,
__in LONG Comperand
);
LONG
__cdecl
InterlockedCompareExchangeAcquire (
__inout LONG volatile *Destination,
__in LONG ExChange,
__in LONG Comperand
);
PVOID
__cdecl
InterlockedExchangePointer (
__inout PVOID volatile *Target,
__in_opt PVOID Value
);
PVOID
__cdecl
InterlockedCompareExchangePointer (
__inout PVOID volatile *Destination,
__in_opt PVOID ExChange,
__in_opt PVOID Comperand
);
PVOID
__cdecl
InterlockedCompareExchangePointerAcquire (
__inout PVOID volatile *Destination,
__in_opt PVOID Exchange,
__in_opt PVOID Comperand
);
PVOID
__cdecl
InterlockedCompareExchangePointerRelease (
__inout PVOID volatile *Destination,
__in_opt PVOID Exchange,
__in_opt PVOID Comperand
);
#if !defined(MIDL_PASS)
#if !defined (InterlockedAnd)
#define InterlockedAnd InterlockedAnd_Inline
FORCEINLINE
LONG
InterlockedAnd_Inline (
__inout LONG volatile *Target,
__in LONG Set
)
{
LONG i;
LONG j;
j = *Target;
do {
i = j;
j = InterlockedCompareExchange(Target,
i & Set,
i);
} while (i != j);
return j;
}
#endif
#if !defined (InterlockedOr)
#define InterlockedOr InterlockedOr_Inline
FORCEINLINE
LONG
InterlockedOr_Inline (
__inout LONG volatile *Target,
__in LONG Set
)
{
LONG i;
LONG j;
j = *Target;
do {
i = j;
j = InterlockedCompareExchange(Target,
i | Set,
i);
} while (i != j);
return j;
}
#endif
#if !defined (InterlockedXor)
#define InterlockedXor InterlockedXor_Inline
FORCEINLINE
LONG
InterlockedXor_Inline (
__inout LONG volatile *Target,
__in LONG Set
)
{
LONG i;
LONG j;
j = *Target;
do {
i = j;
j = InterlockedCompareExchange(Target,
i ^ Set,
i);
} while (i != j);
return j;
}
#endif
#if !defined (InterlockedAnd64)
#define InterlockedAnd64 InterlockedAnd64_Inline
FORCEINLINE
LONGLONG
InterlockedAnd64_Inline (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Destination;
} while (InterlockedCompareExchange64(Destination,
Old & Value,
Old) != Old);
return Old;
}
#endif
#if !defined (InterlockedOr64)
#define InterlockedOr64 InterlockedOr64_Inline
FORCEINLINE
LONGLONG
InterlockedOr64_Inline (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Destination;
} while (InterlockedCompareExchange64(Destination,
Old | Value,
Old) != Old);
return Old;
}
#endif
#if !defined (InterlockedXor64)
#define InterlockedXor64 InterlockedXor64_Inline
FORCEINLINE
LONGLONG
InterlockedXor64_Inline (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Destination;
} while (InterlockedCompareExchange64(Destination,
Old ^ Value,
Old) != Old);
return Old;
}
#endif
#if !defined (InterlockedBitTestAndSet)
#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline
FORCEINLINE
BOOLEAN
InterlockedBitTestAndSet_Inline (
__inout LONG volatile *Base,
__in LONG Bit
)
{
LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedOr(&Base[Bit/(sizeof(*Base)*8)], tBit)&tBit) !=
0);
}
#endif
#if !defined (InterlockedBitTestAndReset)
#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline
FORCEINLINE
BOOLEAN
InterlockedBitTestAndReset_Inline (
__inout LONG volatile *Base,
__in LONG Bit
)
{
LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedAnd(&Base[Bit/(sizeof(*Base)*8)], ~tBit)&tBit)
!= 0);
}
#endif
#if !defined (InterlockedBitTestAndComplement)
#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline
FORCEINLINE
BOOLEAN
InterlockedBitTestAndComplement_Inline (
__inout LONG volatile *Base,
__in LONG Bit
)
{
LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedXor(&Base[Bit/(sizeof(*Base)*8)], tBit)&tBit) !
= 0);
}
#endif
#endif
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedIncrement_acq)
#pragma intrinsic(_InterlockedIncrement_rel)
#pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedDecrement_acq)
#pragma intrinsic(_InterlockedDecrement_rel)
#pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchangeAdd)
#pragma intrinsic(_InterlockedCompareExchange)
#pragma intrinsic(_InterlockedCompareExchange_acq)
#pragma intrinsic(_InterlockedCompareExchange_rel)
#pragma intrinsic(_InterlockedExchangePointer)
#pragma intrinsic(_InterlockedCompareExchangePointer)
#pragma intrinsic(_InterlockedCompareExchangePointer_acq)
#pragma intrinsic(_InterlockedCompareExchangePointer_rel)
#pragma intrinsic(_InterlockedIncrement64)
#pragma intrinsic(_InterlockedDecrement64)
#pragma intrinsic(_InterlockedExchange64)
#pragma intrinsic(_InterlockedExchange64_acq)
#pragma intrinsic(_InterlockedCompareExchange64)
#pragma intrinsic(_InterlockedCompareExchange64_acq)
#pragma intrinsic(_InterlockedCompareExchange64_rel)
#pragma intrinsic(_InterlockedExchangeAdd64)
#pragma intrinsic (_InterlockedOr)
#pragma intrinsic (_InterlockedOr_acq)
#pragma intrinsic (_InterlockedOr_rel)
#pragma intrinsic (_InterlockedOr8)
#pragma intrinsic (_InterlockedOr8_acq)
#pragma intrinsic (_InterlockedOr8_rel)
#pragma intrinsic (_InterlockedOr16)
#pragma intrinsic (_InterlockedOr16_acq)
#pragma intrinsic (_InterlockedOr16_rel)
#pragma intrinsic (_InterlockedOr64)
#pragma intrinsic (_InterlockedOr64_acq)
#pragma intrinsic (_InterlockedOr64_rel)
#pragma intrinsic (_InterlockedXor)
#pragma intrinsic (_InterlockedXor_acq)
#pragma intrinsic (_InterlockedXor_rel)
#pragma intrinsic (_InterlockedXor8)
#pragma intrinsic (_InterlockedXor8_acq)
#pragma intrinsic (_InterlockedXor8_rel)
#pragma intrinsic (_InterlockedXor16)
#pragma intrinsic (_InterlockedXor16_acq)
#pragma intrinsic (_InterlockedXor16_rel)
#pragma intrinsic (_InterlockedXor64)
#pragma intrinsic (_InterlockedXor64_acq)
#pragma intrinsic (_InterlockedXor64_rel)
#pragma intrinsic (_InterlockedAnd)
#pragma intrinsic (_InterlockedAnd_acq)
#pragma intrinsic (_InterlockedAnd_rel)
#pragma intrinsic (_InterlockedAnd8)
#pragma intrinsic (_InterlockedAnd8_acq)
#pragma intrinsic (_InterlockedAnd8_rel)
#pragma intrinsic (_InterlockedAnd16)
#pragma intrinsic (_InterlockedAnd16_acq)
#pragma intrinsic (_InterlockedAnd16_rel)
#pragma intrinsic (_InterlockedAnd64)
#pragma intrinsic (_InterlockedAnd64_acq)
#pragma intrinsic (_InterlockedAnd64_rel)
#elif defined(_M_AMD64) && !defined(RC_INVOKED)
#define InterlockedAnd _InterlockedAnd
#define InterlockedOr _InterlockedOr
#define InterlockedXor _InterlockedXor
#define InterlockedIncrement _InterlockedIncrement
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedDecrement _InterlockedDecrement
#define InterlockedDecrementAcquire InterlockedDecrement
#define InterlockedDecrementRelease InterlockedDecrement
#define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd
#define InterlockedCompareExchange _InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
#define InterlockedCompareExchangeRelease InterlockedCompareExchange
#define InterlockedExchangePointer _InterlockedExchangePointer
#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePoin
ter
#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePoin
ter
#define InterlockedAnd64 _InterlockedAnd64
#define InterlockedOr64 _InterlockedOr64
#define InterlockedXor64 _InterlockedXor64
#define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
LONG
InterlockedAnd (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
InterlockedOr (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
InterlockedXor (
__inout LONG volatile *Destination,
__in LONG Value
);
LONG
InterlockedIncrement (
__inout LONG volatile *Addend
);
LONG
InterlockedDecrement (
__inout LONG volatile *Addend
);
LONG
InterlockedExchange (
__inout LONG volatile *Target,
__in LONG Value
);
LONG
InterlockedExchangeAdd (
__inout LONG volatile *Addend,
__in LONG Value
);
LONG
InterlockedCompareExchange (
__inout LONG volatile *Destination,
__in LONG ExChange,
__in LONG Comperand
);
PVOID
InterlockedCompareExchangePointer (
__inout PVOID volatile *Destination,
__in_opt PVOID Exchange,
__in_opt PVOID Comperand
);
PVOID
InterlockedExchangePointer (
__inout PVOID volatile *Target,
__in_opt PVOID Value
);
LONG64
InterlockedAnd64 (
__inout LONG64 volatile *Destination,
__in LONG64 Value
);
LONG64
InterlockedOr64 (
__inout LONG64 volatile *Destination,
__in LONG64 Value
);
LONG64
InterlockedXor64 (
__inout LONG64 volatile *Destination,
__in LONG64 Value
);
LONG64
InterlockedIncrement64 (
__inout LONG64 volatile *Addend
);
LONG64
InterlockedDecrement64 (
__inout LONG64 volatile *Addend
);
LONG64
InterlockedExchange64 (
__inout LONG64 volatile *Target,
__in LONG64 Value
);
LONG64
InterlockedExchangeAdd64 (
__inout LONG64 volatile *Addend,
__in LONG64 Value
);
LONG64
InterlockedCompareExchange64 (
__inout LONG64 volatile *Destination,
__in LONG64 ExChange,
__in LONG64 Comperand
);
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchangeAdd)
#pragma intrinsic(_InterlockedCompareExchange)
#pragma intrinsic(_InterlockedExchangePointer)
#pragma intrinsic(_InterlockedCompareExchangePointer)
#pragma intrinsic(_InterlockedAnd64)
#pragma intrinsic(_InterlockedOr64)
#pragma intrinsic(_InterlockedXor64)
#pragma intrinsic(_InterlockedIncrement64)
#pragma intrinsic(_InterlockedDecrement64)
#pragma intrinsic(_InterlockedExchange64)
#pragma intrinsic(_InterlockedExchangeAdd64)
#pragma intrinsic(_InterlockedCompareExchange64)
#if _MSC_FULL_VER >= 140041204
#define InterlockedAnd8 _InterlockedAnd8
#define InterlockedOr8 _InterlockedOr8
#define InterlockedXor8 _InterlockedXor8
#define InterlockedAnd16 _InterlockedAnd16
#define InterlockedOr16 _InterlockedOr16
#define InterlockedXor16 _InterlockedXor16
char
InterlockedAnd8 (
__inout char volatile *Destination,
__in char Value
);
char
InterlockedOr8 (
__inout char volatile *Destination,
__in char Value
);
char
InterlockedXor8 (
__inout char volatile *Destination,
__in char Value
);
SHORT
InterlockedAnd16(
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
InterlockedOr16(
__inout SHORT volatile *Destination,
__in SHORT Value
);
SHORT
InterlockedXor16(
__inout SHORT volatile *Destination,
__in SHORT Value
);
#pragma intrinsic (_InterlockedAnd8)
#pragma intrinsic (_InterlockedOr8)
#pragma intrinsic (_InterlockedXor8)
#pragma intrinsic (_InterlockedAnd16)
#pragma intrinsic (_InterlockedOr16)
#pragma intrinsic (_InterlockedXor16)
#endif
#else // X86 interlocked definitions
WINBASEAPI
LONG
WINAPI
InterlockedIncrement (
__inout LONG volatile *lpAddend
);
WINBASEAPI
LONG
WINAPI
InterlockedDecrement (
__inout LONG volatile *lpAddend
);
WINBASEAPI
LONG
WINAPI
InterlockedExchange (
__inout LONG volatile *Target,
__in LONG Value
);
#define InterlockedExchangePointer(Target, Value) \
(PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value))
WINBASEAPI
LONG
WINAPI
InterlockedExchangeAdd (
__inout LONG volatile *Addend,
__in LONG Value
);
WINBASEAPI
LONG
WINAPI
InterlockedCompareExchange (
__inout LONG volatile *Destination,
__in LONG Exchange,
__in LONG Comperand
);
#if (_WIN32_WINNT >= 0x0502)
WINBASEAPI
LONGLONG
WINAPI
InterlockedCompareExchange64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Exchange,
__in LONGLONG Comperand
);
#endif
#if !defined(MIDL_PASS)
#if (_WIN32_WINNT >= 0x0502)
FORCEINLINE
LONGLONG
InterlockedAnd64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Destination;
} while (InterlockedCompareExchange64(Destination,
Old & Value,
Old) != Old);
return Old;
}
FORCEINLINE
LONGLONG
InterlockedOr64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Destination;
} while (InterlockedCompareExchange64(Destination,
Old | Value,
Old) != Old);
return Old;
}
FORCEINLINE
LONGLONG
InterlockedXor64 (
__inout LONGLONG volatile *Destination,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Destination;
} while (InterlockedCompareExchange64(Destination,
Old ^ Value,
Old) != Old);
return Old;
}
FORCEINLINE
LONGLONG
InterlockedIncrement64 (
__inout LONGLONG volatile *Addend
)
{
LONGLONG Old;
do {
Old = *Addend;
} while (InterlockedCompareExchange64(Addend,
Old + 1,
Old) != Old);
return Old + 1;
}
FORCEINLINE
LONGLONG
InterlockedDecrement64 (
__inout LONGLONG volatile *Addend
)
{
LONGLONG Old;
do {
Old = *Addend;
} while (InterlockedCompareExchange64(Addend,
Old - 1,
Old) != Old);
return Old - 1;
}
FORCEINLINE
LONGLONG
InterlockedExchange64 (
__inout LONGLONG volatile *Target,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Target;
} while (InterlockedCompareExchange64(Target,
Value,
Old) != Old);
return Old;
}
FORCEINLINE
LONGLONG
InterlockedExchangeAdd64(
__inout LONGLONG volatile *Addend,
__in LONGLONG Value
)
{
LONGLONG Old;
do {
Old = *Addend;
} while (InterlockedCompareExchange64(Addend,
Old + Value,
Old) != Old);
return Old;
}
#endif
#endif
//
// Use a function for C++ so X86 will generate the same errors as RISC.
//
#ifdef __cplusplus
FORCEINLINE
PVOID
#if !defined(_M_CEE_PURE)
__cdecl
#endif
__InlineInterlockedCompareExchangePointer (
__inout PVOID volatile *Destination,
__in_opt PVOID ExChange,
__in_opt PVOID Comperand
)
{
return((PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)Destinat
ion, (LONG)(LONG_PTR)ExChange, (LONG)(LONG_PTR)Comperand));
}
#define InterlockedCompareExchangePointer __InlineInterlockedCompareExchangePoin
ter
#else
#define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) \
(PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)(Destination),
(LONG)(LONG_PTR)(ExChange), (LONG)(LONG_PTR)(Comperand))
#endif /* __cplusplus */
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedDecrementAcquire InterlockedDecrement
#define InterlockedDecrementRelease InterlockedDecrement
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
#define InterlockedCompareExchangeRelease InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
#define InterlockedCompareExchangePointerAcquire InterlockedCompareExchangePoint
er
#define InterlockedCompareExchangePointerRelease InterlockedCompareExchangePoint
er
#endif /* X86 | IA64 */
#if defined(_SLIST_HEADER_) && !defined(_NTOSP_)
WINBASEAPI
VOID
WINAPI
InitializeSListHead (
__inout PSLIST_HEADER ListHead
);
WINBASEAPI
PSLIST_ENTRY
WINAPI
InterlockedPopEntrySList (
__inout PSLIST_HEADER ListHead
);
WINBASEAPI
PSLIST_ENTRY
WINAPI
InterlockedPushEntrySList (
__inout PSLIST_HEADER ListHead,
__inout PSLIST_ENTRY ListEntry
);
WINBASEAPI
PSLIST_ENTRY
WINAPI
InterlockedFlushSList (
__inout PSLIST_HEADER ListHead
);
WINBASEAPI
USHORT
WINAPI
QueryDepthSList (
__in PSLIST_HEADER ListHead
);
#endif /* _SLIST_HEADER_ */
#endif /* _NTOS_ */
#endif /* NOWINBASEINTERLOCK */
WINBASEAPI
BOOL
WINAPI
FreeResource(
__in HGLOBAL hResData
);
WINBASEAPI
LPVOID
WINAPI
LockResource(
__in HGLOBAL hResData
);
#define UnlockResource(hResData) ((hResData), 0) #define UnlockResource(hResData) ((hResData), 0)
#define MAXINTATOM 0xC000 #define MAXINTATOM 0xC000
#define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i))) #define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i)))
#define INVALID_ATOM ((ATOM)0) #define INVALID_ATOM ((ATOM)0)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
int int
#if !defined(_MAC) #if !defined(_MAC)
#if defined(_M_CEE_PURE) #if defined(_M_CEE_PURE)
__clrcall __clrcall
#else #else
WINAPI WINAPI
#endif #endif
#else #else
CALLBACK CALLBACK
#endif #endif
WinMain ( WinMain (
__in HINSTANCE hInstance, _In_ HINSTANCE hInstance,
__in_opt HINSTANCE hPrevInstance, _In_opt_ HINSTANCE hPrevInstance,
__in LPSTR lpCmdLine, _In_ LPSTR lpCmdLine,
__in int nShowCmd _In_ int nShowCmd
); );
int int
#if defined(_M_CEE_PURE) #if defined(_M_CEE_PURE)
__clrcall __clrcall
#else #else
WINAPI WINAPI
#endif #endif
wWinMain( wWinMain(
__in HINSTANCE hInstance, _In_ HINSTANCE hInstance,
__in_opt HINSTANCE hPrevInstance, _In_opt_ HINSTANCE hPrevInstance,
__in LPWSTR lpCmdLine, _In_ LPWSTR lpCmdLine,
__in int nShowCmd _In_ int nShowCmd
);
WINBASEAPI
BOOL
WINAPI
FreeLibrary (
__in HMODULE hLibModule
);
WINBASEAPI
DECLSPEC_NORETURN
VOID
WINAPI
FreeLibraryAndExitThread (
__in HMODULE hLibModule,
__in DWORD dwExitCode
);
WINBASEAPI
BOOL
WINAPI
DisableThreadLibraryCalls (
__in HMODULE hLibModule
);
WINBASEAPI
FARPROC
WINAPI
GetProcAddress (
__in HMODULE hModule,
__in LPCSTR lpProcName
);
WINBASEAPI
DWORD
WINAPI
GetVersion (
VOID
); );
WINBASEAPI WINBASEAPI
__out_opt _Success_(return != NULL)
_Post_writable_byte_size_(dwBytes)
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalAlloc ( GlobalAlloc(
__in UINT uFlags, _In_ UINT uFlags,
__in SIZE_T dwBytes _In_ SIZE_T dwBytes
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_reallocated_bytes_(hMem, dwBytes)
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalReAlloc ( GlobalReAlloc (
__in HGLOBAL hMem, _Frees_ptr_ HGLOBAL hMem,
__in SIZE_T dwBytes, _In_ SIZE_T dwBytes,
__in UINT uFlags _In_ UINT uFlags
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
GlobalSize ( GlobalSize (
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GlobalFlags ( GlobalFlags (
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
LPVOID LPVOID
WINAPI WINAPI
GlobalLock ( GlobalLock (
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalHandle ( GlobalHandle (
__in LPCVOID pMem _In_ LPCVOID pMem
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GlobalUnlock( GlobalUnlock(
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
_Success_(return==0)
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalFree( GlobalFree(
__deref HGLOBAL hMem _Frees_ptr_opt_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
GlobalCompact( GlobalCompact(
__in DWORD dwMinFree _In_ DWORD dwMinFree
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
GlobalFix( GlobalFix(
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
GlobalUnfix( GlobalUnfix(
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
__out
LPVOID LPVOID
WINAPI WINAPI
GlobalWire( GlobalWire(
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GlobalUnWire( GlobalUnWire(
__in HGLOBAL hMem _In_ HGLOBAL hMem
); );
__drv_preferredFunction("GlobalMemoryStatusEx","Deprecated. See MSDN for details ")
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
GlobalMemoryStatus( GlobalMemoryStatus(
__out LPMEMORYSTATUS lpBuffer _Out_ LPMEMORYSTATUS lpBuffer
);
typedef struct _MEMORYSTATUSEX {
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
WINBASEAPI
BOOL
WINAPI
GlobalMemoryStatusEx(
__out LPMEMORYSTATUSEX lpBuffer
); );
WINBASEAPI WINBASEAPI
__out_bcount_opt( (uFlags&LMEM_FIXED) ? uBytes : 0 ) _Success_(return != NULL)
_Post_writable_byte_size_(uBytes)
HLOCAL HLOCAL
WINAPI WINAPI
LocalAlloc( LocalAlloc(
__in UINT uFlags, _In_ UINT uFlags,
__in SIZE_T uBytes _In_ SIZE_T uBytes
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_reallocated_bytes_(hMem, uBytes)
HLOCAL HLOCAL
WINAPI WINAPI
LocalReAlloc( LocalReAlloc(
__in HLOCAL hMem, _Frees_ptr_opt_ HLOCAL hMem,
__in SIZE_T uBytes, _In_ SIZE_T uBytes,
__in UINT uFlags _In_ UINT uFlags
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
LPVOID LPVOID
WINAPI WINAPI
LocalLock( LocalLock(
__in HLOCAL hMem _In_ HLOCAL hMem
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HLOCAL HLOCAL
WINAPI WINAPI
LocalHandle( LocalHandle(
__in LPCVOID pMem _In_ LPCVOID pMem
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
LocalUnlock( LocalUnlock(
__in HLOCAL hMem _In_ HLOCAL hMem
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
LocalSize( LocalSize(
__in HLOCAL hMem _In_ HLOCAL hMem
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
LocalFlags( LocalFlags(
__in HLOCAL hMem _In_ HLOCAL hMem
); );
WINBASEAPI WINBASEAPI
_Success_(return==0)
_Ret_maybenull_
HLOCAL HLOCAL
WINAPI WINAPI
LocalFree( LocalFree(
__deref HLOCAL hMem _Frees_ptr_opt_ HLOCAL hMem
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
LocalShrink( LocalShrink(
__in HLOCAL hMem, _In_ HLOCAL hMem,
__in UINT cbNewSize _In_ UINT cbNewSize
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
LocalCompact( LocalCompact(
__in UINT uMinFree _In_ UINT uMinFree
);
WINBASEAPI
BOOL
WINAPI
FlushInstructionCache(
__in HANDLE hProcess,
__in_bcount_opt(dwSize) LPCVOID lpBaseAddress,
__in SIZE_T dwSize
);
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
VOID
WINAPI
FlushProcessWriteBuffers(
VOID
);
WINBASEAPI
BOOL
WINAPI
QueryThreadCycleTime (
__in HANDLE ThreadHandle,
__out PULONG64 CycleTime
);
WINBASEAPI
BOOL
WINAPI
QueryProcessCycleTime (
__in HANDLE ProcessHandle,
__out PULONG64 CycleTime
);
WINBASEAPI
BOOL
WINAPI
QueryIdleProcessorCycleTime (
__inout PULONG BufferLength,
__out_bcount_opt(*BufferLength) PULONG64 ProcessorIdleCycleTime
); );
#endif
#if (_WIN32_WINNT >= 0x0601) #if (_WIN32_WINNT >= 0x0601)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryIdleProcessorCycleTimeEx (
__in USHORT Group,
__inout PULONG BufferLength,
__out_bcount_opt(*BufferLength) PULONG64 ProcessorIdleCycleTime
);
WINBASEAPI
BOOL
WINAPI
QueryUnbiasedInterruptTime (
__out PULONGLONG UnbiasedTime
);
WINBASEAPI
BOOL
WINAPI
GetProcessorSystemCycleTime ( GetProcessorSystemCycleTime (
__in USHORT Group, _In_ USHORT Group,
__out_bcount_part_opt(*ReturnedLength, *ReturnedLength) PSYSTEM_PROCESSOR_CY _Out_writes_bytes_to_opt_(*ReturnedLength, *ReturnedLength) PSYSTEM_PROCESSO
CLE_TIME_INFORMATION Buffer, R_CYCLE_TIME_INFORMATION Buffer,
__inout PDWORD ReturnedLength _Inout_ PDWORD ReturnedLength
); );
#endif // (_WIN32_WINNT >= 0x0601) #endif // (_WIN32_WINNT >= 0x0601)
WINBASEAPI
__bcount_opt(dwSize)
LPVOID
WINAPI
VirtualAlloc(
__in_opt LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD flAllocationType,
__in DWORD flProtect
);
__drv_when(((dwFreeType&(MEM_RELEASE|MEM_DECOMMIT)))==(MEM_RELEASE|MEM_DECOMMIT)
,
__drv_reportError("Passing both MEM_RELEASE and MEM_DECOMMIT to VirtualFree
is not allowed. This results in the failure of this call"))
__drv_when(dwFreeType==0,
__drv_reportError("Passing zero as the dwFreeType parameter to VirtualFree i
s not allowed. This results in the failure of this call"))
__drv_when(((dwFreeType&MEM_RELEASE))!=0 && dwSize!=0,
__drv_reportError("Passing MEM_RELEASE and a non-zero dwSize parameter to Vi
rtualFree is not allowed. This results in the failure of this call"))
WINBASEAPI
BOOL
WINAPI
VirtualFree(
__in LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD dwFreeType
);
WINBASEAPI
BOOL
WINAPI
VirtualProtect(
__in LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD flNewProtect,
__out PDWORD lpflOldProtect
);
WINBASEAPI
SIZE_T
WINAPI
VirtualQuery(
__in_opt LPCVOID lpAddress,
__out_bcount_part(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength
);
WINBASEAPI
__bcount_opt(dwSize)
LPVOID
WINAPI
VirtualAllocEx(
__in HANDLE hProcess,
__in_opt LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD flAllocationType,
__in DWORD flProtect
);
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
__bcount(dwSize)
LPVOID
WINAPI
VirtualAllocExNuma(
__in HANDLE hProcess,
__in_opt LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD flAllocationType,
__in DWORD flProtect,
__in DWORD nndPreferred
);
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
UINT
WINAPI
GetWriteWatch(
__in DWORD dwFlags,
__in PVOID lpBaseAddress,
__in SIZE_T dwRegionSize,
__out_ecount_part(*lpdwCount, *lpdwCount) PVOID *lpAddresses,
__inout ULONG_PTR *lpdwCount,
__out PULONG lpdwGranularity
);
WINBASEAPI
UINT
WINAPI
ResetWriteWatch(
__in LPVOID lpBaseAddress,
__in SIZE_T dwRegionSize
);
WINBASEAPI
SIZE_T
WINAPI
GetLargePageMinimum(
VOID
);
WINBASEAPI
UINT
WINAPI
EnumSystemFirmwareTables(
__in DWORD FirmwareTableProviderSignature,
__out_bcount_part_opt(BufferSize, return) PVOID pFirmwareTableEnumBuffer,
__in DWORD BufferSize
);
WINBASEAPI
UINT
WINAPI
GetSystemFirmwareTable(
__in DWORD FirmwareTableProviderSignature,
__in DWORD FirmwareTableID,
__out_bcount_part_opt(BufferSize, return) PVOID pFirmwareTableBuffer,
__in DWORD BufferSize
);
WINBASEAPI
BOOL
WINAPI
GetPhysicallyInstalledSystemMemory(
__out PULONGLONG TotalMemoryInKilobytes
);
__drv_when(((dwFreeType&(MEM_RELEASE|MEM_DECOMMIT)))==(MEM_RELEASE|MEM_DECOMMIT)
,
__drv_reportError("Passing both MEM_RELEASE and MEM_DECOMMIT to VirtualFree
is not allowed. This results in the failure of this call"))
__drv_when(dwFreeType==0,
__drv_reportError("Passing zero as the dwFreeType parameter to VirtualFree i
s not allowed. This results in the failure of this call"))
__drv_when(((dwFreeType&MEM_RELEASE))!=0 && dwSize!=0,
__drv_reportError("Passing MEM_RELEASE and a non-zero dwSize parameter to Vi
rtualFree is not allowed. This results in the failure of this call"))
__drv_when(((dwFreeType&MEM_DECOMMIT))!=0,
__drv_reportError("Calling VirtualFreeEx without the MEM_RELEASE flag frees
memory but not address descriptors (VADs); results in address space leaks"))
WINBASEAPI
BOOL
WINAPI
VirtualFreeEx(
__in HANDLE hProcess,
__in LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD dwFreeType
);
WINBASEAPI
BOOL
WINAPI
VirtualProtectEx(
__in HANDLE hProcess,
__in LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD flNewProtect,
__out PDWORD lpflOldProtect
);
WINBASEAPI
SIZE_T
WINAPI
VirtualQueryEx(
__in HANDLE hProcess,
__in_opt LPCVOID lpAddress,
__out_bcount_part(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
HeapCreate(
__in DWORD flOptions,
__in SIZE_T dwInitialSize,
__in SIZE_T dwMaximumSize
);
WINBASEAPI
BOOL
WINAPI
HeapDestroy(
__in HANDLE hHeap
);
WINBASEAPI
__bcount(dwBytes)
LPVOID
WINAPI
HeapAlloc(
__in HANDLE hHeap,
__in DWORD dwFlags,
__in SIZE_T dwBytes
);
WINBASEAPI
__bcount(dwBytes)
LPVOID
WINAPI
HeapReAlloc(
__inout HANDLE hHeap,
__in DWORD dwFlags,
__deref LPVOID lpMem,
__in SIZE_T dwBytes
);
WINBASEAPI
BOOL
WINAPI
HeapFree(
__inout HANDLE hHeap,
__in DWORD dwFlags,
__drv_freesMem(Mem) __post __notvalid __deref LPVOID lpMem
);
WINBASEAPI
SIZE_T
WINAPI
HeapSize(
__in HANDLE hHeap,
__in DWORD dwFlags,
__in LPCVOID lpMem
);
WINBASEAPI
BOOL
WINAPI
HeapValidate(
__in HANDLE hHeap,
__in DWORD dwFlags,
__in_opt LPCVOID lpMem
);
WINBASEAPI
SIZE_T
WINAPI
HeapCompact(
__in HANDLE hHeap,
__in DWORD dwFlags
);
WINBASEAPI
__out
HANDLE
WINAPI
GetProcessHeap( VOID );
WINBASEAPI
DWORD
WINAPI
GetProcessHeaps(
__in DWORD NumberOfHeaps,
__out_ecount_part(NumberOfHeaps, return) PHANDLE ProcessHeaps
);
typedef struct _PROCESS_HEAP_ENTRY {
PVOID lpData;
DWORD cbData;
BYTE cbOverhead;
BYTE iRegionIndex;
WORD wFlags;
union {
struct {
HANDLE hMem;
DWORD dwReserved[ 3 ];
} Block;
struct {
DWORD dwCommittedSize;
DWORD dwUnCommittedSize;
LPVOID lpFirstBlock;
LPVOID lpLastBlock;
} Region;
} DUMMYUNIONNAME;
} PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY, *PPROCESS_HEAP_ENTRY;
#define PROCESS_HEAP_REGION 0x0001
#define PROCESS_HEAP_UNCOMMITTED_RANGE 0x0002
#define PROCESS_HEAP_ENTRY_BUSY 0x0004
#define PROCESS_HEAP_ENTRY_MOVEABLE 0x0010
#define PROCESS_HEAP_ENTRY_DDESHARE 0x0020
WINBASEAPI
BOOL
WINAPI
HeapLock(
__in HANDLE hHeap
);
WINBASEAPI
BOOL
WINAPI
HeapUnlock(
__in HANDLE hHeap
);
WINBASEAPI
BOOL
WINAPI
HeapWalk(
__in HANDLE hHeap,
__inout LPPROCESS_HEAP_ENTRY lpEntry
);
WINBASEAPI
BOOL
WINAPI
HeapSetInformation (
__in_opt HANDLE HeapHandle,
__in HEAP_INFORMATION_CLASS HeapInformationClass,
__in_bcount_opt(HeapInformationLength) PVOID HeapInformation,
__in SIZE_T HeapInformationLength
);
WINBASEAPI
BOOL
WINAPI
HeapQueryInformation (
__in_opt HANDLE HeapHandle,
__in HEAP_INFORMATION_CLASS HeapInformationClass,
__out_bcount_part_opt(HeapInformationLength, *ReturnLength) PVOID HeapInform
ation,
__in SIZE_T HeapInformationLength,
__out_opt PSIZE_T ReturnLength
);
// GetBinaryType return values. // GetBinaryType return values.
#define SCS_32BIT_BINARY 0 #define SCS_32BIT_BINARY 0
#define SCS_DOS_BINARY 1 #define SCS_DOS_BINARY 1
#define SCS_WOW_BINARY 2 #define SCS_WOW_BINARY 2
#define SCS_PIF_BINARY 3 #define SCS_PIF_BINARY 3
#define SCS_POSIX_BINARY 4 #define SCS_POSIX_BINARY 4
#define SCS_OS216_BINARY 5 #define SCS_OS216_BINARY 5
#define SCS_64BIT_BINARY 6 #define SCS_64BIT_BINARY 6
#if defined(_WIN64) #if defined(_WIN64)
# define SCS_THIS_PLATFORM_BINARY SCS_64BIT_BINARY # define SCS_THIS_PLATFORM_BINARY SCS_64BIT_BINARY
#else #else
# define SCS_THIS_PLATFORM_BINARY SCS_32BIT_BINARY # define SCS_THIS_PLATFORM_BINARY SCS_32BIT_BINARY
#endif #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetBinaryTypeA( GetBinaryTypeA(
__in LPCSTR lpApplicationName, _In_ LPCSTR lpApplicationName,
__out LPDWORD lpBinaryType _Out_ LPDWORD lpBinaryType
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetBinaryTypeW( GetBinaryTypeW(
__in LPCWSTR lpApplicationName, _In_ LPCWSTR lpApplicationName,
__out LPDWORD lpBinaryType _Out_ LPDWORD lpBinaryType
); );
#ifdef UNICODE #ifdef UNICODE
#define GetBinaryType GetBinaryTypeW #define GetBinaryType GetBinaryTypeW
#else #else
#define GetBinaryType GetBinaryTypeA #define GetBinaryType GetBinaryTypeA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < cchBuffer)
DWORD DWORD
WINAPI WINAPI
GetShortPathNameA( GetShortPathNameA(
__in LPCSTR lpszLongPath, _In_ LPCSTR lpszLongPath,
__out_ecount_part_opt(cchBuffer, return + 1) LPSTR lpszShortPath, _Out_writes_to_opt_(cchBuffer, return + 1) LPSTR lpszShortPath,
__in DWORD cchBuffer _In_ DWORD cchBuffer
);
WINBASEAPI
DWORD
WINAPI
GetShortPathNameW(
__in LPCWSTR lpszLongPath,
__out_ecount_part_opt(cchBuffer, return + 1) LPWSTR lpszShortPath,
__in DWORD cchBuffer
); );
#ifdef UNICODE #ifndef UNICODE
#define GetShortPathName GetShortPathNameW
#else
#define GetShortPathName GetShortPathNameA #define GetShortPathName GetShortPathNameA
#endif // !UNICODE #endif
WINBASEAPI
DWORD
WINAPI
GetLongPathNameA(
__in LPCSTR lpszShortPath,
__out_ecount_part_opt(cchBuffer, return + 1) LPSTR lpszLongPath,
__in DWORD cchBuffer
);
WINBASEAPI
DWORD
WINAPI
GetLongPathNameW(
__in LPCWSTR lpszShortPath,
__out_ecount_part_opt(cchBuffer, return + 1) LPWSTR lpszLongPath,
__in DWORD cchBuffer
);
#ifdef UNICODE
#define GetLongPathName GetLongPathNameW
#else
#define GetLongPathName GetLongPathNameA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < cchBuffer)
DWORD DWORD
WINAPI WINAPI
GetLongPathNameTransactedA( GetLongPathNameTransactedA(
__in LPCSTR lpszShortPath, _In_ LPCSTR lpszShortPath,
__out_ecount_part_opt(cchBuffer, return + 1) LPSTR lpszLongPath, _Out_writes_to_opt_(cchBuffer, return + 1) LPSTR lpszLongPath,
__in DWORD cchBuffer, _In_ DWORD cchBuffer,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < cchBuffer)
DWORD DWORD
WINAPI WINAPI
GetLongPathNameTransactedW( GetLongPathNameTransactedW(
__in LPCWSTR lpszShortPath, _In_ LPCWSTR lpszShortPath,
__out_ecount_part_opt(cchBuffer, return + 1) LPWSTR lpszLongPath, _Out_writes_to_opt_(cchBuffer, return + 1) LPWSTR lpszLongPath,
__in DWORD cchBuffer, _In_ DWORD cchBuffer,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define GetLongPathNameTransacted GetLongPathNameTransactedW #define GetLongPathNameTransacted GetLongPathNameTransactedW
#else #else
#define GetLongPathNameTransacted GetLongPathNameTransactedA #define GetLongPathNameTransacted GetLongPathNameTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetProcessAffinityMask( GetProcessAffinityMask(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out PDWORD_PTR lpProcessAffinityMask, _Out_ PDWORD_PTR lpProcessAffinityMask,
__out PDWORD_PTR lpSystemAffinityMask _Out_ PDWORD_PTR lpSystemAffinityMask
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetProcessAffinityMask( SetProcessAffinityMask(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__in DWORD_PTR dwProcessAffinityMask _In_ DWORD_PTR dwProcessAffinityMask
);
#if _WIN32_WINNT >= 0x0601
BOOL
WINAPI
GetProcessGroupAffinity(
__in HANDLE hProcess,
__inout PUSHORT GroupCount,
__out_ecount(*GroupCount) PUSHORT GroupArray
);
#endif // _WIN32_WINNT >= 0x0601
#if _WIN32_WINNT >= 0x0501
WINBASEAPI
BOOL
WINAPI
GetProcessHandleCount(
__in HANDLE hProcess,
__out PDWORD pdwHandleCount
);
#endif // (_WIN32_WINNT >= 0x0501)
WINBASEAPI
BOOL
WINAPI
GetProcessTimes(
__in HANDLE hProcess,
__out LPFILETIME lpCreationTime,
__out LPFILETIME lpExitTime,
__out LPFILETIME lpKernelTime,
__out LPFILETIME lpUserTime
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetProcessIoCounters( GetProcessIoCounters(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out PIO_COUNTERS lpIoCounters _Out_ PIO_COUNTERS lpIoCounters
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetProcessWorkingSetSize( GetProcessWorkingSetSize(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out PSIZE_T lpMinimumWorkingSetSize, _Out_ PSIZE_T lpMinimumWorkingSetSize,
__out PSIZE_T lpMaximumWorkingSetSize _Out_ PSIZE_T lpMaximumWorkingSetSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetProcessWorkingSetSizeEx( SetProcessWorkingSetSize(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out PSIZE_T lpMinimumWorkingSetSize, _In_ SIZE_T dwMinimumWorkingSetSize,
__out PSIZE_T lpMaximumWorkingSetSize, _In_ SIZE_T dwMaximumWorkingSetSize
__out PDWORD Flags
); );
WINBASEAPI WINBASEAPI
BOOL __analysis_noreturn
VOID
WINAPI WINAPI
SetProcessWorkingSetSize( FatalExit(
__in HANDLE hProcess, _In_ int ExitCode
__in SIZE_T dwMinimumWorkingSetSize,
__in SIZE_T dwMaximumWorkingSetSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetProcessWorkingSetSizeEx( SetEnvironmentStringsA(
__in HANDLE hProcess, _In_ _Pre_ _NullNull_terminated_ LPCH NewEnvironment
__in SIZE_T dwMinimumWorkingSetSize,
__in SIZE_T dwMaximumWorkingSetSize,
__in DWORD Flags
); );
#ifndef UNICODE
#define SetEnvironmentStrings SetEnvironmentStringsA
#endif
#if (_WIN32_WINNT >= 0x0600) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#define PROCESS_AFFINITY_ENABLE_AUTO_UPDATE 0x00000001UL #pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINBASEAPI WINBASEAPI
BOOL VOID
WINAPI WINAPI
SetProcessAffinityUpdateMode( RaiseFailFastException(
__in HANDLE hProcess, _In_opt_ PEXCEPTION_RECORD pExceptionRecord,
__in DWORD dwFlags _In_opt_ PCONTEXT pContextRecord,
_In_ DWORD dwFlags
); );
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
BOOL #pragma endregion
WINAPI
QueryProcessAffinityUpdateMode(
__in HANDLE hProcess,
__out_opt LPDWORD lpdwFlags
);
#endif // _WIN32_WINNT >= 0x0600 #if(_WIN32_WINNT >= 0x0400)
WINBASEAPI //
HANDLE // Fiber begin
WINAPI //
OpenProcess(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
);
WINBASEAPI #pragma region Application Family
__out #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
HANDLE
WINAPI
GetCurrentProcess(
VOID
);
WINBASEAPI #define FIBER_FLAG_FLOAT_SWITCH 0x1 // context switch floating point
DWORD
WINAPI
GetCurrentProcessId(
VOID
);
WINBASEAPI WINBASEAPI
DECLSPEC_NORETURN
VOID VOID
WINAPI WINAPI
ExitProcess( SwitchToFiber(
__in UINT uExitCode _In_ LPVOID lpFiber
);
WINBASEAPI
BOOL
WINAPI
TerminateProcess(
__in HANDLE hProcess,
__in UINT uExitCode
);
WINBASEAPI
BOOL
WINAPI
GetExitCodeProcess(
__in HANDLE hProcess,
__out LPDWORD lpExitCode
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
FatalExit( DeleteFiber(
__in int ExitCode _In_ LPVOID lpFiber
); );
WINBASEAPI #if (_WIN32_WINNT >= 0x0501)
__out
__nullnullterminated
LPCH
WINAPI
GetEnvironmentStrings(
VOID
);
WINBASEAPI WINBASEAPI
__out BOOL
__nullnullterminated
LPWCH
WINAPI WINAPI
GetEnvironmentStringsW( ConvertFiberToThread(
VOID VOID
); );
#ifdef UNICODE #endif
#define GetEnvironmentStrings GetEnvironmentStringsW
#else
#define GetEnvironmentStringsA GetEnvironmentStrings
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
SetEnvironmentStringsA(
__in __nullnullterminated LPCH NewEnvironment
);
WINBASEAPI
BOOL
WINAPI
SetEnvironmentStringsW(
__in __nullnullterminated LPWCH NewEnvironment
);
#ifdef UNICODE
#define SetEnvironmentStrings SetEnvironmentStringsW
#else
#define SetEnvironmentStrings SetEnvironmentStringsA
#endif // !UNICODE
WINBASEAPI #if (_WIN32_WINNT >= 0x0603)
BOOL
WINAPI
FreeEnvironmentStringsA(
__in __nullnullterminated LPCH
);
WINBASEAPI
BOOL
WINAPI
FreeEnvironmentStringsW(
__in __nullnullterminated LPWCH
);
#ifdef UNICODE
#define FreeEnvironmentStrings FreeEnvironmentStringsW
#else
#define FreeEnvironmentStrings FreeEnvironmentStringsA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
VOID _Ret_maybenull_
PVOID
WINAPI WINAPI
RaiseException( CalloutOnFiberStack(
__in DWORD dwExceptionCode, _In_ PVOID lpFiber,
__in DWORD dwExceptionFlags, _In_ PFIBER_CALLOUT_ROUTINE lpStartAddress,
__in DWORD nNumberOfArguments, _In_opt_ PVOID lpParameter
__in_ecount_opt(nNumberOfArguments) CONST ULONG_PTR *lpArguments
); );
WINBASEAPI #endif
VOID
WINAPI
RaiseFailFastException(
__in_opt PEXCEPTION_RECORD pExceptionRecord,
__in PCONTEXT pContextRecord,
__in DWORD dwFlags
);
__callback
WINBASEAPI WINBASEAPI
LONG _Ret_maybenull_
LPVOID
WINAPI WINAPI
UnhandledExceptionFilter( CreateFiberEx(
__in struct _EXCEPTION_POINTERS *ExceptionInfo _In_ SIZE_T dwStackCommitSize,
); _In_ SIZE_T dwStackReserveSize,
_In_ DWORD dwFlags,
typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)( _In_ LPFIBER_START_ROUTINE lpStartAddress,
__in struct _EXCEPTION_POINTERS *ExceptionInfo _In_opt_ LPVOID lpParameter
); );
typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
WINBASEAPI WINBASEAPI
LPTOP_LEVEL_EXCEPTION_FILTER _Ret_maybenull_
LPVOID
WINAPI WINAPI
SetUnhandledExceptionFilter( ConvertThreadToFiberEx(
__in_opt LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter _In_opt_ LPVOID lpParameter,
_In_ DWORD dwFlags
); );
#if(_WIN32_WINNT >= 0x0400) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
//
// Fiber creation flags
//
#define FIBER_FLAG_FLOAT_SWITCH 0x1 // context switch floating point #pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
LPVOID LPVOID
WINAPI WINAPI
CreateFiber( CreateFiber(
__in SIZE_T dwStackSize, _In_ SIZE_T dwStackSize,
__in LPFIBER_START_ROUTINE lpStartAddress, _In_ LPFIBER_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter _In_opt_ LPVOID lpParameter
);
WINBASEAPI
__out_opt
LPVOID
WINAPI
CreateFiberEx(
__in SIZE_T dwStackCommitSize,
__in SIZE_T dwStackReserveSize,
__in DWORD dwFlags,
__in LPFIBER_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter
);
WINBASEAPI
VOID
WINAPI
DeleteFiber(
__in LPVOID lpFiber
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
LPVOID LPVOID
WINAPI WINAPI
ConvertThreadToFiber( ConvertThreadToFiber(
__in_opt LPVOID lpParameter _In_opt_ LPVOID lpParameter
);
WINBASEAPI
__out_opt
LPVOID
WINAPI
ConvertThreadToFiberEx(
__in_opt LPVOID lpParameter,
__in DWORD dwFlags
);
#if (_WIN32_WINNT >= 0x0501)
WINBASEAPI
BOOL
WINAPI
ConvertFiberToThread(
VOID
);
#endif
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
IsThreadAFiber(
VOID
); );
#endif #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
WINBASEAPI
VOID
WINAPI
SwitchToFiber(
__in LPVOID lpFiber
);
WINBASEAPI //
BOOL // Fiber end
WINAPI //
SwitchToThread(
VOID
);
// //
// UMS begin // UMS begin
// //
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (_WIN32_WINNT >= 0x0601) && !defined(MIDL_PASS) #if (_WIN32_WINNT >= 0x0601) && !defined(MIDL_PASS)
#define UMS_VERSION RTL_UMS_VERSION #define UMS_VERSION RTL_UMS_VERSION
typedef void *PUMS_CONTEXT; typedef void *PUMS_CONTEXT;
typedef void *PUMS_COMPLETION_LIST; typedef void *PUMS_COMPLETION_LIST;
typedef enum _RTL_UMS_THREAD_INFO_CLASS UMS_THREAD_INFO_CLASS, *PUMS_THREAD_INFO _CLASS; typedef enum _RTL_UMS_THREAD_INFO_CLASS UMS_THREAD_INFO_CLASS, *PUMS_THREAD_INFO _CLASS;
skipping to change at line 3750 skipping to change at line 1422
// //
PUMS_SCHEDULER_ENTRY_POINT SchedulerProc; PUMS_SCHEDULER_ENTRY_POINT SchedulerProc;
// //
// pointer to a variable to be passed to the scheduler uppon first activatio n. // pointer to a variable to be passed to the scheduler uppon first activatio n.
// //
PVOID SchedulerParam; PVOID SchedulerParam;
} UMS_SCHEDULER_STARTUP_INFO, *PUMS_SCHEDULER_STARTUP_INFO; } UMS_SCHEDULER_STARTUP_INFO, *PUMS_SCHEDULER_STARTUP_INFO;
__checkReturn typedef struct _UMS_SYSTEM_THREAD_INFORMATION {
ULONG UmsVersion;
union {
struct {
ULONG IsUmsSchedulerThread : 1;
ULONG IsUmsWorkerThread : 1;
} DUMMYSTRUCTNAME;
ULONG ThreadUmsFlags;
} DUMMYUNIONNAME;
} UMS_SYSTEM_THREAD_INFORMATION, *PUMS_SYSTEM_THREAD_INFORMATION;
_Must_inspect_result_
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateUmsCompletionList( CreateUmsCompletionList(
__deref_out PUMS_COMPLETION_LIST* UmsCompletionList _Outptr_ PUMS_COMPLETION_LIST* UmsCompletionList
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DequeueUmsCompletionListItems( DequeueUmsCompletionListItems(
__in PUMS_COMPLETION_LIST UmsCompletionList, _In_ PUMS_COMPLETION_LIST UmsCompletionList,
__in DWORD WaitTimeOut, _In_ DWORD WaitTimeOut,
__out PUMS_CONTEXT* UmsThreadList _Out_ PUMS_CONTEXT* UmsThreadList
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetUmsCompletionListEvent( GetUmsCompletionListEvent(
__in PUMS_COMPLETION_LIST UmsCompletionList, _In_ PUMS_COMPLETION_LIST UmsCompletionList,
__inout PHANDLE UmsCompletionEvent _Inout_ PHANDLE UmsCompletionEvent
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ExecuteUmsThread( ExecuteUmsThread(
__inout PUMS_CONTEXT UmsThread _Inout_ PUMS_CONTEXT UmsThread
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
UmsThreadYield( UmsThreadYield(
__in PVOID SchedulerParam _In_ PVOID SchedulerParam
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteUmsCompletionList( DeleteUmsCompletionList(
__in PUMS_COMPLETION_LIST UmsCompletionList _In_ PUMS_COMPLETION_LIST UmsCompletionList
); );
WINBASEAPI WINBASEAPI
PUMS_CONTEXT PUMS_CONTEXT
WINAPI WINAPI
GetCurrentUmsThread( GetCurrentUmsThread(
VOID VOID
); );
WINBASEAPI WINBASEAPI
PUMS_CONTEXT PUMS_CONTEXT
WINAPI WINAPI
GetNextUmsListItem( GetNextUmsListItem(
__inout PUMS_CONTEXT UmsContext _Inout_ PUMS_CONTEXT UmsContext
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryUmsThreadInformation( QueryUmsThreadInformation(
__in PUMS_CONTEXT UmsThread, _In_ PUMS_CONTEXT UmsThread,
__in UMS_THREAD_INFO_CLASS UmsThreadInfoClass, _In_ UMS_THREAD_INFO_CLASS UmsThreadInfoClass,
__out_bcount_part(UmsThreadInformationLength, *ReturnLength) PVOID UmsThread _Out_writes_bytes_to_(UmsThreadInformationLength, *ReturnLength) PVOID UmsTh
Information, readInformation,
__in ULONG UmsThreadInformationLength, _In_ ULONG UmsThreadInformationLength,
__out_opt PULONG ReturnLength _Out_opt_ PULONG ReturnLength
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetUmsThreadInformation( SetUmsThreadInformation(
__in PUMS_CONTEXT UmsThread, _In_ PUMS_CONTEXT UmsThread,
__in UMS_THREAD_INFO_CLASS UmsThreadInfoClass, _In_ UMS_THREAD_INFO_CLASS UmsThreadInfoClass,
__in PVOID UmsThreadInformation, _In_ PVOID UmsThreadInformation,
__in ULONG UmsThreadInformationLength _In_ ULONG UmsThreadInformationLength
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteUmsThreadContext( DeleteUmsThreadContext(
__in PUMS_CONTEXT UmsThread _In_ PUMS_CONTEXT UmsThread
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateUmsThreadContext( CreateUmsThreadContext(
__deref_out PUMS_CONTEXT *lpUmsThread _Outptr_ PUMS_CONTEXT *lpUmsThread
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnterUmsSchedulingMode( EnterUmsSchedulingMode(
__in PUMS_SCHEDULER_STARTUP_INFO SchedulerStartupInfo _In_ PUMS_SCHEDULER_STARTUP_INFO SchedulerStartupInfo
);
#endif // (_WIN32_WINNT >= 0x0601) && !defined(MIDL_PASS)
//
// UMS end
//
#endif /* _WIN32_WINNT >= 0x0400 */
typedef struct _PROC_THREAD_ATTRIBUTE_LIST *PPROC_THREAD_ATTRIBUTE_LIST, *LPPROC
_THREAD_ATTRIBUTE_LIST;
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateThread(
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress,
__in_opt __deref __drv_aliasesMem LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateRemoteThread(
__in HANDLE hProcess,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateRemoteThreadEx(
__in HANDLE hProcess,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags,
__in_opt LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
__out_opt LPDWORD lpThreadId
);
WINBASEAPI
__out
HANDLE
WINAPI
GetCurrentThread(
VOID
);
WINBASEAPI
DWORD
WINAPI
GetCurrentThreadId(
VOID
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetThreadStackGuarantee ( GetUmsSystemThreadInformation(
__inout PULONG StackSizeInBytes _In_ HANDLE ThreadHandle,
_Inout_ PUMS_SYSTEM_THREAD_INFORMATION SystemThreadInfo
); );
WINBASEAPI #endif // (_WIN32_WINNT >= 0x0601) && !defined(MIDL_PASS)
DWORD
WINAPI
GetProcessIdOfThread(
__in HANDLE Thread
);
#if (_WIN32_WINNT >= 0x0502) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
WINBASEAPI //
DWORD // UMS end
WINAPI //
GetThreadId(
__in HANDLE Thread
);
#endif // _WIN32_WINNT >= 0x0502 #endif /* _WIN32_WINNT >= 0x0400 */
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINBASEAPI WINBASEAPI
DWORD DWORD_PTR
WINAPI WINAPI
GetProcessId( SetThreadAffinityMask(
__in HANDLE Process _In_ HANDLE hThread,
_In_ DWORD_PTR dwThreadAffinityMask
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#if(_WIN32_WINNT >= 0x0400)
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetCurrentProcessorNumber( SetThreadIdealProcessor(
VOID _In_ HANDLE hThread,
_In_ DWORD dwIdealProcessor
); );
#endif /* _WIN32_WINNT >= 0x0400 */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#if (_WIN32_WINNT >= 0x0601) #pragma region Desktop Family
WINBASEAPI #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
VOID
WINAPI
GetCurrentProcessorNumberEx(
__out PPROCESSOR_NUMBER ProcNumber
);
#endif
#if (_WIN32_WINNT >= 0x0601) //
WINBASEAPI // Process information classes.
BOOL //
WINAPI
GetThreadGroupAffinity(
__in HANDLE hThread,
__out PGROUP_AFFINITY GroupAffinity
);
#endif // _WIN32_WINNT >= 0x0601
WINBASEAPI typedef enum _PROCESS_INFORMATION_CLASS {
DWORD_PTR ProcessMemoryPriority,
WINAPI ProcessInformationClassMax
SetThreadAffinityMask( } PROCESS_INFORMATION_CLASS;
__in HANDLE hThread,
__in DWORD_PTR dwThreadAffinityMask
);
#if (_WIN32_WINNT >= 0x0601) #if (_WIN32_WINNT >= 0x0602)
WINBASEAPI
BOOL
WINAPI
SetThreadGroupAffinity(
__in HANDLE hThread,
__in CONST GROUP_AFFINITY *GroupAffinity,
__out_opt PGROUP_AFFINITY PreviousGroupAffinity
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetThreadIdealProcessorEx ( GetProcessInformation (
__in HANDLE hThread, _In_ HANDLE hProcess,
__in PPROCESSOR_NUMBER lpIdealProcessor, _In_ PROCESS_INFORMATION_CLASS ProcessInformationClass,
__out_opt PPROCESSOR_NUMBER lpPreviousIdealProcessor _Out_writes_bytes_(ProcessInformationSize) LPVOID ProcessInformation,
_In_ DWORD ProcessInformationSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetThreadIdealProcessorEx ( SetProcessInformation (
__in HANDLE hThread, _In_ HANDLE hProcess,
__out PPROCESSOR_NUMBER lpIdealProcessor _In_ PROCESS_INFORMATION_CLASS ProcessInformationClass,
_In_reads_bytes_(ProcessInformationSize) LPVOID ProcessInformation,
_In_ DWORD ProcessInformationSize
); );
#endif // _WIN32_WINNT >= 0x0601 #endif // _WIN32_WINNT >= 0x0602
#if(_WIN32_WINNT >= 0x0400)
WINBASEAPI
DWORD
WINAPI
SetThreadIdealProcessor(
__in HANDLE hThread,
__in DWORD dwIdealProcessor
);
#endif /* _WIN32_WINNT >= 0x0400 */
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define PROCESS_DEP_ENABLE 0x00000001 #define PROCESS_DEP_ENABLE 0x00000001
#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002 #define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetProcessDEPPolicy( SetProcessDEPPolicy(
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetProcessDEPPolicy( GetProcessDEPPolicy(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out LPDWORD lpFlags, _Out_ LPDWORD lpFlags,
__out PBOOL lpPermanent _Out_ PBOOL lpPermanent
); );
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetProcessPriorityBoost(
__in HANDLE hProcess,
__in BOOL bDisablePriorityBoost
);
WINBASEAPI
BOOL
WINAPI
GetProcessPriorityBoost(
__in HANDLE hProcess,
__out PBOOL pDisablePriorityBoost
);
WINBASEAPI
BOOL
WINAPI
RequestWakeupLatency( RequestWakeupLatency(
__in LATENCY_TIME latency _In_ LATENCY_TIME latency
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsSystemResumeAutomatic( IsSystemResumeAutomatic(
VOID VOID
); );
WINBASEAPI WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenThread(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwThreadId
);
WINBASEAPI
BOOL
WINAPI
SetThreadPriority(
__in HANDLE hThread,
__in int nPriority
);
WINBASEAPI
BOOL
WINAPI
SetThreadPriorityBoost(
__in HANDLE hThread,
__in BOOL bDisablePriorityBoost
);
WINBASEAPI
BOOL
WINAPI
GetThreadPriorityBoost(
__in HANDLE hThread,
__out PBOOL pDisablePriorityBoost
);
WINBASEAPI
int
WINAPI
GetThreadPriority(
__in HANDLE hThread
);
WINBASEAPI
BOOL
WINAPI
GetThreadTimes(
__in HANDLE hThread,
__out LPFILETIME lpCreationTime,
__out LPFILETIME lpExitTime,
__out LPFILETIME lpKernelTime,
__out LPFILETIME lpUserTime
);
#if _WIN32_WINNT >= 0x0501
WINBASEAPI
BOOL
WINAPI
GetThreadIOPendingFlag(
__in HANDLE hThread,
__out PBOOL lpIOIsPending
);
#endif // (_WIN32_WINNT >= 0x0501)
WINBASEAPI
DECLSPEC_NORETURN
VOID
WINAPI
ExitThread(
__in DWORD dwExitCode
);
WINBASEAPI
BOOL
WINAPI
TerminateThread(
__in HANDLE hThread,
__in DWORD dwExitCode
);
WINBASEAPI
__success(return != 0)
BOOL
WINAPI
GetExitCodeThread(
__in HANDLE hThread,
__out LPDWORD lpExitCode
);
WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetThreadSelectorEntry( GetThreadSelectorEntry(
__in HANDLE hThread, _In_ HANDLE hThread,
__in DWORD dwSelector, _In_ DWORD dwSelector,
__out LPLDT_ENTRY lpSelectorEntry _Out_ LPLDT_ENTRY lpSelectorEntry
); );
WINBASEAPI WINBASEAPI
EXECUTION_STATE EXECUTION_STATE
WINAPI WINAPI
SetThreadExecutionState( SetThreadExecutionState(
__in EXECUTION_STATE esFlags _In_ EXECUTION_STATE esFlags
); );
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) #if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
typedef struct _REASON_CONTEXT {
ULONG Version;
DWORD Flags;
union {
struct {
HMODULE LocalizedReasonModule;
ULONG LocalizedReasonId;
ULONG ReasonStringCount;
LPWSTR *ReasonStrings;
} Detailed;
LPWSTR SimpleReasonString;
} Reason;
} REASON_CONTEXT, *PREASON_CONTEXT;
// //
// Power Request APIs // Power Request APIs
// //
typedef REASON_CONTEXT POWER_REQUEST_CONTEXT, *PPOWER_REQUEST_CONTEXT, *LPPOWER_ REQUEST_CONTEXT; typedef REASON_CONTEXT POWER_REQUEST_CONTEXT, *PPOWER_REQUEST_CONTEXT, *LPPOWER_ REQUEST_CONTEXT;
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
PowerCreateRequest ( PowerCreateRequest (
__in PREASON_CONTEXT Context _In_ PREASON_CONTEXT Context
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
PowerSetRequest ( PowerSetRequest (
__in HANDLE PowerRequest, _In_ HANDLE PowerRequest,
__in POWER_REQUEST_TYPE RequestType _In_ POWER_REQUEST_TYPE RequestType
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
PowerClearRequest ( PowerClearRequest (
__in HANDLE PowerRequest, _In_ HANDLE PowerRequest,
__in POWER_REQUEST_TYPE RequestType _In_ POWER_REQUEST_TYPE RequestType
); );
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7) #endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#ifdef _M_CEE_PURE #ifdef _M_CEE_PURE
#define GetLastError System::Runtime::InteropServices::Marshal::GetLastWin32Erro r #define GetLastError System::Runtime::InteropServices::Marshal::GetLastWin32Erro r
#else
WINBASEAPI
__checkReturn
DWORD
WINAPI
GetLastError(
VOID
);
#endif #endif
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
VOID #pragma endregion
WINAPI
SetLastError( #pragma region Desktop Family
__in DWORD dwErrCode #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
);
#if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_RESTORE_LAST_ERROR " is a bit long. #if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_RESTORE_LAST_ERROR " is a bit long.
//#if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_RESTORE_LAST_ERROR) //#if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
#if defined(WINBASE_DECLARE_RESTORE_LAST_ERROR) #if defined(WINBASE_DECLARE_RESTORE_LAST_ERROR)
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
RestoreLastError( RestoreLastError(
__in DWORD dwErrCode _In_ DWORD dwErrCode
); );
typedef VOID (WINAPI* PRESTORE_LAST_ERROR)(DWORD); typedef VOID (WINAPI* PRESTORE_LAST_ERROR)(DWORD);
#define RESTORE_LAST_ERROR_NAME_A "RestoreLastError" #define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
#define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError" #define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
#define RESTORE_LAST_ERROR_NAME TEXT("RestoreLastError") #define RESTORE_LAST_ERROR_NAME TEXT("RestoreLastError")
#endif #endif
#endif #endif
#define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal ) != STATUS_PENDING) #define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal ) != STATUS_PENDING)
WINBASEAPI
BOOL
WINAPI
GetOverlappedResult(
__in HANDLE hFile,
__in LPOVERLAPPED lpOverlapped,
__out LPDWORD lpNumberOfBytesTransferred,
__in BOOL bWait
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateIoCompletionPort(
__in HANDLE FileHandle,
__in_opt HANDLE ExistingCompletionPort,
__in ULONG_PTR CompletionKey,
__in DWORD NumberOfConcurrentThreads
);
WINBASEAPI
BOOL
WINAPI
GetQueuedCompletionStatus(
__in HANDLE CompletionPort,
__out LPDWORD lpNumberOfBytesTransferred,
__out PULONG_PTR lpCompletionKey,
__out LPOVERLAPPED *lpOverlapped,
__in DWORD dwMilliseconds
);
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
GetQueuedCompletionStatusEx(
__in HANDLE CompletionPort,
__out_ecount_part(ulCount, *ulNumEntriesRemoved) LPOVERLAPPED_ENTRY lpComple
tionPortEntries,
__in ULONG ulCount,
__out PULONG ulNumEntriesRemoved,
__in DWORD dwMilliseconds,
__in BOOL fAlertable
);
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
PostQueuedCompletionStatus(
__in HANDLE CompletionPort,
__in DWORD dwNumberOfBytesTransferred,
__in ULONG_PTR dwCompletionKey,
__in_opt LPOVERLAPPED lpOverlapped
);
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
// //
// The following flags allows an application to change // The following flags allows an application to change
// the semantics of IO completion notification. // the semantics of IO completion notification.
// //
// //
// Don't queue an entry to an associated completion port if returning success // Don't queue an entry to an associated completion port if returning success
// synchronously. // synchronously.
skipping to change at line 4351 skipping to change at line 1762
// //
// Don't set the file handle event on IO completion. // Don't set the file handle event on IO completion.
// //
#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileCompletionNotificationModes( SetFileCompletionNotificationModes(
__in HANDLE FileHandle, _In_ HANDLE FileHandle,
__in UCHAR Flags _In_ UCHAR Flags
);
WINBASEAPI
BOOL
WINAPI
SetFileIoOverlappedRange(
__in HANDLE FileHandle,
__in PUCHAR OverlappedRangeStart,
__in ULONG Length
); );
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
#define SEM_FAILCRITICALERRORS 0x0001 #define SEM_FAILCRITICALERRORS 0x0001
#define SEM_NOGPFAULTERRORBOX 0x0002 #define SEM_NOGPFAULTERRORBOX 0x0002
#define SEM_NOALIGNMENTFAULTEXCEPT 0x0004 #define SEM_NOALIGNMENTFAULTEXCEPT 0x0004
#define SEM_NOOPENFILEERRORBOX 0x8000 #define SEM_NOOPENFILEERRORBOX 0x8000
WINBASEAPI
UINT
WINAPI
GetErrorMode(
VOID
);
WINBASEAPI
UINT
WINAPI
SetErrorMode(
__in UINT uMode
);
// //
// Thread error mode support // Thread error mode support
// //
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetThreadErrorMode( GetThreadErrorMode(
VOID VOID
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetThreadErrorMode( SetThreadErrorMode(
__in DWORD dwNewMode, _In_ DWORD dwNewMode,
__in_opt LPDWORD lpOldMode _In_opt_ LPDWORD lpOldMode
);
WINBASEAPI
BOOL
WINAPI
ReadProcessMemory(
__in HANDLE hProcess,
__in LPCVOID lpBaseAddress,
__out_bcount_part(nSize, *lpNumberOfBytesRead) LPVOID lpBuffer,
__in SIZE_T nSize,
__out_opt SIZE_T * lpNumberOfBytesRead
);
WINBASEAPI
BOOL
WINAPI
WriteProcessMemory(
__in HANDLE hProcess,
__in LPVOID lpBaseAddress,
__in_bcount(nSize) LPCVOID lpBuffer,
__in SIZE_T nSize,
__out_opt SIZE_T * lpNumberOfBytesWritten
); );
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
WINBASEAPI
BOOL
WINAPI
GetThreadContext(
__in HANDLE hThread,
__inout LPCONTEXT lpContext
);
WINBASEAPI #if (_WIN32_WINNT >= 0x0600)
BOOL
WINAPI
SetThreadContext(
__in HANDLE hThread,
__in CONST CONTEXT *lpContext
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
Wow64GetThreadContext( Wow64GetThreadContext(
__in HANDLE hThread, _In_ HANDLE hThread,
__inout PWOW64_CONTEXT lpContext _Inout_ PWOW64_CONTEXT lpContext
);
#if(_WIN32_WINNT >= 0x0601)
WINBASEAPI
BOOL
WINAPI
Wow64GetThreadSelectorEntry(
__in HANDLE hThread,
__in DWORD dwSelector,
__out PWOW64_LDT_ENTRY lpSelectorEntry
); );
#endif /* _WIN32_WINNT >= 0x0601 */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
Wow64SetThreadContext( Wow64SetThreadContext(
__in HANDLE hThread, _In_ HANDLE hThread,
__in CONST WOW64_CONTEXT *lpContext _In_ CONST WOW64_CONTEXT *lpContext
);
#endif
WINBASEAPI
DWORD
WINAPI
SuspendThread(
__in HANDLE hThread
);
WINBASEAPI
DWORD
WINAPI
Wow64SuspendThread(
__in HANDLE hThread
);
WINBASEAPI
DWORD
WINAPI
ResumeThread(
__in HANDLE hThread
);
#if(_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
WINBASEAPI
DWORD
WINAPI
QueueUserAPC(
__in PAPCFUNC pfnAPC,
__in HANDLE hThread,
__in ULONG_PTR dwData
); );
#endif /* _WIN32_WINNT >= 0x0400 || _WIN32_WINDOWS > 0x0400 */ #endif // (_WIN32_WINNT >= 0x0600)
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
WINBASEAPI
BOOL
WINAPI
IsDebuggerPresent(
VOID
);
#endif
#if _WIN32_WINNT >= 0x0501 #if (_WIN32_WINNT >= 0x0601)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CheckRemoteDebuggerPresent( Wow64GetThreadSelectorEntry(
__in HANDLE hProcess, _In_ HANDLE hThread,
__out PBOOL pbDebuggerPresent _In_ DWORD dwSelector,
_Out_ PWOW64_LDT_ENTRY lpSelectorEntry
); );
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0601)
WINBASEAPI
VOID
WINAPI
DebugBreak(
VOID
);
WINBASEAPI #endif // !defined(MIDL_PASS)
BOOL
WINAPI
WaitForDebugEvent(
__in LPDEBUG_EVENT lpDebugEvent,
__in DWORD dwMilliseconds
);
WINBASEAPI #if (_WIN32_WINNT >= 0x0600)
BOOL
WINAPI
ContinueDebugEvent(
__in DWORD dwProcessId,
__in DWORD dwThreadId,
__in DWORD dwContinueStatus
);
WINBASEAPI WINBASEAPI
BOOL DWORD
WINAPI WINAPI
DebugActiveProcess( Wow64SuspendThread(
__in DWORD dwProcessId _In_ HANDLE hThread
); );
WINBASEAPI #endif // (_WIN32_WINNT >= 0x0600)
BOOL
WINAPI
DebugActiveProcessStop(
__in DWORD dwProcessId
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DebugSetProcessKillOnExit( DebugSetProcessKillOnExit(
__in BOOL KillOnExit _In_ BOOL KillOnExit
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DebugBreakProcess ( DebugBreakProcess (
__in HANDLE Process _In_ HANDLE Process
);
#if (_WIN32_WINNT < _WIN32_WINNT_LONGHORN)
__drv_inTry
#endif
WINBASEAPI
VOID
WINAPI
InitializeCriticalSection(
__out LPCRITICAL_SECTION lpCriticalSection
); );
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
VOID #pragma endregion
WINAPI
EnterCriticalSection(
__inout LPCRITICAL_SECTION lpCriticalSection
);
WINBASEAPI #pragma region Application Family
VOID #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINAPI
LeaveCriticalSection(
__inout LPCRITICAL_SECTION lpCriticalSection
);
#if (_WIN32_WINNT >= 0x0403) #if (_WIN32_WINNT >= 0x0403)
#define CRITICAL_SECTION_NO_DEBUG_INFO RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO #define CRITICAL_SECTION_NO_DEBUG_INFO RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO
WINBASEAPI
BOOL
WINAPI
InitializeCriticalSectionAndSpinCount(
__out LPCRITICAL_SECTION lpCriticalSection,
__in DWORD dwSpinCount
);
WINBASEAPI
BOOL
WINAPI
InitializeCriticalSectionEx(
__out LPCRITICAL_SECTION lpCriticalSection,
__in DWORD dwSpinCount,
__in DWORD Flags
);
WINBASEAPI
DWORD
WINAPI
SetCriticalSectionSpinCount(
__inout LPCRITICAL_SECTION lpCriticalSection,
__in DWORD dwSpinCount
);
#endif #endif
#if(_WIN32_WINNT >= 0x0400) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
WINBASEAPI #pragma endregion
BOOL
WINAPI
TryEnterCriticalSection(
__inout LPCRITICAL_SECTION lpCriticalSection
);
#endif /* _WIN32_WINNT >= 0x0400 */
WINBASEAPI
VOID
WINAPI
DeleteCriticalSection(
__inout LPCRITICAL_SECTION lpCriticalSection
);
WINBASEAPI
BOOL
WINAPI
SetEvent(
__in HANDLE hEvent
);
WINBASEAPI #pragma region Desktop Family
BOOL #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINAPI
ResetEvent(
__in HANDLE hEvent
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
PulseEvent( PulseEvent(
__in HANDLE hEvent _In_ HANDLE hEvent
);
WINBASEAPI
BOOL
WINAPI
ReleaseSemaphore(
__in HANDLE hSemaphore,
__in LONG lReleaseCount,
__out_opt LPLONG lpPreviousCount
);
WINBASEAPI
BOOL
WINAPI
ReleaseMutex(
__in HANDLE hMutex
);
WINBASEAPI
DWORD
WINAPI
WaitForSingleObject(
__in HANDLE hHandle,
__in DWORD dwMilliseconds
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
WaitForMultipleObjects( WaitForMultipleObjects(
__in DWORD nCount, _In_ DWORD nCount,
__in_ecount(nCount) CONST HANDLE *lpHandles, _In_reads_(nCount) CONST HANDLE *lpHandles,
__in BOOL bWaitAll, _In_ BOOL bWaitAll,
__in DWORD dwMilliseconds _In_ DWORD dwMilliseconds
);
WINBASEAPI
VOID
WINAPI
Sleep(
__in DWORD dwMilliseconds
);
WINBASEAPI
__out_opt
HGLOBAL
WINAPI
LoadResource(
__in_opt HMODULE hModule,
__in HRSRC hResInfo
);
WINBASEAPI
DWORD
WINAPI
SizeofResource(
__in_opt HMODULE hModule,
__in HRSRC hResInfo
); );
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
GlobalDeleteAtom( GlobalDeleteAtom(
__in ATOM nAtom _In_ ATOM nAtom
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
InitAtomTable( InitAtomTable(
__in DWORD nSize _In_ DWORD nSize
); );
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
DeleteAtom( DeleteAtom(
__in ATOM nAtom _In_ ATOM nAtom
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
SetHandleCount( SetHandleCount(
__in UINT uNumber _In_ UINT uNumber
);
WINBASEAPI
DWORD
WINAPI
GetLogicalDrives(
VOID
);
WINBASEAPI
BOOL
WINAPI
LockFile(
__in HANDLE hFile,
__in DWORD dwFileOffsetLow,
__in DWORD dwFileOffsetHigh,
__in DWORD nNumberOfBytesToLockLow,
__in DWORD nNumberOfBytesToLockHigh
);
WINBASEAPI
BOOL
WINAPI
UnlockFile(
__in HANDLE hFile,
__in DWORD dwFileOffsetLow,
__in DWORD dwFileOffsetHigh,
__in DWORD nNumberOfBytesToUnlockLow,
__in DWORD nNumberOfBytesToUnlockHigh
);
WINBASEAPI
BOOL
WINAPI
LockFileEx(
__in HANDLE hFile,
__in DWORD dwFlags,
__reserved DWORD dwReserved,
__in DWORD nNumberOfBytesToLockLow,
__in DWORD nNumberOfBytesToLockHigh,
__inout LPOVERLAPPED lpOverlapped
);
#define LOCKFILE_FAIL_IMMEDIATELY 0x00000001
#define LOCKFILE_EXCLUSIVE_LOCK 0x00000002
WINBASEAPI
BOOL
WINAPI
UnlockFileEx(
__in HANDLE hFile,
__reserved DWORD dwReserved,
__in DWORD nNumberOfBytesToUnlockLow,
__in DWORD nNumberOfBytesToUnlockHigh,
__inout LPOVERLAPPED lpOverlapped
);
typedef struct _BY_HANDLE_FILE_INFORMATION {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD dwVolumeSerialNumber;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD nNumberOfLinks;
DWORD nFileIndexHigh;
DWORD nFileIndexLow;
} BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_IN
FORMATION;
WINBASEAPI
BOOL
WINAPI
GetFileInformationByHandle(
__in HANDLE hFile,
__out LPBY_HANDLE_FILE_INFORMATION lpFileInformation
);
WINBASEAPI
DWORD
WINAPI
GetFileType(
__in HANDLE hFile
);
WINBASEAPI
DWORD
WINAPI
GetFileSize(
__in HANDLE hFile,
__out_opt LPDWORD lpFileSizeHigh
);
WINBASEAPI
BOOL
WINAPI
GetFileSizeEx(
__in HANDLE hFile,
__out PLARGE_INTEGER lpFileSize
);
WINBASEAPI
HANDLE
WINAPI
GetStdHandle(
__in DWORD nStdHandle
);
WINBASEAPI
BOOL
WINAPI
SetStdHandle(
__in DWORD nStdHandle,
__in HANDLE hHandle
);
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
SetStdHandleEx(
__in DWORD nStdHandle,
__in HANDLE hHandle,
__out_opt PHANDLE phPrevValue
);
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
WriteFile(
__in HANDLE hFile,
__in_bcount_opt(nNumberOfBytesToWrite) LPCVOID lpBuffer,
__in DWORD nNumberOfBytesToWrite,
__out_opt LPDWORD lpNumberOfBytesWritten,
__inout_opt LPOVERLAPPED lpOverlapped
);
WINBASEAPI
BOOL
WINAPI
ReadFile(
__in HANDLE hFile,
__out_bcount_part_opt(nNumberOfBytesToRead, *lpNumberOfBytesRead) __out_data
_source(FILE) LPVOID lpBuffer,
__in DWORD nNumberOfBytesToRead,
__out_opt LPDWORD lpNumberOfBytesRead,
__inout_opt LPOVERLAPPED lpOverlapped
);
WINBASEAPI
BOOL
WINAPI
FlushFileBuffers(
__in HANDLE hFile
);
WINBASEAPI
BOOL
WINAPI
DeviceIoControl(
__in HANDLE hDevice,
__in DWORD dwIoControlCode,
__in_bcount_opt(nInBufferSize) LPVOID lpInBuffer,
__in DWORD nInBufferSize,
__out_bcount_part_opt(nOutBufferSize, *lpBytesReturned) LPVOID lpOutBuffer,
__in DWORD nOutBufferSize,
__out_opt LPDWORD lpBytesReturned,
__inout_opt LPOVERLAPPED lpOverlapped
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RequestDeviceWakeup( RequestDeviceWakeup(
__in HANDLE hDevice _In_ HANDLE hDevice
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CancelDeviceWakeupRequest( CancelDeviceWakeupRequest(
__in HANDLE hDevice _In_ HANDLE hDevice
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetDevicePowerState( GetDevicePowerState(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__out BOOL *pfOn _Out_ BOOL *pfOn
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetMessageWaitingIndicator( SetMessageWaitingIndicator(
__in HANDLE hMsgIndicator, _In_ HANDLE hMsgIndicator,
__in ULONG ulMsgCount _In_ ULONG ulMsgCount
);
WINBASEAPI
BOOL
WINAPI
SetEndOfFile(
__in HANDLE hFile
);
WINBASEAPI
DWORD
WINAPI
SetFilePointer(
__in HANDLE hFile,
__in LONG lDistanceToMove,
__inout_opt PLONG lpDistanceToMoveHigh,
__in DWORD dwMoveMethod
);
WINBASEAPI
BOOL
WINAPI
SetFilePointerEx(
__in HANDLE hFile,
__in LARGE_INTEGER liDistanceToMove,
__out_opt PLARGE_INTEGER lpNewFilePointer,
__in DWORD dwMoveMethod
);
WINBASEAPI
BOOL
WINAPI
FindClose(
__inout HANDLE hFindFile
);
WINBASEAPI
BOOL
WINAPI
GetFileTime(
__in HANDLE hFile,
__out_opt LPFILETIME lpCreationTime,
__out_opt LPFILETIME lpLastAccessTime,
__out_opt LPFILETIME lpLastWriteTime
);
WINBASEAPI
BOOL
WINAPI
SetFileTime(
__in HANDLE hFile,
__in_opt CONST FILETIME *lpCreationTime,
__in_opt CONST FILETIME *lpLastAccessTime,
__in_opt CONST FILETIME *lpLastWriteTime
);
#if _WIN32_WINNT >= 0x0501
WINBASEAPI
BOOL
WINAPI
SetFileValidData(
__in HANDLE hFile,
__in LONGLONG ValidDataLength
); );
#endif // (_WIN32_WINNT >= 0x0501)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileShortNameA( SetFileShortNameA(
__in HANDLE hFile, _In_ HANDLE hFile,
__in LPCSTR lpShortName _In_ LPCSTR lpShortName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileShortNameW( SetFileShortNameW(
__in HANDLE hFile, _In_ HANDLE hFile,
__in LPCWSTR lpShortName _In_ LPCWSTR lpShortName
); );
#ifdef UNICODE #ifdef UNICODE
#define SetFileShortName SetFileShortNameW #define SetFileShortName SetFileShortNameW
#else #else
#define SetFileShortName SetFileShortNameA #define SetFileShortName SetFileShortNameA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
CloseHandle(
__in HANDLE hObject
);
WINBASEAPI
BOOL
WINAPI
DuplicateHandle(
__in HANDLE hSourceProcessHandle,
__in HANDLE hSourceHandle,
__in HANDLE hTargetProcessHandle,
__deref_out LPHANDLE lpTargetHandle,
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwOptions
);
WINBASEAPI
BOOL
WINAPI
GetHandleInformation(
__in HANDLE hObject,
__out LPDWORD lpdwFlags
);
WINBASEAPI
BOOL
WINAPI
SetHandleInformation(
__in HANDLE hObject,
__in DWORD dwMask,
__in DWORD dwFlags
);
#define HANDLE_FLAG_INHERIT 0x00000001 #define HANDLE_FLAG_INHERIT 0x00000001
#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002 #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
#define HINSTANCE_ERROR 32 #define HINSTANCE_ERROR 32
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
LoadModule( LoadModule(
__in LPCSTR lpModuleName, _In_ LPCSTR lpModuleName,
__in LPVOID lpParameterBlock _In_ LPVOID lpParameterBlock
); );
__drv_preferredFunction("CreateProcess","Deprecated. See MSDN for details") __drv_preferredFunction("CreateProcess","Deprecated. See MSDN for details")
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
WinExec( WinExec(
__in LPCSTR lpCmdLine, _In_ LPCSTR lpCmdLine,
__in UINT uCmdShow _In_ UINT uCmdShow
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ClearCommBreak( ClearCommBreak(
__in HANDLE hFile _In_ HANDLE hFile
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ClearCommError( ClearCommError(
__in HANDLE hFile, _In_ HANDLE hFile,
__out_opt LPDWORD lpErrors, _Out_opt_ LPDWORD lpErrors,
__out_opt LPCOMSTAT lpStat _Out_opt_ LPCOMSTAT lpStat
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetupComm( SetupComm(
__in HANDLE hFile, _In_ HANDLE hFile,
__in DWORD dwInQueue, _In_ DWORD dwInQueue,
__in DWORD dwOutQueue _In_ DWORD dwOutQueue
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EscapeCommFunction( EscapeCommFunction(
__in HANDLE hFile, _In_ HANDLE hFile,
__in DWORD dwFunc _In_ DWORD dwFunc
); );
WINBASEAPI WINBASEAPI
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
GetCommConfig( GetCommConfig(
__in HANDLE hCommDev, _In_ HANDLE hCommDev,
__out_bcount_opt(*lpdwSize) LPCOMMCONFIG lpCC, _Out_writes_bytes_opt_(*lpdwSize) LPCOMMCONFIG lpCC,
__inout LPDWORD lpdwSize _Inout_ LPDWORD lpdwSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetCommMask( GetCommMask(
__in HANDLE hFile, _In_ HANDLE hFile,
__out LPDWORD lpEvtMask _Out_ LPDWORD lpEvtMask
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetCommProperties( GetCommProperties(
__in HANDLE hFile, _In_ HANDLE hFile,
__inout LPCOMMPROP lpCommProp _Inout_ LPCOMMPROP lpCommProp
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetCommModemStatus( GetCommModemStatus(
__in HANDLE hFile, _In_ HANDLE hFile,
__out LPDWORD lpModemStat _Out_ LPDWORD lpModemStat
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetCommState( GetCommState(
__in HANDLE hFile, _In_ HANDLE hFile,
__out LPDCB lpDCB _Out_ LPDCB lpDCB
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetCommTimeouts( GetCommTimeouts(
__in HANDLE hFile, _In_ HANDLE hFile,
__out LPCOMMTIMEOUTS lpCommTimeouts _Out_ LPCOMMTIMEOUTS lpCommTimeouts
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
PurgeComm( PurgeComm(
__in HANDLE hFile, _In_ HANDLE hFile,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetCommBreak( SetCommBreak(
__in HANDLE hFile _In_ HANDLE hFile
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetCommConfig( SetCommConfig(
__in HANDLE hCommDev, _In_ HANDLE hCommDev,
__in_bcount(dwSize) LPCOMMCONFIG lpCC, _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC,
__in DWORD dwSize _In_ DWORD dwSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetCommMask( SetCommMask(
__in HANDLE hFile, _In_ HANDLE hFile,
__in DWORD dwEvtMask _In_ DWORD dwEvtMask
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetCommState( SetCommState(
__in HANDLE hFile, _In_ HANDLE hFile,
__in LPDCB lpDCB _In_ LPDCB lpDCB
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetCommTimeouts( SetCommTimeouts(
__in HANDLE hFile, _In_ HANDLE hFile,
__in LPCOMMTIMEOUTS lpCommTimeouts _In_ LPCOMMTIMEOUTS lpCommTimeouts
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
TransmitCommChar( TransmitCommChar(
__in HANDLE hFile, _In_ HANDLE hFile,
__in char cChar _In_ char cChar
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WaitCommEvent( WaitCommEvent(
__in HANDLE hFile, _In_ HANDLE hFile,
__inout LPDWORD lpEvtMask, _Inout_ LPDWORD lpEvtMask,
__inout_opt LPOVERLAPPED lpOverlapped _Inout_opt_ LPOVERLAPPED lpOverlapped
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SetTapePosition( SetTapePosition(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwPositionMethod, _In_ DWORD dwPositionMethod,
__in DWORD dwPartition, _In_ DWORD dwPartition,
__in DWORD dwOffsetLow, _In_ DWORD dwOffsetLow,
__in DWORD dwOffsetHigh, _In_ DWORD dwOffsetHigh,
__in BOOL bImmediate _In_ BOOL bImmediate
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTapePosition( GetTapePosition(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwPositionType, _In_ DWORD dwPositionType,
__out LPDWORD lpdwPartition, _Out_ LPDWORD lpdwPartition,
__out LPDWORD lpdwOffsetLow, _Out_ LPDWORD lpdwOffsetLow,
__out LPDWORD lpdwOffsetHigh _Out_ LPDWORD lpdwOffsetHigh
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
PrepareTape( PrepareTape(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwOperation, _In_ DWORD dwOperation,
__in BOOL bImmediate _In_ BOOL bImmediate
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
EraseTape( EraseTape(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwEraseType, _In_ DWORD dwEraseType,
__in BOOL bImmediate _In_ BOOL bImmediate
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
CreateTapePartition( CreateTapePartition(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwPartitionMethod, _In_ DWORD dwPartitionMethod,
__in DWORD dwCount, _In_ DWORD dwCount,
__in DWORD dwSize _In_ DWORD dwSize
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
WriteTapemark( WriteTapemark(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwTapemarkType, _In_ DWORD dwTapemarkType,
__in DWORD dwTapemarkCount, _In_ DWORD dwTapemarkCount,
__in BOOL bImmediate _In_ BOOL bImmediate
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTapeStatus( GetTapeStatus(
__in HANDLE hDevice _In_ HANDLE hDevice
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTapeParameters( GetTapeParameters(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwOperation, _In_ DWORD dwOperation,
__inout LPDWORD lpdwSize, _Inout_ LPDWORD lpdwSize,
__out_bcount(*lpdwSize) LPVOID lpTapeInformation _Out_writes_bytes_(*lpdwSize) LPVOID lpTapeInformation
); );
#define GET_TAPE_MEDIA_INFORMATION 0 #define GET_TAPE_MEDIA_INFORMATION 0
#define GET_TAPE_DRIVE_INFORMATION 1 #define GET_TAPE_DRIVE_INFORMATION 1
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SetTapeParameters( SetTapeParameters(
__in HANDLE hDevice, _In_ HANDLE hDevice,
__in DWORD dwOperation, _In_ DWORD dwOperation,
__in LPVOID lpTapeInformation _In_ LPVOID lpTapeInformation
); );
#define SET_TAPE_MEDIA_INFORMATION 0 #define SET_TAPE_MEDIA_INFORMATION 0
#define SET_TAPE_DRIVE_INFORMATION 1 #define SET_TAPE_DRIVE_INFORMATION 1
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
BOOL #pragma endregion
WINAPI
Beep( #pragma region Application Family
__in DWORD dwFreq, #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
__in DWORD dwDuration
);
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
MulDiv( MulDiv(
__in int nNumber, _In_ int nNumber,
__in int nNumerator, _In_ int nNumerator,
__in int nDenominator _In_ int nDenominator
);
WINBASEAPI
VOID
WINAPI
GetSystemTime(
__out LPSYSTEMTIME lpSystemTime
);
WINBASEAPI
VOID
WINAPI
GetSystemTimeAsFileTime(
__out LPFILETIME lpSystemTimeAsFileTime
);
WINBASEAPI
BOOL
WINAPI
SetSystemTime(
__in CONST SYSTEMTIME *lpSystemTime
);
WINBASEAPI
VOID
WINAPI
GetLocalTime(
__out LPSYSTEMTIME lpSystemTime
); );
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
BOOL #pragma endregion
WINAPI
SetLocalTime(
__in CONST SYSTEMTIME *lpSystemTime
);
WINBASEAPI #pragma region Desktop Family
VOID #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINAPI
GetSystemInfo(
__out LPSYSTEM_INFO lpSystemInfo
);
typedef enum _DEP_SYSTEM_POLICY_TYPE { typedef enum _DEP_SYSTEM_POLICY_TYPE {
DEPPolicyAlwaysOff = 0, DEPPolicyAlwaysOff = 0,
DEPPolicyAlwaysOn, DEPPolicyAlwaysOn,
DEPPolicyOptIn, DEPPolicyOptIn,
DEPPolicyOptOut, DEPPolicyOptOut,
DEPTotalPolicyCount DEPTotalPolicyCount
} DEP_SYSTEM_POLICY_TYPE; } DEP_SYSTEM_POLICY_TYPE;
#if (NTDDI_VERSION >= NTDDI_WINXPSP3)
WINBASEAPI WINBASEAPI
DEP_SYSTEM_POLICY_TYPE DEP_SYSTEM_POLICY_TYPE
WINAPI WINAPI
GetSystemDEPPolicy( GetSystemDEPPolicy(
VOID VOID
); );
#if _WIN32_WINNT >= 0x0502 #endif // (NTDDI_VERSION >= NTDDI_WINXPSP3)
#define FILE_CACHE_FLAGS_DEFINED
#define FILE_CACHE_MAX_HARD_ENABLE 0x00000001
#define FILE_CACHE_MAX_HARD_DISABLE 0x00000002
#define FILE_CACHE_MIN_HARD_ENABLE 0x00000004
#define FILE_CACHE_MIN_HARD_DISABLE 0x00000008
WINBASEAPI
BOOL
WINAPI
SetSystemFileCacheSize (
__in SIZE_T MinimumFileCacheSize,
__in SIZE_T MaximumFileCacheSize,
__in DWORD Flags
);
WINBASEAPI
BOOL
WINAPI
GetSystemFileCacheSize (
__out PSIZE_T lpMinimumFileCacheSize,
__out PSIZE_T lpMaximumFileCacheSize,
__out PDWORD lpFlags
);
#endif // (_WIN32_WINNT >= 0x0502)
#if _WIN32_WINNT >= 0x0501 #if _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetSystemRegistryQuota( GetSystemRegistryQuota(
__out_opt PDWORD pdwQuotaAllowed, _Out_opt_ PDWORD pdwQuotaAllowed,
__out_opt PDWORD pdwQuotaUsed _Out_opt_ PDWORD pdwQuotaUsed
);
BOOL
WINAPI
GetSystemTimes(
__out_opt LPFILETIME lpIdleTime,
__out_opt LPFILETIME lpKernelTime,
__out_opt LPFILETIME lpUserTime
); );
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0501)
#if _WIN32_WINNT >= 0x0501
WINBASEAPI
VOID
WINAPI
GetNativeSystemInfo(
__out LPSYSTEM_INFO lpSystemInfo
);
#endif
WINBASEAPI
BOOL
WINAPI
IsProcessorFeaturePresent(
__in DWORD ProcessorFeature
);
typedef struct _TIME_ZONE_INFORMATION {
LONG Bias;
WCHAR StandardName[ 32 ];
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR DaylightName[ 32 ];
SYSTEMTIME DaylightDate;
LONG DaylightBias;
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
typedef struct _TIME_DYNAMIC_ZONE_INFORMATION {
LONG Bias;
WCHAR StandardName[ 32 ];
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR DaylightName[ 32 ];
SYSTEMTIME DaylightDate;
LONG DaylightBias;
WCHAR TimeZoneKeyName[ 128 ];
BOOLEAN DynamicDaylightTimeDisabled;
} DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION;
WINBASEAPI
BOOL
WINAPI
SystemTimeToTzSpecificLocalTime(
__in_opt CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation,
__in CONST SYSTEMTIME *lpUniversalTime,
__out LPSYSTEMTIME lpLocalTime
);
WINBASEAPI
BOOL
WINAPI
TzSpecificLocalTimeToSystemTime(
__in_opt CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation,
__in CONST SYSTEMTIME *lpLocalTime,
__out LPSYSTEMTIME lpUniversalTime
);
BOOL
WINAPI
GetTimeZoneInformationForYear(
__in USHORT wYear,
__in_opt PDYNAMIC_TIME_ZONE_INFORMATION pdtzi,
__out LPTIME_ZONE_INFORMATION ptzi
);
WINBASEAPI
DWORD
WINAPI
GetTimeZoneInformation(
__out LPTIME_ZONE_INFORMATION lpTimeZoneInformation
);
WINBASEAPI
BOOL
WINAPI
SetTimeZoneInformation(
__in CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation
);
WINBASEAPI
DWORD
WINAPI
GetDynamicTimeZoneInformation(
__out PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation
);
WINBASEAPI
BOOL
WINAPI
SetDynamicTimeZoneInformation(
__in CONST DYNAMIC_TIME_ZONE_INFORMATION *lpTimeZoneInformation
);
// //
// Routines to convert back and forth between system time and file time // Routines to convert back and forth between system time and file time
// //
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SystemTimeToFileTime(
__in CONST SYSTEMTIME *lpSystemTime,
__out LPFILETIME lpFileTime
);
WINBASEAPI
BOOL
WINAPI
FileTimeToLocalFileTime(
__in CONST FILETIME *lpFileTime,
__out LPFILETIME lpLocalFileTime
);
WINBASEAPI
BOOL
WINAPI
LocalFileTimeToFileTime(
__in CONST FILETIME *lpLocalFileTime,
__out LPFILETIME lpFileTime
);
WINBASEAPI
BOOL
WINAPI
FileTimeToSystemTime(
__in CONST FILETIME *lpFileTime,
__out LPSYSTEMTIME lpSystemTime
);
WINBASEAPI
LONG
WINAPI
CompareFileTime(
__in CONST FILETIME *lpFileTime1,
__in CONST FILETIME *lpFileTime2
);
WINBASEAPI
BOOL
WINAPI
FileTimeToDosDateTime( FileTimeToDosDateTime(
__in CONST FILETIME *lpFileTime, _In_ CONST FILETIME *lpFileTime,
__out LPWORD lpFatDate, _Out_ LPWORD lpFatDate,
__out LPWORD lpFatTime _Out_ LPWORD lpFatTime
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DosDateTimeToFileTime( DosDateTimeToFileTime(
__in WORD wFatDate, _In_ WORD wFatDate,
__in WORD wFatTime, _In_ WORD wFatTime,
__out LPFILETIME lpFileTime _Out_ LPFILETIME lpFileTime
);
__drv_preferredFunction("GetTickCount64", "GetTickCount overflows roughly every
49 days. Code that does not take that into account can loop indefinitely. GetT
ickCount64 operates on 64 bit values and does not have that problem")
WINBASEAPI
DWORD
WINAPI
GetTickCount(
VOID
);
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
ULONGLONG
WINAPI
GetTickCount64(
VOID
); );
#endif #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
WINBASEAPI
BOOL
WINAPI
SetSystemTimeAdjustment(
__in DWORD dwTimeAdjustment,
__in BOOL bTimeAdjustmentDisabled
);
WINBASEAPI #pragma region Application Family
BOOL #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINAPI
GetSystemTimeAdjustment(
__out PDWORD lpTimeAdjustment,
__out PDWORD lpTimeIncrement,
__out PBOOL lpTimeAdjustmentDisabled
);
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
WINBASEAPI WINBASEAPI
_Success_(return != 0)
DWORD DWORD
WINAPI WINAPI
FormatMessageA( FormatMessageA(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt LPCVOID lpSource, _In_opt_ LPCVOID lpSource,
__in DWORD dwMessageId, _In_ DWORD dwMessageId,
__in DWORD dwLanguageId, _In_ DWORD dwLanguageId,
__out LPSTR lpBuffer, _Out_ LPSTR lpBuffer,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt va_list *Arguments _In_opt_ va_list *Arguments
); );
WINBASEAPI WINBASEAPI
_Success_(return != 0)
DWORD DWORD
WINAPI WINAPI
FormatMessageW( FormatMessageW(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt LPCVOID lpSource, _In_opt_ LPCVOID lpSource,
__in DWORD dwMessageId, _In_ DWORD dwMessageId,
__in DWORD dwLanguageId, _In_ DWORD dwLanguageId,
__out LPWSTR lpBuffer, _Out_ LPWSTR lpBuffer,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt va_list *Arguments _In_opt_ va_list *Arguments
); );
#ifdef UNICODE #ifdef UNICODE
#define FormatMessage FormatMessageW #define FormatMessage FormatMessageW
#else #else
#define FormatMessage FormatMessageA #define FormatMessage FormatMessageA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef FormatMessage #undef FormatMessage
__inline __inline
skipping to change at line 5718 skipping to change at line 2372
dwMessageId, dwMessageId,
dwLanguageId, dwLanguageId,
lpBuffer, lpBuffer,
nSize, nSize,
Arguments Arguments
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#endif /* MIDL_PASS */ #endif /* MIDL_PASS */
#define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
#define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200 #define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
#define FORMAT_MESSAGE_FROM_STRING 0x00000400 #define FORMAT_MESSAGE_FROM_STRING 0x00000400
#define FORMAT_MESSAGE_FROM_HMODULE 0x00000800 #define FORMAT_MESSAGE_FROM_HMODULE 0x00000800
#define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000 #define FORMAT_MESSAGE_FROM_SYSTEM 0x00001000
#define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000 #define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000
#define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF #define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
BOOL #pragma endregion
WINAPI
CreatePipe(
__out_ecount_full(1) PHANDLE hReadPipe,
__out_ecount_full(1) PHANDLE hWritePipe,
__in_opt LPSECURITY_ATTRIBUTES lpPipeAttributes,
__in DWORD nSize
);
WINBASEAPI #pragma region Desktop Family
BOOL #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINAPI
ConnectNamedPipe(
__in HANDLE hNamedPipe,
__inout_opt LPOVERLAPPED lpOverlapped
);
WINBASEAPI //
BOOL // FORMAT_MESSAGE_ALLOCATE_BUFFER requires use of LocalFree which is in the
WINAPI // "Desktop Family" only.
DisconnectNamedPipe( //
__in HANDLE hNamedPipe
);
WINBASEAPI #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
BOOL
WINAPI
SetNamedPipeHandleState(
__in HANDLE hNamedPipe,
__in_opt LPDWORD lpMode,
__in_opt LPDWORD lpMaxCollectionCount,
__in_opt LPDWORD lpCollectDataTimeout
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeInfo( GetNamedPipeInfo(
__in HANDLE hNamedPipe, _In_ HANDLE hNamedPipe,
__out_opt LPDWORD lpFlags, _Out_opt_ LPDWORD lpFlags,
__out_opt LPDWORD lpOutBufferSize, _Out_opt_ LPDWORD lpOutBufferSize,
__out_opt LPDWORD lpInBufferSize, _Out_opt_ LPDWORD lpInBufferSize,
__out_opt LPDWORD lpMaxInstances _Out_opt_ LPDWORD lpMaxInstances
);
WINBASEAPI
BOOL
WINAPI
PeekNamedPipe(
__in HANDLE hNamedPipe,
__out_bcount_part_opt(nBufferSize, *lpBytesRead) LPVOID lpBuffer,
__in DWORD nBufferSize,
__out_opt LPDWORD lpBytesRead,
__out_opt LPDWORD lpTotalBytesAvail,
__out_opt LPDWORD lpBytesLeftThisMessage
);
WINBASEAPI
BOOL
WINAPI
TransactNamedPipe(
__in HANDLE hNamedPipe,
__in_bcount_opt(nInBufferSize) LPVOID lpInBuffer,
__in DWORD nInBufferSize,
__out_bcount_part_opt(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer,
__in DWORD nOutBufferSize,
__out LPDWORD lpBytesRead,
__inout_opt LPOVERLAPPED lpOverlapped
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateMailslotA( CreateMailslotA(
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in DWORD nMaxMessageSize, _In_ DWORD nMaxMessageSize,
__in DWORD lReadTimeout, _In_ DWORD lReadTimeout,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateMailslotW( CreateMailslotW(
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__in DWORD nMaxMessageSize, _In_ DWORD nMaxMessageSize,
__in DWORD lReadTimeout, _In_ DWORD lReadTimeout,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateMailslot CreateMailslotW #define CreateMailslot CreateMailslotW
#else #else
#define CreateMailslot CreateMailslotA #define CreateMailslot CreateMailslotA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetMailslotInfo( GetMailslotInfo(
__in HANDLE hMailslot, _In_ HANDLE hMailslot,
__out_opt LPDWORD lpMaxMessageSize, _Out_opt_ LPDWORD lpMaxMessageSize,
__out_opt LPDWORD lpNextSize, _Out_opt_ LPDWORD lpNextSize,
__out_opt LPDWORD lpMessageCount, _Out_opt_ LPDWORD lpMessageCount,
__out_opt LPDWORD lpReadTimeout _Out_opt_ LPDWORD lpReadTimeout
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetMailslotInfo( SetMailslotInfo(
__in HANDLE hMailslot, _In_ HANDLE hMailslot,
__in DWORD lReadTimeout _In_ DWORD lReadTimeout
);
WINBASEAPI
__out_opt __out_data_source(FILE)
LPVOID
WINAPI
MapViewOfFile(
__in HANDLE hFileMappingObject,
__in DWORD dwDesiredAccess,
__in DWORD dwFileOffsetHigh,
__in DWORD dwFileOffsetLow,
__in SIZE_T dwNumberOfBytesToMap
);
WINBASEAPI
BOOL
WINAPI
FlushViewOfFile(
__in LPCVOID lpBaseAddress,
__in SIZE_T dwNumberOfBytesToFlush
);
WINBASEAPI
BOOL
WINAPI
UnmapViewOfFile(
__in LPCVOID lpBaseAddress
); );
// //
// File Encryption API // File Encryption API
// //
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EncryptFileA( EncryptFileA(
__in LPCSTR lpFileName _In_ LPCSTR lpFileName
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EncryptFileW( EncryptFileW(
__in LPCWSTR lpFileName _In_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define EncryptFile EncryptFileW #define EncryptFile EncryptFileW
#else #else
#define EncryptFile EncryptFileA #define EncryptFile EncryptFileA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
DecryptFileA( DecryptFileA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__reserved DWORD dwReserved _Reserved_ DWORD dwReserved
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
DecryptFileW( DecryptFileW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__reserved DWORD dwReserved _Reserved_ DWORD dwReserved
); );
#ifdef UNICODE #ifdef UNICODE
#define DecryptFile DecryptFileW #define DecryptFile DecryptFileW
#else #else
#define DecryptFile DecryptFileA #define DecryptFile DecryptFileA
#endif // !UNICODE #endif // !UNICODE
// //
// Encryption Status Value // Encryption Status Value
// //
skipping to change at line 5930 skipping to change at line 2507
#define FILE_UNKNOWN 5 #define FILE_UNKNOWN 5
#define FILE_SYSTEM_NOT_SUPPORT 6 #define FILE_SYSTEM_NOT_SUPPORT 6
#define FILE_USER_DISALLOWED 7 #define FILE_USER_DISALLOWED 7
#define FILE_READ_ONLY 8 #define FILE_READ_ONLY 8
#define FILE_DIR_DISALLOWED 9 #define FILE_DIR_DISALLOWED 9
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
FileEncryptionStatusA( FileEncryptionStatusA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__out LPDWORD lpStatus _Out_ LPDWORD lpStatus
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
FileEncryptionStatusW( FileEncryptionStatusW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__out LPDWORD lpStatus _Out_ LPDWORD lpStatus
); );
#ifdef UNICODE #ifdef UNICODE
#define FileEncryptionStatus FileEncryptionStatusW #define FileEncryptionStatus FileEncryptionStatusW
#else #else
#define FileEncryptionStatus FileEncryptionStatusA #define FileEncryptionStatus FileEncryptionStatusA
#endif // !UNICODE #endif // !UNICODE
// //
// Currently defined recovery flags // Currently defined recovery flags
// //
#define EFS_USE_RECOVERY_KEYS (0x1) #define EFS_USE_RECOVERY_KEYS (0x1)
typedef typedef
DWORD DWORD
(WINAPI *PFE_EXPORT_FUNC)( (WINAPI *PFE_EXPORT_FUNC)(
__in_bcount(ulLength) PBYTE pbData, _In_reads_bytes_(ulLength) PBYTE pbData,
__in_opt PVOID pvCallbackContext, _In_opt_ PVOID pvCallbackContext,
__in ULONG ulLength _In_ ULONG ulLength
); );
typedef typedef
DWORD DWORD
(WINAPI *PFE_IMPORT_FUNC)( (WINAPI *PFE_IMPORT_FUNC)(
__out_bcount_part(*ulLength, *ulLength) PBYTE pbData, _Out_writes_bytes_to_(*ulLength, *ulLength) PBYTE pbData,
__in_opt PVOID pvCallbackContext, _In_opt_ PVOID pvCallbackContext,
__inout PULONG ulLength _Inout_ PULONG ulLength
); );
// //
// OpenRaw flag values // OpenRaw flag values
// //
#define CREATE_FOR_IMPORT (1) #define CREATE_FOR_IMPORT (1)
#define CREATE_FOR_DIR (2) #define CREATE_FOR_DIR (2)
#define OVERWRITE_HIDDEN (4) #define OVERWRITE_HIDDEN (4)
#define EFSRPC_SECURE_ONLY (8) #define EFSRPC_SECURE_ONLY (8)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
OpenEncryptedFileRawA( OpenEncryptedFileRawA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in ULONG ulFlags, _In_ ULONG ulFlags,
__deref_out PVOID *pvContext _Outptr_ PVOID *pvContext
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
OpenEncryptedFileRawW( OpenEncryptedFileRawW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in ULONG ulFlags, _In_ ULONG ulFlags,
__deref_out PVOID *pvContext _Outptr_ PVOID *pvContext
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenEncryptedFileRaw OpenEncryptedFileRawW #define OpenEncryptedFileRaw OpenEncryptedFileRawW
#else #else
#define OpenEncryptedFileRaw OpenEncryptedFileRawA #define OpenEncryptedFileRaw OpenEncryptedFileRawA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
ReadEncryptedFileRaw( ReadEncryptedFileRaw(
__in PFE_EXPORT_FUNC pfExportCallback, _In_ PFE_EXPORT_FUNC pfExportCallback,
__in_opt PVOID pvCallbackContext, _In_opt_ PVOID pvCallbackContext,
__in PVOID pvContext _In_ PVOID pvContext
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
WriteEncryptedFileRaw( WriteEncryptedFileRaw(
__in PFE_IMPORT_FUNC pfImportCallback, _In_ PFE_IMPORT_FUNC pfImportCallback,
__in_opt PVOID pvCallbackContext, _In_opt_ PVOID pvCallbackContext,
__in PVOID pvContext _In_ PVOID pvContext
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
CloseEncryptedFileRaw( CloseEncryptedFileRaw(
__in PVOID pvContext _In_ PVOID pvContext
); );
// //
// _l Compat Functions // _l Compat Functions
// //
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
lstrcmpA( lstrcmpA(
__in LPCSTR lpString1, _In_ LPCSTR lpString1,
__in LPCSTR lpString2 _In_ LPCSTR lpString2
); );
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
lstrcmpW( lstrcmpW(
__in LPCWSTR lpString1, _In_ LPCWSTR lpString1,
__in LPCWSTR lpString2 _In_ LPCWSTR lpString2
); );
#ifdef UNICODE #ifdef UNICODE
#define lstrcmp lstrcmpW #define lstrcmp lstrcmpW
#else #else
#define lstrcmp lstrcmpA #define lstrcmp lstrcmpA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
lstrcmpiA( lstrcmpiA(
__in LPCSTR lpString1, _In_ LPCSTR lpString1,
__in LPCSTR lpString2 _In_ LPCSTR lpString2
); );
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
lstrcmpiW( lstrcmpiW(
__in LPCWSTR lpString1, _In_ LPCWSTR lpString1,
__in LPCWSTR lpString2 _In_ LPCWSTR lpString2
); );
#ifdef UNICODE #ifdef UNICODE
#define lstrcmpi lstrcmpiW #define lstrcmpi lstrcmpiW
#else #else
#define lstrcmpi lstrcmpiA #define lstrcmpi lstrcmpiA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out _Check_return_
_Success_(return != NULL)
_Post_satisfies_(return == lpString1)
_Ret_maybenull_
LPSTR LPSTR
WINAPI WINAPI
lstrcpynA( lstrcpynA(
__out_ecount(iMaxLength) LPSTR lpString1, _Out_writes_(iMaxLength) LPSTR lpString1,
__in LPCSTR lpString2, _In_ LPCSTR lpString2,
__in int iMaxLength _In_ int iMaxLength
); );
WINBASEAPI WINBASEAPI
__out _Check_return_
_Success_(return != NULL)
_Post_satisfies_(return == lpString1)
_Ret_maybenull_
LPWSTR LPWSTR
WINAPI WINAPI
lstrcpynW( lstrcpynW(
__out_ecount(iMaxLength) LPWSTR lpString1, _Out_writes_(iMaxLength) LPWSTR lpString1,
__in LPCWSTR lpString2, _In_ LPCWSTR lpString2,
__in int iMaxLength _In_ int iMaxLength
); );
#ifdef UNICODE #ifdef UNICODE
#define lstrcpyn lstrcpynW #define lstrcpyn lstrcpynW
#else #else
#define lstrcpyn lstrcpynA #define lstrcpyn lstrcpynA
#endif // !UNICODE #endif // !UNICODE
#if defined(DEPRECATE_SUPPORTED) #if defined(DEPRECATE_SUPPORTED)
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4995) #pragma warning(disable:4995)
#endif #endif
WINBASEAPI WINBASEAPI
__out
LPSTR LPSTR
WINAPI WINAPI
lstrcpyA( lstrcpyA(
__out_z LPSTR lpString1, // deprecated: annotation is as good as it gets _Out_writes_(_String_length_(lpString2) + 1) LPSTR lpString1, // deprecated:
__in LPCSTR lpString2 annotation is as good as it gets
_In_ LPCSTR lpString2
); );
WINBASEAPI WINBASEAPI
__out
LPWSTR LPWSTR
WINAPI WINAPI
lstrcpyW( lstrcpyW(
__out_z LPWSTR lpString1, // deprecated: annotation is as good as it gets _Out_writes_(_String_length_(lpString2) + 1) LPWSTR lpString1, // deprecated
__in LPCWSTR lpString2 : annotation is as good as it gets
_In_ LPCWSTR lpString2
); );
#ifdef UNICODE #ifdef UNICODE
#define lstrcpy lstrcpyW #define lstrcpy lstrcpyW
#else #else
#define lstrcpy lstrcpyA #define lstrcpy lstrcpyA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out
LPSTR LPSTR
WINAPI WINAPI
lstrcatA( lstrcatA(
__inout LPSTR lpString1, _Inout_updates_z_(_String_length_(lpString1) + _String_length_(lpString2) +
__in LPCSTR lpString2 1) LPSTR lpString1, // deprecated: annotation is as good as it gets
_In_ LPCSTR lpString2
); );
WINBASEAPI WINBASEAPI
__out
LPWSTR LPWSTR
WINAPI WINAPI
lstrcatW( lstrcatW(
__inout LPWSTR lpString1, _Inout_updates_z_(_String_length_(lpString1) + _String_length_(lpString2) +
__in LPCWSTR lpString2 1) LPWSTR lpString1, // deprecated: annotation is as good as it gets
_In_ LPCWSTR lpString2
); );
#ifdef UNICODE #ifdef UNICODE
#define lstrcat lstrcatW #define lstrcat lstrcatW
#else #else
#define lstrcat lstrcatA #define lstrcat lstrcatA
#endif // !UNICODE #endif // !UNICODE
#if defined(DEPRECATE_SUPPORTED) #if defined(DEPRECATE_SUPPORTED)
#pragma warning(pop) #pragma warning(pop)
#endif #endif
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
lstrlenA( lstrlenA(
__in LPCSTR lpString _In_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
int int
WINAPI WINAPI
lstrlenW( lstrlenW(
__in LPCWSTR lpString _In_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define lstrlen lstrlenW #define lstrlen lstrlenW
#else #else
#define lstrlen lstrlenA #define lstrlen lstrlenA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
HFILE HFILE
WINAPI WINAPI
OpenFile( OpenFile(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__inout LPOFSTRUCT lpReOpenBuff, _Inout_ LPOFSTRUCT lpReOpenBuff,
__in UINT uStyle _In_ UINT uStyle
); );
WINBASEAPI WINBASEAPI
HFILE HFILE
WINAPI WINAPI
_lopen( _lopen(
__in LPCSTR lpPathName, _In_ LPCSTR lpPathName,
__in int iReadWrite _In_ int iReadWrite
); );
WINBASEAPI WINBASEAPI
HFILE HFILE
WINAPI WINAPI
_lcreat( _lcreat(
__in LPCSTR lpPathName, _In_ LPCSTR lpPathName,
__in int iAttribute _In_ int iAttribute
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
_lread( _lread(
__in HFILE hFile, _In_ HFILE hFile,
__out_bcount_part(uBytes, return) LPVOID lpBuffer, _Out_writes_bytes_to_(uBytes, return) LPVOID lpBuffer,
__in UINT uBytes _In_ UINT uBytes
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
_lwrite( _lwrite(
__in HFILE hFile, _In_ HFILE hFile,
__in_bcount(uBytes) LPCCH lpBuffer, _In_reads_bytes_(uBytes) LPCCH lpBuffer,
__in UINT uBytes _In_ UINT uBytes
); );
WINBASEAPI WINBASEAPI
long long
WINAPI WINAPI
_hread( _hread(
__in HFILE hFile, _In_ HFILE hFile,
__out_bcount_part(lBytes, return) LPVOID lpBuffer, _Out_writes_bytes_to_(lBytes, return) LPVOID lpBuffer,
__in long lBytes _In_ long lBytes
); );
WINBASEAPI WINBASEAPI
long long
WINAPI WINAPI
_hwrite( _hwrite(
__in HFILE hFile, _In_ HFILE hFile,
__in_bcount(lBytes) LPCCH lpBuffer, _In_reads_bytes_(lBytes) LPCCH lpBuffer,
__in long lBytes _In_ long lBytes
); );
WINBASEAPI WINBASEAPI
HFILE HFILE
WINAPI WINAPI
_lclose( _lclose(
__in HFILE hFile _In_ HFILE hFile
); );
WINBASEAPI WINBASEAPI
LONG LONG
WINAPI WINAPI
_llseek( _llseek(
__in HFILE hFile, _In_ HFILE hFile,
__in LONG lOffset, _In_ LONG lOffset,
__in int iOrigin _In_ int iOrigin
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
IsTextUnicode( IsTextUnicode(
__in_bcount(iSize) CONST VOID* lpv, _In_reads_bytes_(iSize) CONST VOID* lpv,
__in int iSize, _In_ int iSize,
__inout_opt LPINT lpiResult _Inout_opt_ LPINT lpiResult
);
#define FLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
WINBASEAPI
DWORD
WINAPI
FlsAlloc(
__in_opt PFLS_CALLBACK_FUNCTION lpCallback
);
WINBASEAPI
PVOID
WINAPI
FlsGetValue(
__in DWORD dwFlsIndex
);
WINBASEAPI
BOOL
WINAPI
FlsSetValue(
__in DWORD dwFlsIndex,
__in_opt PVOID lpFlsData
);
WINBASEAPI
BOOL
WINAPI
FlsFree(
__in DWORD dwFlsIndex
);
#define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
WINBASEAPI
DWORD
WINAPI
TlsAlloc(
VOID
);
WINBASEAPI
LPVOID
WINAPI
TlsGetValue(
__in DWORD dwTlsIndex
);
WINBASEAPI
BOOL
WINAPI
TlsSetValue(
__in DWORD dwTlsIndex,
__in_opt LPVOID lpTlsValue
);
WINBASEAPI
BOOL
WINAPI
TlsFree(
__in DWORD dwTlsIndex
);
typedef
VOID
(WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
__in DWORD dwErrorCode,
__in DWORD dwNumberOfBytesTransfered,
__inout LPOVERLAPPED lpOverlapped
);
WINBASEAPI
DWORD
WINAPI
SleepEx(
__in DWORD dwMilliseconds,
__in BOOL bAlertable
);
WINBASEAPI
DWORD
WINAPI
WaitForSingleObjectEx(
__in HANDLE hHandle,
__in DWORD dwMilliseconds,
__in BOOL bAlertable
);
WINBASEAPI
DWORD
WINAPI
WaitForMultipleObjectsEx(
__in DWORD nCount,
__in_ecount(nCount) CONST HANDLE *lpHandles,
__in BOOL bWaitAll,
__in DWORD dwMilliseconds,
__in BOOL bAlertable
); );
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SignalObjectAndWait( SignalObjectAndWait(
__in HANDLE hObjectToSignal, _In_ HANDLE hObjectToSignal,
__in HANDLE hObjectToWaitOn, _In_ HANDLE hObjectToWaitOn,
__in DWORD dwMilliseconds, _In_ DWORD dwMilliseconds,
__in BOOL bAlertable _In_ BOOL bAlertable
); );
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReadFileEx(
__in HANDLE hFile,
__out_bcount_opt(nNumberOfBytesToRead) __out_data_source(FILE) LPVOID lpBuff
er,
__in DWORD nNumberOfBytesToRead,
__inout LPOVERLAPPED lpOverlapped,
__in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
WINBASEAPI
BOOL
WINAPI
WriteFileEx(
__in HANDLE hFile,
__in_bcount_opt(nNumberOfBytesToWrite) LPCVOID lpBuffer,
__in DWORD nNumberOfBytesToWrite,
__inout LPOVERLAPPED lpOverlapped,
__in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
WINBASEAPI
BOOL
WINAPI
BackupRead( BackupRead(
__in HANDLE hFile, _In_ HANDLE hFile,
__out_bcount_part(nNumberOfBytesToRead, *lpNumberOfBytesRead) LPBYTE lpBuffe _Out_writes_bytes_to_(nNumberOfBytesToRead, *lpNumberOfBytesRead) LPBYTE lpB
r, uffer,
__in DWORD nNumberOfBytesToRead, _In_ DWORD nNumberOfBytesToRead,
__out LPDWORD lpNumberOfBytesRead, _Out_ LPDWORD lpNumberOfBytesRead,
__in BOOL bAbort, _In_ BOOL bAbort,
__in BOOL bProcessSecurity, _In_ BOOL bProcessSecurity,
__inout LPVOID *lpContext _Inout_ LPVOID *lpContext
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BackupSeek( BackupSeek(
__in HANDLE hFile, _In_ HANDLE hFile,
__in DWORD dwLowBytesToSeek, _In_ DWORD dwLowBytesToSeek,
__in DWORD dwHighBytesToSeek, _In_ DWORD dwHighBytesToSeek,
__out LPDWORD lpdwLowByteSeeked, _Out_ LPDWORD lpdwLowByteSeeked,
__out LPDWORD lpdwHighByteSeeked, _Out_ LPDWORD lpdwHighByteSeeked,
__inout LPVOID *lpContext _Inout_ LPVOID *lpContext
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BackupWrite( BackupWrite(
__in HANDLE hFile, _In_ HANDLE hFile,
__in_bcount(nNumberOfBytesToWrite) LPBYTE lpBuffer, _In_reads_bytes_(nNumberOfBytesToWrite) LPBYTE lpBuffer,
__in DWORD nNumberOfBytesToWrite, _In_ DWORD nNumberOfBytesToWrite,
__out LPDWORD lpNumberOfBytesWritten, _Out_ LPDWORD lpNumberOfBytesWritten,
__in BOOL bAbort, _In_ BOOL bAbort,
__in BOOL bProcessSecurity, _In_ BOOL bProcessSecurity,
__inout LPVOID *lpContext _Inout_ LPVOID *lpContext
); );
// //
// Stream id structure // Stream id structure
// //
typedef struct _WIN32_STREAM_ID { typedef struct _WIN32_STREAM_ID {
DWORD dwStreamId ; DWORD dwStreamId ;
DWORD dwStreamAttributes ; DWORD dwStreamAttributes ;
LARGE_INTEGER Size ; LARGE_INTEGER Size ;
DWORD dwStreamNameSize ; DWORD dwStreamNameSize ;
skipping to change at line 6456 skipping to change at line 2915
// //
// Stream Attributes // Stream Attributes
// //
#define STREAM_NORMAL_ATTRIBUTE 0x00000000 #define STREAM_NORMAL_ATTRIBUTE 0x00000000
#define STREAM_MODIFIED_WHEN_READ 0x00000001 #define STREAM_MODIFIED_WHEN_READ 0x00000001
#define STREAM_CONTAINS_SECURITY 0x00000002 #define STREAM_CONTAINS_SECURITY 0x00000002
#define STREAM_CONTAINS_PROPERTIES 0x00000004 #define STREAM_CONTAINS_PROPERTIES 0x00000004
#define STREAM_SPARSE_ATTRIBUTE 0x00000008 #define STREAM_SPARSE_ATTRIBUTE 0x00000008
WINBASEAPI
BOOL
WINAPI
ReadFileScatter(
__in HANDLE hFile,
__in FILE_SEGMENT_ELEMENT aSegmentArray[],
__in DWORD nNumberOfBytesToRead,
__reserved LPDWORD lpReserved,
__inout LPOVERLAPPED lpOverlapped
);
WINBASEAPI
BOOL
WINAPI
WriteFileGather(
__in HANDLE hFile,
__in FILE_SEGMENT_ELEMENT aSegmentArray[],
__in DWORD nNumberOfBytesToWrite,
__reserved LPDWORD lpReserved,
__inout LPOVERLAPPED lpOverlapped
);
// //
// Dual Mode API below this line. Dual Mode Structures also included. // Dual Mode API below this line. Dual Mode Structures also included.
// //
#define STARTF_USESHOWWINDOW 0x00000001 #define STARTF_USESHOWWINDOW 0x00000001
#define STARTF_USESIZE 0x00000002 #define STARTF_USESIZE 0x00000002
#define STARTF_USEPOSITION 0x00000004 #define STARTF_USEPOSITION 0x00000004
#define STARTF_USECOUNTCHARS 0x00000008 #define STARTF_USECOUNTCHARS 0x00000008
#define STARTF_USEFILLATTRIBUTE 0x00000010 #define STARTF_USEFILLATTRIBUTE 0x00000010
#define STARTF_RUNFULLSCREEN 0x00000020 // ignored for non-x86 platforms #define STARTF_RUNFULLSCREEN 0x00000020 // ignored for non-x86 platforms
#define STARTF_FORCEONFEEDBACK 0x00000040 #define STARTF_FORCEONFEEDBACK 0x00000040
#define STARTF_FORCEOFFFEEDBACK 0x00000080 #define STARTF_FORCEOFFFEEDBACK 0x00000080
#define STARTF_USESTDHANDLES 0x00000100 #define STARTF_USESTDHANDLES 0x00000100
#if(WINVER >= 0x0400) #if(WINVER >= 0x0400)
#define STARTF_USEHOTKEY 0x00000200 #define STARTF_USEHOTKEY 0x00000200
#define STARTF_TITLEISLINKNAME 0x00000800 #define STARTF_TITLEISLINKNAME 0x00000800
#define STARTF_TITLEISAPPID 0x00001000 #define STARTF_TITLEISAPPID 0x00001000
#define STARTF_PREVENTPINNING 0x00002000 #define STARTF_PREVENTPINNING 0x00002000
#endif /* WINVER >= 0x0400 */ #endif /* WINVER >= 0x0400 */
typedef struct _STARTUPINFOA {
DWORD cb;
LPSTR lpReserved;
LPSTR lpDesktop;
LPSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
LPBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFOA, *LPSTARTUPINFOA;
typedef struct _STARTUPINFOW {
DWORD cb;
LPWSTR lpReserved;
LPWSTR lpDesktop;
LPWSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
LPBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFOW, *LPSTARTUPINFOW;
#ifdef UNICODE
typedef STARTUPINFOW STARTUPINFO;
typedef LPSTARTUPINFOW LPSTARTUPINFO;
#else
typedef STARTUPINFOA STARTUPINFO;
typedef LPSTARTUPINFOA LPSTARTUPINFO;
#endif // UNICODE
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
typedef struct _STARTUPINFOEXA { typedef struct _STARTUPINFOEXA {
STARTUPINFOA StartupInfo; STARTUPINFOA StartupInfo;
LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList; LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList;
} STARTUPINFOEXA, *LPSTARTUPINFOEXA; } STARTUPINFOEXA, *LPSTARTUPINFOEXA;
typedef struct _STARTUPINFOEXW { typedef struct _STARTUPINFOEXW {
STARTUPINFOW StartupInfo; STARTUPINFOW StartupInfo;
LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList; LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList;
} STARTUPINFOEXW, *LPSTARTUPINFOEXW; } STARTUPINFOEXW, *LPSTARTUPINFOEXW;
skipping to change at line 6570 skipping to change at line 2959
typedef LPSTARTUPINFOEXW LPSTARTUPINFOEX; typedef LPSTARTUPINFOEXW LPSTARTUPINFOEX;
#else #else
typedef STARTUPINFOEXA STARTUPINFOEX; typedef STARTUPINFOEXA STARTUPINFOEX;
typedef LPSTARTUPINFOEXA LPSTARTUPINFOEX; typedef LPSTARTUPINFOEXA LPSTARTUPINFOEX;
#endif // UNICODE #endif // UNICODE
#endif // (_WIN32_WINNT >= 0x0600) #endif // (_WIN32_WINNT >= 0x0600)
#define SHUTDOWN_NORETRY 0x00000001 #define SHUTDOWN_NORETRY 0x00000001
typedef struct _WIN32_FIND_DATAA { #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
DWORD dwFileAttributes; #pragma endregion
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD dwReserved0;
DWORD dwReserved1;
CHAR cFileName[ MAX_PATH ];
CHAR cAlternateFileName[ 14 ];
#ifdef _MAC
DWORD dwFileType;
DWORD dwCreatorType;
WORD wFinderFlags;
#endif
} WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
typedef struct _WIN32_FIND_DATAW {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD dwReserved0;
DWORD dwReserved1;
WCHAR cFileName[ MAX_PATH ];
WCHAR cAlternateFileName[ 14 ];
#ifdef _MAC
DWORD dwFileType;
DWORD dwCreatorType;
WORD wFinderFlags;
#endif
} WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
#ifdef UNICODE
typedef WIN32_FIND_DATAW WIN32_FIND_DATA;
typedef PWIN32_FIND_DATAW PWIN32_FIND_DATA;
typedef LPWIN32_FIND_DATAW LPWIN32_FIND_DATA;
#else
typedef WIN32_FIND_DATAA WIN32_FIND_DATA;
typedef PWIN32_FIND_DATAA PWIN32_FIND_DATA;
typedef LPWIN32_FIND_DATAA LPWIN32_FIND_DATA;
#endif // UNICODE
typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
//
// Synchronization APIs
//
WINBASEAPI #pragma region Desktop Family
__out_opt #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
HANDLE
WINAPI
CreateMutexA(
__in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes,
__in BOOL bInitialOwner,
__in_opt LPCSTR lpName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateMutexW(
__in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes,
__in BOOL bInitialOwner,
__in_opt LPCWSTR lpName
);
#ifdef UNICODE
#define CreateMutex CreateMutexW
#else
#define CreateMutex CreateMutexA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
OpenMutexA( OpenMutexA(
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in BOOL bInheritHandle, _In_ BOOL bInheritHandle,
__in LPCSTR lpName _In_ LPCSTR lpName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenMutexW(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in LPCWSTR lpName
); );
#ifdef UNICODE #ifndef UNICODE
#define OpenMutex OpenMutexW
#else
#define OpenMutex OpenMutexA #define OpenMutex OpenMutexA
#endif // !UNICODE #endif
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateEventA(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in BOOL bManualReset,
__in BOOL bInitialState,
__in_opt LPCSTR lpName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateEventW(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in BOOL bManualReset,
__in BOOL bInitialState,
__in_opt LPCWSTR lpName
);
#ifdef UNICODE
#define CreateEvent CreateEventW
#else
#define CreateEvent CreateEventA
#endif // !UNICODE
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenEventA(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in LPCSTR lpName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenEventW(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in LPCWSTR lpName
);
#ifdef UNICODE
#define OpenEvent OpenEventW
#else
#define OpenEvent OpenEventA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateSemaphoreA( CreateSemaphoreA(
__in_opt LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
__in LONG lInitialCount, _In_ LONG lInitialCount,
__in LONG lMaximumCount, _In_ LONG lMaximumCount,
__in_opt LPCSTR lpName _In_opt_ LPCSTR lpName
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateSemaphoreW( CreateSemaphoreW(
__in_opt LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
__in LONG lInitialCount, _In_ LONG lInitialCount,
__in LONG lMaximumCount, _In_ LONG lMaximumCount,
__in_opt LPCWSTR lpName _In_opt_ LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateSemaphore CreateSemaphoreW #define CreateSemaphore CreateSemaphoreW
#else #else
#define CreateSemaphore CreateSemaphoreA #define CreateSemaphore CreateSemaphoreA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
OpenSemaphoreA( OpenSemaphoreA(
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in BOOL bInheritHandle, _In_ BOOL bInheritHandle,
__in LPCSTR lpName _In_ LPCSTR lpName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenSemaphoreW(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in LPCWSTR lpName
); );
#ifdef UNICODE #ifndef UNICODE
#define OpenSemaphore OpenSemaphoreW
#else
#define OpenSemaphore OpenSemaphoreA #define OpenSemaphore OpenSemaphoreA
#endif // !UNICODE #endif
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
typedef
VOID
(APIENTRY *PTIMERAPCROUTINE)(
__in_opt LPVOID lpArgToCompletionRoutine,
__in DWORD dwTimerLowValue,
__in DWORD dwTimerHighValue
);
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateWaitableTimerA( CreateWaitableTimerA(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in BOOL bManualReset, _In_ BOOL bManualReset,
__in_opt LPCSTR lpTimerName _In_opt_ LPCSTR lpTimerName
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateWaitableTimerW( CreateWaitableTimerW(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in BOOL bManualReset, _In_ BOOL bManualReset,
__in_opt LPCWSTR lpTimerName _In_opt_ LPCWSTR lpTimerName
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateWaitableTimer CreateWaitableTimerW #define CreateWaitableTimer CreateWaitableTimerW
#else #else
#define CreateWaitableTimer CreateWaitableTimerA #define CreateWaitableTimer CreateWaitableTimerA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
OpenWaitableTimerA( OpenWaitableTimerA(
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in BOOL bInheritHandle, _In_ BOOL bInheritHandle,
__in LPCSTR lpTimerName _In_ LPCSTR lpTimerName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenWaitableTimerW(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in LPCWSTR lpTimerName
); );
#ifdef UNICODE #ifndef UNICODE
#define OpenWaitableTimer OpenWaitableTimerW
#else
#define OpenWaitableTimer OpenWaitableTimerA #define OpenWaitableTimer OpenWaitableTimerA
#endif // !UNICODE #endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
BOOL
WINAPI
SetWaitableTimerEx(
__in HANDLE hTimer,
__in const LARGE_INTEGER *lpDueTime,
__in LONG lPeriod,
__in_opt PTIMERAPCROUTINE pfnCompletionRoutine,
__in_opt LPVOID lpArgToCompletionRoutine,
__in_opt PREASON_CONTEXT WakeContext,
__in ULONG TolerableDelay
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
WINBASEAPI
BOOL
WINAPI
SetWaitableTimer(
__in HANDLE hTimer,
__in const LARGE_INTEGER *lpDueTime,
__in LONG lPeriod,
__in_opt PTIMERAPCROUTINE pfnCompletionRoutine,
__in_opt LPVOID lpArgToCompletionRoutine,
__in BOOL fResume
);
WINBASEAPI
BOOL
WINAPI
CancelWaitableTimer(
__in HANDLE hTimer
);
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
#define CREATE_MUTEX_INITIAL_OWNER 0x00000001
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateMutexExA(
__in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes,
__in_opt LPCSTR lpName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateMutexExW(
__in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes,
__in_opt LPCWSTR lpName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
);
#ifdef UNICODE
#define CreateMutexEx CreateMutexExW
#else
#define CreateMutexEx CreateMutexExA
#endif // !UNICODE
#define CREATE_EVENT_MANUAL_RESET 0x00000001
#define CREATE_EVENT_INITIAL_SET 0x00000002
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateEventExA(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in_opt LPCSTR lpName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateEventExW(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in_opt LPCWSTR lpName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
);
#ifdef UNICODE
#define CreateEventEx CreateEventExW
#else
#define CreateEventEx CreateEventExA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateSemaphoreExA( CreateSemaphoreExA(
__in_opt LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
__in LONG lInitialCount, _In_ LONG lInitialCount,
__in LONG lMaximumCount, _In_ LONG lMaximumCount,
__in_opt LPCSTR lpName, _In_opt_ LPCSTR lpName,
__reserved DWORD dwFlags, _Reserved_ DWORD dwFlags,
__in DWORD dwDesiredAccess _In_ DWORD dwDesiredAccess
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateSemaphoreExW(
__in_opt LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
__in LONG lInitialCount,
__in LONG lMaximumCount,
__in_opt LPCWSTR lpName,
__reserved DWORD dwFlags,
__in DWORD dwDesiredAccess
); );
#ifdef UNICODE #ifndef UNICODE
#define CreateSemaphoreEx CreateSemaphoreExW
#else
#define CreateSemaphoreEx CreateSemaphoreExA #define CreateSemaphoreEx CreateSemaphoreExA
#endif // !UNICODE #endif
#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateWaitableTimerExA( CreateWaitableTimerExA(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in_opt LPCSTR lpTimerName, _In_opt_ LPCSTR lpTimerName,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwDesiredAccess _In_ DWORD dwDesiredAccess
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateWaitableTimerExW(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in_opt LPCWSTR lpTimerName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
); );
#ifdef UNICODE #ifndef UNICODE
#define CreateWaitableTimerEx CreateWaitableTimerExW
#else
#define CreateWaitableTimerEx CreateWaitableTimerExA #define CreateWaitableTimerEx CreateWaitableTimerExA
#endif // !UNICODE #endif
#endif /* (_WIN32_WINNT >= 0x0600) */ #endif /* (_WIN32_WINNT >= 0x0600) */
#endif /* (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) */ #endif /* (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) */
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateFileMappingA( CreateFileMappingA(
__in HANDLE hFile, _In_ HANDLE hFile,
__in_opt LPSECURITY_ATTRIBUTES lpFileMappingAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
__in DWORD flProtect, _In_ DWORD flProtect,
__in DWORD dwMaximumSizeHigh, _In_ DWORD dwMaximumSizeHigh,
__in DWORD dwMaximumSizeLow, _In_ DWORD dwMaximumSizeLow,
__in_opt LPCSTR lpName _In_opt_ LPCSTR lpName
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateFileMappingW(
__in HANDLE hFile,
__in_opt LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
__in DWORD flProtect,
__in DWORD dwMaximumSizeHigh,
__in DWORD dwMaximumSizeLow,
__in_opt LPCWSTR lpName
); );
#ifdef UNICODE #ifndef UNICODE
#define CreateFileMapping CreateFileMappingW
#else
#define CreateFileMapping CreateFileMappingA #define CreateFileMapping CreateFileMappingA
#endif // !UNICODE #endif
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateFileMappingNumaA( CreateFileMappingNumaA(
__in HANDLE hFile, _In_ HANDLE hFile,
__in_opt LPSECURITY_ATTRIBUTES lpFileMappingAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
__in DWORD flProtect, _In_ DWORD flProtect,
__in DWORD dwMaximumSizeHigh, _In_ DWORD dwMaximumSizeHigh,
__in DWORD dwMaximumSizeLow, _In_ DWORD dwMaximumSizeLow,
__in_opt LPCSTR lpName, _In_opt_ LPCSTR lpName,
__in DWORD nndPreferred _In_ DWORD nndPreferred
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateFileMappingNumaW(
__in HANDLE hFile,
__in_opt LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
__in DWORD flProtect,
__in DWORD dwMaximumSizeHigh,
__in DWORD dwMaximumSizeLow,
__in_opt LPCWSTR lpName,
__in DWORD nndPreferred
); );
#ifdef UNICODE
#define CreateFileMappingNuma CreateFileMappingNumaW #ifndef UNICODE
#else
#define CreateFileMappingNuma CreateFileMappingNumaA #define CreateFileMappingNuma CreateFileMappingNumaA
#endif // !UNICODE #endif
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenFileMappingA( OpenFileMappingA(
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in BOOL bInheritHandle, _In_ BOOL bInheritHandle,
__in LPCSTR lpName _In_ LPCSTR lpName
);
WINBASEAPI
__out
HANDLE
WINAPI
OpenFileMappingW(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in LPCWSTR lpName
); );
#ifdef UNICODE #ifndef UNICODE
#define OpenFileMapping OpenFileMappingW
#else
#define OpenFileMapping OpenFileMappingA #define OpenFileMapping OpenFileMappingA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return <= nBufferLength)
DWORD DWORD
WINAPI WINAPI
GetLogicalDriveStringsA( GetLogicalDriveStringsA(
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer
);
WINBASEAPI
DWORD
WINAPI
GetLogicalDriveStringsW(
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer
); );
#ifdef UNICODE #ifndef UNICODE
#define GetLogicalDriveStrings GetLogicalDriveStringsW
#else
#define GetLogicalDriveStrings GetLogicalDriveStringsA #define GetLogicalDriveStrings GetLogicalDriveStringsA
#endif // !UNICODE #endif
#if _WIN32_WINNT >= 0x0501
typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE {
LowMemoryResourceNotification,
HighMemoryResourceNotification
} MEMORY_RESOURCE_NOTIFICATION_TYPE;
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateMemoryResourceNotification(
__in MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType
);
WINBASEAPI
BOOL
WINAPI
QueryMemoryResourceNotification(
__in HANDLE ResourceNotificationHandle,
__out PBOOL ResourceState
);
#endif // _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HMODULE HMODULE
WINAPI WINAPI
LoadLibraryA( LoadLibraryA(
__in LPCSTR lpLibFileName _In_ LPCSTR lpLibFileName
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HMODULE HMODULE
WINAPI WINAPI
LoadLibraryW( LoadLibraryW(
__in LPCWSTR lpLibFileName _In_ LPCWSTR lpLibFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define LoadLibrary LoadLibraryW #define LoadLibrary LoadLibraryW
#else #else
#define LoadLibrary LoadLibraryA #define LoadLibrary LoadLibraryA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
__out_opt #pragma endregion
HMODULE
WINAPI
LoadLibraryExA(
__in LPCSTR lpLibFileName,
__reserved HANDLE hFile,
__in DWORD dwFlags
);
WINBASEAPI
__out_opt
HMODULE
WINAPI
LoadLibraryExW(
__in LPCWSTR lpLibFileName,
__reserved HANDLE hFile,
__in DWORD dwFlags
);
#ifdef UNICODE
#define LoadLibraryEx LoadLibraryExW
#else
#define LoadLibraryEx LoadLibraryExA
#endif // !UNICODE
#define DONT_RESOLVE_DLL_REFERENCES 0x00000001 #pragma region Application Family
#define LOAD_LIBRARY_AS_DATAFILE 0x00000002 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x00000020
#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x00000040
#define LOAD_LIBRARY_REQUIRE_SIGNED_TARGET 0x00000080
WINBASEAPI #if (_WIN32_WINNT >= 0x0602)
DWORD
WINAPI
GetModuleFileNameA(
__in_opt HMODULE hModule,
__out_ecount_part(nSize, return + 1) LPSTR lpFilename,
__in DWORD nSize
);
WINBASEAPI
DWORD
WINAPI
GetModuleFileNameW(
__in_opt HMODULE hModule,
__out_ecount_part(nSize, return + 1) LPWSTR lpFilename,
__in DWORD nSize
);
#ifdef UNICODE
#define GetModuleFileName GetModuleFileNameW
#else
#define GetModuleFileName GetModuleFileNameA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HMODULE
WINAPI
GetModuleHandleA(
__in_opt LPCSTR lpModuleName
);
WINBASEAPI
__out_opt
HMODULE HMODULE
WINAPI WINAPI
GetModuleHandleW( LoadPackagedLibrary (
__in_opt LPCWSTR lpModuleName _In_ LPCWSTR lpwLibFileName,
); _Reserved_ DWORD Reserved
#ifdef UNICODE
#define GetModuleHandle GetModuleHandleW
#else
#define GetModuleHandle GetModuleHandleA
#endif // !UNICODE
#if !defined(RC_INVOKED)
#if _WIN32_WINNT > 0x0500 || defined(WINBASE_DECLARE_GET_MODULE_HANDLE_EX) || IS
OLATION_AWARE_ENABLED
#define GET_MODULE_HANDLE_EX_FLAG_PIN (0x00000001)
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x00000002)
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x00000004)
typedef
BOOL
(WINAPI*
PGET_MODULE_HANDLE_EXA)(
__in DWORD dwFlags,
__in_opt LPCSTR lpModuleName,
__deref_out HMODULE* phModule
);
typedef
BOOL
(WINAPI*
PGET_MODULE_HANDLE_EXW)(
__in DWORD dwFlags,
__in_opt LPCWSTR lpModuleName,
__deref_out HMODULE* phModule
);
#ifdef UNICODE
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXW
#else
#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
GetModuleHandleExA(
__in DWORD dwFlags,
__in_opt LPCSTR lpModuleName,
__out HMODULE* phModule
);
WINBASEAPI
BOOL
WINAPI
GetModuleHandleExW(
__in DWORD dwFlags,
__in_opt LPCWSTR lpModuleName,
__out HMODULE* phModule
); );
#ifdef UNICODE
#define GetModuleHandleEx GetModuleHandleExW
#else
#define GetModuleHandleEx GetModuleHandleExA
#endif // !UNICODE
#endif
#endif
#if _WIN32_WINNT >= 0x0502 #endif // _WIN32_WINNT >= 0x0602
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
BOOL #pragma endregion
WINAPI
NeedCurrentDirectoryForExePathA(
__in LPCSTR ExeName
);
WINBASEAPI
BOOL
WINAPI
NeedCurrentDirectoryForExePathW(
__in LPCWSTR ExeName
);
#ifdef UNICODE
#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW
#else
#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA
#endif // !UNICODE
#endif #pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if _WIN32_WINNT >= 0x0600 #if (_WIN32_WINNT >= 0x0600)
#define PROCESS_NAME_NATIVE 0x00000001 #define PROCESS_NAME_NATIVE 0x00000001
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryFullProcessImageNameA( QueryFullProcessImageNameA(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_ecount_part(*lpdwSize, *lpdwSize) LPSTR lpExeName, _Out_writes_to_(*lpdwSize, *lpdwSize) LPSTR lpExeName,
__inout PDWORD lpdwSize _Inout_ PDWORD lpdwSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryFullProcessImageNameW( QueryFullProcessImageNameW(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_ecount_part(*lpdwSize, *lpdwSize) LPWSTR lpExeName, _Out_writes_to_(*lpdwSize, *lpdwSize) LPWSTR lpExeName,
__inout PDWORD lpdwSize _Inout_ PDWORD lpdwSize
); );
#ifdef UNICODE #ifdef UNICODE
#define QueryFullProcessImageName QueryFullProcessImageNameW #define QueryFullProcessImageName QueryFullProcessImageNameW
#else #else
#define QueryFullProcessImageName QueryFullProcessImageNameA #define QueryFullProcessImageName QueryFullProcessImageNameA
#endif // !UNICODE #endif // !UNICODE
#endif #endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
// //
// Extended process and thread attribute support // Extended process and thread attribute support
// //
#define PROC_THREAD_ATTRIBUTE_NUMBER 0x0000FFFF #define PROC_THREAD_ATTRIBUTE_NUMBER 0x0000FFFF
#define PROC_THREAD_ATTRIBUTE_THREAD 0x00010000 // Attribute may be used wit h thread creation #define PROC_THREAD_ATTRIBUTE_THREAD 0x00010000 // Attribute may be used wit h thread creation
#define PROC_THREAD_ATTRIBUTE_INPUT 0x00020000 // Attribute is input only #define PROC_THREAD_ATTRIBUTE_INPUT 0x00020000 // Attribute is input only
#define PROC_THREAD_ATTRIBUTE_ADDITIVE 0x00040000 // Attribute may be "accumul ated," e.g. bitmasks, counters, etc. #define PROC_THREAD_ATTRIBUTE_ADDITIVE 0x00040000 // Attribute may be "accumul ated," e.g. bitmasks, counters, etc.
#define PROTECTION_LEVEL_SAME 0xFFFFFFFF
#ifndef _USE_FULL_PROC_THREAD_ATTRIBUTE
typedef enum _PROC_THREAD_ATTRIBUTE_NUM { typedef enum _PROC_THREAD_ATTRIBUTE_NUM {
ProcThreadAttributeParentProcess = 0, ProcThreadAttributeParentProcess = 0,
ProcThreadAttributeExtendedFlags, ProcThreadAttributeHandleList = 2,
ProcThreadAttributeHandleList, #if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
ProcThreadAttributeGroupAffinity, ProcThreadAttributeGroupAffinity = 3,
ProcThreadAttributePreferredNode, ProcThreadAttributePreferredNode = 4,
ProcThreadAttributeIdealProcessor, ProcThreadAttributeIdealProcessor = 5,
ProcThreadAttributeUmsThread, ProcThreadAttributeUmsThread = 6,
ProcThreadAttributeMitigationPolicy, ProcThreadAttributeMitigationPolicy = 7,
ProcThreadAttributeMax #endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ProcThreadAttributeSecurityCapabilities = 9,
#endif
ProcThreadAttributeProtectionLevel = 11,
} PROC_THREAD_ATTRIBUTE_NUM; } PROC_THREAD_ATTRIBUTE_NUM;
#endif
#define ProcThreadAttributeValue(Number, Thread, Input, Additive) \ #define ProcThreadAttributeValue(Number, Thread, Input, Additive) \
(((Number) & PROC_THREAD_ATTRIBUTE_NUMBER) | \ (((Number) & PROC_THREAD_ATTRIBUTE_NUMBER) | \
((Thread != FALSE) ? PROC_THREAD_ATTRIBUTE_THREAD : 0) | \ ((Thread != FALSE) ? PROC_THREAD_ATTRIBUTE_THREAD : 0) | \
((Input != FALSE) ? PROC_THREAD_ATTRIBUTE_INPUT : 0) | \ ((Input != FALSE) ? PROC_THREAD_ATTRIBUTE_INPUT : 0) | \
((Additive != FALSE) ? PROC_THREAD_ATTRIBUTE_ADDITIVE : 0)) ((Additive != FALSE) ? PROC_THREAD_ATTRIBUTE_ADDITIVE : 0))
#define PROC_THREAD_ATTRIBUTE_PARENT_PROCESS \ #define PROC_THREAD_ATTRIBUTE_PARENT_PROCESS \
ProcThreadAttributeValue (ProcThreadAttributeParentProcess, FALSE, TRUE, FAL SE) ProcThreadAttributeValue (ProcThreadAttributeParentProcess, FALSE, TRUE, FAL SE)
#define PROC_THREAD_ATTRIBUTE_EXTENDED_FLAGS \
ProcThreadAttributeValue (ProcThreadAttributeExtendedFlags, FALSE, TRUE, TRU
E)
#define PROC_THREAD_ATTRIBUTE_HANDLE_LIST \ #define PROC_THREAD_ATTRIBUTE_HANDLE_LIST \
ProcThreadAttributeValue (ProcThreadAttributeHandleList, FALSE, TRUE, FALSE) ProcThreadAttributeValue (ProcThreadAttributeHandleList, FALSE, TRUE, FALSE)
#endif // (_WIN32_WINNT >= 0x0600)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY \ #define PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY \
ProcThreadAttributeValue (ProcThreadAttributeGroupAffinity, TRUE, TRUE, FALS E) ProcThreadAttributeValue (ProcThreadAttributeGroupAffinity, TRUE, TRUE, FALS E)
#define PROC_THREAD_ATTRIBUTE_PREFERRED_NODE \ #define PROC_THREAD_ATTRIBUTE_PREFERRED_NODE \
ProcThreadAttributeValue (ProcThreadAttributePreferredNode, FALSE, TRUE, FAL SE) ProcThreadAttributeValue (ProcThreadAttributePreferredNode, FALSE, TRUE, FAL SE)
#define PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR \ #define PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR \
ProcThreadAttributeValue (ProcThreadAttributeIdealProcessor, TRUE, TRUE, FAL SE) ProcThreadAttributeValue (ProcThreadAttributeIdealProcessor, TRUE, TRUE, FAL SE)
#define PROC_THREAD_ATTRIBUTE_UMS_THREAD \ #define PROC_THREAD_ATTRIBUTE_UMS_THREAD \
ProcThreadAttributeValue (ProcThreadAttributeUmsThread, TRUE, TRUE, FALSE) ProcThreadAttributeValue (ProcThreadAttributeUmsThread, TRUE, TRUE, FALSE)
#define PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY \ #define PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY \
ProcThreadAttributeValue (ProcThreadAttributeMitigationPolicy, FALSE, TRUE, FALSE) ProcThreadAttributeValue (ProcThreadAttributeMitigationPolicy, FALSE, TRUE, FALSE)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES \
ProcThreadAttributeValue (ProcThreadAttributeSecurityCapabilities, FALSE, TR
UE, FALSE)
#endif
#define PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL \
ProcThreadAttributeValue (ProcThreadAttributeProtectionLevel, FALSE, TRUE, F
ALSE)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
//
// Define legacy creation mitigation policy options, which are straight
// bitmasks. Bits 0-5 are legacy bits.
//
#define PROCESS_CREATION_MITIGATION_POLICY_DEP_ENABLE 0x01 #define PROCESS_CREATION_MITIGATION_POLICY_DEP_ENABLE 0x01
#define PROCESS_CREATION_MITIGATION_POLICY_DEP_ATL_THUNK_ENABLE 0x02 #define PROCESS_CREATION_MITIGATION_POLICY_DEP_ATL_THUNK_ENABLE 0x02
#define PROCESS_CREATION_MITIGATION_POLICY_SEHOP_ENABLE 0x04 #define PROCESS_CREATION_MITIGATION_POLICY_SEHOP_ENABLE 0x04
#endif
WINBASEAPI #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
BOOL //
WINAPI // Define mandatory ASLR options. Mandatory ASLR forcibly rebases images that
InitializeProcThreadAttributeList( // are not dynamic base compatible by acting as though there were an image base
__out_xcount_opt(*lpSize) LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList, // collision at load time.
__in DWORD dwAttributeCount, //
__reserved DWORD dwFlags, // Note that 'require relocations' mode refuses load of images that do not have
__inout PSIZE_T lpSize // a base relocation section.
); //
WINBASEAPI #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_MASK
VOID (0x00000003 << 8)
WINAPI #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_DEFER
DeleteProcThreadAttributeList( (0x00000000 << 8)
__inout LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList #define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_ON
); (0x00000001 << 8)
#define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_OFF
(0x00000002 << 8)
#define PROCESS_CREATION_MITIGATION_POLICY_FORCE_RELOCATE_IMAGES_ALWAYS_ON_REQ_R
ELOCS (0x00000003 << 8)
#define PROC_THREAD_ATTRIBUTE_REPLACE_VALUE 0x00000001 //
// Define heap terminate on corruption options. Note that 'always off' does
// not override the default opt-in for binaries with current subsystem versions
// set in the image header.
//
// Heap terminate on corruption is user mode enforced.
//
WINBASEAPI #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_MASK
BOOL (0x00000003 << 12)
WINAPI #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_DEFER
UpdateProcThreadAttribute( (0x00000000 << 12)
__inout LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList, #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_ALWAYS_ON
__in DWORD dwFlags, (0x00000001 << 12)
__in DWORD_PTR Attribute, #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_ALWAYS_OFF
__in_bcount_opt(cbSize) PVOID lpValue, (0x00000002 << 12)
__in SIZE_T cbSize, #define PROCESS_CREATION_MITIGATION_POLICY_HEAP_TERMINATE_RESERVED
__out_bcount_opt(cbSize) PVOID lpPreviousValue, (0x00000003 << 12)
__in_opt PSIZE_T lpReturnSize
);
#endif // (_WIN32_WINNT >= 0x0600) //
// Define bottom up randomization (includes stack randomization) options,
// i.e. randomization of the lowest user address.
//
WINBASEAPI #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_MASK
BOOL (0x00000003 << 16)
WINAPI #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_DEFER
CreateProcessA( (0x00000000 << 16)
__in_opt LPCSTR lpApplicationName, #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_ALWAYS_ON
__inout_opt LPSTR lpCommandLine, (0x00000001 << 16)
__in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_ALWAYS_OFF
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, (0x00000002 << 16)
__in BOOL bInheritHandles, #define PROCESS_CREATION_MITIGATION_POLICY_BOTTOM_UP_ASLR_RESERVED
__in DWORD dwCreationFlags, (0x00000003 << 16)
__in_opt LPVOID lpEnvironment,
__in_opt LPCSTR lpCurrentDirectory,
__in LPSTARTUPINFOA lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation
);
WINBASEAPI
BOOL
WINAPI
CreateProcessW(
__in_opt LPCWSTR lpApplicationName,
__inout_opt LPWSTR lpCommandLine,
__in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in BOOL bInheritHandles,
__in DWORD dwCreationFlags,
__in_opt LPVOID lpEnvironment,
__in_opt LPCWSTR lpCurrentDirectory,
__in LPSTARTUPINFOW lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation
);
#ifdef UNICODE
#define CreateProcess CreateProcessW
#else
#define CreateProcess CreateProcessA
#endif // !UNICODE
WINBASEAPI //
BOOL // Define high entropy bottom up randomization. Note that high entropy bottom
WINAPI // up randomization is effective if and only if bottom up ASLR is also enabled.
SetProcessShutdownParameters( //
__in DWORD dwLevel, // N.B. High entropy mode is only meaningful for native 64-bit processes. in
__in DWORD dwFlags // high entropy mode, up to 1TB of bottom up variance is enabled.
); //
#define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_MASK
(0x00000003 << 20)
#define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_DEFER
(0x00000000 << 20)
#define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_ALWAYS_ON
(0x00000001 << 20)
#define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_ALWAYS_OFF
(0x00000002 << 20)
#define PROCESS_CREATION_MITIGATION_POLICY_HIGH_ENTROPY_ASLR_RESERVED
(0x00000003 << 20)
//
// Define handle checking enforcement options. Handle checking enforcement
// causes an exception to be raised immediately on a bad handle reference,
// versus simply returning a failure status from the handle reference.
//
#define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_MASK
(0x00000003 << 24)
#define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_DEFER
(0x00000000 << 24)
#define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_ALWAYS_ON
(0x00000001 << 24)
#define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_ALWAYS_OFF
(0x00000002 << 24)
#define PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_RESERVED
(0x00000003 << 24)
//
// Define win32k system call disable options. Win32k system call disable
// prevents a process from making Win32k calls.
//
#define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_MASK
(0x00000003 << 28)
#define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_DEFER
(0x00000000 << 28)
#define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_ON
(0x00000001 << 28)
#define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_ALWAYS_OFF
(0x00000002 << 28)
#define PROCESS_CREATION_MITIGATION_POLICY_WIN32K_SYSTEM_CALL_DISABLE_RESERVED
(0x00000003 << 28)
//
// Define the extension point disable options. Extension point disable allows
// a process to opt-out of loading various arbitrary extension point DLLs.
//
#define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_MASK
(0x00000003ui64 << 32)
#define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_DEFER
(0x00000000ui64 << 32)
#define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_ALWAYS_ON
(0x00000001ui64 << 32)
#define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_ALWAYS_OFF
(0x00000002ui64 << 32)
#define PROCESS_CREATION_MITIGATION_POLICY_EXTENSION_POINT_DISABLE_RESERVED
(0x00000003ui64 << 32)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
//
// Define dynamic code options.
//
#define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_MASK
(0x00000003ui64 << 36)
#define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_DEFER
(0x00000000ui64 << 36)
#define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_ON
(0x00000001ui64 << 36)
#define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_ALWAYS_OFF
(0x00000002ui64 << 36)
#define PROCESS_CREATION_MITIGATION_POLICY_PROHIBIT_DYNAMIC_CODE_RESERVED
(0x00000003ui64 << 36)
//
// Define module signature options. When enabled, this option will
// block mapping of non-microsoft binaries.
//
#define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_MASK
(0x00000003ui64 << 44)
#define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_DEFER
(0x00000000ui64 << 44)
#define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_O
N (0x00000001ui64 << 44)
#define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_O
FF (0x00000002ui64 << 44)
#define PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_RESERVED
(0x00000003ui64 << 44)
#endif // _WIN32_WINNT_WINBLUE
#endif // _WIN32_WINNT_WIN8
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetProcessShutdownParameters( GetProcessShutdownParameters(
__out LPDWORD lpdwLevel, _Out_ LPDWORD lpdwLevel,
__out LPDWORD lpdwFlags _Out_ LPDWORD lpdwFlags
);
WINBASEAPI
DWORD
WINAPI
GetProcessVersion(
__in DWORD ProcessId
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
FatalAppExitA( FatalAppExitA(
__in UINT uAction, _In_ UINT uAction,
__in LPCSTR lpMessageText _In_ LPCSTR lpMessageText
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
FatalAppExitW( FatalAppExitW(
__in UINT uAction, _In_ UINT uAction,
__in LPCWSTR lpMessageText _In_ LPCWSTR lpMessageText
); );
#ifdef UNICODE #ifdef UNICODE
#define FatalAppExit FatalAppExitW #define FatalAppExit FatalAppExitW
#else #else
#define FatalAppExit FatalAppExitA #define FatalAppExit FatalAppExitA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
GetStartupInfoA( GetStartupInfoA(
__out LPSTARTUPINFOA lpStartupInfo _Out_ LPSTARTUPINFOA lpStartupInfo
);
WINBASEAPI
VOID
WINAPI
GetStartupInfoW(
__out LPSTARTUPINFOW lpStartupInfo
); );
#ifdef UNICODE #ifndef UNICODE
#define GetStartupInfo GetStartupInfoW
#else
#define GetStartupInfo GetStartupInfoA #define GetStartupInfo GetStartupInfoA
#endif // !UNICODE #endif
WINBASEAPI
__out
LPSTR
WINAPI
GetCommandLineA(
VOID
);
WINBASEAPI
__out
LPWSTR
WINAPI
GetCommandLineW(
VOID
);
#ifdef UNICODE
#define GetCommandLine GetCommandLineW
#else
#define GetCommandLine GetCommandLineA
#endif // !UNICODE
WINBASEAPI
__success(return < nSize)
__success(return != 0)
DWORD
WINAPI
GetEnvironmentVariableA(
__in_opt LPCSTR lpName,
__out_ecount_part_opt(nSize, return + 1) LPSTR lpBuffer,
__in DWORD nSize
);
WINBASEAPI
__success(return < nSize)
__success(return != 0)
DWORD
WINAPI
GetEnvironmentVariableW(
__in_opt LPCWSTR lpName,
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpBuffer,
__in DWORD nSize
);
#ifdef UNICODE
#define GetEnvironmentVariable GetEnvironmentVariableW
#else
#define GetEnvironmentVariable GetEnvironmentVariableA
#endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetEnvironmentVariable #undef GetEnvironmentVariable
#if _MSC_VER >= 1400
#pragma warning(push)
#pragma warning(disable: 6103)
#endif _MSC_VER >= 1400 /* _MSC_VER >= 1400 */
_Success_(return != 0 && return < nSize)
__inline __inline
DWORD DWORD
GetEnvironmentVariable( GetEnvironmentVariable(
__in_opt LPCTSTR lpName, _In_opt_ LPCTSTR lpName,
__out_ecount_part_opt(nSize, return + 1) LPTSTR lpBuffer, _Out_writes_to_opt_(nSize, return + 1) LPTSTR lpBuffer,
__in DWORD nSize _In_ DWORD nSize
) )
{ {
#ifdef UNICODE #ifdef UNICODE
return GetEnvironmentVariableW( return GetEnvironmentVariableW(
#else #else
return GetEnvironmentVariableA( return GetEnvironmentVariableA(
#endif #endif
lpName, lpName,
lpBuffer, lpBuffer,
nSize nSize
); );
} }
#endif /* _M_CEE */
WINBASEAPI #if _MSC_VER >= 1400
BOOL #pragma warning(pop)
WINAPI #endif _MSC_VER >= 1400 /* _MSC_VER >= 1400 */
SetEnvironmentVariableA(
__in LPCSTR lpName, #endif /* _M_CEE */
__in_opt LPCSTR lpValue
);
WINBASEAPI
BOOL
WINAPI
SetEnvironmentVariableW(
__in LPCWSTR lpName,
__in_opt LPCWSTR lpValue
);
#ifdef UNICODE
#define SetEnvironmentVariable SetEnvironmentVariableW
#else
#define SetEnvironmentVariable SetEnvironmentVariableA
#endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef SetEnvironmentVariable #undef SetEnvironmentVariable
__inline __inline
BOOL BOOL
SetEnvironmentVariable( SetEnvironmentVariable(
LPCTSTR lpName, LPCTSTR lpName,
LPCTSTR lpValue LPCTSTR lpValue
) )
{ {
skipping to change at line 7613 skipping to change at line 3511
#else #else
return SetEnvironmentVariableA( return SetEnvironmentVariableA(
#endif #endif
lpName, lpName,
lpValue lpValue
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
__success(return <= nSize)
__success(return != 0)
DWORD DWORD
WINAPI WINAPI
ExpandEnvironmentStringsA( GetFirmwareEnvironmentVariableA(
__in LPCSTR lpSrc, _In_ LPCSTR lpName,
__out_ecount_part_opt(nSize, return) LPSTR lpDst, _In_ LPCSTR lpGuid,
__in DWORD nSize _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer,
_In_ DWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return <= nSize)
__success(return != 0)
DWORD DWORD
WINAPI WINAPI
ExpandEnvironmentStringsW( GetFirmwareEnvironmentVariableW(
__in LPCWSTR lpSrc, _In_ LPCWSTR lpName,
__out_ecount_part_opt(nSize, return) LPWSTR lpDst, _In_ LPCWSTR lpGuid,
__in DWORD nSize _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer,
_In_ DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define ExpandEnvironmentStrings ExpandEnvironmentStringsW #define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableW
#else #else
#define ExpandEnvironmentStrings ExpandEnvironmentStringsA #define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableA
#endif // !UNICODE #endif // !UNICODE
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetFirmwareEnvironmentVariableA( GetFirmwareEnvironmentVariableExA(
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in LPCSTR lpGuid, _In_ LPCSTR lpGuid,
__out_bcount_part_opt(nSize, return) PVOID pBuffer, _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer,
__in DWORD nSize _In_ DWORD nSize,
_Out_opt_ PDWORD pdwAttribubutes
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetFirmwareEnvironmentVariableW( GetFirmwareEnvironmentVariableExW(
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__in LPCWSTR lpGuid, _In_ LPCWSTR lpGuid,
__out_bcount_part_opt(nSize, return) PVOID pBuffer, _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer,
__in DWORD nSize _In_ DWORD nSize,
_Out_opt_ PDWORD pdwAttribubutes
); );
#ifdef UNICODE #ifdef UNICODE
#define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableW #define GetFirmwareEnvironmentVariableEx GetFirmwareEnvironmentVariableExW
#else #else
#define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableA #define GetFirmwareEnvironmentVariableEx GetFirmwareEnvironmentVariableExA
#endif // !UNICODE #endif // !UNICODE
#endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFirmwareEnvironmentVariableA( SetFirmwareEnvironmentVariableA(
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in LPCSTR lpGuid, _In_ LPCSTR lpGuid,
__in_bcount_opt(nSize) PVOID pValue, _In_reads_bytes_opt_(nSize) PVOID pValue,
__in DWORD nSize _In_ DWORD nSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFirmwareEnvironmentVariableW( SetFirmwareEnvironmentVariableW(
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__in LPCWSTR lpGuid, _In_ LPCWSTR lpGuid,
__in_bcount_opt(nSize) PVOID pValue, _In_reads_bytes_opt_(nSize) PVOID pValue,
__in DWORD nSize _In_ DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW
#else #else
#define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA
#endif // !UNICODE #endif // !UNICODE
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
WINBASEAPI WINBASEAPI
VOID BOOL
WINAPI WINAPI
OutputDebugStringA( SetFirmwareEnvironmentVariableExA(
__in_opt LPCSTR lpOutputString _In_ LPCSTR lpName,
_In_ LPCSTR lpGuid,
_In_reads_bytes_opt_(nSize) PVOID pValue,
_In_ DWORD nSize,
_In_ DWORD dwAttributes
); );
WINBASEAPI WINBASEAPI
VOID BOOL
WINAPI WINAPI
OutputDebugStringW( SetFirmwareEnvironmentVariableExW(
__in_opt LPCWSTR lpOutputString _In_ LPCWSTR lpName,
_In_ LPCWSTR lpGuid,
_In_reads_bytes_opt_(nSize) PVOID pValue,
_In_ DWORD nSize,
_In_ DWORD dwAttributes
); );
#ifdef UNICODE #ifdef UNICODE
#define OutputDebugString OutputDebugStringW #define SetFirmwareEnvironmentVariableEx SetFirmwareEnvironmentVariableExW
#else #else
#define OutputDebugString OutputDebugStringA #define SetFirmwareEnvironmentVariableEx SetFirmwareEnvironmentVariableExA
#endif // !UNICODE #endif // !UNICODE
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
WINBASEAPI WINBASEAPI
__out_opt BOOL
WINAPI
GetFirmwareType (
_Inout_ PFIRMWARE_TYPE FirmwareType
);
WINBASEAPI
BOOL
WINAPI
IsNativeVhdBoot (
_Out_ PBOOL NativeVhdBoot
);
#endif // _WIN32_WINNT >= _WIN32_WINNT_WIN8
WINBASEAPI
_Ret_maybenull_
HRSRC HRSRC
WINAPI WINAPI
FindResourceA( FindResourceA(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in LPCSTR lpType _In_ LPCSTR lpType
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HRSRC HRSRC
WINAPI WINAPI
FindResourceW( FindResourceW(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__in LPCWSTR lpType _In_ LPCWSTR lpType
); );
#ifdef UNICODE #ifdef UNICODE
#define FindResource FindResourceW #define FindResource FindResourceW
#else #else
#define FindResource FindResourceA #define FindResource FindResourceA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HRSRC HRSRC
WINAPI WINAPI
FindResourceExA( FindResourceExA(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCSTR lpType, _In_ LPCSTR lpType,
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in WORD wLanguage _In_ WORD wLanguage
);
WINBASEAPI
__out_opt
HRSRC
WINAPI
FindResourceExW(
__in_opt HMODULE hModule,
__in LPCWSTR lpType,
__in LPCWSTR lpName,
__in WORD wLanguage
); );
#ifdef UNICODE #ifndef UNICODE
#define FindResourceEx FindResourceExW
#else
#define FindResourceEx FindResourceExA #define FindResourceEx FindResourceExA
#endif // !UNICODE
#ifdef STRICT
typedef BOOL (CALLBACK* ENUMRESTYPEPROCA)(__in_opt HMODULE hModule, __in LPSTR l
pType,
__in LONG_PTR lParam);
typedef BOOL (CALLBACK* ENUMRESTYPEPROCW)(__in_opt HMODULE hModule, __in LPWSTR
lpType,
__in LONG_PTR lParam);
#ifdef UNICODE
#define ENUMRESTYPEPROC ENUMRESTYPEPROCW
#else
#define ENUMRESTYPEPROC ENUMRESTYPEPROCA
#endif // !UNICODE
typedef BOOL (CALLBACK* ENUMRESNAMEPROCA)(__in_opt HMODULE hModule, __in LPCSTR
lpType,
__in LPSTR lpName, __in LONG_PTR lParam);
typedef BOOL (CALLBACK* ENUMRESNAMEPROCW)(__in_opt HMODULE hModule, __in LPCWSTR
lpType,
__in LPWSTR lpName, __in LONG_PTR lParam);
#ifdef UNICODE
#define ENUMRESNAMEPROC ENUMRESNAMEPROCW
#else
#define ENUMRESNAMEPROC ENUMRESNAMEPROCA
#endif // !UNICODE
typedef BOOL (CALLBACK* ENUMRESLANGPROCA)(__in_opt HMODULE hModule, __in LPCSTR
lpType,
__in LPCSTR lpName, __in WORD wLanguage, __in LONG_PTR lParam);
typedef BOOL (CALLBACK* ENUMRESLANGPROCW)(__in_opt HMODULE hModule, __in LPCWSTR
lpType,
__in LPCWSTR lpName, __in WORD wLanguage, __in LONG_PTR lParam);
#ifdef UNICODE
#define ENUMRESLANGPROC ENUMRESLANGPROCW
#else
#define ENUMRESLANGPROC ENUMRESLANGPROCA
#endif // !UNICODE
#else
typedef FARPROC ENUMRESTYPEPROCA;
typedef FARPROC ENUMRESTYPEPROCW;
#ifdef UNICODE
typedef ENUMRESTYPEPROCW ENUMRESTYPEPROC;
#else
typedef ENUMRESTYPEPROCA ENUMRESTYPEPROC;
#endif // UNICODE
typedef FARPROC ENUMRESNAMEPROCA;
typedef FARPROC ENUMRESNAMEPROCW;
#ifdef UNICODE
typedef ENUMRESNAMEPROCW ENUMRESNAMEPROC;
#else
typedef ENUMRESNAMEPROCA ENUMRESNAMEPROC;
#endif // UNICODE
typedef FARPROC ENUMRESLANGPROCA;
typedef FARPROC ENUMRESLANGPROCW;
#ifdef UNICODE
typedef ENUMRESLANGPROCW ENUMRESLANGPROC;
#else
typedef ENUMRESLANGPROCA ENUMRESLANGPROC;
#endif // UNICODE
#endif #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnumResourceTypesA( EnumResourceTypesA(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in ENUMRESTYPEPROCA lpEnumFunc, _In_ ENUMRESTYPEPROCA lpEnumFunc,
__in LONG_PTR lParam _In_ LONG_PTR lParam
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnumResourceTypesW( EnumResourceTypesW(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in ENUMRESTYPEPROCW lpEnumFunc, _In_ ENUMRESTYPEPROCW lpEnumFunc,
__in LONG_PTR lParam _In_ LONG_PTR lParam
); );
#ifdef UNICODE #ifdef UNICODE
#define EnumResourceTypes EnumResourceTypesW #define EnumResourceTypes EnumResourceTypesW
#else #else
#define EnumResourceTypes EnumResourceTypesA #define EnumResourceTypes EnumResourceTypesA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnumResourceNamesA( EnumResourceNamesA(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCSTR lpType, _In_ LPCSTR lpType,
__in ENUMRESNAMEPROCA lpEnumFunc, _In_ ENUMRESNAMEPROCA lpEnumFunc,
__in LONG_PTR lParam _In_ LONG_PTR lParam
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnumResourceNamesW( EnumResourceNamesW(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCWSTR lpType, _In_ LPCWSTR lpType,
__in ENUMRESNAMEPROCW lpEnumFunc, _In_ ENUMRESNAMEPROCW lpEnumFunc,
__in LONG_PTR lParam _In_ LONG_PTR lParam
); );
#ifdef UNICODE #ifdef UNICODE
#define EnumResourceNames EnumResourceNamesW #define EnumResourceNames EnumResourceNamesW
#else #else
#define EnumResourceNames EnumResourceNamesA #define EnumResourceNames EnumResourceNamesA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnumResourceLanguagesA( EnumResourceLanguagesA(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCSTR lpType, _In_ LPCSTR lpType,
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in ENUMRESLANGPROCA lpEnumFunc, _In_ ENUMRESLANGPROCA lpEnumFunc,
__in LONG_PTR lParam _In_ LONG_PTR lParam
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EnumResourceLanguagesW( EnumResourceLanguagesW(
__in_opt HMODULE hModule, _In_opt_ HMODULE hModule,
__in LPCWSTR lpType, _In_ LPCWSTR lpType,
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__in ENUMRESLANGPROCW lpEnumFunc, _In_ ENUMRESLANGPROCW lpEnumFunc,
__in LONG_PTR lParam _In_ LONG_PTR lParam
); );
#ifdef UNICODE #ifdef UNICODE
#define EnumResourceLanguages EnumResourceLanguagesW #define EnumResourceLanguages EnumResourceLanguagesW
#else #else
#define EnumResourceLanguages EnumResourceLanguagesA #define EnumResourceLanguages EnumResourceLanguagesA
#endif // !UNICODE #endif // !UNICODE
#define RESOURCE_ENUM_LN (0x0001)
#define RESOURCE_ENUM_MUI (0x0002)
#define RESOURCE_ENUM_MUI_SYSTEM (0x0004)
#define RESOURCE_ENUM_VALIDATE (0x0008)
#define RESOURCE_ENUM_MODULE_EXACT (0x0010)
WINBASEAPI
BOOL
WINAPI
EnumResourceTypesExA(
__in_opt HMODULE hModule,
__in ENUMRESTYPEPROCA lpEnumFunc,
__in LONG_PTR lParam,
DWORD dwFlags,
LANGID LangId
);
WINBASEAPI
BOOL
WINAPI
EnumResourceTypesExW(
__in_opt HMODULE hModule,
__in ENUMRESTYPEPROCW lpEnumFunc,
__in LONG_PTR lParam,
DWORD dwFlags,
LANGID LangId
);
#ifdef UNICODE
#define EnumResourceTypesEx EnumResourceTypesExW
#else
#define EnumResourceTypesEx EnumResourceTypesExA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
EnumResourceNamesExA(
__in_opt HMODULE hModule,
__in LPCSTR lpType,
__in ENUMRESNAMEPROCA lpEnumFunc,
__in LONG_PTR lParam,
DWORD dwFlags,
LANGID LangId
);
WINBASEAPI
BOOL
WINAPI
EnumResourceNamesExW(
__in_opt HMODULE hModule,
__in LPCWSTR lpType,
__in ENUMRESNAMEPROCW lpEnumFunc,
__in LONG_PTR lParam,
DWORD dwFlags,
LANGID LangId
);
#ifdef UNICODE
#define EnumResourceNamesEx EnumResourceNamesExW
#else
#define EnumResourceNamesEx EnumResourceNamesExA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
EnumResourceLanguagesExA(
__in_opt HMODULE hModule,
__in LPCSTR lpType,
__in LPCSTR lpName,
__in ENUMRESLANGPROCA lpEnumFunc,
__in LONG_PTR lParam,
DWORD dwFlags,
LANGID LangId
);
WINBASEAPI
BOOL
WINAPI
EnumResourceLanguagesExW(
__in_opt HMODULE hModule,
__in LPCWSTR lpType,
__in LPCWSTR lpName,
__in ENUMRESLANGPROCW lpEnumFunc,
__in LONG_PTR lParam,
DWORD dwFlags,
LANGID LangId
);
#ifdef UNICODE
#define EnumResourceLanguagesEx EnumResourceLanguagesExW
#else
#define EnumResourceLanguagesEx EnumResourceLanguagesExA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
BeginUpdateResourceA( BeginUpdateResourceA(
__in LPCSTR pFileName, _In_ LPCSTR pFileName,
__in BOOL bDeleteExistingResources _In_ BOOL bDeleteExistingResources
); );
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
BeginUpdateResourceW( BeginUpdateResourceW(
__in LPCWSTR pFileName, _In_ LPCWSTR pFileName,
__in BOOL bDeleteExistingResources _In_ BOOL bDeleteExistingResources
); );
#ifdef UNICODE #ifdef UNICODE
#define BeginUpdateResource BeginUpdateResourceW #define BeginUpdateResource BeginUpdateResourceW
#else #else
#define BeginUpdateResource BeginUpdateResourceA #define BeginUpdateResource BeginUpdateResourceA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
UpdateResourceA( UpdateResourceA(
__in HANDLE hUpdate, _In_ HANDLE hUpdate,
__in LPCSTR lpType, _In_ LPCSTR lpType,
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in WORD wLanguage, _In_ WORD wLanguage,
__in_bcount_opt(cb) LPVOID lpData, _In_reads_bytes_opt_(cb) LPVOID lpData,
__in DWORD cb _In_ DWORD cb
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
UpdateResourceW( UpdateResourceW(
__in HANDLE hUpdate, _In_ HANDLE hUpdate,
__in LPCWSTR lpType, _In_ LPCWSTR lpType,
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__in WORD wLanguage, _In_ WORD wLanguage,
__in_bcount_opt(cb) LPVOID lpData, _In_reads_bytes_opt_(cb) LPVOID lpData,
__in DWORD cb _In_ DWORD cb
); );
#ifdef UNICODE #ifdef UNICODE
#define UpdateResource UpdateResourceW #define UpdateResource UpdateResourceW
#else #else
#define UpdateResource UpdateResourceA #define UpdateResource UpdateResourceA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EndUpdateResourceA( EndUpdateResourceA(
__in HANDLE hUpdate, _In_ HANDLE hUpdate,
__in BOOL fDiscard _In_ BOOL fDiscard
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
EndUpdateResourceW( EndUpdateResourceW(
__in HANDLE hUpdate, _In_ HANDLE hUpdate,
__in BOOL fDiscard _In_ BOOL fDiscard
); );
#ifdef UNICODE #ifdef UNICODE
#define EndUpdateResource EndUpdateResourceW #define EndUpdateResource EndUpdateResourceW
#else #else
#define EndUpdateResource EndUpdateResourceA #define EndUpdateResource EndUpdateResourceA
#endif // !UNICODE #endif // !UNICODE
#define ATOM_FLAG_GLOBAL 0x2
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
GlobalAddAtomA( GlobalAddAtomA(
__in_opt LPCSTR lpString _In_opt_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
GlobalAddAtomW( GlobalAddAtomW(
__in_opt LPCWSTR lpString _In_opt_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define GlobalAddAtom GlobalAddAtomW #define GlobalAddAtom GlobalAddAtomW
#else #else
#define GlobalAddAtom GlobalAddAtomA #define GlobalAddAtom GlobalAddAtomA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
GlobalAddAtomExA(
_In_opt_ LPCSTR lpString,
_In_ DWORD Flags
);
WINBASEAPI
ATOM
WINAPI
GlobalAddAtomExW(
_In_opt_ LPCWSTR lpString,
_In_ DWORD Flags
);
#ifdef UNICODE
#define GlobalAddAtomEx GlobalAddAtomExW
#else
#define GlobalAddAtomEx GlobalAddAtomExA
#endif // !UNICODE
WINBASEAPI
ATOM
WINAPI
GlobalFindAtomA( GlobalFindAtomA(
__in_opt LPCSTR lpString _In_opt_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
GlobalFindAtomW( GlobalFindAtomW(
__in_opt LPCWSTR lpString _In_opt_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define GlobalFindAtom GlobalFindAtomW #define GlobalFindAtom GlobalFindAtomW
#else #else
#define GlobalFindAtom GlobalFindAtomA #define GlobalFindAtom GlobalFindAtomA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GlobalGetAtomNameA( GlobalGetAtomNameA(
__in ATOM nAtom, _In_ ATOM nAtom,
__out_ecount_part(nSize, return + 1) LPSTR lpBuffer, _Out_writes_to_(nSize, return + 1) LPSTR lpBuffer,
__in int nSize _In_ int nSize
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GlobalGetAtomNameW( GlobalGetAtomNameW(
__in ATOM nAtom, _In_ ATOM nAtom,
__out_ecount_part(nSize, return + 1) LPWSTR lpBuffer, _Out_writes_to_(nSize, return + 1) LPWSTR lpBuffer,
__in int nSize _In_ int nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GlobalGetAtomName GlobalGetAtomNameW #define GlobalGetAtomName GlobalGetAtomNameW
#else #else
#define GlobalGetAtomName GlobalGetAtomNameA #define GlobalGetAtomName GlobalGetAtomNameA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
AddAtomA( AddAtomA(
__in_opt LPCSTR lpString _In_opt_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
AddAtomW( AddAtomW(
__in_opt LPCWSTR lpString _In_opt_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define AddAtom AddAtomW #define AddAtom AddAtomW
#else #else
#define AddAtom AddAtomA #define AddAtom AddAtomA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
FindAtomA( FindAtomA(
__in_opt LPCSTR lpString _In_opt_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
ATOM ATOM
WINAPI WINAPI
FindAtomW( FindAtomW(
__in_opt LPCWSTR lpString _In_opt_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define FindAtom FindAtomW #define FindAtom FindAtomW
#else #else
#define FindAtom FindAtomA #define FindAtom FindAtomA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetAtomNameA( GetAtomNameA(
__in ATOM nAtom, _In_ ATOM nAtom,
__out_ecount_part(nSize, return + 1) LPSTR lpBuffer, _Out_writes_to_(nSize, return + 1) LPSTR lpBuffer,
__in int nSize _In_ int nSize
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetAtomNameW( GetAtomNameW(
__in ATOM nAtom, _In_ ATOM nAtom,
__out_ecount_part(nSize, return + 1) LPWSTR lpBuffer, _Out_writes_to_(nSize, return + 1) LPWSTR lpBuffer,
__in int nSize _In_ int nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetAtomName GetAtomNameW #define GetAtomName GetAtomNameW
#else #else
#define GetAtomName GetAtomNameA #define GetAtomName GetAtomNameA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetProfileIntA( GetProfileIntA(
__in LPCSTR lpAppName, _In_ LPCSTR lpAppName,
__in LPCSTR lpKeyName, _In_ LPCSTR lpKeyName,
__in INT nDefault _In_ INT nDefault
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetProfileIntW( GetProfileIntW(
__in LPCWSTR lpAppName, _In_ LPCWSTR lpAppName,
__in LPCWSTR lpKeyName, _In_ LPCWSTR lpKeyName,
__in INT nDefault _In_ INT nDefault
); );
#ifdef UNICODE #ifdef UNICODE
#define GetProfileInt GetProfileIntW #define GetProfileInt GetProfileIntW
#else #else
#define GetProfileInt GetProfileIntA #define GetProfileInt GetProfileIntA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetProfileStringA( GetProfileStringA(
__in_opt LPCSTR lpAppName, _In_opt_ LPCSTR lpAppName,
__in_opt LPCSTR lpKeyName, _In_opt_ LPCSTR lpKeyName,
__in_opt LPCSTR lpDefault, _In_opt_ LPCSTR lpDefault,
__out_ecount_part_opt(nSize, return + 1) LPSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
__in DWORD nSize _In_ DWORD nSize
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetProfileStringW( GetProfileStringW(
__in_opt LPCWSTR lpAppName, _In_opt_ LPCWSTR lpAppName,
__in_opt LPCWSTR lpKeyName, _In_opt_ LPCWSTR lpKeyName,
__in_opt LPCWSTR lpDefault, _In_opt_ LPCWSTR lpDefault,
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
__in DWORD nSize _In_ DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetProfileString GetProfileStringW #define GetProfileString GetProfileStringW
#else #else
#define GetProfileString GetProfileStringA #define GetProfileString GetProfileStringA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WriteProfileStringA( WriteProfileStringA(
__in_opt LPCSTR lpAppName, _In_opt_ LPCSTR lpAppName,
__in_opt LPCSTR lpKeyName, _In_opt_ LPCSTR lpKeyName,
__in_opt LPCSTR lpString _In_opt_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WriteProfileStringW( WriteProfileStringW(
__in_opt LPCWSTR lpAppName, _In_opt_ LPCWSTR lpAppName,
__in_opt LPCWSTR lpKeyName, _In_opt_ LPCWSTR lpKeyName,
__in_opt LPCWSTR lpString _In_opt_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define WriteProfileString WriteProfileStringW #define WriteProfileString WriteProfileStringW
#else #else
#define WriteProfileString WriteProfileStringA #define WriteProfileString WriteProfileStringA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetProfileSectionA( GetProfileSectionA(
__in LPCSTR lpAppName, _In_ LPCSTR lpAppName,
__out_ecount_part_opt(nSize, return + 1) LPSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
__in DWORD nSize _In_ DWORD nSize
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetProfileSectionW( GetProfileSectionW(
__in LPCWSTR lpAppName, _In_ LPCWSTR lpAppName,
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
__in DWORD nSize _In_ DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetProfileSection GetProfileSectionW #define GetProfileSection GetProfileSectionW
#else #else
#define GetProfileSection GetProfileSectionA #define GetProfileSection GetProfileSectionA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WriteProfileSectionA( WriteProfileSectionA(
__in LPCSTR lpAppName, _In_ LPCSTR lpAppName,
__in LPCSTR lpString _In_ LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WriteProfileSectionW( WriteProfileSectionW(
__in LPCWSTR lpAppName, _In_ LPCWSTR lpAppName,
__in LPCWSTR lpString _In_ LPCWSTR lpString
); );
#ifdef UNICODE #ifdef UNICODE
#define WriteProfileSection WriteProfileSectionW #define WriteProfileSection WriteProfileSectionW
#else #else
#define WriteProfileSection WriteProfileSectionA #define WriteProfileSection WriteProfileSectionA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetPrivateProfileIntA( GetPrivateProfileIntA(
__in LPCSTR lpAppName, _In_ LPCSTR lpAppName,
__in LPCSTR lpKeyName, _In_ LPCSTR lpKeyName,
__in INT nDefault, _In_ INT nDefault,
__in_opt LPCSTR lpFileName _In_opt_ LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetPrivateProfileIntW( GetPrivateProfileIntW(
__in LPCWSTR lpAppName, _In_ LPCWSTR lpAppName,
__in LPCWSTR lpKeyName, _In_ LPCWSTR lpKeyName,
__in INT nDefault, _In_ INT nDefault,
__in_opt LPCWSTR lpFileName _In_opt_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define GetPrivateProfileInt GetPrivateProfileIntW #define GetPrivateProfileInt GetPrivateProfileIntW
#else #else
#define GetPrivateProfileInt GetPrivateProfileIntA #define GetPrivateProfileInt GetPrivateProfileIntA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetPrivateProfileInt #undef GetPrivateProfileInt
__inline __inline
skipping to change at line 8316 skipping to change at line 4116
nDefault, nDefault,
lpFileName lpFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetPrivateProfileStringA( GetPrivateProfileStringA(
__in_opt LPCSTR lpAppName, _In_opt_ LPCSTR lpAppName,
__in_opt LPCSTR lpKeyName, _In_opt_ LPCSTR lpKeyName,
__in_opt LPCSTR lpDefault, _In_opt_ LPCSTR lpDefault,
__out_ecount_part_opt(nSize, return + 1) LPSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt LPCSTR lpFileName _In_opt_ LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetPrivateProfileStringW( GetPrivateProfileStringW(
__in_opt LPCWSTR lpAppName, _In_opt_ LPCWSTR lpAppName,
__in_opt LPCWSTR lpKeyName, _In_opt_ LPCWSTR lpKeyName,
__in_opt LPCWSTR lpDefault, _In_opt_ LPCWSTR lpDefault,
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt LPCWSTR lpFileName _In_opt_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define GetPrivateProfileString GetPrivateProfileStringW #define GetPrivateProfileString GetPrivateProfileStringW
#else #else
#define GetPrivateProfileString GetPrivateProfileStringA #define GetPrivateProfileString GetPrivateProfileStringA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetPrivateProfileString #undef GetPrivateProfileString
__inline __inline
skipping to change at line 8372 skipping to change at line 4172
nSize, nSize,
lpFileName lpFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WritePrivateProfileStringA( WritePrivateProfileStringA(
__in_opt LPCSTR lpAppName, _In_opt_ LPCSTR lpAppName,
__in_opt LPCSTR lpKeyName, _In_opt_ LPCSTR lpKeyName,
__in_opt LPCSTR lpString, _In_opt_ LPCSTR lpString,
__in_opt LPCSTR lpFileName _In_opt_ LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WritePrivateProfileStringW( WritePrivateProfileStringW(
__in_opt LPCWSTR lpAppName, _In_opt_ LPCWSTR lpAppName,
__in_opt LPCWSTR lpKeyName, _In_opt_ LPCWSTR lpKeyName,
__in_opt LPCWSTR lpString, _In_opt_ LPCWSTR lpString,
__in_opt LPCWSTR lpFileName _In_opt_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define WritePrivateProfileString WritePrivateProfileStringW #define WritePrivateProfileString WritePrivateProfileStringW
#else #else
#define WritePrivateProfileString WritePrivateProfileStringA #define WritePrivateProfileString WritePrivateProfileStringA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetPrivateProfileSectionA( GetPrivateProfileSectionA(
__in LPCSTR lpAppName, _In_ LPCSTR lpAppName,
__out_ecount_part_opt(nSize, return + 1) LPSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt LPCSTR lpFileName _In_opt_ LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetPrivateProfileSectionW( GetPrivateProfileSectionW(
__in LPCWSTR lpAppName, _In_ LPCWSTR lpAppName,
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpReturnedString, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt LPCWSTR lpFileName _In_opt_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define GetPrivateProfileSection GetPrivateProfileSectionW #define GetPrivateProfileSection GetPrivateProfileSectionW
#else #else
#define GetPrivateProfileSection GetPrivateProfileSectionA #define GetPrivateProfileSection GetPrivateProfileSectionA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetPrivateProfileSection #undef GetPrivateProfileSection
__inline __inline
skipping to change at line 8444 skipping to change at line 4244
nSize, nSize,
lpFileName lpFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WritePrivateProfileSectionA( WritePrivateProfileSectionA(
__in_opt LPCSTR lpAppName, _In_opt_ LPCSTR lpAppName,
__in_opt LPCSTR lpString, _In_opt_ LPCSTR lpString,
__in_opt LPCSTR lpFileName _In_opt_ LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WritePrivateProfileSectionW( WritePrivateProfileSectionW(
__in_opt LPCWSTR lpAppName, _In_opt_ LPCWSTR lpAppName,
__in_opt LPCWSTR lpString, _In_opt_ LPCWSTR lpString,
__in_opt LPCWSTR lpFileName _In_opt_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define WritePrivateProfileSection WritePrivateProfileSectionW #define WritePrivateProfileSection WritePrivateProfileSectionW
#else #else
#define WritePrivateProfileSection WritePrivateProfileSectionA #define WritePrivateProfileSection WritePrivateProfileSectionA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetPrivateProfileSectionNamesA( GetPrivateProfileSectionNamesA(
__out_ecount_part_opt(nSize, return + 1) LPSTR lpszReturnBuffer, _Out_writes_to_opt_(nSize, return + 1) LPSTR lpszReturnBuffer,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt LPCSTR lpFileName _In_opt_ LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetPrivateProfileSectionNamesW( GetPrivateProfileSectionNamesW(
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpszReturnBuffer, _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpszReturnBuffer,
__in DWORD nSize, _In_ DWORD nSize,
__in_opt LPCWSTR lpFileName _In_opt_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesW #define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesW
#else #else
#define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesA #define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetPrivateProfileSectionNames #undef GetPrivateProfileSectionNames
__inline __inline
skipping to change at line 8510 skipping to change at line 4310
nSize, nSize,
lpFileName lpFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetPrivateProfileStructA( GetPrivateProfileStructA(
__in LPCSTR lpszSection, _In_ LPCSTR lpszSection,
__in LPCSTR lpszKey, _In_ LPCSTR lpszKey,
__out_bcount_opt(uSizeStruct) LPVOID lpStruct, _Out_writes_bytes_opt_(uSizeStruct) LPVOID lpStruct,
__in UINT uSizeStruct, _In_ UINT uSizeStruct,
__in_opt LPCSTR szFile _In_opt_ LPCSTR szFile
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetPrivateProfileStructW( GetPrivateProfileStructW(
__in LPCWSTR lpszSection, _In_ LPCWSTR lpszSection,
__in LPCWSTR lpszKey, _In_ LPCWSTR lpszKey,
__out_bcount_opt(uSizeStruct) LPVOID lpStruct, _Out_writes_bytes_opt_(uSizeStruct) LPVOID lpStruct,
__in UINT uSizeStruct, _In_ UINT uSizeStruct,
__in_opt LPCWSTR szFile _In_opt_ LPCWSTR szFile
); );
#ifdef UNICODE #ifdef UNICODE
#define GetPrivateProfileStruct GetPrivateProfileStructW #define GetPrivateProfileStruct GetPrivateProfileStructW
#else #else
#define GetPrivateProfileStruct GetPrivateProfileStructA #define GetPrivateProfileStruct GetPrivateProfileStructA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetPrivateProfileStruct #undef GetPrivateProfileStruct
__inline __inline
skipping to change at line 8562 skipping to change at line 4362
uSizeStruct, uSizeStruct,
szFile szFile
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WritePrivateProfileStructA( WritePrivateProfileStructA(
__in LPCSTR lpszSection, _In_ LPCSTR lpszSection,
__in LPCSTR lpszKey, _In_ LPCSTR lpszKey,
__in_bcount_opt(uSizeStruct) LPVOID lpStruct, _In_reads_bytes_opt_(uSizeStruct) LPVOID lpStruct,
__in UINT uSizeStruct, _In_ UINT uSizeStruct,
__in_opt LPCSTR szFile _In_opt_ LPCSTR szFile
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WritePrivateProfileStructW( WritePrivateProfileStructW(
__in LPCWSTR lpszSection, _In_ LPCWSTR lpszSection,
__in LPCWSTR lpszKey, _In_ LPCWSTR lpszKey,
__in_bcount_opt(uSizeStruct) LPVOID lpStruct, _In_reads_bytes_opt_(uSizeStruct) LPVOID lpStruct,
__in UINT uSizeStruct, _In_ UINT uSizeStruct,
__in_opt LPCWSTR szFile _In_opt_ LPCWSTR szFile
); );
#ifdef UNICODE #ifdef UNICODE
#define WritePrivateProfileStruct WritePrivateProfileStructW #define WritePrivateProfileStruct WritePrivateProfileStructW
#else #else
#define WritePrivateProfileStruct WritePrivateProfileStructA #define WritePrivateProfileStruct WritePrivateProfileStructA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
UINT
WINAPI
GetDriveTypeA(
__in_opt LPCSTR lpRootPathName
);
WINBASEAPI
UINT
WINAPI
GetDriveTypeW(
__in_opt LPCWSTR lpRootPathName
);
#ifdef UNICODE
#define GetDriveType GetDriveTypeW
#else
#define GetDriveType GetDriveTypeA
#endif // !UNICODE
WINBASEAPI
UINT
WINAPI
GetSystemDirectoryA(
__out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer,
__in UINT uSize
);
WINBASEAPI
UINT
WINAPI
GetSystemDirectoryW(
__out_ecount_part_opt(uSize, return + 1) LPWSTR lpBuffer,
__in UINT uSize
);
#ifdef UNICODE
#define GetSystemDirectory GetSystemDirectoryW
#else
#define GetSystemDirectory GetSystemDirectoryA
#endif // !UNICODE
WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTempPathA( GetTempPathA(
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer
);
WINBASEAPI
DWORD
WINAPI
GetTempPathW(
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer
); );
#ifdef UNICODE #ifndef UNICODE
#define GetTempPath GetTempPathW
#else
#define GetTempPath GetTempPathA #define GetTempPath GetTempPathA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetTempFileNameA( GetTempFileNameA(
__in LPCSTR lpPathName, _In_ LPCSTR lpPathName,
__in LPCSTR lpPrefixString, _In_ LPCSTR lpPrefixString,
__in UINT uUnique, _In_ UINT uUnique,
__out_ecount(MAX_PATH) LPSTR lpTempFileName _Out_writes_(MAX_PATH) LPSTR lpTempFileName
);
WINBASEAPI
UINT
WINAPI
GetTempFileNameW(
__in LPCWSTR lpPathName,
__in LPCWSTR lpPrefixString,
__in UINT uUnique,
__out_ecount(MAX_PATH) LPWSTR lpTempFileName
); );
#ifdef UNICODE #ifndef UNICODE
#define GetTempFileName GetTempFileNameW
#else
#define GetTempFileName GetTempFileNameA #define GetTempFileName GetTempFileNameA
#endif // !UNICODE #endif
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetTempFileName #undef GetTempFileName
__inline __inline
UINT UINT
GetTempFileName( GetTempFileName(
LPCTSTR lpPathName, LPCTSTR lpPathName,
LPCTSTR lpPrefixString, LPCTSTR lpPrefixString,
UINT uUnique, UINT uUnique,
LPTSTR lpTempFileName LPTSTR lpTempFileName
skipping to change at line 8690 skipping to change at line 4432
return GetTempFileNameA( return GetTempFileNameA(
#endif #endif
lpPathName, lpPathName,
lpPrefixString, lpPrefixString,
uUnique, uUnique,
lpTempFileName lpTempFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI
UINT
WINAPI
GetWindowsDirectoryA(
__out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer,
__in UINT uSize
);
WINBASEAPI
UINT
WINAPI
GetWindowsDirectoryW(
__out_ecount_part_opt(uSize, return + 1) LPWSTR lpBuffer,
__in UINT uSize
);
#ifdef UNICODE
#define GetWindowsDirectory GetWindowsDirectoryW
#else
#define GetWindowsDirectory GetWindowsDirectoryA
#endif // !UNICODE
WINBASEAPI
UINT
WINAPI
GetSystemWindowsDirectoryA(
__out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer,
__in UINT uSize
);
WINBASEAPI
UINT
WINAPI
GetSystemWindowsDirectoryW(
__out_ecount_part_opt(uSize, return + 1) LPWSTR lpBuffer,
__in UINT uSize
);
#ifdef UNICODE
#define GetSystemWindowsDirectory GetSystemWindowsDirectoryW
#else
#define GetSystemWindowsDirectory GetSystemWindowsDirectoryA
#endif // !UNICODE
#if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_GET_SYSTEM_WOW64_D IRECTORY" is a bit long. #if !defined(RC_INVOKED) // RC warns because "WINBASE_DECLARE_GET_SYSTEM_WOW64_D IRECTORY" is a bit long.
#if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY ) #if _WIN32_WINNT >= 0x0501 || defined(WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY )
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < uSize)
UINT UINT
WINAPI WINAPI
GetSystemWow64DirectoryA( GetSystemWow64DirectoryA(
__out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer, _Out_writes_to_opt_(uSize, return + 1) LPSTR lpBuffer,
__in UINT uSize _In_ UINT uSize
); );
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < uSize)
UINT UINT
WINAPI WINAPI
GetSystemWow64DirectoryW( GetSystemWow64DirectoryW(
__out_ecount_part_opt(uSize, return + 1) LPWSTR lpBuffer, _Out_writes_to_opt_(uSize, return + 1) LPWSTR lpBuffer,
__in UINT uSize _In_ UINT uSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetSystemWow64Directory GetSystemWow64DirectoryW #define GetSystemWow64Directory GetSystemWow64DirectoryW
#else #else
#define GetSystemWow64Directory GetSystemWow64DirectoryA #define GetSystemWow64Directory GetSystemWow64DirectoryA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOLEAN BOOLEAN
WINAPI WINAPI
Wow64EnableWow64FsRedirection ( Wow64EnableWow64FsRedirection (
__in BOOLEAN Wow64FsEnableRedirection _In_ BOOLEAN Wow64FsEnableRedirection
);
WINBASEAPI
BOOL
WINAPI
Wow64DisableWow64FsRedirection (
__out PVOID *OldValue
);
WINBASEAPI
BOOL
WINAPI
Wow64RevertWow64FsRedirection (
__in PVOID OlValue
); );
// //
// for GetProcAddress // for GetProcAddress
// //
typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_A)(__out_ecount_part_opt(uSize typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_A)(_Out_writes_to_opt_(uSize,
, return + 1) LPSTR lpBuffer, __in UINT uSize); return + 1) LPSTR lpBuffer, _In_ UINT uSize);
typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_W)(__out_ecount_part_opt(uSize typedef UINT (WINAPI* PGET_SYSTEM_WOW64_DIRECTORY_W)(_Out_writes_to_opt_(uSize,
, return + 1) LPWSTR lpBuffer, __in UINT uSize); return + 1) LPWSTR lpBuffer, _In_ UINT uSize);
// //
// GetProcAddress only accepts GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A, // GetProcAddress only accepts GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A,
// GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A, GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A. // GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A, GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A.
// The others are if you want to use the strings in some other way. // The others are if you want to use the strings in some other way.
// //
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A "GetSystemWow64DirectoryA" #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A "GetSystemWow64DirectoryA"
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W L"GetSystemWow64DirectoryA" #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W L"GetSystemWow64DirectoryA"
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T TEXT("GetSystemWow64DirectoryA") #define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T TEXT("GetSystemWow64DirectoryA")
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A "GetSystemWow64DirectoryW" #define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A "GetSystemWow64DirectoryW"
skipping to change at line 8805 skipping to change at line 4495
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T
#else #else
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W
#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T #define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T
#endif #endif
#endif // _WIN32_WINNT >= 0x0501 #endif // _WIN32_WINNT >= 0x0501
#endif #endif
WINBASEAPI
BOOL
WINAPI
SetCurrentDirectoryA(
__in LPCSTR lpPathName
);
WINBASEAPI
BOOL
WINAPI
SetCurrentDirectoryW(
__in LPCWSTR lpPathName
);
#ifdef UNICODE
#define SetCurrentDirectory SetCurrentDirectoryW
#else
#define SetCurrentDirectory SetCurrentDirectoryA
#endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef SetCurrentDirectory #undef SetCurrentDirectory
__inline __inline
BOOL BOOL
SetCurrentDirectory( SetCurrentDirectory(
LPCTSTR lpPathName LPCTSTR lpPathName
) )
{ {
#ifdef UNICODE #ifdef UNICODE
return SetCurrentDirectoryW( return SetCurrentDirectoryW(
#else #else
return SetCurrentDirectoryA( return SetCurrentDirectoryA(
#endif #endif
lpPathName lpPathName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI
DWORD
WINAPI
GetCurrentDirectoryA(
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer
);
WINBASEAPI
DWORD
WINAPI
GetCurrentDirectoryW(
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer
);
#ifdef UNICODE
#define GetCurrentDirectory GetCurrentDirectoryW
#else
#define GetCurrentDirectory GetCurrentDirectoryA
#endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef GetCurrentDirectory #undef GetCurrentDirectory
__inline __inline
DWORD DWORD
GetCurrentDirectory( GetCurrentDirectory(
DWORD nBufferLength, DWORD nBufferLength,
LPTSTR lpBuffer LPTSTR lpBuffer
) )
{ {
#ifdef UNICODE #ifdef UNICODE
skipping to change at line 8887 skipping to change at line 4539
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#if _WIN32_WINNT >= 0x0502 #if _WIN32_WINNT >= 0x0502
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetDllDirectoryA( SetDllDirectoryA(
__in_opt LPCSTR lpPathName _In_opt_ LPCSTR lpPathName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetDllDirectoryW( SetDllDirectoryW(
__in_opt LPCWSTR lpPathName _In_opt_ LPCWSTR lpPathName
); );
#ifdef UNICODE #ifdef UNICODE
#define SetDllDirectory SetDllDirectoryW #define SetDllDirectory SetDllDirectoryW
#else #else
#define SetDllDirectory SetDllDirectoryA #define SetDllDirectory SetDllDirectoryA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < nBufferLength)
DWORD DWORD
WINAPI WINAPI
GetDllDirectoryA( GetDllDirectoryA(
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer
); );
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < nBufferLength)
DWORD DWORD
WINAPI WINAPI
GetDllDirectoryW( GetDllDirectoryW(
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer _Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define GetDllDirectory GetDllDirectoryW #define GetDllDirectory GetDllDirectoryW
#else #else
#define GetDllDirectory GetDllDirectoryA #define GetDllDirectory GetDllDirectoryA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0502 #endif // _WIN32_WINNT >= 0x0502
#define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x1 #define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x1
#define BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE 0x10000 #define BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE 0x10000
#define BASE_SEARCH_PATH_PERMANENT 0x8000 #define BASE_SEARCH_PATH_PERMANENT 0x8000
#define BASE_SEARCH_PATH_INVALID_FLAGS ~0x18001 #define BASE_SEARCH_PATH_INVALID_FLAGS ~0x18001
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetSearchPathMode ( SetSearchPathMode (
__in DWORD Flags _In_ DWORD Flags
);
WINBASEAPI
BOOL
WINAPI
GetDiskFreeSpaceA(
__in_opt LPCSTR lpRootPathName,
__out_opt LPDWORD lpSectorsPerCluster,
__out_opt LPDWORD lpBytesPerSector,
__out_opt LPDWORD lpNumberOfFreeClusters,
__out_opt LPDWORD lpTotalNumberOfClusters
);
WINBASEAPI
BOOL
WINAPI
GetDiskFreeSpaceW(
__in_opt LPCWSTR lpRootPathName,
__out_opt LPDWORD lpSectorsPerCluster,
__out_opt LPDWORD lpBytesPerSector,
__out_opt LPDWORD lpNumberOfFreeClusters,
__out_opt LPDWORD lpTotalNumberOfClusters
); );
#ifdef UNICODE
#define GetDiskFreeSpace GetDiskFreeSpaceW
#else
#define GetDiskFreeSpace GetDiskFreeSpaceA
#endif // !UNICODE
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
BOOL #pragma endregion
WINAPI
GetDiskFreeSpaceExA(
__in_opt LPCSTR lpDirectoryName,
__out_opt PULARGE_INTEGER lpFreeBytesAvailableToCaller,
__out_opt PULARGE_INTEGER lpTotalNumberOfBytes,
__out_opt PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
WINBASEAPI
BOOL
WINAPI
GetDiskFreeSpaceExW(
__in_opt LPCWSTR lpDirectoryName,
__out_opt PULARGE_INTEGER lpFreeBytesAvailableToCaller,
__out_opt PULARGE_INTEGER lpTotalNumberOfBytes,
__out_opt PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
#ifdef UNICODE
#define GetDiskFreeSpaceEx GetDiskFreeSpaceExW
#else
#define GetDiskFreeSpaceEx GetDiskFreeSpaceExA
#endif // !UNICODE
WINBASEAPI #pragma region Application Family
BOOL #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINAPI
CreateDirectoryA(
__in LPCSTR lpPathName,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
WINBASEAPI
BOOL
WINAPI
CreateDirectoryW(
__in LPCWSTR lpPathName,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
#ifdef UNICODE
#define CreateDirectory CreateDirectoryW
#else
#define CreateDirectory CreateDirectoryA
#endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef CreateDirectory #undef CreateDirectory
__inline __inline
BOOL BOOL
CreateDirectory( CreateDirectory(
LPCTSTR lpPathName, LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes LPSECURITY_ATTRIBUTES lpSecurityAttributes
) )
{ {
skipping to change at line 9025 skipping to change at line 4615
return CreateDirectoryW( return CreateDirectoryW(
#else #else
return CreateDirectoryA( return CreateDirectoryA(
#endif #endif
lpPathName, lpPathName,
lpSecurityAttributes lpSecurityAttributes
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateDirectoryExA( CreateDirectoryExA(
__in LPCSTR lpTemplateDirectory, _In_ LPCSTR lpTemplateDirectory,
__in LPCSTR lpNewDirectory, _In_ LPCSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateDirectoryExW( CreateDirectoryExW(
__in LPCWSTR lpTemplateDirectory, _In_ LPCWSTR lpTemplateDirectory,
__in LPCWSTR lpNewDirectory, _In_ LPCWSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateDirectoryEx CreateDirectoryExW #define CreateDirectoryEx CreateDirectoryExW
#else #else
#define CreateDirectoryEx CreateDirectoryExA #define CreateDirectoryEx CreateDirectoryExA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateDirectoryTransactedA( CreateDirectoryTransactedA(
__in_opt LPCSTR lpTemplateDirectory, _In_opt_ LPCSTR lpTemplateDirectory,
__in LPCSTR lpNewDirectory, _In_ LPCSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateDirectoryTransactedW( CreateDirectoryTransactedW(
__in_opt LPCWSTR lpTemplateDirectory, _In_opt_ LPCWSTR lpTemplateDirectory,
__in LPCWSTR lpNewDirectory, _In_ LPCWSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateDirectoryTransacted CreateDirectoryTransactedW #define CreateDirectoryTransacted CreateDirectoryTransactedW
#else #else
#define CreateDirectoryTransacted CreateDirectoryTransactedA #define CreateDirectoryTransacted CreateDirectoryTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
RemoveDirectoryA(
__in LPCSTR lpPathName
);
WINBASEAPI
BOOL
WINAPI
RemoveDirectoryW(
__in LPCWSTR lpPathName
);
#ifdef UNICODE
#define RemoveDirectory RemoveDirectoryW
#else
#define RemoveDirectory RemoveDirectoryA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RemoveDirectoryTransactedA( RemoveDirectoryTransactedA(
__in LPCSTR lpPathName, _In_ LPCSTR lpPathName,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RemoveDirectoryTransactedW( RemoveDirectoryTransactedW(
__in LPCWSTR lpPathName, _In_ LPCWSTR lpPathName,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define RemoveDirectoryTransacted RemoveDirectoryTransactedW #define RemoveDirectoryTransacted RemoveDirectoryTransactedW
#else #else
#define RemoveDirectoryTransacted RemoveDirectoryTransactedA #define RemoveDirectoryTransacted RemoveDirectoryTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
DWORD
WINAPI
GetFullPathNameA(
__in LPCSTR lpFileName,
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer,
__deref_opt_out LPSTR *lpFilePart
);
WINBASEAPI
DWORD
WINAPI
GetFullPathNameW(
__in LPCWSTR lpFileName,
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer,
__deref_opt_out LPWSTR *lpFilePart
);
#ifdef UNICODE
#define GetFullPathName GetFullPathNameW
#else
#define GetFullPathName GetFullPathNameA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < nBufferLength)
DWORD DWORD
WINAPI WINAPI
GetFullPathNameTransactedA( GetFullPathNameTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer, _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer,
__deref_opt_out LPSTR *lpFilePart, _Outptr_opt_ LPSTR *lpFilePart,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
_Success_(return != 0 && return < nBufferLength)
DWORD DWORD
WINAPI WINAPI
GetFullPathNameTransactedW( GetFullPathNameTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer, _Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer,
__deref_opt_out LPWSTR *lpFilePart, _Outptr_opt_ LPWSTR *lpFilePart,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define GetFullPathNameTransacted GetFullPathNameTransactedW #define GetFullPathNameTransacted GetFullPathNameTransactedW
#else #else
#define GetFullPathNameTransacted GetFullPathNameTransactedA #define GetFullPathNameTransacted GetFullPathNameTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
#define DDD_RAW_TARGET_PATH 0x00000001 #define DDD_RAW_TARGET_PATH 0x00000001
#define DDD_REMOVE_DEFINITION 0x00000002 #define DDD_REMOVE_DEFINITION 0x00000002
#define DDD_EXACT_MATCH_ON_REMOVE 0x00000004 #define DDD_EXACT_MATCH_ON_REMOVE 0x00000004
#define DDD_NO_BROADCAST_SYSTEM 0x00000008 #define DDD_NO_BROADCAST_SYSTEM 0x00000008
#define DDD_LUID_BROADCAST_DRIVE 0x00000010 #define DDD_LUID_BROADCAST_DRIVE 0x00000010
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DefineDosDeviceA( DefineDosDeviceA(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in LPCSTR lpDeviceName, _In_ LPCSTR lpDeviceName,
__in_opt LPCSTR lpTargetPath _In_opt_ LPCSTR lpTargetPath
);
WINBASEAPI
BOOL
WINAPI
DefineDosDeviceW(
__in DWORD dwFlags,
__in LPCWSTR lpDeviceName,
__in_opt LPCWSTR lpTargetPath
); );
#ifdef UNICODE #ifndef UNICODE
#define DefineDosDevice DefineDosDeviceW
#else
#define DefineDosDevice DefineDosDeviceA #define DefineDosDevice DefineDosDeviceA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
QueryDosDeviceA( QueryDosDeviceA(
__in_opt LPCSTR lpDeviceName, _In_opt_ LPCSTR lpDeviceName,
__out_ecount_part_opt(ucchMax, return) LPSTR lpTargetPath, _Out_writes_to_opt_(ucchMax, return) LPSTR lpTargetPath,
__in DWORD ucchMax _In_ DWORD ucchMax
);
WINBASEAPI
DWORD
WINAPI
QueryDosDeviceW(
__in_opt LPCWSTR lpDeviceName,
__out_ecount_part_opt(ucchMax, return) LPWSTR lpTargetPath,
__in DWORD ucchMax
); );
#ifdef UNICODE #ifndef UNICODE
#define QueryDosDevice QueryDosDeviceW
#else
#define QueryDosDevice QueryDosDeviceA #define QueryDosDevice QueryDosDeviceA
#endif // !UNICODE #endif
#define EXPAND_LOCAL_DRIVES #define EXPAND_LOCAL_DRIVES
WINBASEAPI
__out
HANDLE
WINAPI
CreateFileA(
__in LPCSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile
);
WINBASEAPI
__out
HANDLE
WINAPI
CreateFileW(
__in LPCWSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile
);
#ifdef UNICODE
#define CreateFile CreateFileW
#else
#define CreateFile CreateFileA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateFileTransactedA( CreateFileTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwShareMode, _In_ DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition, _In_ DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes, _In_ DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile, _In_opt_ HANDLE hTemplateFile,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__in_opt PUSHORT pusMiniVersion, _In_opt_ PUSHORT pusMiniVersion,
__reserved PVOID lpExtendedParameter _Reserved_ PVOID lpExtendedParameter
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateFileTransactedW( CreateFileTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwShareMode, _In_ DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition, _In_ DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes, _In_ DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile, _In_opt_ HANDLE hTemplateFile,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__in_opt PUSHORT pusMiniVersion, _In_opt_ PUSHORT pusMiniVersion,
__reserved PVOID lpExtendedParameter _Reserved_ PVOID lpExtendedParameter
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateFileTransacted CreateFileTransactedW #define CreateFileTransacted CreateFileTransactedW
#else #else
#define CreateFileTransacted CreateFileTransactedA #define CreateFileTransacted CreateFileTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
#if _WIN32_WINNT >= 0x0502 #if _WIN32_WINNT >= 0x0502
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
ReOpenFile( ReOpenFile(
__in HANDLE hOriginalFile, _In_ HANDLE hOriginalFile,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwShareMode, _In_ DWORD dwShareMode,
__in DWORD dwFlagsAndAttributes _In_ DWORD dwFlagsAndAttributes
); );
#endif // _WIN32_WINNT >= 0x0502 #endif // _WIN32_WINNT >= 0x0502
WINBASEAPI
BOOL
WINAPI
SetFileAttributesA(
__in LPCSTR lpFileName,
__in DWORD dwFileAttributes
);
WINBASEAPI
BOOL
WINAPI
SetFileAttributesW(
__in LPCWSTR lpFileName,
__in DWORD dwFileAttributes
);
#ifdef UNICODE
#define SetFileAttributes SetFileAttributesW
#else
#define SetFileAttributes SetFileAttributesA
#endif // !UNICODE
WINBASEAPI
DWORD
WINAPI
GetFileAttributesA(
__in LPCSTR lpFileName
);
WINBASEAPI
DWORD
WINAPI
GetFileAttributesW(
__in LPCWSTR lpFileName
);
#ifdef UNICODE
#define GetFileAttributes GetFileAttributesW
#else
#define GetFileAttributes GetFileAttributesA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileAttributesTransactedA( SetFileAttributesTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in DWORD dwFileAttributes, _In_ DWORD dwFileAttributes,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileAttributesTransactedW( SetFileAttributesTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in DWORD dwFileAttributes, _In_ DWORD dwFileAttributes,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define SetFileAttributesTransacted SetFileAttributesTransactedW #define SetFileAttributesTransacted SetFileAttributesTransactedW
#else #else
#define SetFileAttributesTransacted SetFileAttributesTransactedA #define SetFileAttributesTransacted SetFileAttributesTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard,
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;
#if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetFileAttributesTransactedA( GetFileAttributesTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId, _In_ GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation, _Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformati
__in HANDLE hTransaction on,
_In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetFileAttributesTransactedW( GetFileAttributesTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId, _In_ GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation, _Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformati
__in HANDLE hTransaction on,
_In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define GetFileAttributesTransacted GetFileAttributesTransactedW #define GetFileAttributesTransacted GetFileAttributesTransactedW
#else #else
#define GetFileAttributesTransacted GetFileAttributesTransactedA #define GetFileAttributesTransacted GetFileAttributesTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
GetFileAttributesExA(
__in LPCSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation
);
WINBASEAPI
BOOL
WINAPI
GetFileAttributesExW(
__in LPCWSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation
);
#ifdef UNICODE
#define GetFileAttributesEx GetFileAttributesExW
#else
#define GetFileAttributesEx GetFileAttributesExA
#endif // !UNICODE
WINBASEAPI
DWORD
WINAPI
GetCompressedFileSizeA(
__in LPCSTR lpFileName,
__out_opt LPDWORD lpFileSizeHigh
);
WINBASEAPI
DWORD
WINAPI
GetCompressedFileSizeW(
__in LPCWSTR lpFileName,
__out_opt LPDWORD lpFileSizeHigh
);
#ifdef UNICODE
#define GetCompressedFileSize GetCompressedFileSizeW
#else
#define GetCompressedFileSize GetCompressedFileSizeA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetCompressedFileSizeTransactedA( GetCompressedFileSizeTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__out_opt LPDWORD lpFileSizeHigh, _Out_opt_ LPDWORD lpFileSizeHigh,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetCompressedFileSizeTransactedW( GetCompressedFileSizeTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__out_opt LPDWORD lpFileSizeHigh, _Out_opt_ LPDWORD lpFileSizeHigh,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define GetCompressedFileSizeTransacted GetCompressedFileSizeTransactedW #define GetCompressedFileSizeTransacted GetCompressedFileSizeTransactedW
#else #else
#define GetCompressedFileSizeTransacted GetCompressedFileSizeTransactedA #define GetCompressedFileSizeTransacted GetCompressedFileSizeTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
DeleteFileA(
__in LPCSTR lpFileName
);
WINBASEAPI
BOOL
WINAPI
DeleteFileW(
__in LPCWSTR lpFileName
);
#ifdef UNICODE
#define DeleteFile DeleteFileW
#else
#define DeleteFile DeleteFileA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteFileTransactedA( DeleteFileTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteFileTransactedW( DeleteFileTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define DeleteFileTransacted DeleteFileTransactedW #define DeleteFileTransacted DeleteFileTransactedW
#else #else
#define DeleteFileTransacted DeleteFileTransactedA #define DeleteFileTransacted DeleteFileTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#if defined(_M_CEE) #if defined(_M_CEE)
#undef DeleteFile #undef DeleteFile
__inline __inline
BOOL BOOL
DeleteFile( DeleteFile(
LPCTSTR lpFileName LPCTSTR lpFileName
) )
{ {
#ifdef UNICODE #ifdef UNICODE
return DeleteFileW( return DeleteFileW(
#else #else
return DeleteFileA( return DeleteFileA(
#endif #endif
lpFileName lpFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if _WIN32_WINNT >= 0x0501 #if _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CheckNameLegalDOS8Dot3A( CheckNameLegalDOS8Dot3A(
__in LPCSTR lpName, _In_ LPCSTR lpName,
__out_ecount_opt(OemNameSize) LPSTR lpOemName, _Out_writes_opt_(OemNameSize) LPSTR lpOemName,
__in DWORD OemNameSize, _In_ DWORD OemNameSize,
__out_opt PBOOL pbNameContainsSpaces OPTIONAL, _Out_opt_ PBOOL pbNameContainsSpaces OPTIONAL,
__out PBOOL pbNameLegal _Out_ PBOOL pbNameLegal
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CheckNameLegalDOS8Dot3W( CheckNameLegalDOS8Dot3W(
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__out_ecount_opt(OemNameSize) LPSTR lpOemName, _Out_writes_opt_(OemNameSize) LPSTR lpOemName,
__in DWORD OemNameSize, _In_ DWORD OemNameSize,
__out_opt PBOOL pbNameContainsSpaces OPTIONAL, _Out_opt_ PBOOL pbNameContainsSpaces OPTIONAL,
__out PBOOL pbNameLegal _Out_ PBOOL pbNameLegal
); );
#ifdef UNICODE #ifdef UNICODE
#define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3W #define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3W
#else #else
#define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3A #define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3A
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0501)
#if(_WIN32_WINNT >= 0x0400) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
typedef enum _FINDEX_INFO_LEVELS { #pragma endregion
FindExInfoStandard,
FindExInfoBasic,
FindExInfoMaxInfoLevel
} FINDEX_INFO_LEVELS;
typedef enum _FINDEX_SEARCH_OPS {
FindExSearchNameMatch,
FindExSearchLimitToDirectories,
FindExSearchLimitToDevices,
FindExSearchMaxSearchOp
} FINDEX_SEARCH_OPS;
#define FIND_FIRST_EX_CASE_SENSITIVE 0x00000001 #if(_WIN32_WINNT >= 0x0400)
#define FIND_FIRST_EX_LARGE_FETCH 0x00000002
WINBASEAPI #pragma region Desktop Family
__out #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
HANDLE
WINAPI
FindFirstFileExA(
__in LPCSTR lpFileName,
__in FINDEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags
);
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstFileExW(
__in LPCWSTR lpFileName,
__in FINDEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags
);
#ifdef UNICODE
#define FindFirstFileEx FindFirstFileExW
#else
#define FindFirstFileEx FindFirstFileExA
#endif // !UNICODE
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
FindFirstFileTransactedA( FindFirstFileTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in FINDEX_INFO_LEVELS fInfoLevelId, _In_ FINDEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFindFileData, _Out_writes_bytes_(sizeof(WIN32_FIND_DATAA)) LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp, _In_ FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter, _Reserved_ LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags, _In_ DWORD dwAdditionalFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
FindFirstFileTransactedW( FindFirstFileTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in FINDEX_INFO_LEVELS fInfoLevelId, _In_ FINDEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFindFileData, _Out_writes_bytes_(sizeof(WIN32_FIND_DATAW)) LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp, _In_ FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter, _Reserved_ LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags, _In_ DWORD dwAdditionalFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define FindFirstFileTransacted FindFirstFileTransactedW #define FindFirstFileTransacted FindFirstFileTransactedW
#else #else
#define FindFirstFileTransacted FindFirstFileTransactedA #define FindFirstFileTransacted FindFirstFileTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif #endif
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstFileA(
__in LPCSTR lpFileName,
__out LPWIN32_FIND_DATAA lpFindFileData
);
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstFileW(
__in LPCWSTR lpFileName,
__out LPWIN32_FIND_DATAW lpFindFileData
);
#ifdef UNICODE
#define FindFirstFile FindFirstFileW
#else
#define FindFirstFile FindFirstFileA
#endif // !UNICODE
WINBASEAPI #endif /* _WIN32_WINNT >= 0x0400 */
BOOL
WINAPI
FindNextFileA(
__in HANDLE hFindFile,
__out LPWIN32_FIND_DATAA lpFindFileData
);
WINBASEAPI
BOOL
WINAPI
FindNextFileW(
__in HANDLE hFindFile,
__out LPWIN32_FIND_DATAW lpFindFileData
);
#ifdef UNICODE
#define FindNextFile FindNextFileW
#else
#define FindNextFile FindNextFileA
#endif // !UNICODE
WINBASEAPI #pragma region Desktop Family
DWORD #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINAPI
SearchPathA(
__in_opt LPCSTR lpPath,
__in LPCSTR lpFileName,
__in_opt LPCSTR lpExtension,
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer,
__out_opt LPSTR *lpFilePart
);
WINBASEAPI
DWORD
WINAPI
SearchPathW(
__in_opt LPCWSTR lpPath,
__in LPCWSTR lpFileName,
__in_opt LPCWSTR lpExtension,
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer,
__out_opt LPWSTR *lpFilePart
);
#ifdef UNICODE
#define SearchPath SearchPathW
#else
#define SearchPath SearchPathA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyFileA( CopyFileA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in LPCSTR lpNewFileName, _In_ LPCSTR lpNewFileName,
__in BOOL bFailIfExists _In_ BOOL bFailIfExists
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyFileW( CopyFileW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in LPCWSTR lpNewFileName, _In_ LPCWSTR lpNewFileName,
__in BOOL bFailIfExists _In_ BOOL bFailIfExists
); );
#ifdef UNICODE #ifdef UNICODE
#define CopyFile CopyFileW #define CopyFile CopyFileW
#else #else
#define CopyFile CopyFileA #define CopyFile CopyFileA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef CopyFile #undef CopyFile
__inline __inline
skipping to change at line 9765 skipping to change at line 5051
#else #else
return CopyFileA( return CopyFileA(
#endif #endif
lpExistingFileName, lpExistingFileName,
lpNewFileName, lpNewFileName,
bFailIfExists bFailIfExists
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
typedef typedef
DWORD DWORD
(WINAPI *LPPROGRESS_ROUTINE)( (WINAPI *LPPROGRESS_ROUTINE)(
__in LARGE_INTEGER TotalFileSize, _In_ LARGE_INTEGER TotalFileSize,
__in LARGE_INTEGER TotalBytesTransferred, _In_ LARGE_INTEGER TotalBytesTransferred,
__in LARGE_INTEGER StreamSize, _In_ LARGE_INTEGER StreamSize,
__in LARGE_INTEGER StreamBytesTransferred, _In_ LARGE_INTEGER StreamBytesTransferred,
__in DWORD dwStreamNumber, _In_ DWORD dwStreamNumber,
__in DWORD dwCallbackReason, _In_ DWORD dwCallbackReason,
__in HANDLE hSourceFile, _In_ HANDLE hSourceFile,
__in HANDLE hDestinationFile, _In_ HANDLE hDestinationFile,
__in_opt LPVOID lpData _In_opt_ LPVOID lpData
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyFileExA( CopyFileExA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in LPCSTR lpNewFileName, _In_ LPCSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in_opt LPBOOL pbCancel, _When_(pbCancel != NULL, _Pre_satisfies_(*pbCancel == FALSE))
__in DWORD dwCopyFlags _Inout_opt_ LPBOOL pbCancel,
_In_ DWORD dwCopyFlags
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyFileExW( CopyFileExW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in LPCWSTR lpNewFileName, _In_ LPCWSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in_opt LPBOOL pbCancel, _When_(pbCancel != NULL, _Pre_satisfies_(*pbCancel == FALSE))
__in DWORD dwCopyFlags _Inout_opt_ LPBOOL pbCancel,
_In_ DWORD dwCopyFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CopyFileEx CopyFileExW #define CopyFileEx CopyFileExW
#else #else
#define CopyFileEx CopyFileExA #define CopyFileEx CopyFileExA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyFileTransactedA( CopyFileTransactedA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in LPCSTR lpNewFileName, _In_ LPCSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in_opt LPBOOL pbCancel, _In_opt_ LPBOOL pbCancel,
__in DWORD dwCopyFlags, _In_ DWORD dwCopyFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyFileTransactedW( CopyFileTransactedW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in LPCWSTR lpNewFileName, _In_ LPCWSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in_opt LPBOOL pbCancel, _In_opt_ LPBOOL pbCancel,
__in DWORD dwCopyFlags, _In_ DWORD dwCopyFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define CopyFileTransacted CopyFileTransactedW #define CopyFileTransacted CopyFileTransactedW
#else #else
#define CopyFileTransacted CopyFileTransactedA #define CopyFileTransacted CopyFileTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//
// TODO: Win7 for now, when we roll over the version number this needs to be upd
ated.
//
#if _WIN32_WINNT >= 0x0601
typedef enum _COPYFILE2_MESSAGE_TYPE {
COPYFILE2_CALLBACK_NONE = 0,
COPYFILE2_CALLBACK_CHUNK_STARTED,
COPYFILE2_CALLBACK_CHUNK_FINISHED,
COPYFILE2_CALLBACK_STREAM_STARTED,
COPYFILE2_CALLBACK_STREAM_FINISHED,
COPYFILE2_CALLBACK_POLL_CONTINUE,
COPYFILE2_CALLBACK_ERROR,
COPYFILE2_CALLBACK_MAX,
} COPYFILE2_MESSAGE_TYPE;
typedef enum _COPYFILE2_MESSAGE_ACTION {
COPYFILE2_PROGRESS_CONTINUE = 0,
COPYFILE2_PROGRESS_CANCEL,
COPYFILE2_PROGRESS_STOP,
COPYFILE2_PROGRESS_QUIET,
COPYFILE2_PROGRESS_PAUSE,
} COPYFILE2_MESSAGE_ACTION;
typedef enum _COPYFILE2_COPY_PHASE {
COPYFILE2_PHASE_NONE = 0,
COPYFILE2_PHASE_PREPARE_SOURCE,
COPYFILE2_PHASE_PREPARE_DEST,
COPYFILE2_PHASE_READ_SOURCE,
COPYFILE2_PHASE_WRITE_DESTINATION,
COPYFILE2_PHASE_SERVER_COPY,
COPYFILE2_PHASE_NAMEGRAFT_COPY,
// ... etc phases.
COPYFILE2_PHASE_MAX,
} COPYFILE2_COPY_PHASE;
#define COPYFILE2_MESSAGE_COPY_OFFLOAD (0x00000001L)
typedef struct COPYFILE2_MESSAGE {
COPYFILE2_MESSAGE_TYPE Type;
DWORD dwPadding;
union {
struct {
DWORD dwStreamNumber; // monotonically increasing stream n
umber
DWORD dwReserved;
HANDLE hSourceFile; // handle to the source stream
HANDLE hDestinationFile; // handle to the destination stre
am
ULARGE_INTEGER uliChunkNumber; // monotonically increasing chunk nu
mber
ULARGE_INTEGER uliChunkSize; // size of the copied chunk
ULARGE_INTEGER uliStreamSize; // size of the current stream
ULARGE_INTEGER uliTotalFileSize; // size of all streams for this fi
le
} ChunkStarted;
struct {
DWORD dwStreamNumber; // monotonically increasing stream n
umber
DWORD dwFlags;
HANDLE hSourceFile; // handle to the source stream
HANDLE hDestinationFile; // handle to the destination stre
am
ULARGE_INTEGER uliChunkNumber; // monotonically increasing chunk nu
mber
ULARGE_INTEGER uliChunkSize; // size of the copied chunk
ULARGE_INTEGER uliStreamSize; // size of the current stream
ULARGE_INTEGER uliStreamBytesTransferred; // bytes copied for this
stream so far
ULARGE_INTEGER uliTotalFileSize; // size of all streams for this fi
le
ULARGE_INTEGER uliTotalBytesTransferred; // total bytes copied so f
ar
} ChunkFinished;
struct {
DWORD dwStreamNumber;
DWORD dwReserved;
HANDLE hSourceFile; // handle to the source stream
HANDLE hDestinationFile; // handle to the destination stre
am
ULARGE_INTEGER uliStreamSize; // size of this stream
ULARGE_INTEGER uliTotalFileSize; // total size of all streams for t
his file
} StreamStarted;
struct {
DWORD dwStreamNumber;
DWORD dwReserved;
HANDLE hSourceFile; // handle to the source stream
HANDLE hDestinationFile; // handle to the destination stre
am
ULARGE_INTEGER uliStreamSize;
ULARGE_INTEGER uliStreamBytesTransferred;
ULARGE_INTEGER uliTotalFileSize;
ULARGE_INTEGER uliTotalBytesTransferred;
} StreamFinished;
struct {
DWORD dwReserved;
} PollContinue;
struct {
COPYFILE2_COPY_PHASE CopyPhase;
DWORD dwStreamNumber;
HRESULT hrFailure;
DWORD dwReserved;
ULARGE_INTEGER uliChunkNumber;
ULARGE_INTEGER uliStreamSize;
ULARGE_INTEGER uliStreamBytesTransferred;
ULARGE_INTEGER uliTotalFileSize;
ULARGE_INTEGER uliTotalBytesTransferred;
} Error;
} Info;
} COPYFILE2_MESSAGE;
typedef
COPYFILE2_MESSAGE_ACTION (CALLBACK *PCOPYFILE2_PROGRESS_ROUTINE)(
_In_ const COPYFILE2_MESSAGE *pMessage,
_In_opt_ PVOID pvCallbackContext
);
typedef struct COPYFILE2_EXTENDED_PARAMETERS {
DWORD dwSize;
DWORD dwCopyFlags;
BOOL *pfCancel;
PCOPYFILE2_PROGRESS_ROUTINE pProgressRoutine;
PVOID pvCallbackContext;
} COPYFILE2_EXTENDED_PARAMETERS;
WINBASEAPI
HRESULT
WINAPI
CopyFile2(
_In_ PCWSTR pwszExistingFileName,
_In_ PCWSTR pwszNewFileName,
_In_opt_ COPYFILE2_EXTENDED_PARAMETERS *pExtendedParameters
);
#endif // _WIN32_WINNT >= 0x0601
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileA( MoveFileA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in LPCSTR lpNewFileName _In_ LPCSTR lpNewFileName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileW( MoveFileW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in LPCWSTR lpNewFileName _In_ LPCWSTR lpNewFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define MoveFile MoveFileW #define MoveFile MoveFileW
#else #else
#define MoveFile MoveFileA #define MoveFile MoveFileA
#endif // !UNICODE #endif // !UNICODE
#if defined(_M_CEE) #if defined(_M_CEE)
#undef MoveFile #undef MoveFile
__inline __inline
skipping to change at line 9883 skipping to change at line 5326
return MoveFileW( return MoveFileW(
#else #else
return MoveFileA( return MoveFileA(
#endif #endif
lpExistingFileName, lpExistingFileName,
lpNewFileName lpNewFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileExA( MoveFileExA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in_opt LPCSTR lpNewFileName, _In_opt_ LPCSTR lpNewFileName,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileExW( MoveFileExW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in_opt LPCWSTR lpNewFileName, _In_opt_ LPCWSTR lpNewFileName,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define MoveFileEx MoveFileExW #define MoveFileEx MoveFileExW
#else #else
#define MoveFileEx MoveFileExA #define MoveFileEx MoveFileExA
#endif // !UNICODE #endif // !UNICODE
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileWithProgressA( MoveFileWithProgressA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in_opt LPCSTR lpNewFileName, _In_opt_ LPCSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileWithProgressW( MoveFileWithProgressW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in_opt LPCWSTR lpNewFileName, _In_opt_ LPCWSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define MoveFileWithProgress MoveFileWithProgressW #define MoveFileWithProgress MoveFileWithProgressW
#else #else
#define MoveFileWithProgress MoveFileWithProgressA #define MoveFileWithProgress MoveFileWithProgressA
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0500) #endif // (_WIN32_WINNT >= 0x0500)
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileTransactedA( MoveFileTransactedA(
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__in_opt LPCSTR lpNewFileName, _In_opt_ LPCSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileTransactedW( MoveFileTransactedW(
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__in_opt LPCWSTR lpNewFileName, _In_opt_ LPCWSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData, _In_opt_ LPVOID lpData,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define MoveFileTransacted MoveFileTransactedW #define MoveFileTransacted MoveFileTransactedW
#else #else
#define MoveFileTransacted MoveFileTransactedA #define MoveFileTransacted MoveFileTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0600) #endif // (_WIN32_WINNT >= 0x0600)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define MOVEFILE_REPLACE_EXISTING 0x00000001 #define MOVEFILE_REPLACE_EXISTING 0x00000001
#define MOVEFILE_COPY_ALLOWED 0x00000002 #define MOVEFILE_COPY_ALLOWED 0x00000002
#define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004 #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
#define MOVEFILE_WRITE_THROUGH 0x00000008 #define MOVEFILE_WRITE_THROUGH 0x00000008
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
#define MOVEFILE_CREATE_HARDLINK 0x00000010 #define MOVEFILE_CREATE_HARDLINK 0x00000010
#define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x00000020 #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x00000020
#endif // (_WIN32_WINNT >= 0x0500) #endif // (_WIN32_WINNT >= 0x0500)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReplaceFileA( ReplaceFileA(
__in LPCSTR lpReplacedFileName, _In_ LPCSTR lpReplacedFileName,
__in LPCSTR lpReplacementFileName, _In_ LPCSTR lpReplacementFileName,
__in_opt LPCSTR lpBackupFileName, _In_opt_ LPCSTR lpBackupFileName,
__in DWORD dwReplaceFlags, _In_ DWORD dwReplaceFlags,
__reserved LPVOID lpExclude, _Reserved_ LPVOID lpExclude,
__reserved LPVOID lpReserved _Reserved_ LPVOID lpReserved
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReplaceFileW( ReplaceFileW(
__in LPCWSTR lpReplacedFileName, _In_ LPCWSTR lpReplacedFileName,
__in LPCWSTR lpReplacementFileName, _In_ LPCWSTR lpReplacementFileName,
__in_opt LPCWSTR lpBackupFileName, _In_opt_ LPCWSTR lpBackupFileName,
__in DWORD dwReplaceFlags, _In_ DWORD dwReplaceFlags,
__reserved LPVOID lpExclude, _Reserved_ LPVOID lpExclude,
__reserved LPVOID lpReserved _Reserved_ LPVOID lpReserved
); );
#ifdef UNICODE #ifdef UNICODE
#define ReplaceFile ReplaceFileW #define ReplaceFile ReplaceFileW
#else #else
#define ReplaceFile ReplaceFileA #define ReplaceFile ReplaceFileA
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0500) #endif // (_WIN32_WINNT >= 0x0500)
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
// //
// API call to create hard links. // API call to create hard links.
// //
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateHardLinkA( CreateHardLinkA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__reserved LPSECURITY_ATTRIBUTES lpSecurityAttributes _Reserved_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateHardLinkW( CreateHardLinkW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__reserved LPSECURITY_ATTRIBUTES lpSecurityAttributes _Reserved_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateHardLink CreateHardLinkW #define CreateHardLink CreateHardLinkW
#else #else
#define CreateHardLink CreateHardLinkA #define CreateHardLink CreateHardLinkA
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0500) #endif // (_WIN32_WINNT >= 0x0500)
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
// //
// API call to create hard links. // API call to create hard links.
// //
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateHardLinkTransactedA( CreateHardLinkTransactedA(
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in LPCSTR lpExistingFileName, _In_ LPCSTR lpExistingFileName,
__reserved LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Reserved_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateHardLinkTransactedW( CreateHardLinkTransactedW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in LPCWSTR lpExistingFileName, _In_ LPCWSTR lpExistingFileName,
__reserved LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Reserved_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateHardLinkTransacted CreateHardLinkTransactedW #define CreateHardLinkTransacted CreateHardLinkTransactedW
#else #else
#define CreateHardLinkTransacted CreateHardLinkTransactedA #define CreateHardLinkTransacted CreateHardLinkTransactedA
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0600) #endif // (_WIN32_WINNT >= 0x0600)
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
skipping to change at line 10084 skipping to change at line 5551
} STREAM_INFO_LEVELS; } STREAM_INFO_LEVELS;
typedef struct _WIN32_FIND_STREAM_DATA { typedef struct _WIN32_FIND_STREAM_DATA {
LARGE_INTEGER StreamSize; LARGE_INTEGER StreamSize;
WCHAR cStreamName[ MAX_PATH + 36 ]; WCHAR cStreamName[ MAX_PATH + 36 ];
} WIN32_FIND_STREAM_DATA, *PWIN32_FIND_STREAM_DATA; } WIN32_FIND_STREAM_DATA, *PWIN32_FIND_STREAM_DATA;
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
FindFirstStreamW( FindFirstStreamW(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in STREAM_INFO_LEVELS InfoLevel, _In_ STREAM_INFO_LEVELS InfoLevel,
__out LPVOID lpFindStreamData, _Out_writes_bytes_(sizeof(WIN32_FIND_STREAM_DATA)) LPVOID lpFindStreamData,
__reserved DWORD dwFlags _Reserved_ DWORD dwFlags
); );
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
FindFirstStreamTransactedW ( FindFirstStreamTransactedW (
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in STREAM_INFO_LEVELS InfoLevel, _In_ STREAM_INFO_LEVELS InfoLevel,
__out LPVOID lpFindStreamData, _Out_writes_bytes_(sizeof(WIN32_FIND_STREAM_DATA)) LPVOID lpFindStreamData,
__reserved DWORD dwFlags, _Reserved_ DWORD dwFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#endif // _WIN32_WINNT >= 0x600 #endif // _WIN32_WINNT >= 0x600
WINBASEAPI WINBASEAPI
BOOL BOOL
APIENTRY APIENTRY
FindNextStreamW( FindNextStreamW(
__in HANDLE hFindStream, _In_ HANDLE hFindStream,
__out LPVOID lpFindStreamData _Out_writes_bytes_(sizeof(WIN32_FIND_STREAM_DATA)) LPVOID lpFindStreamData
); );
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0501)
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
FindFirstFileNameW ( FindFirstFileNameW (
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout LPDWORD StringLength, _Inout_ LPDWORD StringLength,
__inout_ecount(*StringLength) PWCHAR LinkName _Out_writes_(*StringLength) PWSTR LinkName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
APIENTRY APIENTRY
FindNextFileNameW ( FindNextFileNameW (
__in HANDLE hFindStream, _In_ HANDLE hFindStream,
__inout LPDWORD StringLength, _Inout_ LPDWORD StringLength,
__inout_ecount(*StringLength) PWCHAR LinkName _Out_writes_(*StringLength) PWSTR LinkName
); );
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
FindFirstFileNameTransactedW ( FindFirstFileNameTransactedW (
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout LPDWORD StringLength, _Inout_ LPDWORD StringLength,
__inout_ecount(*StringLength) PWCHAR LinkName, _Out_writes_(*StringLength) PWSTR LinkName,
__in_opt HANDLE hTransaction _In_opt_ HANDLE hTransaction
); );
#endif #endif
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateNamedPipeA( CreateNamedPipeA(
__in LPCSTR lpName, _In_ LPCSTR lpName,
__in DWORD dwOpenMode, _In_ DWORD dwOpenMode,
__in DWORD dwPipeMode, _In_ DWORD dwPipeMode,
__in DWORD nMaxInstances, _In_ DWORD nMaxInstances,
__in DWORD nOutBufferSize, _In_ DWORD nOutBufferSize,
__in DWORD nInBufferSize, _In_ DWORD nInBufferSize,
__in DWORD nDefaultTimeOut, _In_ DWORD nDefaultTimeOut,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
WINBASEAPI
__out
HANDLE
WINAPI
CreateNamedPipeW(
__in LPCWSTR lpName,
__in DWORD dwOpenMode,
__in DWORD dwPipeMode,
__in DWORD nMaxInstances,
__in DWORD nOutBufferSize,
__in DWORD nInBufferSize,
__in DWORD nDefaultTimeOut,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
#ifdef UNICODE #ifndef UNICODE
#define CreateNamedPipe CreateNamedPipeW
#else
#define CreateNamedPipe CreateNamedPipeA #define CreateNamedPipe CreateNamedPipeA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeHandleStateA( GetNamedPipeHandleStateA(
__in HANDLE hNamedPipe, _In_ HANDLE hNamedPipe,
__out_opt LPDWORD lpState, _Out_opt_ LPDWORD lpState,
__out_opt LPDWORD lpCurInstances, _Out_opt_ LPDWORD lpCurInstances,
__out_opt LPDWORD lpMaxCollectionCount, _Out_opt_ LPDWORD lpMaxCollectionCount,
__out_opt LPDWORD lpCollectDataTimeout, _Out_opt_ LPDWORD lpCollectDataTimeout,
__out_ecount_opt(nMaxUserNameSize) LPSTR lpUserName, _Out_writes_opt_(nMaxUserNameSize) LPSTR lpUserName,
__in DWORD nMaxUserNameSize _In_ DWORD nMaxUserNameSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeHandleStateW( GetNamedPipeHandleStateW(
__in HANDLE hNamedPipe, _In_ HANDLE hNamedPipe,
__out_opt LPDWORD lpState, _Out_opt_ LPDWORD lpState,
__out_opt LPDWORD lpCurInstances, _Out_opt_ LPDWORD lpCurInstances,
__out_opt LPDWORD lpMaxCollectionCount, _Out_opt_ LPDWORD lpMaxCollectionCount,
__out_opt LPDWORD lpCollectDataTimeout, _Out_opt_ LPDWORD lpCollectDataTimeout,
__out_ecount_opt(nMaxUserNameSize) LPWSTR lpUserName, _Out_writes_opt_(nMaxUserNameSize) LPWSTR lpUserName,
__in DWORD nMaxUserNameSize _In_ DWORD nMaxUserNameSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetNamedPipeHandleState GetNamedPipeHandleStateW #define GetNamedPipeHandleState GetNamedPipeHandleStateW
#else #else
#define GetNamedPipeHandleState GetNamedPipeHandleStateA #define GetNamedPipeHandleState GetNamedPipeHandleStateA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CallNamedPipeA( CallNamedPipeA(
__in LPCSTR lpNamedPipeName, _In_ LPCSTR lpNamedPipeName,
__in_bcount_opt(nInBufferSize) LPVOID lpInBuffer, _In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer,
__in DWORD nInBufferSize, _In_ DWORD nInBufferSize,
__out_bcount_part_opt(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer, _Out_writes_bytes_to_opt_(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer,
__in DWORD nOutBufferSize, _In_ DWORD nOutBufferSize,
__out LPDWORD lpBytesRead, _Out_ LPDWORD lpBytesRead,
__in DWORD nTimeOut _In_ DWORD nTimeOut
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CallNamedPipeW( CallNamedPipeW(
__in LPCWSTR lpNamedPipeName, _In_ LPCWSTR lpNamedPipeName,
__in_bcount_opt(nInBufferSize) LPVOID lpInBuffer, _In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer,
__in DWORD nInBufferSize, _In_ DWORD nInBufferSize,
__out_bcount_part_opt(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer, _Out_writes_bytes_to_opt_(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer,
__in DWORD nOutBufferSize, _In_ DWORD nOutBufferSize,
__out LPDWORD lpBytesRead, _Out_ LPDWORD lpBytesRead,
__in DWORD nTimeOut _In_ DWORD nTimeOut
); );
#ifdef UNICODE #ifdef UNICODE
#define CallNamedPipe CallNamedPipeW #define CallNamedPipe CallNamedPipeW
#else #else
#define CallNamedPipe CallNamedPipeA #define CallNamedPipe CallNamedPipeA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WaitNamedPipeA( WaitNamedPipeA(
__in LPCSTR lpNamedPipeName, _In_ LPCSTR lpNamedPipeName,
__in DWORD nTimeOut _In_ DWORD nTimeOut
);
WINBASEAPI
BOOL
WINAPI
WaitNamedPipeW(
__in LPCWSTR lpNamedPipeName,
__in DWORD nTimeOut
); );
#ifdef UNICODE #ifndef UNICODE
#define WaitNamedPipe WaitNamedPipeW
#else
#define WaitNamedPipe WaitNamedPipeA #define WaitNamedPipe WaitNamedPipeA
#endif // !UNICODE #endif
typedef enum {
PipeAttribute,
PipeConnectionAttribute,
PipeHandleAttribute
} PIPE_ATTRIBUTE_TYPE;
WINBASEAPI
BOOL
WINAPI
GetNamedPipeAttribute(
__in HANDLE Pipe,
__in PIPE_ATTRIBUTE_TYPE AttributeType,
__in PSTR AttributeName,
__out_bcount(*AttributeValueLength) PVOID AttributeValue,
__inout PSIZE_T AttributeValueLength
);
WINBASEAPI #if (_WIN32_WINNT >= 0x0600)
BOOL
WINAPI
SetNamedPipeAttribute(
__in HANDLE Pipe,
__in PIPE_ATTRIBUTE_TYPE AttributeType,
__in PSTR AttributeName,
__in PVOID AttributeValue,
__in SIZE_T AttributeValueLength
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeClientComputerNameA( GetNamedPipeClientComputerNameA(
__in HANDLE Pipe, _In_ HANDLE Pipe,
__out_bcount(ClientComputerNameLength) LPSTR ClientComputerName, _Out_writes_bytes_(ClientComputerNameLength) LPSTR ClientComputerName,
__in ULONG ClientComputerNameLength _In_ ULONG ClientComputerNameLength
);
WINBASEAPI
BOOL
WINAPI
GetNamedPipeClientComputerNameW(
__in HANDLE Pipe,
__out_bcount(ClientComputerNameLength) LPWSTR ClientComputerName,
__in ULONG ClientComputerNameLength
); );
#ifdef UNICODE
#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameW #ifndef UNICODE
#else
#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameA #define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeClientProcessId( GetNamedPipeClientProcessId(
__in HANDLE Pipe, _In_ HANDLE Pipe,
__out PULONG ClientProcessId _Out_ PULONG ClientProcessId
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeClientSessionId( GetNamedPipeClientSessionId(
__in HANDLE Pipe, _In_ HANDLE Pipe,
__out PULONG ClientSessionId _Out_ PULONG ClientSessionId
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeServerProcessId( GetNamedPipeServerProcessId(
__in HANDLE Pipe, _In_ HANDLE Pipe,
__out PULONG ServerProcessId _Out_ PULONG ServerProcessId
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNamedPipeServerSessionId( GetNamedPipeServerSessionId(
__in HANDLE Pipe, _In_ HANDLE Pipe,
__out PULONG ServerSessionId _Out_ PULONG ServerSessionId
); );
#endif // (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetVolumeLabelA( SetVolumeLabelA(
__in_opt LPCSTR lpRootPathName, _In_opt_ LPCSTR lpRootPathName,
__in_opt LPCSTR lpVolumeName _In_opt_ LPCSTR lpVolumeName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetVolumeLabelW( SetVolumeLabelW(
__in_opt LPCWSTR lpRootPathName, _In_opt_ LPCWSTR lpRootPathName,
__in_opt LPCWSTR lpVolumeName _In_opt_ LPCWSTR lpVolumeName
); );
#ifdef UNICODE #ifdef UNICODE
#define SetVolumeLabel SetVolumeLabelW #define SetVolumeLabel SetVolumeLabelW
#else #else
#define SetVolumeLabel SetVolumeLabelA #define SetVolumeLabel SetVolumeLabelA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
skipping to change at line 10385 skipping to change at line 5792
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
AreFileApisANSI( VOID ); AreFileApisANSI( VOID );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetVolumeInformationA( GetVolumeInformationA(
__in_opt LPCSTR lpRootPathName, _In_opt_ LPCSTR lpRootPathName,
__out_ecount_opt(nVolumeNameSize) LPSTR lpVolumeNameBuffer, _Out_writes_opt_(nVolumeNameSize) LPSTR lpVolumeNameBuffer,
__in DWORD nVolumeNameSize, _In_ DWORD nVolumeNameSize,
__out_opt LPDWORD lpVolumeSerialNumber, _Out_opt_ LPDWORD lpVolumeSerialNumber,
__out_opt LPDWORD lpMaximumComponentLength, _Out_opt_ LPDWORD lpMaximumComponentLength,
__out_opt LPDWORD lpFileSystemFlags, _Out_opt_ LPDWORD lpFileSystemFlags,
__out_ecount_opt(nFileSystemNameSize) LPSTR lpFileSystemNameBuffer, _Out_writes_opt_(nFileSystemNameSize) LPSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize _In_ DWORD nFileSystemNameSize
);
WINBASEAPI
BOOL
WINAPI
GetVolumeInformationW(
__in_opt LPCWSTR lpRootPathName,
__out_ecount_opt(nVolumeNameSize) LPWSTR lpVolumeNameBuffer,
__in DWORD nVolumeNameSize,
__out_opt LPDWORD lpVolumeSerialNumber,
__out_opt LPDWORD lpMaximumComponentLength,
__out_opt LPDWORD lpFileSystemFlags,
__out_ecount_opt(nFileSystemNameSize) LPWSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize
);
#ifdef UNICODE
#define GetVolumeInformation GetVolumeInformationW
#else
#define GetVolumeInformation GetVolumeInformationA
#endif // !UNICODE
#if(_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
GetVolumeInformationByHandleW(
__in HANDLE hFile,
__out_ecount_opt(nVolumeNameSize) LPWSTR lpVolumeNameBuffer,
__in DWORD nVolumeNameSize,
__out_opt LPDWORD lpVolumeSerialNumber,
__out_opt LPDWORD lpMaximumComponentLength,
__out_opt LPDWORD lpFileSystemFlags,
__out_ecount_opt(nFileSystemNameSize) LPWSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize
);
#endif /* _WIN32_WINNT >= 0x0600 */
WINBASEAPI
BOOL
WINAPI
CancelSynchronousIo(
__in HANDLE hThread
); );
WINBASEAPI #ifndef UNICODE
BOOL #define GetVolumeInformation GetVolumeInformationA
WINAPI #endif
CancelIoEx(
__in HANDLE hFile,
__in_opt LPOVERLAPPED lpOverlapped
);
WINBASEAPI #if (_WIN32_WINNT >= 0x0600)
BOOL
WINAPI
CancelIo(
__in HANDLE hFile
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileBandwidthReservation( SetFileBandwidthReservation(
__in HANDLE hFile, _In_ HANDLE hFile,
__in DWORD nPeriodMilliseconds, _In_ DWORD nPeriodMilliseconds,
__in DWORD nBytesPerPeriod, _In_ DWORD nBytesPerPeriod,
__in BOOL bDiscardable, _In_ BOOL bDiscardable,
__out LPDWORD lpTransferSize, _Out_ LPDWORD lpTransferSize,
__out LPDWORD lpNumOutstandingRequests _Out_ LPDWORD lpNumOutstandingRequests
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetFileBandwidthReservation( GetFileBandwidthReservation(
__in HANDLE hFile, _In_ HANDLE hFile,
__out LPDWORD lpPeriodMilliseconds, _Out_ LPDWORD lpPeriodMilliseconds,
__out LPDWORD lpBytesPerPeriod, _Out_ LPDWORD lpBytesPerPeriod,
__out LPBOOL pDiscardable, _Out_ LPBOOL pDiscardable,
__out LPDWORD lpTransferSize, _Out_ LPDWORD lpTransferSize,
__out LPDWORD lpNumOutstandingRequests _Out_ LPDWORD lpNumOutstandingRequests
); );
#endif // (_WIN32_WINNT >= 0x0600)
// //
// Event logging APIs // Event logging APIs
// //
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ClearEventLogA ( ClearEventLogA (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in_opt LPCSTR lpBackupFileName _In_opt_ LPCSTR lpBackupFileName
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ClearEventLogW ( ClearEventLogW (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in_opt LPCWSTR lpBackupFileName _In_opt_ LPCWSTR lpBackupFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define ClearEventLog ClearEventLogW #define ClearEventLog ClearEventLogW
#else #else
#define ClearEventLog ClearEventLogA #define ClearEventLog ClearEventLogA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
BackupEventLogA ( BackupEventLogA (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in LPCSTR lpBackupFileName _In_ LPCSTR lpBackupFileName
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
BackupEventLogW ( BackupEventLogW (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in LPCWSTR lpBackupFileName _In_ LPCWSTR lpBackupFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define BackupEventLog BackupEventLogW #define BackupEventLog BackupEventLogW
#else #else
#define BackupEventLog BackupEventLogA #define BackupEventLog BackupEventLogA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CloseEventLog ( CloseEventLog (
__in HANDLE hEventLog _In_ HANDLE hEventLog
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
DeregisterEventSource ( DeregisterEventSource (
__in HANDLE hEventLog _In_ HANDLE hEventLog
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
NotifyChangeEventLog( NotifyChangeEventLog(
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in HANDLE hEvent _In_ HANDLE hEvent
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetNumberOfEventLogRecords ( GetNumberOfEventLogRecords (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__out PDWORD NumberOfRecords _Out_ PDWORD NumberOfRecords
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetOldestEventLogRecord ( GetOldestEventLogRecord (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__out PDWORD OldestRecord _Out_ PDWORD OldestRecord
); );
WINADVAPI WINADVAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenEventLogA ( OpenEventLogA (
__in_opt LPCSTR lpUNCServerName, _In_opt_ LPCSTR lpUNCServerName,
__in LPCSTR lpSourceName _In_ LPCSTR lpSourceName
); );
WINADVAPI WINADVAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenEventLogW ( OpenEventLogW (
__in_opt LPCWSTR lpUNCServerName, _In_opt_ LPCWSTR lpUNCServerName,
__in LPCWSTR lpSourceName _In_ LPCWSTR lpSourceName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenEventLog OpenEventLogW #define OpenEventLog OpenEventLogW
#else #else
#define OpenEventLog OpenEventLogA #define OpenEventLog OpenEventLogA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__out
HANDLE HANDLE
WINAPI WINAPI
RegisterEventSourceA ( RegisterEventSourceA (
__in_opt LPCSTR lpUNCServerName, _In_opt_ LPCSTR lpUNCServerName,
__in LPCSTR lpSourceName _In_ LPCSTR lpSourceName
); );
WINADVAPI WINADVAPI
__out
HANDLE HANDLE
WINAPI WINAPI
RegisterEventSourceW ( RegisterEventSourceW (
__in_opt LPCWSTR lpUNCServerName, _In_opt_ LPCWSTR lpUNCServerName,
__in LPCWSTR lpSourceName _In_ LPCWSTR lpSourceName
); );
#ifdef UNICODE #ifdef UNICODE
#define RegisterEventSource RegisterEventSourceW #define RegisterEventSource RegisterEventSourceW
#else #else
#define RegisterEventSource RegisterEventSourceA #define RegisterEventSource RegisterEventSourceA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenBackupEventLogA ( OpenBackupEventLogA (
__in_opt LPCSTR lpUNCServerName, _In_opt_ LPCSTR lpUNCServerName,
__in LPCSTR lpFileName _In_ LPCSTR lpFileName
); );
WINADVAPI WINADVAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenBackupEventLogW ( OpenBackupEventLogW (
__in_opt LPCWSTR lpUNCServerName, _In_opt_ LPCWSTR lpUNCServerName,
__in LPCWSTR lpFileName _In_ LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenBackupEventLog OpenBackupEventLogW #define OpenBackupEventLog OpenBackupEventLogW
#else #else
#define OpenBackupEventLog OpenBackupEventLogA #define OpenBackupEventLog OpenBackupEventLogA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ReadEventLogA ( ReadEventLogA (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in DWORD dwReadFlags, _In_ DWORD dwReadFlags,
__in DWORD dwRecordOffset, _In_ DWORD dwRecordOffset,
__out_bcount_part(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffer, _Out_writes_bytes_to_(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffe
__in DWORD nNumberOfBytesToRead, r,
__out DWORD *pnBytesRead, _In_ DWORD nNumberOfBytesToRead,
__out DWORD *pnMinNumberOfBytesNeeded _Out_ DWORD *pnBytesRead,
_Out_ DWORD *pnMinNumberOfBytesNeeded
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ReadEventLogW ( ReadEventLogW (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in DWORD dwReadFlags, _In_ DWORD dwReadFlags,
__in DWORD dwRecordOffset, _In_ DWORD dwRecordOffset,
__out_bcount_part(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffer, _Out_writes_bytes_to_(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffe
__in DWORD nNumberOfBytesToRead, r,
__out DWORD *pnBytesRead, _In_ DWORD nNumberOfBytesToRead,
__out DWORD *pnMinNumberOfBytesNeeded _Out_ DWORD *pnBytesRead,
_Out_ DWORD *pnMinNumberOfBytesNeeded
); );
#ifdef UNICODE #ifdef UNICODE
#define ReadEventLog ReadEventLogW #define ReadEventLog ReadEventLogW
#else #else
#define ReadEventLog ReadEventLogA #define ReadEventLog ReadEventLogA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ReportEventA ( ReportEventA (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in WORD wType, _In_ WORD wType,
__in WORD wCategory, _In_ WORD wCategory,
__in DWORD dwEventID, _In_ DWORD dwEventID,
__in_opt PSID lpUserSid, _In_opt_ PSID lpUserSid,
__in WORD wNumStrings, _In_ WORD wNumStrings,
__in DWORD dwDataSize, _In_ DWORD dwDataSize,
__in_ecount_opt(wNumStrings) LPCSTR *lpStrings, _In_reads_opt_(wNumStrings) LPCSTR *lpStrings,
__in_bcount_opt(dwDataSize) LPVOID lpRawData _In_reads_bytes_opt_(dwDataSize) LPVOID lpRawData
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ReportEventW ( ReportEventW (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in WORD wType, _In_ WORD wType,
__in WORD wCategory, _In_ WORD wCategory,
__in DWORD dwEventID, _In_ DWORD dwEventID,
__in_opt PSID lpUserSid, _In_opt_ PSID lpUserSid,
__in WORD wNumStrings, _In_ WORD wNumStrings,
__in DWORD dwDataSize, _In_ DWORD dwDataSize,
__in_ecount_opt(wNumStrings) LPCWSTR *lpStrings, _In_reads_opt_(wNumStrings) LPCWSTR *lpStrings,
__in_bcount_opt(dwDataSize) LPVOID lpRawData _In_reads_bytes_opt_(dwDataSize) LPVOID lpRawData
); );
#ifdef UNICODE #ifdef UNICODE
#define ReportEvent ReportEventW #define ReportEvent ReportEventW
#else #else
#define ReportEvent ReportEventA #define ReportEvent ReportEventA
#endif // !UNICODE #endif // !UNICODE
#define EVENTLOG_FULL_INFO 0 #define EVENTLOG_FULL_INFO 0
typedef struct _EVENTLOG_FULL_INFORMATION typedef struct _EVENTLOG_FULL_INFORMATION
{ {
DWORD dwFull; DWORD dwFull;
} }
EVENTLOG_FULL_INFORMATION, *LPEVENTLOG_FULL_INFORMATION; EVENTLOG_FULL_INFORMATION, *LPEVENTLOG_FULL_INFORMATION;
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetEventLogInformation ( GetEventLogInformation (
__in HANDLE hEventLog, _In_ HANDLE hEventLog,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__out_bcount_part(cbBufSize, *pcbBytesNeeded) LPVOID lpBuffer, _Out_writes_bytes_to_(cbBufSize, *pcbBytesNeeded) LPVOID lpBuffer,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
#if (_WIN32_WINNT >= 0x0602)
// //
// Operation prefetch API.
// //
// Security APIs
//
WINADVAPI
BOOL
WINAPI
DuplicateToken(
__in HANDLE ExistingTokenHandle,
__in SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
__deref_out PHANDLE DuplicateTokenHandle
);
WINADVAPI
BOOL
WINAPI
GetKernelObjectSecurity (
__in HANDLE Handle,
__in SECURITY_INFORMATION RequestedInformation,
__out_bcount_opt(nLength) PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in DWORD nLength,
__out LPDWORD lpnLengthNeeded
);
WINADVAPI
BOOL
WINAPI
ImpersonateNamedPipeClient(
__in HANDLE hNamedPipe
);
WINADVAPI
BOOL
WINAPI
ImpersonateSelf(
__in SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
);
WINADVAPI
BOOL
WINAPI
RevertToSelf (
VOID
);
WINADVAPI #define OPERATION_API_VERSION 1
BOOL typedef ULONG OPERATION_ID;
APIENTRY
SetThreadToken (
__in_opt PHANDLE Thread,
__in_opt HANDLE Token
);
WINADVAPI //
BOOL // OperationStart() parameters.
WINAPI //
AccessCheck (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in HANDLE ClientToken,
__in DWORD DesiredAccess,
__in PGENERIC_MAPPING GenericMapping,
__out_bcount_part_opt(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_S
ET PrivilegeSet,
__inout LPDWORD PrivilegeSetLength,
__out LPDWORD GrantedAccess,
__out LPBOOL AccessStatus
);
#if(_WIN32_WINNT >= 0x0500) typedef struct _OPERATION_START_PARAMETERS {
WINADVAPI ULONG Version;
BOOL OPERATION_ID OperationId;
WINAPI ULONG Flags;
AccessCheckByType ( } OPERATION_START_PARAMETERS, *POPERATION_START_PARAMETERS;
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in_opt PSID PrincipalSelfSid,
__in HANDLE ClientToken,
__in DWORD DesiredAccess,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping,
__out_bcount_part_opt(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_S
ET PrivilegeSet,
__inout LPDWORD PrivilegeSetLength,
__out LPDWORD GrantedAccess,
__out LPBOOL AccessStatus
);
WINADVAPI #define OPERATION_START_TRACE_CURRENT_THREAD 0x1
BOOL
WINAPI
AccessCheckByTypeResultList (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in_opt PSID PrincipalSelfSid,
__in HANDLE ClientToken,
__in DWORD DesiredAccess,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping,
__out_bcount_part_opt(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_S
ET PrivilegeSet,
__inout LPDWORD PrivilegeSetLength,
__out LPDWORD GrantedAccessList,
__out LPDWORD AccessStatusList
);
#endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI //
BOOL // OperationEnd() parameters.
WINAPI //
OpenProcessToken (
__in HANDLE ProcessHandle,
__in DWORD DesiredAccess,
__deref_out PHANDLE TokenHandle
);
WINADVAPI typedef struct _OPERATION_END_PARAMETERS {
BOOL ULONG Version;
WINAPI OPERATION_ID OperationId;
OpenThreadToken ( ULONG Flags;
__in HANDLE ThreadHandle, } OPERATION_END_PARAMETERS, *POPERATION_END_PARAMETERS;
__in DWORD DesiredAccess,
__in BOOL OpenAsSelf,
__deref_out PHANDLE TokenHandle
);
WINADVAPI #define OPERATION_END_DISCARD 0x1
BOOL
WINAPI
GetTokenInformation (
__in HANDLE TokenHandle,
__in TOKEN_INFORMATION_CLASS TokenInformationClass,
__out_bcount_part_opt(TokenInformationLength, *ReturnLength) LPVOID TokenInf
ormation,
__in DWORD TokenInformationLength,
__out PDWORD ReturnLength
);
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
SetTokenInformation ( OperationStart (
__in HANDLE TokenHandle, _In_ OPERATION_START_PARAMETERS* OperationStartParams
__in TOKEN_INFORMATION_CLASS TokenInformationClass,
__in_bcount(TokenInformationLength) LPVOID TokenInformation,
__in DWORD TokenInformationLength
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AdjustTokenPrivileges ( OperationEnd (
__in HANDLE TokenHandle, _In_ OPERATION_END_PARAMETERS* OperationEndParams
__in BOOL DisableAllPrivileges,
__in_opt PTOKEN_PRIVILEGES NewState,
__in DWORD BufferLength,
__out_bcount_part_opt(BufferLength, *ReturnLength) PTOKEN_PRIVILEGES Previou
sState,
__out_opt PDWORD ReturnLength
); );
WINADVAPI #endif // _WIN32_WINNT >= 0x0602
BOOL
WINAPI
AdjustTokenGroups (
__in HANDLE TokenHandle,
__in BOOL ResetToDefault,
__in_opt PTOKEN_GROUPS NewState,
__in DWORD BufferLength,
__out_bcount_part_opt(BufferLength, *ReturnLength) PTOKEN_GROUPS PreviousSta
te,
__out_opt PDWORD ReturnLength
);
WINADVAPI //
BOOL //
WINAPI // Security APIs
PrivilegeCheck ( //
__in HANDLE ClientToken,
__inout PPRIVILEGE_SET RequiredPrivileges,
__out LPBOOL pfResult
);
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckAndAuditAlarmA ( AccessCheckAndAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in_opt LPVOID HandleId, _In_opt_ LPVOID HandleId,
__in LPSTR ObjectTypeName, _In_ LPSTR ObjectTypeName,
__in_opt LPSTR ObjectName, _In_opt_ LPSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
__in DWORD DesiredAccess, _In_ DWORD DesiredAccess,
__in PGENERIC_MAPPING GenericMapping, _In_ PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation, _In_ BOOL ObjectCreation,
__out LPDWORD GrantedAccess, _Out_ LPDWORD GrantedAccess,
__out LPBOOL AccessStatus, _Out_ LPBOOL AccessStatus,
__out LPBOOL pfGenerateOnClose _Out_ LPBOOL pfGenerateOnClose
);
WINADVAPI
BOOL
WINAPI
AccessCheckAndAuditAlarmW (
__in LPCWSTR SubsystemName,
__in_opt LPVOID HandleId,
__in LPWSTR ObjectTypeName,
__in_opt LPWSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor,
__in DWORD DesiredAccess,
__in PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation,
__out LPDWORD GrantedAccess,
__out LPBOOL AccessStatus,
__out LPBOOL pfGenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmW
#else
#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA #define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA
#endif // !UNICODE #endif
#if(_WIN32_WINNT >= 0x0500) #if(_WIN32_WINNT >= 0x0500)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckByTypeAndAuditAlarmA ( AccessCheckByTypeAndAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in LPCSTR ObjectTypeName, _In_ LPCSTR ObjectTypeName,
__in_opt LPCSTR ObjectName, _In_opt_ LPCSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PSID PrincipalSelfSid, _In_opt_ PSID PrincipalSelfSid,
__in DWORD DesiredAccess, _In_ DWORD DesiredAccess,
__in AUDIT_EVENT_TYPE AuditType, _In_ AUDIT_EVENT_TYPE AuditType,
__in DWORD Flags, _In_ DWORD Flags,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, _Inout_updates_opt_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength, _In_ DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping, _In_ PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation, _In_ BOOL ObjectCreation,
__out LPDWORD GrantedAccess, _Out_ LPDWORD GrantedAccess,
__out LPBOOL AccessStatus, _Out_ LPBOOL AccessStatus,
__out LPBOOL pfGenerateOnClose _Out_ LPBOOL pfGenerateOnClose
);
WINADVAPI
BOOL
WINAPI
AccessCheckByTypeAndAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in LPCWSTR ObjectTypeName,
__in_opt LPCWSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PSID PrincipalSelfSid,
__in DWORD DesiredAccess,
__in AUDIT_EVENT_TYPE AuditType,
__in DWORD Flags,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation,
__out LPDWORD GrantedAccess,
__out LPBOOL AccessStatus,
__out LPBOOL pfGenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmW
#else
#define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmA #define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckByTypeResultListAndAuditAlarmA ( AccessCheckByTypeResultListAndAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in LPCSTR ObjectTypeName, _In_ LPCSTR ObjectTypeName,
__in_opt LPCSTR ObjectName, _In_opt_ LPCSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PSID PrincipalSelfSid, _In_opt_ PSID PrincipalSelfSid,
__in DWORD DesiredAccess, _In_ DWORD DesiredAccess,
__in AUDIT_EVENT_TYPE AuditType, _In_ AUDIT_EVENT_TYPE AuditType,
__in DWORD Flags, _In_ DWORD Flags,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, _Inout_updates_opt_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength, _In_ DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping, _In_ PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation, _In_ BOOL ObjectCreation,
__out LPDWORD GrantedAccess, _Out_writes_(ObjectTypeListLength) LPDWORD GrantedAccess,
__out LPDWORD AccessStatusList, _Out_writes_(ObjectTypeListLength) LPDWORD AccessStatusList,
__out LPBOOL pfGenerateOnClose _Out_ LPBOOL pfGenerateOnClose
);
WINADVAPI
BOOL
WINAPI
AccessCheckByTypeResultListAndAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in LPCWSTR ObjectTypeName,
__in_opt LPCWSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PSID PrincipalSelfSid,
__in DWORD DesiredAccess,
__in AUDIT_EVENT_TYPE AuditType,
__in DWORD Flags,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation,
__out LPDWORD GrantedAccess,
__out LPDWORD AccessStatusList,
__out LPBOOL pfGenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAnd
AuditAlarmW
#else
#define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAnd AuditAlarmA #define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAnd AuditAlarmA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckByTypeResultListAndAuditAlarmByHandleA ( AccessCheckByTypeResultListAndAuditAlarmByHandleA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in HANDLE ClientToken, _In_ HANDLE ClientToken,
__in LPCSTR ObjectTypeName, _In_ LPCSTR ObjectTypeName,
__in_opt LPCSTR ObjectName, _In_opt_ LPCSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PSID PrincipalSelfSid, _In_opt_ PSID PrincipalSelfSid,
__in DWORD DesiredAccess, _In_ DWORD DesiredAccess,
__in AUDIT_EVENT_TYPE AuditType, _In_ AUDIT_EVENT_TYPE AuditType,
__in DWORD Flags, _In_ DWORD Flags,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, _Inout_updates_opt_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength, _In_ DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping, _In_ PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation, _In_ BOOL ObjectCreation,
__out LPDWORD GrantedAccess, _Out_writes_(ObjectTypeListLength) LPDWORD GrantedAccess,
__out LPDWORD AccessStatusList, _Out_writes_(ObjectTypeListLength) LPDWORD AccessStatusList,
__out LPBOOL pfGenerateOnClose _Out_ LPBOOL pfGenerateOnClose
);
WINADVAPI
BOOL
WINAPI
AccessCheckByTypeResultListAndAuditAlarmByHandleW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in HANDLE ClientToken,
__in LPCWSTR ObjectTypeName,
__in_opt LPCWSTR ObjectName,
__in PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PSID PrincipalSelfSid,
__in DWORD DesiredAccess,
__in AUDIT_EVENT_TYPE AuditType,
__in DWORD Flags,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping,
__in BOOL ObjectCreation,
__out LPDWORD GrantedAccess,
__out LPDWORD AccessStatusList,
__out LPBOOL pfGenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResul
tListAndAuditAlarmByHandleW
#else
#define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResul tListAndAuditAlarmByHandleA #define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResul tListAndAuditAlarmByHandleA
#endif // !UNICODE #endif
#endif //(_WIN32_WINNT >= 0x0500) #endif //(_WIN32_WINNT >= 0x0500)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ObjectOpenAuditAlarmA ( ObjectOpenAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in LPSTR ObjectTypeName, _In_ LPSTR ObjectTypeName,
__in_opt LPSTR ObjectName, _In_opt_ LPSTR ObjectName,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor, _In_ PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in HANDLE ClientToken, _In_ HANDLE ClientToken,
__in DWORD DesiredAccess, _In_ DWORD DesiredAccess,
__in DWORD GrantedAccess, _In_ DWORD GrantedAccess,
__in_opt PPRIVILEGE_SET Privileges, _In_opt_ PPRIVILEGE_SET Privileges,
__in BOOL ObjectCreation, _In_ BOOL ObjectCreation,
__in BOOL AccessGranted, _In_ BOOL AccessGranted,
__out LPBOOL GenerateOnClose _Out_ LPBOOL GenerateOnClose
);
WINADVAPI
BOOL
WINAPI
ObjectOpenAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in LPWSTR ObjectTypeName,
__in_opt LPWSTR ObjectName,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in HANDLE ClientToken,
__in DWORD DesiredAccess,
__in DWORD GrantedAccess,
__in_opt PPRIVILEGE_SET Privileges,
__in BOOL ObjectCreation,
__in BOOL AccessGranted,
__out LPBOOL GenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmW
#else
#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA #define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ObjectPrivilegeAuditAlarmA ( ObjectPrivilegeAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in HANDLE ClientToken, _In_ HANDLE ClientToken,
__in DWORD DesiredAccess, _In_ DWORD DesiredAccess,
__in PPRIVILEGE_SET Privileges, _In_ PPRIVILEGE_SET Privileges,
__in BOOL AccessGranted _In_ BOOL AccessGranted
);
WINADVAPI
BOOL
WINAPI
ObjectPrivilegeAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in HANDLE ClientToken,
__in DWORD DesiredAccess,
__in PPRIVILEGE_SET Privileges,
__in BOOL AccessGranted
); );
#ifdef UNICODE #ifndef UNICODE
#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmW
#else
#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA #define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ObjectCloseAuditAlarmA ( ObjectCloseAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in BOOL GenerateOnClose _In_ BOOL GenerateOnClose
);
WINADVAPI
BOOL
WINAPI
ObjectCloseAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in BOOL GenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmW
#else
#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA #define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ObjectDeleteAuditAlarmA ( ObjectDeleteAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPVOID HandleId, _In_ LPVOID HandleId,
__in BOOL GenerateOnClose _In_ BOOL GenerateOnClose
);
WINADVAPI
BOOL
WINAPI
ObjectDeleteAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPVOID HandleId,
__in BOOL GenerateOnClose
); );
#ifdef UNICODE #ifndef UNICODE
#define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmW
#else
#define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA #define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
PrivilegedServiceAuditAlarmA ( PrivilegedServiceAuditAlarmA (
__in LPCSTR SubsystemName, _In_ LPCSTR SubsystemName,
__in LPCSTR ServiceName, _In_ LPCSTR ServiceName,
__in HANDLE ClientToken, _In_ HANDLE ClientToken,
__in PPRIVILEGE_SET Privileges, _In_ PPRIVILEGE_SET Privileges,
__in BOOL AccessGranted _In_ BOOL AccessGranted
);
WINADVAPI
BOOL
WINAPI
PrivilegedServiceAuditAlarmW (
__in LPCWSTR SubsystemName,
__in LPCWSTR ServiceName,
__in HANDLE ClientToken,
__in PPRIVILEGE_SET Privileges,
__in BOOL AccessGranted
); );
#ifdef UNICODE #ifndef UNICODE
#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmW
#else
#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA #define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA
#endif // !UNICODE #endif
#if(_WIN32_WINNT >= 0x0501)
WINADVAPI
BOOL
WINAPI
IsWellKnownSid (
__in PSID pSid,
__in WELL_KNOWN_SID_TYPE WellKnownSidType
);
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
CreateWellKnownSid(
__in WELL_KNOWN_SID_TYPE WellKnownSidType,
__in_opt PSID DomainSid,
__out_bcount_part_opt(*cbSid, *cbSid) PSID pSid,
__inout DWORD *cbSid
);
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
EqualDomainSid(
__in PSID pSid1,
__in PSID pSid2,
__out BOOL *pfEqual
);
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
GetWindowsAccountDomainSid(
__in PSID pSid,
__out_bcount_part_opt(*cbDomainSid, *cbDomainSid) PSID pDomainSid,
__inout DWORD* cbDomainSid
);
#endif //(_WIN32_WINNT >= 0x0501)
WINADVAPI
BOOL
WINAPI
IsValidSid (
__in PSID pSid
);
WINADVAPI
BOOL
WINAPI
EqualSid (
__in PSID pSid1,
__in PSID pSid2
);
WINADVAPI
BOOL
WINAPI
EqualPrefixSid (
__in PSID pSid1,
__in PSID pSid2
);
WINADVAPI
DWORD
WINAPI
GetSidLengthRequired (
__in UCHAR nSubAuthorityCount
);
WINADVAPI
BOOL
WINAPI
AllocateAndInitializeSid (
__in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
__in BYTE nSubAuthorityCount,
__in DWORD nSubAuthority0,
__in DWORD nSubAuthority1,
__in DWORD nSubAuthority2,
__in DWORD nSubAuthority3,
__in DWORD nSubAuthority4,
__in DWORD nSubAuthority5,
__in DWORD nSubAuthority6,
__in DWORD nSubAuthority7,
__deref_out PSID *pSid
);
WINADVAPI
PVOID
WINAPI
FreeSid(
__in PSID pSid
);
WINADVAPI
BOOL
WINAPI
InitializeSid (
__out PSID Sid,
__in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
__in BYTE nSubAuthorityCount
);
WINADVAPI
__out
PSID_IDENTIFIER_AUTHORITY
WINAPI
GetSidIdentifierAuthority (
__in PSID pSid
);
WINADVAPI
__out
PDWORD
WINAPI
GetSidSubAuthority (
__in PSID pSid,
__in DWORD nSubAuthority
);
WINADVAPI
__out
PUCHAR
WINAPI
GetSidSubAuthorityCount (
__in PSID pSid
);
WINADVAPI
DWORD
WINAPI
GetLengthSid (
__in PSID pSid
);
WINADVAPI
BOOL
WINAPI
CopySid (
__in DWORD nDestinationSidLength,
__out_bcount(nDestinationSidLength) PSID pDestinationSid,
__in PSID pSourceSid
);
WINADVAPI
BOOL
WINAPI
AreAllAccessesGranted (
__in DWORD GrantedAccess,
__in DWORD DesiredAccess
);
WINADVAPI
BOOL
WINAPI
AreAnyAccessesGranted (
__in DWORD GrantedAccess,
__in DWORD DesiredAccess
);
WINADVAPI
VOID
WINAPI
MapGenericMask (
__inout PDWORD AccessMask,
__in PGENERIC_MAPPING GenericMapping
);
WINADVAPI
BOOL
WINAPI
IsValidAcl (
__in PACL pAcl
);
WINADVAPI
BOOL
WINAPI
InitializeAcl (
__out_bcount(nAclLength) PACL pAcl,
__in DWORD nAclLength,
__in DWORD dwAclRevision
);
WINADVAPI
BOOL
WINAPI
GetAclInformation (
__in PACL pAcl,
__out_bcount(nAclInformationLength) LPVOID pAclInformation,
__in DWORD nAclInformationLength,
__in ACL_INFORMATION_CLASS dwAclInformationClass
);
WINADVAPI
BOOL
WINAPI
SetAclInformation (
__inout PACL pAcl,
__in_bcount(nAclInformationLength) LPVOID pAclInformation,
__in DWORD nAclInformationLength,
__in ACL_INFORMATION_CLASS dwAclInformationClass
);
WINADVAPI
BOOL
WINAPI
AddAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD dwStartingAceIndex,
__in_bcount(nAceListLength) LPVOID pAceList,
__in DWORD nAceListLength
);
WINADVAPI
BOOL
WINAPI
DeleteAce (
__inout PACL pAcl,
__in DWORD dwAceIndex
);
WINADVAPI
BOOL
WINAPI
GetAce (
__in PACL pAcl,
__in DWORD dwAceIndex,
__deref_out LPVOID *pAce
);
WINADVAPI
BOOL
WINAPI
AddAccessAllowedAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AccessMask,
__in PSID pSid
);
#if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL
WINAPI
AddAccessAllowedAceEx (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD AccessMask,
__in PSID pSid
);
#endif /* _WIN32_WINNT >= 0x0500 */
#if(_WIN32_WINNT >= 0x0600)
WINADVAPI
BOOL
WINAPI
AddMandatoryAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD MandatoryPolicy,
__in PSID pLabelSid
);
#endif /* _WIN32_WINNT >= 0x0600 */
#if(_WIN32_WINNT >= 0x0601) #if(_WIN32_WINNT >= 0x0601)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AddConditionalAce ( AddConditionalAce (
__inout PACL pAcl, _Inout_ PACL pAcl,
__in DWORD dwAceRevision, _In_ DWORD dwAceRevision,
__in DWORD AceFlags, _In_ DWORD AceFlags,
__in UCHAR AceType, _In_ UCHAR AceType,
__in DWORD AccessMask, _In_ DWORD AccessMask,
__in PSID pSid, _In_ PSID pSid,
__in PWCHAR ConditionStr, _In_ _Null_terminated_ PWCHAR ConditionStr,
__out DWORD *ReturnLength _Out_ DWORD *ReturnLength
); );
#endif /* _WIN32_WINNT >= 0x0601 */ #endif /* _WIN32_WINNT >= 0x0601 */
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AddAccessDeniedAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AccessMask,
__in PSID pSid
);
#if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL
WINAPI
AddAccessDeniedAceEx (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD AccessMask,
__in PSID pSid
);
#endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI
BOOL
WINAPI
AddAuditAccessAce(
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD dwAccessMask,
__in PSID pSid,
__in BOOL bAuditSuccess,
__in BOOL bAuditFailure
);
#if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL
WINAPI
AddAuditAccessAceEx(
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD dwAccessMask,
__in PSID pSid,
__in BOOL bAuditSuccess,
__in BOOL bAuditFailure
);
WINADVAPI
BOOL
WINAPI
AddAccessAllowedObjectAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD AccessMask,
__in_opt GUID *ObjectTypeGuid,
__in_opt GUID *InheritedObjectTypeGuid,
__in PSID pSid
);
WINADVAPI
BOOL
WINAPI
AddAccessDeniedObjectAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD AccessMask,
__in_opt GUID *ObjectTypeGuid,
__in_opt GUID *InheritedObjectTypeGuid,
__in PSID pSid
);
WINADVAPI
BOOL
WINAPI
AddAuditAccessObjectAce (
__inout PACL pAcl,
__in DWORD dwAceRevision,
__in DWORD AceFlags,
__in DWORD AccessMask,
__in_opt GUID *ObjectTypeGuid,
__in_opt GUID *InheritedObjectTypeGuid,
__in PSID pSid,
__in BOOL bAuditSuccess,
__in BOOL bAuditFailure
);
#endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI
BOOL
WINAPI
FindFirstFreeAce (
__in PACL pAcl,
__deref_out LPVOID *pAce
);
WINADVAPI
BOOL
WINAPI
InitializeSecurityDescriptor (
__out PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in DWORD dwRevision
);
WINADVAPI
BOOL
WINAPI
IsValidSecurityDescriptor (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor
);
WINADVAPI
BOOL
WINAPI
IsValidRelativeSecurityDescriptor (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in ULONG SecurityDescriptorLength,
__in SECURITY_INFORMATION RequiredInformation
);
WINADVAPI
DWORD
WINAPI
GetSecurityDescriptorLength (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor
);
WINADVAPI
BOOL
WINAPI
GetSecurityDescriptorControl (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__out PSECURITY_DESCRIPTOR_CONTROL pControl,
__out LPDWORD lpdwRevision
);
#if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL
WINAPI
SetSecurityDescriptorControl (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
__in SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
);
#endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI
BOOL
WINAPI
SetSecurityDescriptorDacl (
__inout PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in BOOL bDaclPresent,
__in_opt PACL pDacl,
__in BOOL bDaclDefaulted
);
WINADVAPI
BOOL
WINAPI
GetSecurityDescriptorDacl (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__out LPBOOL lpbDaclPresent,
__deref_out PACL *pDacl,
__out LPBOOL lpbDaclDefaulted
);
WINADVAPI
BOOL
WINAPI
SetSecurityDescriptorSacl (
__inout PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in BOOL bSaclPresent,
__in_opt PACL pSacl,
__in BOOL bSaclDefaulted
);
WINADVAPI
BOOL
WINAPI
GetSecurityDescriptorSacl (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__out LPBOOL lpbSaclPresent,
__deref_out PACL *pSacl,
__out LPBOOL lpbSaclDefaulted
);
WINADVAPI
BOOL
WINAPI
SetSecurityDescriptorOwner (
__inout PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in_opt PSID pOwner,
__in BOOL bOwnerDefaulted
);
WINADVAPI
BOOL
WINAPI
GetSecurityDescriptorOwner (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__deref_out PSID *pOwner,
__out LPBOOL lpbOwnerDefaulted
);
WINADVAPI
BOOL
WINAPI
SetSecurityDescriptorGroup (
__inout PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in_opt PSID pGroup,
__in BOOL bGroupDefaulted
);
WINADVAPI
BOOL
WINAPI
GetSecurityDescriptorGroup (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__deref_out PSID *pGroup,
__out LPBOOL lpbGroupDefaulted
);
WINADVAPI
DWORD
WINAPI
SetSecurityDescriptorRMControl(
__inout PSECURITY_DESCRIPTOR SecurityDescriptor,
__in_opt PUCHAR RMControl
);
WINADVAPI
DWORD
WINAPI
GetSecurityDescriptorRMControl(
__in PSECURITY_DESCRIPTOR SecurityDescriptor,
__out PUCHAR RMControl
);
WINADVAPI
BOOL
WINAPI
CreatePrivateObjectSecurity (
__in_opt PSECURITY_DESCRIPTOR ParentDescriptor,
__in_opt PSECURITY_DESCRIPTOR CreatorDescriptor,
__deref_out PSECURITY_DESCRIPTOR * NewDescriptor,
__in BOOL IsDirectoryObject,
__in_opt HANDLE Token,
__in PGENERIC_MAPPING GenericMapping
);
#if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL
WINAPI
ConvertToAutoInheritPrivateObjectSecurity(
__in_opt PSECURITY_DESCRIPTOR ParentDescriptor,
__in PSECURITY_DESCRIPTOR CurrentSecurityDescriptor,
__deref_out PSECURITY_DESCRIPTOR *NewSecurityDescriptor,
__in_opt GUID *ObjectType,
__in BOOLEAN IsDirectoryObject,
__in PGENERIC_MAPPING GenericMapping
);
WINADVAPI
BOOL
WINAPI
CreatePrivateObjectSecurityEx (
__in_opt PSECURITY_DESCRIPTOR ParentDescriptor,
__in_opt PSECURITY_DESCRIPTOR CreatorDescriptor,
__deref_out PSECURITY_DESCRIPTOR * NewDescriptor,
__in_opt GUID *ObjectType,
__in BOOL IsContainerObject,
__in ULONG AutoInheritFlags,
__in_opt HANDLE Token,
__in PGENERIC_MAPPING GenericMapping
);
WINADVAPI
BOOL
WINAPI
CreatePrivateObjectSecurityWithMultipleInheritance (
__in_opt PSECURITY_DESCRIPTOR ParentDescriptor,
__in_opt PSECURITY_DESCRIPTOR CreatorDescriptor,
__deref_out PSECURITY_DESCRIPTOR * NewDescriptor,
__in_ecount_opt(GuidCount) GUID **ObjectTypes,
__in ULONG GuidCount,
__in BOOL IsContainerObject,
__in ULONG AutoInheritFlags,
__in_opt HANDLE Token,
__in PGENERIC_MAPPING GenericMapping
);
#endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI
BOOL
WINAPI
SetPrivateObjectSecurity (
__in SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR ModificationDescriptor,
__deref_inout PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
__in PGENERIC_MAPPING GenericMapping,
__in_opt HANDLE Token
);
#if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL
WINAPI
SetPrivateObjectSecurityEx (
__in SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR ModificationDescriptor,
__deref_inout PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
__in ULONG AutoInheritFlags,
__in PGENERIC_MAPPING GenericMapping,
__in_opt HANDLE Token
);
#endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
GetPrivateObjectSecurity (
__in PSECURITY_DESCRIPTOR ObjectDescriptor,
__in SECURITY_INFORMATION SecurityInformation,
__out_bcount_part_opt(DescriptorLength, *ReturnLength) PSECURITY_DESCRIPTOR
ResultantDescriptor,
__in DWORD DescriptorLength,
__out PDWORD ReturnLength
);
WINADVAPI
BOOL
WINAPI
DestroyPrivateObjectSecurity (
__deref PSECURITY_DESCRIPTOR * ObjectDescriptor
);
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
MakeSelfRelativeSD (
__in PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
__out_bcount_part_opt(*lpdwBufferLength, *lpdwBufferLength) PSECURITY_DESCRI
PTOR pSelfRelativeSecurityDescriptor,
__inout LPDWORD lpdwBufferLength
);
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
MakeAbsoluteSD (
__in PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
__out_bcount_part_opt(*lpdwAbsoluteSecurityDescriptorSize, *lpdwAbsoluteSecu
rityDescriptorSize) PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
__inout LPDWORD lpdwAbsoluteSecurityDescriptorSize,
__out_bcount_part_opt(*lpdwDaclSize, *lpdwDaclSize) PACL pDacl,
__inout LPDWORD lpdwDaclSize,
__out_bcount_part_opt(*lpdwSaclSize, *lpdwSaclSize) PACL pSacl,
__inout LPDWORD lpdwSaclSize,
__out_bcount_part_opt(*lpdwOwnerSize, *lpdwOwnerSize) PSID pOwner,
__inout LPDWORD lpdwOwnerSize,
__out_bcount_part_opt(*lpdwPrimaryGroupSize, *lpdwPrimaryGroupSize) PSID pPr
imaryGroup,
__inout LPDWORD lpdwPrimaryGroupSize
);
WINADVAPI
__success(return != FALSE) BOOL
WINAPI
MakeAbsoluteSD2 (
__inout_bcount_part(*lpdwBufferSize, *lpdwBufferSize) PSECURITY_DESCRIPTOR p
SelfRelativeSecurityDescriptor,
__inout LPDWORD lpdwBufferSize
);
WINADVAPI
VOID
WINAPI
QuerySecurityAccessMask(
__in SECURITY_INFORMATION SecurityInformation,
__out LPDWORD DesiredAccess
);
WINADVAPI
VOID
WINAPI
SetSecurityAccessMask(
__in SECURITY_INFORMATION SecurityInformation,
__out LPDWORD DesiredAccess
);
WINADVAPI
BOOL
WINAPI
SetFileSecurityA ( SetFileSecurityA (
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor _In_ PSECURITY_DESCRIPTOR pSecurityDescriptor
);
WINADVAPI
BOOL
WINAPI
SetFileSecurityW (
__in LPCWSTR lpFileName,
__in SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor
); );
#ifdef UNICODE #ifndef UNICODE
#define SetFileSecurity SetFileSecurityW
#else
#define SetFileSecurity SetFileSecurityA #define SetFileSecurity SetFileSecurityA
#endif // !UNICODE #endif
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetFileSecurityA ( GetFileSecurityA (
__in LPCSTR lpFileName, _In_ LPCSTR lpFileName,
__in SECURITY_INFORMATION RequestedInformation, _In_ SECURITY_INFORMATION RequestedInformation,
__out_bcount_part_opt(nLength, *lpnLengthNeeded) PSECURITY_DESCRIPTOR pSecur _Out_writes_bytes_to_opt_(nLength, *lpnLengthNeeded) PSECURITY_DESCRIPTOR pS
ityDescriptor, ecurityDescriptor,
__in DWORD nLength, _In_ DWORD nLength,
__out LPDWORD lpnLengthNeeded _Out_ LPDWORD lpnLengthNeeded
);
WINADVAPI
BOOL
WINAPI
GetFileSecurityW (
__in LPCWSTR lpFileName,
__in SECURITY_INFORMATION RequestedInformation,
__out_bcount_part_opt(nLength, *lpnLengthNeeded) PSECURITY_DESCRIPTOR pSecur
ityDescriptor,
__in DWORD nLength,
__out LPDWORD lpnLengthNeeded
); );
#ifdef UNICODE #ifndef UNICODE
#define GetFileSecurity GetFileSecurityW
#else
#define GetFileSecurity GetFileSecurityA #define GetFileSecurity GetFileSecurityA
#endif // !UNICODE #endif
WINADVAPI
BOOL
WINAPI
SetKernelObjectSecurity (
__in HANDLE Handle,
__in SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR SecurityDescriptor
);
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstChangeNotificationA(
__in LPCSTR lpPathName,
__in BOOL bWatchSubtree,
__in DWORD dwNotifyFilter
);
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstChangeNotificationW(
__in LPCWSTR lpPathName,
__in BOOL bWatchSubtree,
__in DWORD dwNotifyFilter
);
#ifdef UNICODE
#define FindFirstChangeNotification FindFirstChangeNotificationW
#else
#define FindFirstChangeNotification FindFirstChangeNotificationA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
FindNextChangeNotification(
__in HANDLE hChangeHandle
);
WINBASEAPI
BOOL
WINAPI
FindCloseChangeNotification(
__in HANDLE hChangeHandle
);
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReadDirectoryChangesW( ReadDirectoryChangesW(
__in HANDLE hDirectory, _In_ HANDLE hDirectory,
__out_bcount_part(nBufferLength, *lpBytesReturned) LPVOID lpBuffer, _Out_writes_bytes_to_(nBufferLength, *lpBytesReturned) LPVOID lpBuffer,
__in DWORD nBufferLength, _In_ DWORD nBufferLength,
__in BOOL bWatchSubtree, _In_ BOOL bWatchSubtree,
__in DWORD dwNotifyFilter, _In_ DWORD dwNotifyFilter,
__out_opt LPDWORD lpBytesReturned, _Out_opt_ LPDWORD lpBytesReturned,
__inout_opt LPOVERLAPPED lpOverlapped, _Inout_opt_ LPOVERLAPPED lpOverlapped,
__in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine _In_opt_ LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
); );
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
WINBASEAPI
BOOL
WINAPI
VirtualLock(
__in LPVOID lpAddress,
__in SIZE_T dwSize
);
WINBASEAPI
BOOL
WINAPI
VirtualUnlock(
__in LPVOID lpAddress,
__in SIZE_T dwSize
);
WINBASEAPI
__out_opt __out_data_source(FILE)
LPVOID
WINAPI
MapViewOfFileEx(
__in HANDLE hFileMappingObject,
__in DWORD dwDesiredAccess,
__in DWORD dwFileOffsetHigh,
__in DWORD dwFileOffsetLow,
__in SIZE_T dwNumberOfBytesToMap,
__in_opt LPVOID lpBaseAddress
);
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
__out __out_data_source(FILE) _Ret_maybenull_ __out_data_source(FILE)
LPVOID LPVOID
WINAPI WINAPI
MapViewOfFileExNuma( MapViewOfFileExNuma(
__in HANDLE hFileMappingObject, _In_ HANDLE hFileMappingObject,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwFileOffsetHigh, _In_ DWORD dwFileOffsetHigh,
__in DWORD dwFileOffsetLow, _In_ DWORD dwFileOffsetLow,
__in SIZE_T dwNumberOfBytesToMap, _In_ SIZE_T dwNumberOfBytesToMap,
__in_opt LPVOID lpBaseAddress, _In_opt_ LPVOID lpBaseAddress,
__in DWORD nndPreferred _In_ DWORD nndPreferred
); );
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetPriorityClass(
__in HANDLE hProcess,
__in DWORD dwPriorityClass
);
WINBASEAPI
DWORD
WINAPI
GetPriorityClass(
__in HANDLE hProcess
);
WINBASEAPI
BOOL
WINAPI
IsBadReadPtr( IsBadReadPtr(
__in_opt CONST VOID *lp, _In_opt_ CONST VOID *lp,
__in UINT_PTR ucb _In_ UINT_PTR ucb
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsBadWritePtr( IsBadWritePtr(
__in_opt LPVOID lp, _In_opt_ LPVOID lp,
__in UINT_PTR ucb _In_ UINT_PTR ucb
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsBadHugeReadPtr( IsBadHugeReadPtr(
__in_opt CONST VOID *lp, _In_opt_ CONST VOID *lp,
__in UINT_PTR ucb _In_ UINT_PTR ucb
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsBadHugeWritePtr( IsBadHugeWritePtr(
__in_opt LPVOID lp, _In_opt_ LPVOID lp,
__in UINT_PTR ucb _In_ UINT_PTR ucb
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsBadCodePtr( IsBadCodePtr(
__in_opt FARPROC lpfn _In_opt_ FARPROC lpfn
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsBadStringPtrA( IsBadStringPtrA(
__in_opt LPCSTR lpsz, _In_opt_ LPCSTR lpsz,
__in UINT_PTR ucchMax _In_ UINT_PTR ucchMax
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsBadStringPtrW( IsBadStringPtrW(
__in_opt LPCWSTR lpsz, _In_opt_ LPCWSTR lpsz,
__in UINT_PTR ucchMax _In_ UINT_PTR ucchMax
); );
#ifdef UNICODE #ifdef UNICODE
#define IsBadStringPtr IsBadStringPtrW #define IsBadStringPtr IsBadStringPtrW
#else #else
#define IsBadStringPtr IsBadStringPtrA #define IsBadStringPtr IsBadStringPtrA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountSidA( LookupAccountSidA(
__in_opt LPCSTR lpSystemName, _In_opt_ LPCSTR lpSystemName,
__in PSID Sid, _In_ PSID Sid,
__out_ecount_part_opt(*cchName, *cchName + 1) LPSTR Name, _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR Name,
__inout LPDWORD cchName, _Inout_ LPDWORD cchName,
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
) LPSTR ReferencedDomainName, LPSTR ReferencedDomainName,
__inout LPDWORD cchReferencedDomainName, _Inout_ LPDWORD cchReferencedDomainName,
__out PSID_NAME_USE peUse _Out_ PSID_NAME_USE peUse
); );
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountSidW( LookupAccountSidW(
__in_opt LPCWSTR lpSystemName, _In_opt_ LPCWSTR lpSystemName,
__in PSID Sid, _In_ PSID Sid,
__out_ecount_part_opt(*cchName, *cchName + 1) LPWSTR Name, _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR Name,
__inout LPDWORD cchName, _Inout_ LPDWORD cchName,
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
) LPWSTR ReferencedDomainName, LPWSTR ReferencedDomainName,
__inout LPDWORD cchReferencedDomainName, _Inout_ LPDWORD cchReferencedDomainName,
__out PSID_NAME_USE peUse _Out_ PSID_NAME_USE peUse
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupAccountSid LookupAccountSidW #define LookupAccountSid LookupAccountSidW
#else #else
#define LookupAccountSid LookupAccountSidA #define LookupAccountSid LookupAccountSidA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountSidLocalA( LookupAccountNameA(
__in PSID Sid, _In_opt_ LPCSTR lpSystemName,
__out_ecount_part_opt(*cchName, *cchName + 1) LPSTR Name, _In_ LPCSTR lpAccountName,
__inout LPDWORD cchName, _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid,
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 _Inout_ LPDWORD cbSid,
) LPSTR ReferencedDomainName, _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
__inout LPDWORD cchReferencedDomainName, LPSTR ReferencedDomainName,
__out PSID_NAME_USE peUse _Inout_ LPDWORD cchReferencedDomainName,
_Out_ PSID_NAME_USE peUse
); );
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountSidLocalW( LookupAccountNameW(
__in PSID Sid, _In_opt_ LPCWSTR lpSystemName,
__out_ecount_part_opt(*cchName, *cchName + 1) LPWSTR Name, _In_ LPCWSTR lpAccountName,
__inout LPDWORD cchName, _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid,
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 _Inout_ LPDWORD cbSid,
) LPWSTR ReferencedDomainName, _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
__inout LPDWORD cchReferencedDomainName, LPWSTR ReferencedDomainName,
__out PSID_NAME_USE peUse _Inout_ LPDWORD cchReferencedDomainName,
_Out_ PSID_NAME_USE peUse
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupAccountSidLocal LookupAccountSidLocalW #define LookupAccountName LookupAccountNameW
#else #else
#define LookupAccountSidLocal LookupAccountSidLocalA #define LookupAccountName LookupAccountNameA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0601
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountNameA( LookupAccountNameLocalA(
__in_opt LPCSTR lpSystemName, _In_ LPCSTR lpAccountName,
__in LPCSTR lpAccountName, _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid,
__out_bcount_part_opt(*cbSid, *cbSid) PSID Sid, _Inout_ LPDWORD cbSid,
__inout LPDWORD cbSid, _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 LPSTR ReferencedDomainName,
) LPSTR ReferencedDomainName, _Inout_ LPDWORD cchReferencedDomainName,
__inout LPDWORD cchReferencedDomainName, _Out_ PSID_NAME_USE peUse
__out PSID_NAME_USE peUse
); );
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountNameW( LookupAccountNameLocalW(
__in_opt LPCWSTR lpSystemName, _In_ LPCWSTR lpAccountName,
__in LPCWSTR lpAccountName, _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid,
__out_bcount_part_opt(*cbSid, *cbSid) PSID Sid, _Inout_ LPDWORD cbSid,
__inout LPDWORD cbSid, _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 LPWSTR ReferencedDomainName,
) LPWSTR ReferencedDomainName, _Inout_ LPDWORD cchReferencedDomainName,
__inout LPDWORD cchReferencedDomainName, _Out_ PSID_NAME_USE peUse
__out PSID_NAME_USE peUse
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupAccountName LookupAccountNameW #define LookupAccountNameLocal LookupAccountNameLocalW
#else #else
#define LookupAccountName LookupAccountNameA #define LookupAccountNameLocal LookupAccountNameLocalA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountNameLocalA( LookupAccountSidLocalA(
__in LPCSTR lpAccountName, _In_ PSID Sid,
__out_bcount_part_opt(*cbSid, *cbSid) PSID Sid, _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR Name,
__inout LPDWORD cbSid, _Inout_ LPDWORD cchName,
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
) LPSTR ReferencedDomainName, LPSTR ReferencedDomainName,
__inout LPDWORD cchReferencedDomainName, _Inout_ LPDWORD cchReferencedDomainName,
__out PSID_NAME_USE peUse _Out_ PSID_NAME_USE peUse
); );
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupAccountNameLocalW( LookupAccountSidLocalW(
__in LPCWSTR lpAccountName, _In_ PSID Sid,
__out_bcount_part_opt(*cbSid, *cbSid) PSID Sid, _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR Name,
__inout LPDWORD cbSid, _Inout_ LPDWORD cchName,
__out_ecount_part_opt(*cchReferencedDomainName, *cchReferencedDomainName + 1 _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1)
) LPWSTR ReferencedDomainName, LPWSTR ReferencedDomainName,
__inout LPDWORD cchReferencedDomainName, _Inout_ LPDWORD cchReferencedDomainName,
__out PSID_NAME_USE peUse _Out_ PSID_NAME_USE peUse
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupAccountSidLocal LookupAccountSidLocalW
#else
#define LookupAccountSidLocal LookupAccountSidLocalA
#endif // !UNICODE
#else // _WIN32_WINNT >= 0x0601
#define LookupAccountNameLocalA(n, s, cs, d, cd, u) \
LookupAccountNameA(NULL, n, s, cs, d, cd, u)
#define LookupAccountNameLocalW(n, s, cs, d, cd, u) \
LookupAccountNameW(NULL, n, s, cs, d, cd, u)
#ifdef UNICODE
#define LookupAccountNameLocal LookupAccountNameLocalW #define LookupAccountNameLocal LookupAccountNameLocalW
#else #else
#define LookupAccountNameLocal LookupAccountNameLocalA #define LookupAccountNameLocal LookupAccountNameLocalA
#endif // !UNICODE #endif // !UNICODE
#define LookupAccountSidLocalA(s, n, cn, d, cd, u) \
LookupAccountSidA(NULL, s, n, cn, d, cd, u)
#define LookupAccountSidLocalW(s, n, cn, d, cd, u) \
LookupAccountSidW(NULL, s, n, cn, d, cd, u)
#ifdef UNICODE
#define LookupAccountSidLocal LookupAccountSidLocalW
#else
#define LookupAccountSidLocal LookupAccountSidLocalA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0601
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
LookupPrivilegeValueA( LookupPrivilegeValueA(
__in_opt LPCSTR lpSystemName, _In_opt_ LPCSTR lpSystemName,
__in LPCSTR lpName, _In_ LPCSTR lpName,
__out PLUID lpLuid _Out_ PLUID lpLuid
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
LookupPrivilegeValueW( LookupPrivilegeValueW(
__in_opt LPCWSTR lpSystemName, _In_opt_ LPCWSTR lpSystemName,
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__out PLUID lpLuid _Out_ PLUID lpLuid
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupPrivilegeValue LookupPrivilegeValueW #define LookupPrivilegeValue LookupPrivilegeValueW
#else #else
#define LookupPrivilegeValue LookupPrivilegeValueA #define LookupPrivilegeValue LookupPrivilegeValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupPrivilegeNameA( LookupPrivilegeNameA(
__in_opt LPCSTR lpSystemName, _In_opt_ LPCSTR lpSystemName,
__in PLUID lpLuid, _In_ PLUID lpLuid,
__out_ecount_part_opt(*cchName, *cchName + 1) LPSTR lpName, _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR lpName,
__inout LPDWORD cchName _Inout_ LPDWORD cchName
); );
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupPrivilegeNameW( LookupPrivilegeNameW(
__in_opt LPCWSTR lpSystemName, _In_opt_ LPCWSTR lpSystemName,
__in PLUID lpLuid, _In_ PLUID lpLuid,
__out_ecount_part_opt(*cchName, *cchName + 1) LPWSTR lpName, _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR lpName,
__inout LPDWORD cchName _Inout_ LPDWORD cchName
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupPrivilegeName LookupPrivilegeNameW #define LookupPrivilegeName LookupPrivilegeNameW
#else #else
#define LookupPrivilegeName LookupPrivilegeNameA #define LookupPrivilegeName LookupPrivilegeNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupPrivilegeDisplayNameA( LookupPrivilegeDisplayNameA(
__in_opt LPCSTR lpSystemName, _In_opt_ LPCSTR lpSystemName,
__in LPCSTR lpName, _In_ LPCSTR lpName,
__out_ecount_part_opt(*cchDisplayName, *cchDisplayName + 1) LPSTR lpDisplayN _Out_writes_to_opt_(*cchDisplayName, *cchDisplayName + 1) LPSTR lpDisplayNam
ame, e,
__inout LPDWORD cchDisplayName, _Inout_ LPDWORD cchDisplayName,
__out LPDWORD lpLanguageId _Out_ LPDWORD lpLanguageId
); );
WINADVAPI WINADVAPI
__success(return != FALSE) BOOL _Success_(return != FALSE) BOOL
WINAPI WINAPI
LookupPrivilegeDisplayNameW( LookupPrivilegeDisplayNameW(
__in_opt LPCWSTR lpSystemName, _In_opt_ LPCWSTR lpSystemName,
__in LPCWSTR lpName, _In_ LPCWSTR lpName,
__out_ecount_part_opt(*cchDisplayName, *cchDisplayName + 1) LPWSTR lpDisplay _Out_writes_to_opt_(*cchDisplayName, *cchDisplayName + 1) LPWSTR lpDisplayNa
Name, me,
__inout LPDWORD cchDisplayName, _Inout_ LPDWORD cchDisplayName,
__out LPDWORD lpLanguageId _Out_ LPDWORD lpLanguageId
); );
#ifdef UNICODE #ifdef UNICODE
#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW #define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW
#else #else
#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA #define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI
BOOL
WINAPI
AllocateLocallyUniqueId(
__out PLUID Luid
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BuildCommDCBA( BuildCommDCBA(
__in LPCSTR lpDef, _In_ LPCSTR lpDef,
__out LPDCB lpDCB _Out_ LPDCB lpDCB
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BuildCommDCBW( BuildCommDCBW(
__in LPCWSTR lpDef, _In_ LPCWSTR lpDef,
__out LPDCB lpDCB _Out_ LPDCB lpDCB
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildCommDCB BuildCommDCBW #define BuildCommDCB BuildCommDCBW
#else #else
#define BuildCommDCB BuildCommDCBA #define BuildCommDCB BuildCommDCBA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BuildCommDCBAndTimeoutsA( BuildCommDCBAndTimeoutsA(
__in LPCSTR lpDef, _In_ LPCSTR lpDef,
__out LPDCB lpDCB, _Out_ LPDCB lpDCB,
__out LPCOMMTIMEOUTS lpCommTimeouts _Out_ LPCOMMTIMEOUTS lpCommTimeouts
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BuildCommDCBAndTimeoutsW( BuildCommDCBAndTimeoutsW(
__in LPCWSTR lpDef, _In_ LPCWSTR lpDef,
__out LPDCB lpDCB, _Out_ LPDCB lpDCB,
__out LPCOMMTIMEOUTS lpCommTimeouts _Out_ LPCOMMTIMEOUTS lpCommTimeouts
); );
#ifdef UNICODE #ifdef UNICODE
#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW
#else #else
#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA #define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CommConfigDialogA( CommConfigDialogA(
__in LPCSTR lpszName, _In_ LPCSTR lpszName,
__in_opt HWND hWnd, _In_opt_ HWND hWnd,
__inout LPCOMMCONFIG lpCC _Inout_ LPCOMMCONFIG lpCC
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CommConfigDialogW( CommConfigDialogW(
__in LPCWSTR lpszName, _In_ LPCWSTR lpszName,
__in_opt HWND hWnd, _In_opt_ HWND hWnd,
__inout LPCOMMCONFIG lpCC _Inout_ LPCOMMCONFIG lpCC
); );
#ifdef UNICODE #ifdef UNICODE
#define CommConfigDialog CommConfigDialogW #define CommConfigDialog CommConfigDialogW
#else #else
#define CommConfigDialog CommConfigDialogA #define CommConfigDialog CommConfigDialogA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetDefaultCommConfigA( GetDefaultCommConfigA(
__in LPCSTR lpszName, _In_ LPCSTR lpszName,
__out_bcount_part(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC, _Out_writes_bytes_to_(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC,
__inout LPDWORD lpdwSize _Inout_ LPDWORD lpdwSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetDefaultCommConfigW( GetDefaultCommConfigW(
__in LPCWSTR lpszName, _In_ LPCWSTR lpszName,
__out_bcount_part(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC, _Out_writes_bytes_to_(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC,
__inout LPDWORD lpdwSize _Inout_ LPDWORD lpdwSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetDefaultCommConfig GetDefaultCommConfigW #define GetDefaultCommConfig GetDefaultCommConfigW
#else #else
#define GetDefaultCommConfig GetDefaultCommConfigA #define GetDefaultCommConfig GetDefaultCommConfigA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetDefaultCommConfigA( SetDefaultCommConfigA(
__in LPCSTR lpszName, _In_ LPCSTR lpszName,
__in_bcount(dwSize) LPCOMMCONFIG lpCC, _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC,
__in DWORD dwSize _In_ DWORD dwSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetDefaultCommConfigW( SetDefaultCommConfigW(
__in LPCWSTR lpszName, _In_ LPCWSTR lpszName,
__in_bcount(dwSize) LPCOMMCONFIG lpCC, _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC,
__in DWORD dwSize _In_ DWORD dwSize
); );
#ifdef UNICODE #ifdef UNICODE
#define SetDefaultCommConfig SetDefaultCommConfigW #define SetDefaultCommConfig SetDefaultCommConfigW
#else #else
#define SetDefaultCommConfig SetDefaultCommConfigA #define SetDefaultCommConfig SetDefaultCommConfigA
#endif // !UNICODE #endif // !UNICODE
#ifndef _MAC #ifndef _MAC
#define MAX_COMPUTERNAME_LENGTH 15 #define MAX_COMPUTERNAME_LENGTH 15
#else #else
#define MAX_COMPUTERNAME_LENGTH 31 #define MAX_COMPUTERNAME_LENGTH 31
#endif #endif
WINBASEAPI WINBASEAPI
__success(return != 0) _Success_(return != 0)
BOOL BOOL
WINAPI WINAPI
GetComputerNameA ( GetComputerNameA (
__out_ecount_part_opt(*nSize, *nSize + 1) LPSTR lpBuffer, _Out_writes_to_opt_(*nSize, *nSize + 1) LPSTR lpBuffer,
__inout LPDWORD nSize _Inout_ LPDWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return != 0) _Success_(return != 0)
BOOL BOOL
WINAPI WINAPI
GetComputerNameW ( GetComputerNameW (
__out_ecount_part_opt(*nSize, *nSize + 1) LPWSTR lpBuffer, _Out_writes_to_opt_(*nSize, *nSize + 1) LPWSTR lpBuffer,
__inout LPDWORD nSize _Inout_ LPDWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetComputerName GetComputerNameW #define GetComputerName GetComputerNameW
#else #else
#define GetComputerName GetComputerNameA #define GetComputerName GetComputerNameA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetComputerNameA ( SetComputerNameA (
__in LPCSTR lpComputerName _In_ LPCSTR lpComputerName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetComputerNameW ( SetComputerNameW (
__in LPCWSTR lpComputerName _In_ LPCWSTR lpComputerName
); );
#ifdef UNICODE #ifdef UNICODE
#define SetComputerName SetComputerNameW #define SetComputerName SetComputerNameW
#else #else
#define SetComputerName SetComputerNameA #define SetComputerName SetComputerNameA
#endif // !UNICODE #endif // !UNICODE
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
typedef enum _COMPUTER_NAME_FORMAT {
ComputerNameNetBIOS,
ComputerNameDnsHostname,
ComputerNameDnsDomain,
ComputerNameDnsFullyQualified,
ComputerNamePhysicalNetBIOS,
ComputerNamePhysicalDnsHostname,
ComputerNamePhysicalDnsDomain,
ComputerNamePhysicalDnsFullyQualified,
ComputerNameMax
} COMPUTER_NAME_FORMAT ;
WINBASEAPI
__success(return != 0)
BOOL
WINAPI
GetComputerNameExA (
__in COMPUTER_NAME_FORMAT NameType,
__out_ecount_part_opt(*nSize, *nSize + 1) LPSTR lpBuffer,
__inout LPDWORD nSize
);
WINBASEAPI
__success(return != 0)
BOOL
WINAPI
GetComputerNameExW (
__in COMPUTER_NAME_FORMAT NameType,
__out_ecount_part_opt(*nSize, *nSize + 1) LPWSTR lpBuffer,
__inout LPDWORD nSize
);
#ifdef UNICODE
#define GetComputerNameEx GetComputerNameExW
#else
#define GetComputerNameEx GetComputerNameExA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetComputerNameExA ( SetComputerNameExA (
__in COMPUTER_NAME_FORMAT NameType, _In_ COMPUTER_NAME_FORMAT NameType,
__in LPCSTR lpBuffer _In_ LPCSTR lpBuffer
);
WINBASEAPI
BOOL
WINAPI
SetComputerNameExW (
__in COMPUTER_NAME_FORMAT NameType,
__in LPCWSTR lpBuffer
); );
#ifdef UNICODE #ifndef UNICODE
#define SetComputerNameEx SetComputerNameExW #define SetComputerNameEx SetComputerNameExA
#else #endif
#define SetComputerNameEx SetComputerNameExA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
DnsHostnameToComputerNameA ( DnsHostnameToComputerNameA (
__in LPCSTR Hostname, _In_ LPCSTR Hostname,
__out_ecount_part_opt(*nSize, *nSize + 1) LPSTR ComputerName, _Out_writes_to_opt_(*nSize, *nSize + 1) LPSTR ComputerName,
__inout LPDWORD nSize _Inout_ LPDWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
DnsHostnameToComputerNameW ( DnsHostnameToComputerNameW (
__in LPCWSTR Hostname, _In_ LPCWSTR Hostname,
__out_ecount_part_opt(*nSize, *nSize + 1) LPWSTR ComputerName, _Out_writes_to_opt_(*nSize, *nSize + 1) LPWSTR ComputerName,
__inout LPDWORD nSize _Inout_ LPDWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define DnsHostnameToComputerName DnsHostnameToComputerNameW #define DnsHostnameToComputerName DnsHostnameToComputerNameW
#else #else
#define DnsHostnameToComputerName DnsHostnameToComputerNameA #define DnsHostnameToComputerName DnsHostnameToComputerNameA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT #endif // _WIN32_WINNT
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetUserNameA ( GetUserNameA (
__out_ecount_part_opt(*pcbBuffer, *pcbBuffer) LPSTR lpBuffer, _Out_writes_to_opt_(*pcbBuffer, *pcbBuffer) LPSTR lpBuffer,
__inout LPDWORD pcbBuffer _Inout_ LPDWORD pcbBuffer
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetUserNameW ( GetUserNameW (
__out_ecount_part_opt(*pcbBuffer, *pcbBuffer) LPWSTR lpBuffer, _Out_writes_to_opt_(*pcbBuffer, *pcbBuffer) LPWSTR lpBuffer,
__inout LPDWORD pcbBuffer _Inout_ LPDWORD pcbBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define GetUserName GetUserNameW #define GetUserName GetUserNameW
#else #else
#define GetUserName GetUserNameA #define GetUserName GetUserNameA
#endif // !UNICODE #endif // !UNICODE
// //
// Logon Support APIs // Logon Support APIs
// //
skipping to change at line 12598 skipping to change at line 6878
#define LOGON32_PROVIDER_WINNT50 3 #define LOGON32_PROVIDER_WINNT50 3
#endif // (_WIN32_WINNT >= 0x0500) #endif // (_WIN32_WINNT >= 0x0500)
#if(_WIN32_WINNT >= 0x0600) #if(_WIN32_WINNT >= 0x0600)
#define LOGON32_PROVIDER_VIRTUAL 4 #define LOGON32_PROVIDER_VIRTUAL 4
#endif // (_WIN32_WINNT >= 0x0600) #endif // (_WIN32_WINNT >= 0x0600)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
LogonUserA ( LogonUserA (
__in LPCSTR lpszUsername, _In_ LPCSTR lpszUsername,
__in_opt LPCSTR lpszDomain, _In_opt_ LPCSTR lpszDomain,
__in LPCSTR lpszPassword, _In_opt_ LPCSTR lpszPassword,
__in DWORD dwLogonType, _In_ DWORD dwLogonType,
__in DWORD dwLogonProvider, _In_ DWORD dwLogonProvider,
__deref_out PHANDLE phToken _Outptr_ PHANDLE phToken
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
LogonUserW ( LogonUserW (
__in LPCWSTR lpszUsername, _In_ LPCWSTR lpszUsername,
__in_opt LPCWSTR lpszDomain, _In_opt_ LPCWSTR lpszDomain,
__in LPCWSTR lpszPassword, _In_opt_ LPCWSTR lpszPassword,
__in DWORD dwLogonType, _In_ DWORD dwLogonType,
__in DWORD dwLogonProvider, _In_ DWORD dwLogonProvider,
__deref_out PHANDLE phToken _Outptr_ PHANDLE phToken
); );
#ifdef UNICODE #ifdef UNICODE
#define LogonUser LogonUserW #define LogonUser LogonUserW
#else #else
#define LogonUser LogonUserA #define LogonUser LogonUserA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
LogonUserExA ( LogonUserExA (
__in LPCSTR lpszUsername, _In_ LPCSTR lpszUsername,
__in_opt LPCSTR lpszDomain, _In_opt_ LPCSTR lpszDomain,
__in LPCSTR lpszPassword, _In_opt_ LPCSTR lpszPassword,
__in DWORD dwLogonType, _In_ DWORD dwLogonType,
__in DWORD dwLogonProvider, _In_ DWORD dwLogonProvider,
__deref_opt_out PHANDLE phToken, _Outptr_opt_ PHANDLE phToken,
__deref_opt_out PSID *ppLogonSid, _Outptr_opt_ PSID *ppLogonSid,
__deref_opt_out_bcount_full(*pdwProfileLength) PVOID *ppProfileBuffer, _Outptr_opt_result_bytebuffer_all_(*pdwProfileLength) PVOID *ppProfileBuffer
__out_opt LPDWORD pdwProfileLength, ,
__out_opt PQUOTA_LIMITS pQuotaLimits _Out_opt_ LPDWORD pdwProfileLength,
_Out_opt_ PQUOTA_LIMITS pQuotaLimits
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
LogonUserExW ( LogonUserExW (
__in LPCWSTR lpszUsername, _In_ LPCWSTR lpszUsername,
__in_opt LPCWSTR lpszDomain, _In_opt_ LPCWSTR lpszDomain,
__in LPCWSTR lpszPassword, _In_opt_ LPCWSTR lpszPassword,
__in DWORD dwLogonType, _In_ DWORD dwLogonType,
__in DWORD dwLogonProvider, _In_ DWORD dwLogonProvider,
__deref_opt_out PHANDLE phToken, _Outptr_opt_ PHANDLE phToken,
__deref_opt_out PSID *ppLogonSid, _Outptr_opt_ PSID *ppLogonSid,
__deref_opt_out_bcount_full(*pdwProfileLength) PVOID *ppProfileBuffer, _Outptr_opt_result_bytebuffer_all_(*pdwProfileLength) PVOID *ppProfileBuffer
__out_opt LPDWORD pdwProfileLength, ,
__out_opt PQUOTA_LIMITS pQuotaLimits _Out_opt_ LPDWORD pdwProfileLength,
_Out_opt_ PQUOTA_LIMITS pQuotaLimits
); );
#ifdef UNICODE #ifdef UNICODE
#define LogonUserEx LogonUserExW #define LogonUserEx LogonUserExW
#else #else
#define LogonUserEx LogonUserExA #define LogonUserEx LogonUserExA
#endif // !UNICODE #endif // !UNICODE
#if(_WIN32_WINNT >= 0x0600) #if(_WIN32_WINNT >= 0x0600)
#endif // (_WIN32_WINNT >= 0x0600) #endif // (_WIN32_WINNT >= 0x0600)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ImpersonateLoggedOnUser(
__in HANDLE hToken
);
WINADVAPI
BOOL
WINAPI
CreateProcessAsUserA ( CreateProcessAsUserA (
__in_opt HANDLE hToken, _In_opt_ HANDLE hToken,
__in_opt LPCSTR lpApplicationName, _In_opt_ LPCSTR lpApplicationName,
__inout_opt LPSTR lpCommandLine, _Inout_opt_ LPSTR lpCommandLine,
__in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in BOOL bInheritHandles, _In_ BOOL bInheritHandles,
__in DWORD dwCreationFlags, _In_ DWORD dwCreationFlags,
__in_opt LPVOID lpEnvironment, _In_opt_ LPVOID lpEnvironment,
__in_opt LPCSTR lpCurrentDirectory, _In_opt_ LPCSTR lpCurrentDirectory,
__in LPSTARTUPINFOA lpStartupInfo, _In_ LPSTARTUPINFOA lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation _Out_ LPPROCESS_INFORMATION lpProcessInformation
);
WINADVAPI
BOOL
WINAPI
CreateProcessAsUserW (
__in_opt HANDLE hToken,
__in_opt LPCWSTR lpApplicationName,
__inout_opt LPWSTR lpCommandLine,
__in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in BOOL bInheritHandles,
__in DWORD dwCreationFlags,
__in_opt LPVOID lpEnvironment,
__in_opt LPCWSTR lpCurrentDirectory,
__in LPSTARTUPINFOW lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation
); );
#ifdef UNICODE #ifndef UNICODE
#define CreateProcessAsUser CreateProcessAsUserW
#else
#define CreateProcessAsUser CreateProcessAsUserA #define CreateProcessAsUser CreateProcessAsUserA
#endif // !UNICODE #endif
#if(_WIN32_WINNT >= 0x0500) #if(_WIN32_WINNT >= 0x0500)
// //
// LogonFlags // LogonFlags
// //
#define LOGON_WITH_PROFILE 0x00000001 #define LOGON_WITH_PROFILE 0x00000001
#define LOGON_NETCREDENTIALS_ONLY 0x00000002 #define LOGON_NETCREDENTIALS_ONLY 0x00000002
#define LOGON_ZERO_PASSWORD_BUFFER 0x80000000 #define LOGON_ZERO_PASSWORD_BUFFER 0x80000000
WINADVAPI WINADVAPI
__checkReturn BOOL _Must_inspect_result_ BOOL
WINAPI WINAPI
CreateProcessWithLogonW( CreateProcessWithLogonW(
__in LPCWSTR lpUsername, _In_ LPCWSTR lpUsername,
__in_opt LPCWSTR lpDomain, _In_opt_ LPCWSTR lpDomain,
__in LPCWSTR lpPassword, _In_ LPCWSTR lpPassword,
__in DWORD dwLogonFlags, _In_ DWORD dwLogonFlags,
__in_opt LPCWSTR lpApplicationName, _In_opt_ LPCWSTR lpApplicationName,
__inout_opt LPWSTR lpCommandLine, _Inout_opt_ LPWSTR lpCommandLine,
__in DWORD dwCreationFlags, _In_ DWORD dwCreationFlags,
__in_opt LPVOID lpEnvironment, _In_opt_ LPVOID lpEnvironment,
__in_opt LPCWSTR lpCurrentDirectory, _In_opt_ LPCWSTR lpCurrentDirectory,
__in LPSTARTUPINFOW lpStartupInfo, _In_ LPSTARTUPINFOW lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation _Out_ LPPROCESS_INFORMATION lpProcessInformation
); );
WINADVAPI WINADVAPI
__checkReturn BOOL _Must_inspect_result_ BOOL
WINAPI WINAPI
CreateProcessWithTokenW( CreateProcessWithTokenW(
__in HANDLE hToken, _In_ HANDLE hToken,
__in DWORD dwLogonFlags, _In_ DWORD dwLogonFlags,
__in_opt LPCWSTR lpApplicationName, _In_opt_ LPCWSTR lpApplicationName,
__inout_opt LPWSTR lpCommandLine, _Inout_opt_ LPWSTR lpCommandLine,
__in DWORD dwCreationFlags, _In_ DWORD dwCreationFlags,
__in_opt LPVOID lpEnvironment, _In_opt_ LPVOID lpEnvironment,
__in_opt LPCWSTR lpCurrentDirectory, _In_opt_ LPCWSTR lpCurrentDirectory,
__in LPSTARTUPINFOW lpStartupInfo, _In_ LPSTARTUPINFOW lpStartupInfo,
__out LPPROCESS_INFORMATION lpProcessInformation _Out_ LPPROCESS_INFORMATION lpProcessInformation
); );
#endif // (_WIN32_WINNT >= 0x0500) #endif // (_WIN32_WINNT >= 0x0500)
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY
ImpersonateAnonymousToken(
__in HANDLE ThreadHandle
);
WINADVAPI
BOOL
WINAPI
DuplicateTokenEx(
__in HANDLE hExistingToken,
__in DWORD dwDesiredAccess,
__in_opt LPSECURITY_ATTRIBUTES lpTokenAttributes,
__in SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
__in TOKEN_TYPE TokenType,
__deref_out PHANDLE phNewToken);
WINADVAPI
BOOL
APIENTRY
CreateRestrictedToken(
__in HANDLE ExistingTokenHandle,
__in DWORD Flags,
__in DWORD DisableSidCount,
__in_ecount_opt(DisableSidCount) PSID_AND_ATTRIBUTES SidsToDisable,
__in DWORD DeletePrivilegeCount,
__in_ecount_opt(DeletePrivilegeCount) PLUID_AND_ATTRIBUTES PrivilegesToDelet
e,
__in DWORD RestrictedSidCount,
__in_ecount_opt(RestrictedSidCount) PSID_AND_ATTRIBUTES SidsToRestrict,
__deref_out PHANDLE NewTokenHandle
);
WINADVAPI
BOOL
WINAPI
IsTokenRestricted(
__in HANDLE TokenHandle
);
WINADVAPI
BOOL
WINAPI WINAPI
IsTokenUntrusted( IsTokenUntrusted(
__in HANDLE TokenHandle _In_ HANDLE TokenHandle
);
WINADVAPI
BOOL
APIENTRY
CheckTokenMembership(
__in_opt HANDLE TokenHandle,
__in PSID SidToCheck,
__out PBOOL IsMember
); );
// //
// Thread pool API's // Thread pool API's
// //
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK ;
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RegisterWaitForSingleObject( RegisterWaitForSingleObject(
__deref_out PHANDLE phNewWaitObject, _Outptr_ PHANDLE phNewWaitObject,
__in HANDLE hObject, _In_ HANDLE hObject,
__in WAITORTIMERCALLBACK Callback, _In_ WAITORTIMERCALLBACK Callback,
__in_opt PVOID Context, _In_opt_ PVOID Context,
__in ULONG dwMilliseconds, _In_ ULONG dwMilliseconds,
__in ULONG dwFlags _In_ ULONG dwFlags
);
WINBASEAPI
HANDLE
WINAPI
RegisterWaitForSingleObjectEx(
__in HANDLE hObject,
__in WAITORTIMERCALLBACK Callback,
__in_opt PVOID Context,
__in ULONG dwMilliseconds,
__in ULONG dwFlags
); );
WINBASEAPI WINBASEAPI
__checkReturn _Must_inspect_result_
BOOL BOOL
WINAPI WINAPI
UnregisterWait( UnregisterWait(
__in HANDLE WaitHandle _In_ HANDLE WaitHandle
);
WINBASEAPI
__checkReturn
BOOL
WINAPI
UnregisterWaitEx(
__in HANDLE WaitHandle,
__in_opt HANDLE CompletionEvent
);
WINBASEAPI
BOOL
WINAPI
QueueUserWorkItem(
__in LPTHREAD_START_ROUTINE Function,
__in_opt PVOID Context,
__in ULONG Flags
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BindIoCompletionCallback ( BindIoCompletionCallback (
__in HANDLE FileHandle, _In_ HANDLE FileHandle,
__in LPOVERLAPPED_COMPLETION_ROUTINE Function, _In_ LPOVERLAPPED_COMPLETION_ROUTINE Function,
__in ULONG Flags _In_ ULONG Flags
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateTimerQueue(
VOID
);
WINBASEAPI
BOOL
WINAPI
CreateTimerQueueTimer(
__deref_out PHANDLE phNewTimer,
__in_opt HANDLE TimerQueue,
__in WAITORTIMERCALLBACK Callback,
__in_opt PVOID Parameter,
__in DWORD DueTime,
__in DWORD Period,
__in ULONG Flags
) ;
WINBASEAPI
__checkReturn
BOOL
WINAPI
ChangeTimerQueueTimer(
__in_opt HANDLE TimerQueue,
__inout HANDLE Timer,
__in ULONG DueTime,
__in ULONG Period
);
WINBASEAPI
__checkReturn
BOOL
WINAPI
DeleteTimerQueueTimer(
__in_opt HANDLE TimerQueue,
__in HANDLE Timer,
__in_opt HANDLE CompletionEvent
);
WINBASEAPI
__checkReturn
BOOL
WINAPI
DeleteTimerQueueEx(
__in HANDLE TimerQueue,
__in_opt HANDLE CompletionEvent
); );
WINBASEAPI WINBASEAPI
HANDLE HANDLE
WINAPI WINAPI
SetTimerQueueTimer( SetTimerQueueTimer(
__in_opt HANDLE TimerQueue, _In_opt_ HANDLE TimerQueue,
__in WAITORTIMERCALLBACK Callback, _In_ WAITORTIMERCALLBACK Callback,
__in_opt PVOID Parameter, _In_opt_ PVOID Parameter,
__in DWORD DueTime, _In_ DWORD DueTime,
__in DWORD Period, _In_ DWORD Period,
__in BOOL PreferIo _In_ BOOL PreferIo
); );
WINBASEAPI WINBASEAPI
__checkReturn _Must_inspect_result_
BOOL BOOL
WINAPI WINAPI
CancelTimerQueueTimer( CancelTimerQueueTimer(
__in_opt HANDLE TimerQueue, _In_opt_ HANDLE TimerQueue,
__in HANDLE Timer _In_ HANDLE Timer
); );
WINBASEAPI WINBASEAPI
__checkReturn _Must_inspect_result_
BOOL BOOL
WINAPI WINAPI
DeleteTimerQueue( DeleteTimerQueue(
__in HANDLE TimerQueue _In_ HANDLE TimerQueue
); );
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
typedef VOID (WINAPI *PTP_WIN32_IO_CALLBACK)(
__inout PTP_CALLBACK_INSTANCE Instance,
__inout_opt PVOID Context,
__inout_opt PVOID Overlapped,
__in ULONG IoResult,
__in ULONG_PTR NumberOfBytesTransferred,
__inout PTP_IO Io
);
WINBASEAPI
__checkReturn
__out
PTP_POOL
WINAPI
CreateThreadpool(
__reserved PVOID reserved
);
WINBASEAPI
VOID
WINAPI
SetThreadpoolThreadMaximum(
__inout PTP_POOL ptpp,
__in DWORD cthrdMost
);
WINBASEAPI
BOOL
WINAPI
SetThreadpoolThreadMinimum(
__inout PTP_POOL ptpp,
__in DWORD cthrdMic
);
WINBASEAPI
BOOL
WINAPI
SetThreadpoolStackInformation(
__inout PTP_POOL ptpp,
__in PTP_POOL_STACK_INFORMATION ptpsi
);
WINBASEAPI
BOOL
WINAPI
QueryThreadpoolStackInformation(
__in PTP_POOL ptpp,
__out PTP_POOL_STACK_INFORMATION ptpsi
);
WINBASEAPI
VOID
WINAPI
CloseThreadpool(
__inout PTP_POOL ptpp
);
WINBASEAPI
__checkReturn
__out
PTP_CLEANUP_GROUP
WINAPI
CreateThreadpoolCleanupGroup(
VOID
);
WINBASEAPI
VOID
WINAPI
CloseThreadpoolCleanupGroupMembers(
__inout PTP_CLEANUP_GROUP ptpcg,
__in BOOL fCancelPendingCallbacks,
__inout_opt PVOID pvCleanupContext
);
WINBASEAPI
VOID
WINAPI
CloseThreadpoolCleanupGroup(
__inout PTP_CLEANUP_GROUP ptpcg
);
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
FORCEINLINE FORCEINLINE
VOID VOID
InitializeThreadpoolEnvironment( InitializeThreadpoolEnvironment(
__out PTP_CALLBACK_ENVIRON pcbe _Out_ PTP_CALLBACK_ENVIRON pcbe
) )
{ {
TpInitializeCallbackEnviron(pcbe); TpInitializeCallbackEnviron(pcbe);
} }
FORCEINLINE FORCEINLINE
VOID VOID
SetThreadpoolCallbackPool( SetThreadpoolCallbackPool(
__inout PTP_CALLBACK_ENVIRON pcbe, _Inout_ PTP_CALLBACK_ENVIRON pcbe,
__in PTP_POOL ptpp _In_ PTP_POOL ptpp
) )
{ {
TpSetCallbackThreadpool(pcbe, ptpp); TpSetCallbackThreadpool(pcbe, ptpp);
} }
FORCEINLINE FORCEINLINE
VOID VOID
SetThreadpoolCallbackCleanupGroup( SetThreadpoolCallbackCleanupGroup(
__inout PTP_CALLBACK_ENVIRON pcbe, _Inout_ PTP_CALLBACK_ENVIRON pcbe,
__in PTP_CLEANUP_GROUP ptpcg, _In_ PTP_CLEANUP_GROUP ptpcg,
__in_opt PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng _In_opt_ PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng
) )
{ {
TpSetCallbackCleanupGroup(pcbe, ptpcg, pfng); TpSetCallbackCleanupGroup(pcbe, ptpcg, pfng);
} }
FORCEINLINE FORCEINLINE
VOID VOID
SetThreadpoolCallbackRunsLong( SetThreadpoolCallbackRunsLong(
__inout PTP_CALLBACK_ENVIRON pcbe _Inout_ PTP_CALLBACK_ENVIRON pcbe
) )
{ {
TpSetCallbackLongFunction(pcbe); TpSetCallbackLongFunction(pcbe);
} }
FORCEINLINE FORCEINLINE
VOID VOID
SetThreadpoolCallbackLibrary( SetThreadpoolCallbackLibrary(
__inout PTP_CALLBACK_ENVIRON pcbe, _Inout_ PTP_CALLBACK_ENVIRON pcbe,
__in PVOID mod _In_ PVOID mod
) )
{ {
TpSetCallbackRaceWithDll(pcbe, mod); TpSetCallbackRaceWithDll(pcbe, mod);
} }
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) #if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
FORCEINLINE FORCEINLINE
VOID VOID
SetThreadpoolCallbackPriority( SetThreadpoolCallbackPriority(
__inout PTP_CALLBACK_ENVIRON pcbe, _Inout_ PTP_CALLBACK_ENVIRON pcbe,
__in TP_CALLBACK_PRIORITY Priority _In_ TP_CALLBACK_PRIORITY Priority
) )
{ {
TpSetCallbackPriority(pcbe, Priority); TpSetCallbackPriority(pcbe, Priority);
} }
#endif #endif
FORCEINLINE FORCEINLINE
VOID VOID
SetThreadpoolCallbackPersistent( SetThreadpoolCallbackPersistent(
__inout PTP_CALLBACK_ENVIRON pcbe _Inout_ PTP_CALLBACK_ENVIRON pcbe
) )
{ {
TpSetCallbackPersistent(pcbe); TpSetCallbackPersistent(pcbe);
} }
FORCEINLINE FORCEINLINE
VOID VOID
DestroyThreadpoolEnvironment( DestroyThreadpoolEnvironment(
__inout PTP_CALLBACK_ENVIRON pcbe _Inout_ PTP_CALLBACK_ENVIRON pcbe
) )
{ {
TpDestroyCallbackEnviron(pcbe); TpDestroyCallbackEnviron(pcbe);
} }
#endif // !defined(MIDL_PASS) #endif // !defined(MIDL_PASS)
WINBASEAPI
VOID
WINAPI
SetEventWhenCallbackReturns(
__inout PTP_CALLBACK_INSTANCE pci,
__in HANDLE evt
);
WINBASEAPI
VOID
WINAPI
ReleaseSemaphoreWhenCallbackReturns(
__inout PTP_CALLBACK_INSTANCE pci,
__in HANDLE sem,
__in DWORD crel
);
WINBASEAPI
VOID
WINAPI
ReleaseMutexWhenCallbackReturns(
__inout PTP_CALLBACK_INSTANCE pci,
__in HANDLE mut
);
WINBASEAPI
VOID
WINAPI
LeaveCriticalSectionWhenCallbackReturns(
__inout PTP_CALLBACK_INSTANCE pci,
__inout PCRITICAL_SECTION pcs
);
WINBASEAPI
VOID
WINAPI
FreeLibraryWhenCallbackReturns(
__inout PTP_CALLBACK_INSTANCE pci,
__in HMODULE mod
);
WINBASEAPI
BOOL
WINAPI
CallbackMayRunLong(
__inout PTP_CALLBACK_INSTANCE pci
);
WINBASEAPI
VOID
WINAPI
DisassociateCurrentThreadFromCallback(
__inout PTP_CALLBACK_INSTANCE pci
);
WINBASEAPI
__checkReturn
BOOL
WINAPI
TrySubmitThreadpoolCallback(
__in PTP_SIMPLE_CALLBACK pfns,
__inout_opt PVOID pv,
__in_opt PTP_CALLBACK_ENVIRON pcbe
);
WINBASEAPI
__checkReturn
__out
PTP_WORK
WINAPI
CreateThreadpoolWork(
__in PTP_WORK_CALLBACK pfnwk,
__inout_opt PVOID pv,
__in_opt PTP_CALLBACK_ENVIRON pcbe
);
WINBASEAPI
VOID
WINAPI
SubmitThreadpoolWork(
__inout PTP_WORK pwk
);
WINBASEAPI
VOID
WINAPI
WaitForThreadpoolWorkCallbacks(
__inout PTP_WORK pwk,
__in BOOL fCancelPendingCallbacks
);
WINBASEAPI
VOID
WINAPI
CloseThreadpoolWork(
__inout PTP_WORK pwk
);
WINBASEAPI
__checkReturn
__out
PTP_TIMER
WINAPI
CreateThreadpoolTimer(
__in PTP_TIMER_CALLBACK pfnti,
__inout_opt PVOID pv,
__in_opt PTP_CALLBACK_ENVIRON pcbe
);
WINBASEAPI
VOID
WINAPI
SetThreadpoolTimer(
__inout PTP_TIMER pti,
__in_opt PFILETIME pftDueTime,
__in DWORD msPeriod,
__in_opt DWORD msWindowLength
);
WINBASEAPI
BOOL
WINAPI
IsThreadpoolTimerSet(
__inout PTP_TIMER pti
);
WINBASEAPI
VOID
WINAPI
WaitForThreadpoolTimerCallbacks(
__inout PTP_TIMER pti,
__in BOOL fCancelPendingCallbacks
);
WINBASEAPI
VOID
WINAPI
CloseThreadpoolTimer(
__inout PTP_TIMER pti
);
WINBASEAPI
__checkReturn
__out
PTP_WAIT
WINAPI
CreateThreadpoolWait(
__in PTP_WAIT_CALLBACK pfnwa,
__inout_opt PVOID pv,
__in_opt PTP_CALLBACK_ENVIRON pcbe
);
WINBASEAPI
VOID
WINAPI
SetThreadpoolWait(
__inout PTP_WAIT pwa,
__in_opt HANDLE h,
__in_opt PFILETIME pftTimeout
);
WINBASEAPI
VOID
WINAPI
WaitForThreadpoolWaitCallbacks(
__inout PTP_WAIT pwa,
__in BOOL fCancelPendingCallbacks
);
WINBASEAPI
VOID
WINAPI
CloseThreadpoolWait(
__inout PTP_WAIT pwa
);
WINBASEAPI
__checkReturn
__out
PTP_IO
WINAPI
CreateThreadpoolIo(
__in HANDLE fl,
__in PTP_WIN32_IO_CALLBACK pfnio,
__inout_opt PVOID pv,
__in_opt PTP_CALLBACK_ENVIRON pcbe
);
WINBASEAPI
VOID
WINAPI
StartThreadpoolIo(
__inout PTP_IO pio
);
WINBASEAPI
VOID
WINAPI
CancelThreadpoolIo(
__inout PTP_IO pio
);
WINBASEAPI
VOID
WINAPI
WaitForThreadpoolIoCallbacks(
__inout PTP_IO pio,
__in BOOL fCancelPendingCallbacks
);
WINBASEAPI
VOID
WINAPI
CloseThreadpoolIo(
__inout PTP_IO pio
);
// //
// Private Namespaces support // Private Namespaces support
// //
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreatePrivateNamespaceA( CreatePrivateNamespaceA(
__in_opt LPSECURITY_ATTRIBUTES lpPrivateNamespaceAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpPrivateNamespaceAttributes,
__in LPVOID lpBoundaryDescriptor, _In_ LPVOID lpBoundaryDescriptor,
__in LPCSTR lpAliasPrefix _In_ LPCSTR lpAliasPrefix
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreatePrivateNamespaceW(
__in_opt LPSECURITY_ATTRIBUTES lpPrivateNamespaceAttributes,
__in LPVOID lpBoundaryDescriptor,
__in LPCWSTR lpAliasPrefix
); );
#ifdef UNICODE
#define CreatePrivateNamespace CreatePrivateNamespaceW #ifndef UNICODE
#define CreatePrivateNamespace CreatePrivateNamespaceA
#else #else
#define CreatePrivateNamespace CreatePrivateNamespaceA #define CreatePrivateNamespace CreatePrivateNamespaceW
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
OpenPrivateNamespaceA( OpenPrivateNamespaceA(
__in LPVOID lpBoundaryDescriptor, _In_ LPVOID lpBoundaryDescriptor,
__in LPCSTR lpAliasPrefix _In_ LPCSTR lpAliasPrefix
);
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenPrivateNamespaceW(
__in LPVOID lpBoundaryDescriptor,
__in LPCWSTR lpAliasPrefix
); );
#ifdef UNICODE
#define OpenPrivateNamespace OpenPrivateNamespaceW
#else
#define OpenPrivateNamespace OpenPrivateNamespaceA
#endif // !UNICODE
#define PRIVATE_NAMESPACE_FLAG_DESTROY 0x00000001
WINBASEAPI #ifndef UNICODE
BOOLEAN #define OpenPrivateNamespace OpenPrivateNamespaceA
WINAPI #else
ClosePrivateNamespace( #define OpenPrivateNamespace OpenPrivateNamespaceW
__in HANDLE Handle, #endif
__in ULONG Flags
);
// //
// Boundary descriptors support // Boundary descriptors support
// //
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
APIENTRY APIENTRY
CreateBoundaryDescriptorA( CreateBoundaryDescriptorA(
__in LPCSTR Name, _In_ LPCSTR Name,
__in ULONG Flags _In_ ULONG Flags
);
WINBASEAPI
__out_opt
HANDLE
APIENTRY
CreateBoundaryDescriptorW(
__in LPCWSTR Name,
__in ULONG Flags
); );
#ifdef UNICODE
#define CreateBoundaryDescriptor CreateBoundaryDescriptorW
#else
#define CreateBoundaryDescriptor CreateBoundaryDescriptorA
#endif // !UNICODE
WINBASEAPI #ifndef UNICODE
BOOL #define CreateBoundaryDescriptor CreateBoundaryDescriptorA
WINAPI #else
AddSIDToBoundaryDescriptor( #define CreateBoundaryDescriptor CreateBoundaryDescriptorW
__inout HANDLE * BoundaryDescriptor, #endif
__in PSID RequiredSid
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
AddIntegrityLabelToBoundaryDescriptor( AddIntegrityLabelToBoundaryDescriptor(
__inout HANDLE * BoundaryDescriptor, _Inout_ HANDLE * BoundaryDescriptor,
__in PSID IntegrityLabel _In_ PSID IntegrityLabel
);
WINBASEAPI
VOID
WINAPI
DeleteBoundaryDescriptor(
__in HANDLE BoundaryDescriptor
); );
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
#endif // _WIN32_WINNT >= 0x0500 #endif // _WIN32_WINNT >= 0x0500
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
// //
// Plug-and-Play API's // Plug-and-Play API's
// //
skipping to change at line 13487 skipping to change at line 7265
typedef LPHW_PROFILE_INFOW LPHW_PROFILE_INFO; typedef LPHW_PROFILE_INFOW LPHW_PROFILE_INFO;
#else #else
typedef HW_PROFILE_INFOA HW_PROFILE_INFO; typedef HW_PROFILE_INFOA HW_PROFILE_INFO;
typedef LPHW_PROFILE_INFOA LPHW_PROFILE_INFO; typedef LPHW_PROFILE_INFOA LPHW_PROFILE_INFO;
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetCurrentHwProfileA ( GetCurrentHwProfileA (
__out LPHW_PROFILE_INFOA lpHwProfileInfo _Out_ LPHW_PROFILE_INFOA lpHwProfileInfo
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetCurrentHwProfileW ( GetCurrentHwProfileW (
__out LPHW_PROFILE_INFOW lpHwProfileInfo _Out_ LPHW_PROFILE_INFOW lpHwProfileInfo
); );
#ifdef UNICODE #ifdef UNICODE
#define GetCurrentHwProfile GetCurrentHwProfileW #define GetCurrentHwProfile GetCurrentHwProfileW
#else #else
#define GetCurrentHwProfile GetCurrentHwProfileA #define GetCurrentHwProfile GetCurrentHwProfileA
#endif // !UNICODE #endif // !UNICODE
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
//
// Performance counter API's
//
WINBASEAPI
BOOL
WINAPI
QueryPerformanceCounter(
__out LARGE_INTEGER *lpPerformanceCount
);
WINBASEAPI
BOOL
WINAPI
QueryPerformanceFrequency(
__out LARGE_INTEGER *lpFrequency
);
WINBASEAPI
BOOL
WINAPI
GetVersionExA(
__inout LPOSVERSIONINFOA lpVersionInformation
);
WINBASEAPI
BOOL
WINAPI
GetVersionExW(
__inout LPOSVERSIONINFOW lpVersionInformation
);
#ifdef UNICODE
#define GetVersionEx GetVersionExW
#else
#define GetVersionEx GetVersionExA
#endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
VerifyVersionInfoA( VerifyVersionInfoA(
__inout LPOSVERSIONINFOEXA lpVersionInformation, _Inout_ LPOSVERSIONINFOEXA lpVersionInformation,
__in DWORD dwTypeMask, _In_ DWORD dwTypeMask,
__in DWORDLONG dwlConditionMask _In_ DWORDLONG dwlConditionMask
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
VerifyVersionInfoW( VerifyVersionInfoW(
__inout LPOSVERSIONINFOEXW lpVersionInformation, _Inout_ LPOSVERSIONINFOEXW lpVersionInformation,
__in DWORD dwTypeMask, _In_ DWORD dwTypeMask,
__in DWORDLONG dwlConditionMask _In_ DWORDLONG dwlConditionMask
); );
#ifdef UNICODE #ifdef UNICODE
#define VerifyVersionInfo VerifyVersionInfoW #define VerifyVersionInfo VerifyVersionInfoW
#else #else
#define VerifyVersionInfo VerifyVersionInfoA #define VerifyVersionInfo VerifyVersionInfoA
#endif // !UNICODE #endif // !UNICODE
#if (_WIN32_WINNT >= 0x0600) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
WINBASEAPI
BOOL
WINAPI
GetProductInfo(
__in DWORD dwOSMajorVersion,
__in DWORD dwOSMinorVersion,
__in DWORD dwSpMajorVersion,
__in DWORD dwSpMinorVersion,
__out PDWORD pdwReturnedProductType
);
#endif
// DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base // DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
// API functions. // API functions.
// //
#include <winerror.h> #include <winerror.h>
#include <timezoneapi.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
/* Abnormal termination codes */ /* Abnormal termination codes */
#define TC_NORMAL 0 #define TC_NORMAL 0
#define TC_HARDERR 1 #define TC_HARDERR 1
#define TC_GP_TRAP 2 #define TC_GP_TRAP 2
#define TC_SIGNAL 3 #define TC_SIGNAL 3
#if(WINVER >= 0x0400) #if(WINVER >= 0x0400)
// //
skipping to change at line 13622 skipping to change at line 7356
BYTE BatteryLifePercent; BYTE BatteryLifePercent;
BYTE Reserved1; BYTE Reserved1;
DWORD BatteryLifeTime; DWORD BatteryLifeTime;
DWORD BatteryFullLifeTime; DWORD BatteryFullLifeTime;
} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS; } SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetSystemPowerStatus( GetSystemPowerStatus(
__out LPSYSTEM_POWER_STATUS lpSystemPowerStatus _Out_ LPSYSTEM_POWER_STATUS lpSystemPowerStatus
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetSystemPowerState( SetSystemPowerState(
__in BOOL fSuspend, _In_ BOOL fSuspend,
__in BOOL fForce _In_ BOOL fForce
); );
#endif /* WINVER >= 0x0400 */ #endif /* WINVER >= 0x0400 */
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
// //
// Very Large Memory API Subset // Very Large Memory API Subset
// //
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
AllocateUserPhysicalPages(
__in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages,
__out_ecount_part(*NumberOfPages, *NumberOfPages) PULONG_PTR PageArray
);
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
AllocateUserPhysicalPagesNuma(
__in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages,
__out_ecount_part(*NumberOfPages, *NumberOfPages) PULONG_PTR PageArray,
__in DWORD nndPreferred
);
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
FreeUserPhysicalPages(
__in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages,
__in_ecount(*NumberOfPages) PULONG_PTR PageArray
);
WINBASEAPI
BOOL
WINAPI
MapUserPhysicalPages(
__in PVOID VirtualAddress,
__in ULONG_PTR NumberOfPages,
__in_ecount_opt(NumberOfPages) PULONG_PTR PageArray
);
WINBASEAPI
BOOL
WINAPI
MapUserPhysicalPagesScatter( MapUserPhysicalPagesScatter(
__in_ecount(NumberOfPages) PVOID *VirtualAddresses, _In_reads_(NumberOfPages) PVOID *VirtualAddresses,
__in ULONG_PTR NumberOfPages, _In_ ULONG_PTR NumberOfPages,
__in_ecount_opt(NumberOfPages) PULONG_PTR PageArray _In_reads_opt_(NumberOfPages) PULONG_PTR PageArray
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateJobObjectA( CreateJobObjectA(
__in_opt LPSECURITY_ATTRIBUTES lpJobAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpJobAttributes,
__in_opt LPCSTR lpName _In_opt_ LPCSTR lpName
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
CreateJobObjectW( CreateJobObjectW(
__in_opt LPSECURITY_ATTRIBUTES lpJobAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpJobAttributes,
__in_opt LPCWSTR lpName _In_opt_ LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateJobObject CreateJobObjectW #define CreateJobObject CreateJobObjectW
#else #else
#define CreateJobObject CreateJobObjectA #define CreateJobObject CreateJobObjectA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
OpenJobObjectA( OpenJobObjectA(
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in BOOL bInheritHandle, _In_ BOOL bInheritHandle,
__in LPCSTR lpName _In_ LPCSTR lpName
); );
WINBASEAPI WINBASEAPI
__out_opt _Ret_maybenull_
HANDLE HANDLE
WINAPI WINAPI
OpenJobObjectW( OpenJobObjectW(
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in BOOL bInheritHandle, _In_ BOOL bInheritHandle,
__in LPCWSTR lpName _In_ LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenJobObject OpenJobObjectW #define OpenJobObject OpenJobObjectW
#else #else
#define OpenJobObject OpenJobObjectA #define OpenJobObject OpenJobObjectA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
AssignProcessToJobObject( AssignProcessToJobObject(
__in HANDLE hJob, _In_ HANDLE hJob,
__in HANDLE hProcess _In_ HANDLE hProcess
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
TerminateJobObject( TerminateJobObject(
__in HANDLE hJob, _In_ HANDLE hJob,
__in UINT uExitCode _In_ UINT uExitCode
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryInformationJobObject( QueryInformationJobObject(
__in_opt HANDLE hJob, _In_opt_ HANDLE hJob,
__in JOBOBJECTINFOCLASS JobObjectInformationClass, _In_ JOBOBJECTINFOCLASS JobObjectInformationClass,
__out_bcount_part(cbJobObjectInformationLength, *lpReturnLength) LPVOID lpJo _Out_writes_bytes_to_(cbJobObjectInformationLength, *lpReturnLength) LPVOID
bObjectInformation, lpJobObjectInformation,
__in DWORD cbJobObjectInformationLength, _In_ DWORD cbJobObjectInformationLength,
__out_opt LPDWORD lpReturnLength _Out_opt_ LPDWORD lpReturnLength
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetInformationJobObject( SetInformationJobObject(
__in HANDLE hJob, _In_ HANDLE hJob,
__in JOBOBJECTINFOCLASS JobObjectInformationClass, _In_ JOBOBJECTINFOCLASS JobObjectInformationClass,
__in_bcount(cbJobObjectInformationLength) LPVOID lpJobObjectInformation, _In_reads_bytes_(cbJobObjectInformationLength) LPVOID lpJobObjectInformation
__in DWORD cbJobObjectInformationLength ,
); _In_ DWORD cbJobObjectInformationLength
#if (_WIN32_WINNT >= 0x0501)
WINBASEAPI
BOOL
WINAPI
IsProcessInJob (
__in HANDLE ProcessHandle,
__in_opt HANDLE JobHandle,
__out PBOOL Result
); );
#endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateJobSet ( CreateJobSet (
__in ULONG NumJob, _In_ ULONG NumJob,
__in_ecount(NumJob) PJOB_SET_ARRAY UserJobSet, _In_reads_(NumJob) PJOB_SET_ARRAY UserJobSet,
__in ULONG Flags); _In_ ULONG Flags);
WINBASEAPI
__out_opt
PVOID
WINAPI
AddVectoredExceptionHandler (
__in ULONG First,
__in PVECTORED_EXCEPTION_HANDLER Handler
);
WINBASEAPI
ULONG
WINAPI
RemoveVectoredExceptionHandler (
__in PVOID Handle
);
WINBASEAPI
__out_opt
PVOID
WINAPI
AddVectoredContinueHandler (
__in ULONG First,
__in PVECTORED_EXCEPTION_HANDLER Handler
);
WINBASEAPI
ULONG
WINAPI
RemoveVectoredContinueHandler (
__in PVOID Handle
);
//
// New Volume Mount Point API.
//
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
FindFirstVolumeA( FindFirstVolumeA(
__out_ecount(cchBufferLength) LPSTR lpszVolumeName, _Out_writes_(cchBufferLength) LPSTR lpszVolumeName,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
);
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstVolumeW(
__out_ecount(cchBufferLength) LPWSTR lpszVolumeName,
__in DWORD cchBufferLength
); );
#ifdef UNICODE #ifndef UNICODE
#define FindFirstVolume FindFirstVolumeW
#else
#define FindFirstVolume FindFirstVolumeA #define FindFirstVolume FindFirstVolumeA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindNextVolumeA( FindNextVolumeA(
__inout HANDLE hFindVolume, _Inout_ HANDLE hFindVolume,
__out_ecount(cchBufferLength) LPSTR lpszVolumeName, _Out_writes_(cchBufferLength) LPSTR lpszVolumeName,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
);
WINBASEAPI
BOOL
WINAPI
FindNextVolumeW(
__inout HANDLE hFindVolume,
__out_ecount(cchBufferLength) LPWSTR lpszVolumeName,
__in DWORD cchBufferLength
); );
#ifdef UNICODE #ifndef UNICODE
#define FindNextVolume FindNextVolumeW
#else
#define FindNextVolume FindNextVolumeA #define FindNextVolume FindNextVolumeA
#endif // !UNICODE #endif
WINBASEAPI
BOOL
WINAPI
FindVolumeClose(
__in HANDLE hFindVolume
);
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
FindFirstVolumeMountPointA( FindFirstVolumeMountPointA(
__in LPCSTR lpszRootPathName, _In_ LPCSTR lpszRootPathName,
__out_ecount(cchBufferLength) LPSTR lpszVolumeMountPoint, _Out_writes_(cchBufferLength) LPSTR lpszVolumeMountPoint,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
FindFirstVolumeMountPointW( FindFirstVolumeMountPointW(
__in LPCWSTR lpszRootPathName, _In_ LPCWSTR lpszRootPathName,
__out_ecount(cchBufferLength) LPWSTR lpszVolumeMountPoint, _Out_writes_(cchBufferLength) LPWSTR lpszVolumeMountPoint,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
); );
#ifdef UNICODE #ifdef UNICODE
#define FindFirstVolumeMountPoint FindFirstVolumeMountPointW #define FindFirstVolumeMountPoint FindFirstVolumeMountPointW
#else #else
#define FindFirstVolumeMountPoint FindFirstVolumeMountPointA #define FindFirstVolumeMountPoint FindFirstVolumeMountPointA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindNextVolumeMountPointA( FindNextVolumeMountPointA(
__in HANDLE hFindVolumeMountPoint, _In_ HANDLE hFindVolumeMountPoint,
__out_ecount(cchBufferLength) LPSTR lpszVolumeMountPoint, _Out_writes_(cchBufferLength) LPSTR lpszVolumeMountPoint,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindNextVolumeMountPointW( FindNextVolumeMountPointW(
__in HANDLE hFindVolumeMountPoint, _In_ HANDLE hFindVolumeMountPoint,
__out_ecount(cchBufferLength) LPWSTR lpszVolumeMountPoint, _Out_writes_(cchBufferLength) LPWSTR lpszVolumeMountPoint,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
); );
#ifdef UNICODE #ifdef UNICODE
#define FindNextVolumeMountPoint FindNextVolumeMountPointW #define FindNextVolumeMountPoint FindNextVolumeMountPointW
#else #else
#define FindNextVolumeMountPoint FindNextVolumeMountPointA #define FindNextVolumeMountPoint FindNextVolumeMountPointA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindVolumeMountPointClose( FindVolumeMountPointClose(
__in HANDLE hFindVolumeMountPoint _In_ HANDLE hFindVolumeMountPoint
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetVolumeMountPointA( SetVolumeMountPointA(
__in LPCSTR lpszVolumeMountPoint, _In_ LPCSTR lpszVolumeMountPoint,
__in LPCSTR lpszVolumeName _In_ LPCSTR lpszVolumeName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetVolumeMountPointW( SetVolumeMountPointW(
__in LPCWSTR lpszVolumeMountPoint, _In_ LPCWSTR lpszVolumeMountPoint,
__in LPCWSTR lpszVolumeName _In_ LPCWSTR lpszVolumeName
); );
#ifdef UNICODE #ifdef UNICODE
#define SetVolumeMountPoint SetVolumeMountPointW #define SetVolumeMountPoint SetVolumeMountPointW
#else #else
#define SetVolumeMountPoint SetVolumeMountPointA #define SetVolumeMountPoint SetVolumeMountPointA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteVolumeMountPointA( DeleteVolumeMountPointA(
__in LPCSTR lpszVolumeMountPoint _In_ LPCSTR lpszVolumeMountPoint
);
WINBASEAPI
BOOL
WINAPI
DeleteVolumeMountPointW(
__in LPCWSTR lpszVolumeMountPoint
); );
#ifdef UNICODE #ifndef UNICODE
#define DeleteVolumeMountPoint DeleteVolumeMountPointW
#else
#define DeleteVolumeMountPoint DeleteVolumeMountPointA #define DeleteVolumeMountPoint DeleteVolumeMountPointA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetVolumeNameForVolumeMountPointA( GetVolumeNameForVolumeMountPointA(
__in LPCSTR lpszVolumeMountPoint, _In_ LPCSTR lpszVolumeMountPoint,
__out_ecount(cchBufferLength) LPSTR lpszVolumeName, _Out_writes_(cchBufferLength) LPSTR lpszVolumeName,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
);
WINBASEAPI
BOOL
WINAPI
GetVolumeNameForVolumeMountPointW(
__in LPCWSTR lpszVolumeMountPoint,
__out_ecount(cchBufferLength) LPWSTR lpszVolumeName,
__in DWORD cchBufferLength
); );
#ifdef UNICODE #ifndef UNICODE
#define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointW
#else
#define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointA #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointA
#endif // !UNICODE #endif
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetVolumePathNameA( GetVolumePathNameA(
__in LPCSTR lpszFileName, _In_ LPCSTR lpszFileName,
__out_ecount(cchBufferLength) LPSTR lpszVolumePathName, _Out_writes_(cchBufferLength) LPSTR lpszVolumePathName,
__in DWORD cchBufferLength _In_ DWORD cchBufferLength
);
WINBASEAPI
BOOL
WINAPI
GetVolumePathNameW(
__in LPCWSTR lpszFileName,
__out_ecount(cchBufferLength) LPWSTR lpszVolumePathName,
__in DWORD cchBufferLength
); );
#ifdef UNICODE #ifndef UNICODE
#define GetVolumePathName GetVolumePathNameW
#else
#define GetVolumePathName GetVolumePathNameA #define GetVolumePathName GetVolumePathNameA
#endif // !UNICODE #endif
#endif #endif
#if(_WIN32_WINNT >= 0x0501) #if(_WIN32_WINNT >= 0x0501)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetVolumePathNamesForVolumeNameA( GetVolumePathNamesForVolumeNameA(
__in LPCSTR lpszVolumeName, _In_ LPCSTR lpszVolumeName,
__out_ecount_part_opt(cchBufferLength, *lpcchReturnLength) __nullnulltermina _Out_writes_to_opt_(cchBufferLength, *lpcchReturnLength) _Post_ _NullNull_te
ted LPCH lpszVolumePathNames, rminated_ LPCH lpszVolumePathNames,
__in DWORD cchBufferLength, _In_ DWORD cchBufferLength,
__out PDWORD lpcchReturnLength _Out_ PDWORD lpcchReturnLength
);
WINBASEAPI
BOOL
WINAPI
GetVolumePathNamesForVolumeNameW(
__in LPCWSTR lpszVolumeName,
__out_ecount_part_opt(cchBufferLength, *lpcchReturnLength) __nullnulltermina
ted LPWCH lpszVolumePathNames,
__in DWORD cchBufferLength,
__out PDWORD lpcchReturnLength
); );
#ifdef UNICODE
#define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameW #ifndef UNICODE
#else
#define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameA #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameA
#endif // !UNICODE #endif
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0501)
#if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENA BLED #if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENA BLED
#define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID (0x00000001) #define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID (0x00000001)
#define ACTCTX_FLAG_LANGID_VALID (0x00000002) #define ACTCTX_FLAG_LANGID_VALID (0x00000002)
#define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID (0x00000004) #define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID (0x00000004)
#define ACTCTX_FLAG_RESOURCE_NAME_VALID (0x00000008) #define ACTCTX_FLAG_RESOURCE_NAME_VALID (0x00000008)
#define ACTCTX_FLAG_SET_PROCESS_DEFAULT (0x00000010) #define ACTCTX_FLAG_SET_PROCESS_DEFAULT (0x00000010)
skipping to change at line 14096 skipping to change at line 7672
typedef const ACTCTXA *PCACTCTXA; typedef const ACTCTXA *PCACTCTXA;
typedef const ACTCTXW *PCACTCTXW; typedef const ACTCTXW *PCACTCTXW;
#ifdef UNICODE #ifdef UNICODE
typedef PCACTCTXW PCACTCTX; typedef PCACTCTXW PCACTCTX;
#else #else
typedef PCACTCTXA PCACTCTX; typedef PCACTCTXA PCACTCTX;
#endif // UNICODE #endif // UNICODE
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateActCtxA( CreateActCtxA(
__in PCACTCTXA pActCtx _In_ PCACTCTXA pActCtx
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
CreateActCtxW( CreateActCtxW(
__in PCACTCTXW pActCtx _In_ PCACTCTXW pActCtx
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateActCtx CreateActCtxW #define CreateActCtx CreateActCtxW
#else #else
#define CreateActCtx CreateActCtxA #define CreateActCtx CreateActCtxA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
AddRefActCtx( AddRefActCtx(
__inout HANDLE hActCtx _Inout_ HANDLE hActCtx
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
ReleaseActCtx( ReleaseActCtx(
__inout HANDLE hActCtx _Inout_ HANDLE hActCtx
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ZombifyActCtx( ZombifyActCtx(
__inout HANDLE hActCtx _Inout_ HANDLE hActCtx
); );
_Success_(return)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ActivateActCtx( ActivateActCtx(
__inout_opt HANDLE hActCtx, _Inout_opt_ HANDLE hActCtx,
__out ULONG_PTR *lpCookie _Out_ ULONG_PTR *lpCookie
); );
#define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x00000001) #define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x00000001)
_Success_(return)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeactivateActCtx( DeactivateActCtx(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in ULONG_PTR ulCookie _In_ ULONG_PTR ulCookie
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetCurrentActCtx( GetCurrentActCtx(
__deref_out HANDLE *lphActCtx); _Outptr_ HANDLE *lphActCtx);
typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 { typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
ULONG cbSize; ULONG cbSize;
ULONG ulDataFormatVersion; ULONG ulDataFormatVersion;
PVOID lpData; PVOID lpData;
ULONG ulLength; ULONG ulLength;
PVOID lpSectionGlobalData; PVOID lpSectionGlobalData;
ULONG ulSectionGlobalDataLength; ULONG ulSectionGlobalDataLength;
PVOID lpSectionBase; PVOID lpSectionBase;
ULONG ulSectionTotalLength; ULONG ulSectionTotalLength;
skipping to change at line 14204 skipping to change at line 7780
// 2600 stops here // 2600 stops here
ULONG ulFlags; ULONG ulFlags;
ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata; ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
} ACTCTX_SECTION_KEYED_DATA, *PACTCTX_SECTION_KEYED_DATA; } ACTCTX_SECTION_KEYED_DATA, *PACTCTX_SECTION_KEYED_DATA;
typedef const ACTCTX_SECTION_KEYED_DATA * PCACTCTX_SECTION_KEYED_DATA; typedef const ACTCTX_SECTION_KEYED_DATA * PCACTCTX_SECTION_KEYED_DATA;
#define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX (0x00000001) #define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX (0x00000001)
#define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS (0x00000002) #define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS (0x00000002)
#define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA (0x00000004) #define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA (0x00000004)
_Success_(return)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindActCtxSectionStringA( FindActCtxSectionStringA(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved const GUID *lpExtensionGuid, _Reserved_ const GUID *lpExtensionGuid,
__in ULONG ulSectionId, _In_ ULONG ulSectionId,
__in LPCSTR lpStringToFind, _In_ LPCSTR lpStringToFind,
__out PACTCTX_SECTION_KEYED_DATA ReturnedData _Out_ PACTCTX_SECTION_KEYED_DATA ReturnedData
); );
_Success_(return)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindActCtxSectionStringW( FindActCtxSectionStringW(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved const GUID *lpExtensionGuid, _Reserved_ const GUID *lpExtensionGuid,
__in ULONG ulSectionId, _In_ ULONG ulSectionId,
__in LPCWSTR lpStringToFind, _In_ LPCWSTR lpStringToFind,
__out PACTCTX_SECTION_KEYED_DATA ReturnedData _Out_ PACTCTX_SECTION_KEYED_DATA ReturnedData
); );
#ifdef UNICODE #ifdef UNICODE
#define FindActCtxSectionString FindActCtxSectionStringW #define FindActCtxSectionString FindActCtxSectionStringW
#else #else
#define FindActCtxSectionString FindActCtxSectionStringA #define FindActCtxSectionString FindActCtxSectionStringA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FindActCtxSectionGuid( FindActCtxSectionGuid(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved const GUID *lpExtensionGuid, _Reserved_ const GUID *lpExtensionGuid,
__in ULONG ulSectionId, _In_ ULONG ulSectionId,
__in_opt const GUID *lpGuidToFind, _In_opt_ const GUID *lpGuidToFind,
__out PACTCTX_SECTION_KEYED_DATA ReturnedData _Out_ PACTCTX_SECTION_KEYED_DATA ReturnedData
); );
#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */ #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
#if !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED) #if !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION { typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
HANDLE hActCtx; HANDLE hActCtx;
DWORD dwFlags; DWORD dwFlags;
} ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION; } ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION;
skipping to change at line 14289 skipping to change at line 7867
// pvSubInstance->ulAssemblyIndex < ACTIVATION_CONTEXT_DETAILED_INFORMATION ::ulAssemblyCount // pvSubInstance->ulAssemblyIndex < ACTIVATION_CONTEXT_DETAILED_INFORMATION ::ulAssemblyCount
// pvSubInstance->ulFileIndexInAssembly < ACTIVATION_CONTEXT_ASSEMBLY_DETAI LED_INFORMATION::ulFileCount // pvSubInstance->ulFileIndexInAssembly < ACTIVATION_CONTEXT_ASSEMBLY_DETAI LED_INFORMATION::ulFileCount
// pvBuffer is of type PASSEMBLY_FILE_DETAILED_INFORMATION // pvBuffer is of type PASSEMBLY_FILE_DETAILED_INFORMATION
// //
// case RunlevelInformationInActivationContext : // case RunlevelInformationInActivationContext :
// pvSubInstance == NULL // pvSubInstance == NULL
// pvBuffer is of type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION // pvBuffer is of type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION
// //
// String are placed after the structs. // String are placed after the structs.
// //
_Success_(return)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryActCtxW( QueryActCtxW(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in HANDLE hActCtx, _In_ HANDLE hActCtx,
__in_opt PVOID pvSubInstance, _In_opt_ PVOID pvSubInstance,
__in ULONG ulInfoClass, _In_ ULONG ulInfoClass,
__out_bcount_part_opt(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer, _Out_writes_bytes_to_opt_(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer,
__in SIZE_T cbBuffer, _In_ SIZE_T cbBuffer,
__out_opt SIZE_T *pcbWrittenOrRequired _Out_opt_ SIZE_T *pcbWrittenOrRequired
); );
typedef BOOL (WINAPI * PQUERYACTCTXW_FUNC)( typedef _Success_(return) BOOL (WINAPI * PQUERYACTCTXW_FUNC)(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in HANDLE hActCtx, _In_ HANDLE hActCtx,
__in_opt PVOID pvSubInstance, _In_opt_ PVOID pvSubInstance,
__in ULONG ulInfoClass, _In_ ULONG ulInfoClass,
__out_bcount_part_opt(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer, _Out_writes_bytes_to_opt_(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer,
__in SIZE_T cbBuffer, _In_ SIZE_T cbBuffer,
__out_opt SIZE_T *pcbWrittenOrRequired _Out_opt_ SIZE_T *pcbWrittenOrRequired
); );
#endif // (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWAR E_ENABLED #endif // (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWAR E_ENABLED
WINBASEAPI
BOOL
WINAPI
ProcessIdToSessionId(
__in DWORD dwProcessId,
__out DWORD *pSessionId
);
#if _WIN32_WINNT >= 0x0501 #if _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
WTSGetActiveConsoleSessionId( WTSGetActiveConsoleSessionId(
VOID VOID
); );
WINBASEAPI
BOOL
WINAPI
IsWow64Process(
__in HANDLE hProcess,
__out PBOOL Wow64Process
);
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0501)
WINBASEAPI
BOOL
WINAPI
GetLogicalProcessorInformation(
__out_bcount_part_opt(*ReturnedLength, *ReturnedLength) PSYSTEM_LOGICAL_PROC
ESSOR_INFORMATION Buffer,
__inout PDWORD ReturnedLength
);
#if _WIN32_WINNT >= 0x0601 #if _WIN32_WINNT >= 0x0601
WINBASEAPI WINBASEAPI
BOOL
WINAPI
GetLogicalProcessorInformationEx(
__in LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType,
__out_bcount_part_opt(*ReturnedLength, *ReturnedLength) PSYSTEM_LOGICAL_PROC
ESSOR_INFORMATION_EX Buffer,
__inout PDWORD ReturnedLength
);
WINBASEAPI
WORD WORD
WINAPI WINAPI
GetActiveProcessorGroupCount( GetActiveProcessorGroupCount(
VOID VOID
); );
WINBASEAPI WINBASEAPI
WORD WORD
WINAPI WINAPI
GetMaximumProcessorGroupCount( GetMaximumProcessorGroupCount(
VOID VOID
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetActiveProcessorCount( GetActiveProcessorCount(
__in WORD GroupNumber _In_ WORD GroupNumber
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetMaximumProcessorCount( GetMaximumProcessorCount(
__in WORD GroupNumber _In_ WORD GroupNumber
); );
#endif // (_WIN32_WINNT >=0x0601) #endif // (_WIN32_WINNT >=0x0601)
// //
// NUMA Information routines. // NUMA Information routines.
// //
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaHighestNodeNumber(
__out PULONG HighestNodeNumber
);
WINBASEAPI
BOOL
WINAPI
GetNumaProcessorNode( GetNumaProcessorNode(
__in UCHAR Processor, _In_ UCHAR Processor,
__out PUCHAR NodeNumber _Out_ PUCHAR NodeNumber
); );
#if _WIN32_WINNT >= 0x0601 #if _WIN32_WINNT >= 0x0601
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaNodeNumberFromHandle( GetNumaNodeNumberFromHandle(
__in HANDLE hFile, _In_ HANDLE hFile,
__out PUSHORT NodeNumber _Out_ PUSHORT NodeNumber
); );
#endif // (_WIN32_WINNT >=0x0601) #endif // (_WIN32_WINNT >=0x0601)
#if _WIN32_WINNT >= 0x0601 #if _WIN32_WINNT >= 0x0601
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaProcessorNodeEx( GetNumaProcessorNodeEx(
__in PPROCESSOR_NUMBER Processor, _In_ PPROCESSOR_NUMBER Processor,
__out PUSHORT NodeNumber _Out_ PUSHORT NodeNumber
); );
#endif // (_WIN32_WINNT >=0x0601) #endif // (_WIN32_WINNT >=0x0601)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaNodeProcessorMask( GetNumaNodeProcessorMask(
__in UCHAR Node, _In_ UCHAR Node,
__out PULONGLONG ProcessorMask _Out_ PULONGLONG ProcessorMask
);
#if _WIN32_WINNT >= 0x0601
WINBASEAPI
BOOL
WINAPI
GetNumaNodeProcessorMaskEx(
__in USHORT Node,
__out PGROUP_AFFINITY ProcessorMask
); );
#endif // (_WIN32_WINNT >=0x0601)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaAvailableMemoryNode( GetNumaAvailableMemoryNode(
__in UCHAR Node, _In_ UCHAR Node,
__out PULONGLONG AvailableBytes _Out_ PULONGLONG AvailableBytes
); );
#if _WIN32_WINNT >= 0x0601 #if _WIN32_WINNT >= 0x0601
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaAvailableMemoryNodeEx( GetNumaAvailableMemoryNodeEx(
__in USHORT Node, _In_ USHORT Node,
__out PULONGLONG AvailableBytes _Out_ PULONGLONG AvailableBytes
); );
#endif // (_WIN32_WINNT >=0x0601) #endif // (_WIN32_WINNT >=0x0601)
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaProximityNode( GetNumaProximityNode(
__in ULONG ProximityId, _In_ ULONG ProximityId,
__out PUCHAR NodeNumber _Out_ PUCHAR NodeNumber
); );
#endif #endif
#if _WIN32_WINNT >= 0x0601 #if _WIN32_WINNT >= 0x0601
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaProximityNodeEx( GetNumaProximityNodeEx(
__in ULONG ProximityId, _In_ ULONG ProximityId,
__out PUSHORT NodeNumber _Out_ PUSHORT NodeNumber
); );
#endif // (_WIN32_WINNT >=0x0601) #endif // (_WIN32_WINNT >=0x0601)
// //
// Application restart and data recovery callback // Application restart and data recovery callback
// //
typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK)(PVOID pvParameter); typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK)(PVOID pvParameter);
// //
skipping to change at line 14527 skipping to change at line 8054
// //
// Do not restart the process for termination due to patch installations // Do not restart the process for termination due to patch installations
// //
#define RESTART_NO_PATCH 4 #define RESTART_NO_PATCH 4
// //
// Do not restart the process when the system is rebooted due to patch installat ions // Do not restart the process when the system is rebooted due to patch installat ions
// //
#define RESTART_NO_REBOOT 8 #define RESTART_NO_REBOOT 8
#define RECOVERY_DEFAULT_PING_INTERVAL 5000
#define RECOVERY_MAX_PING_INTERVAL (5 * 60 * 1000)
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
RegisterApplicationRecoveryCallback( RegisterApplicationRecoveryCallback(
__in APPLICATION_RECOVERY_CALLBACK pRecoveyCallback, _In_ APPLICATION_RECOVERY_CALLBACK pRecoveyCallback,
__in_opt PVOID pvParameter, _In_opt_ PVOID pvParameter,
__in DWORD dwPingInterval, _In_ DWORD dwPingInterval,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
UnregisterApplicationRecoveryCallback(void); UnregisterApplicationRecoveryCallback(void);
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
RegisterApplicationRestart( RegisterApplicationRestart(
__in_opt PCWSTR pwzCommandline, _In_opt_ PCWSTR pwzCommandline,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
UnregisterApplicationRestart(void); UnregisterApplicationRestart(void);
#define RECOVERY_DEFAULT_PING_INTERVAL 5000
#define RECOVERY_MAX_PING_INTERVAL (5 * 60 * 1000)
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
GetApplicationRecoveryCallback( GetApplicationRecoveryCallback(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out APPLICATION_RECOVERY_CALLBACK* pRecoveryCallback, _Out_ APPLICATION_RECOVERY_CALLBACK* pRecoveryCallback,
__deref_opt_out_opt PVOID* ppvParameter, _Outptr_opt_result_maybenull_ PVOID* ppvParameter,
__out_opt PDWORD pdwPingInterval, _Out_opt_ PDWORD pdwPingInterval,
__out_opt PDWORD pdwFlags _Out_opt_ PDWORD pdwFlags
); );
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
GetApplicationRestartSettings( GetApplicationRestartSettings(
__in HANDLE hProcess, _In_ HANDLE hProcess,
__out_ecount_opt(*pcchSize) PWSTR pwzCommandline, _Out_writes_opt_(*pcchSize) PWSTR pwzCommandline,
__inout PDWORD pcchSize, _Inout_ PDWORD pcchSize,
__out_opt PDWORD pdwFlags _Out_opt_ PDWORD pdwFlags
); );
WINBASEAPI WINBASEAPI
HRESULT HRESULT
WINAPI WINAPI
ApplicationRecoveryInProgress( ApplicationRecoveryInProgress(
__out PBOOL pbCancelled _Out_ PBOOL pbCancelled
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
ApplicationRecoveryFinished( ApplicationRecoveryFinished(
__in BOOL bSuccess _In_ BOOL bSuccess
); );
#endif // _WIN32_WINNT >= 0x0600
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
typedef enum _FILE_INFO_BY_HANDLE_CLASS {
FileBasicInfo, #pragma region Application Family
FileStandardInfo, #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
FileNameInfo,
FileRenameInfo,
FileDispositionInfo,
FileAllocationInfo,
FileEndOfFileInfo,
FileStreamInfo,
FileCompressionInfo,
FileAttributeTagInfo,
FileIdBothDirectoryInfo,
FileIdBothDirectoryRestartInfo,
FileIoPriorityHintInfo,
FileRemoteProtocolInfo,
MaximumFileInfoByHandleClass
} FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS;
typedef struct _FILE_BASIC_INFO { typedef struct _FILE_BASIC_INFO {
LARGE_INTEGER CreationTime; LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime; LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime; LARGE_INTEGER LastWriteTime;
LARGE_INTEGER ChangeTime; LARGE_INTEGER ChangeTime;
DWORD FileAttributes; DWORD FileAttributes;
} FILE_BASIC_INFO, *PFILE_BASIC_INFO; } FILE_BASIC_INFO, *PFILE_BASIC_INFO;
typedef struct _FILE_STANDARD_INFO { typedef struct _FILE_STANDARD_INFO {
skipping to change at line 14692 skipping to change at line 8212
LARGE_INTEGER AllocationSize; LARGE_INTEGER AllocationSize;
DWORD FileAttributes; DWORD FileAttributes;
DWORD FileNameLength; DWORD FileNameLength;
DWORD EaSize; DWORD EaSize;
CCHAR ShortNameLength; CCHAR ShortNameLength;
WCHAR ShortName[12]; WCHAR ShortName[12];
LARGE_INTEGER FileId; LARGE_INTEGER FileId;
WCHAR FileName[1]; WCHAR FileName[1];
} FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO; } FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO;
typedef struct _FILE_FULL_DIR_INFO {
ULONG NextEntryOffset;
ULONG FileIndex;
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
LARGE_INTEGER ChangeTime;
LARGE_INTEGER EndOfFile;
LARGE_INTEGER AllocationSize;
ULONG FileAttributes;
ULONG FileNameLength;
ULONG EaSize;
WCHAR FileName[1];
} FILE_FULL_DIR_INFO, *PFILE_FULL_DIR_INFO;
typedef enum _PRIORITY_HINT { typedef enum _PRIORITY_HINT {
IoPriorityHintVeryLow = 0, IoPriorityHintVeryLow = 0,
IoPriorityHintLow, IoPriorityHintLow,
IoPriorityHintNormal, IoPriorityHintNormal,
MaximumIoPriorityHintType MaximumIoPriorityHintType
} PRIORITY_HINT; } PRIORITY_HINT;
typedef struct _FILE_IO_PRIORITY_HINT_INFO { typedef struct _FILE_IO_PRIORITY_HINT_INFO {
PRIORITY_HINT PriorityHint; PRIORITY_HINT PriorityHint;
} FILE_IO_PRIORITY_HINT_INFO, *PFILE_IO_PRIORITY_HINT_INFO; } FILE_IO_PRIORITY_HINT_INFO, *PFILE_IO_PRIORITY_HINT_INFO;
// Structure and constants must match those in ntioapi_x.w // Structure and constants must match those in ntioapi_x.w
#define REMOTE_PROTOCOL_INFO_FLAG_LOOPBACK 0x00000001 #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define REMOTE_PROTOCOL_INFO_FLAG_OFFLINE 0x00000002
typedef struct _FILE_ALIGNMENT_INFO {
ULONG AlignmentRequirement;
} FILE_ALIGNMENT_INFO, *PFILE_ALIGNMENT_INFO;
//
// Flag definitions for FILE_STORAGE_INFO structure
//
//
// If this flag is set then the partition is correctly aligned with the
// physical sector size of the device for optimial performance.
//
#define STORAGE_INFO_FLAGS_ALIGNED_DEVICE 0x00000001
#define STORAGE_INFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002
//
// If this value is set for the Sector and Parition alignment
// fields then it means the alignment is not known and the
// alignment flags have no meaning
//
#define STORAGE_INFO_OFFSET_UNKNOWN (0xffffffff)
typedef struct _FILE_STORAGE_INFO {
ULONG LogicalBytesPerSector;
ULONG PhysicalBytesPerSectorForAtomicity;
ULONG PhysicalBytesPerSectorForPerformance;
ULONG FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
ULONG Flags;
ULONG ByteOffsetForSectorAlignment;
ULONG ByteOffsetForPartitionAlignment;
} FILE_STORAGE_INFO, *PFILE_STORAGE_INFO;
//
// Structure definition for FileIdInfo
//
typedef struct _FILE_ID_INFO {
ULONGLONG VolumeSerialNumber;
FILE_ID_128 FileId;
} FILE_ID_INFO, *PFILE_ID_INFO;
//
// Structure definition for FileIdExtdDirectoryInfo
//
typedef struct _FILE_ID_EXTD_DIR_INFO {
ULONG NextEntryOffset;
ULONG FileIndex;
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
LARGE_INTEGER ChangeTime;
LARGE_INTEGER EndOfFile;
LARGE_INTEGER AllocationSize;
ULONG FileAttributes;
ULONG FileNameLength;
ULONG EaSize;
ULONG ReparsePointTag;
FILE_ID_128 FileId;
WCHAR FileName[1];
} FILE_ID_EXTD_DIR_INFO, *PFILE_ID_EXTD_DIR_INFO;
#endif
//
// File Remote protocol info (FileRemoteProtocolInfo)
//
// Protocol generic flags.
#define REMOTE_PROTOCOL_INFO_FLAG_LOOPBACK 0x00000001
#define REMOTE_PROTOCOL_INFO_FLAG_OFFLINE 0x00000002
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define REMOTE_PROTOCOL_INFO_FLAG_PERSISTENT_HANDLE 0x00000004
#endif
// Protocol specific SMB2 share capability flags.
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define RPI_FLAG_SMB2_SHARECAP_TIMEWARP 0x00000002
#define RPI_FLAG_SMB2_SHARECAP_DFS 0x00000008
#define RPI_FLAG_SMB2_SHARECAP_CONTINUOUS_AVAILABILITY 0x00000010
#define RPI_FLAG_SMB2_SHARECAP_SCALEOUT 0x00000020
#define RPI_FLAG_SMB2_SHARECAP_CLUSTER 0x00000040
#endif
// Protocol specific SMB2 server capability flags.
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define RPI_SMB2_FLAG_SERVERCAP_DFS 0x00000001
#define RPI_SMB2_FLAG_SERVERCAP_LEASING 0x00000002
#define RPI_SMB2_FLAG_SERVERCAP_LARGEMTU 0x00000004
#define RPI_SMB2_FLAG_SERVERCAP_MULTICHANNEL 0x00000008
#define RPI_SMB2_FLAG_SERVERCAP_PERSISTENT_HANDLES 0x00000010
#define RPI_SMB2_FLAG_SERVERCAP_DIRECTORY_LEASING 0x00000020
#endif
typedef struct _FILE_REMOTE_PROTOCOL_INFO typedef struct _FILE_REMOTE_PROTOCOL_INFO
{ {
// Structure Version // Structure Version
USHORT StructureVersion; // 1 USHORT StructureVersion; // 1
USHORT StructureSize; // sizeof(FILE_REMOTE_PROTOCOL_INFO) USHORT StructureSize; // sizeof(FILE_REMOTE_PROTOCOL_INFO)
DWORD Protocol; // Protocol (WNNC_NET_*) defined in wnnc.h or n tifs.h. ULONG Protocol; // Protocol (WNNC_NET_*) defined in winnetwk.h or ntifs.h.
// Protocol Version & Type // Protocol Version & Type
USHORT ProtocolMajorVersion; USHORT ProtocolMajorVersion;
USHORT ProtocolMinorVersion; USHORT ProtocolMinorVersion;
USHORT ProtocolRevision; USHORT ProtocolRevision;
USHORT Reserved; USHORT Reserved;
// Protocol-Generic Information // Protocol-Generic Information
DWORD Flags; ULONG Flags;
struct { struct {
DWORD Reserved[8]; ULONG Reserved[8];
} GenericReserved; } GenericReserved;
// Protocol specific information // Protocol specific information
#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
struct { struct {
DWORD Reserved[16]; ULONG Reserved[16];
} ProtocolSpecificReserved; } ProtocolSpecificReserved;
#else
union {
} FILE_REMOTE_PROTOCOL_INFO, *PFILE_REMOTE_PROTOCOL_INFO; struct {
WINBASEAPI struct {
BOOL ULONG Capabilities;
WINAPI } Server;
SetFileInformationByHandle(
__in HANDLE hFile, struct {
__in FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ULONG Capabilities;
__in_bcount(dwBufferSize) LPVOID lpFileInformation, ULONG CachingFlags;
__in DWORD dwBufferSize } Share;
);
} Smb2;
ULONG Reserved[16];
} ProtocolSpecific;
#endif
} FILE_REMOTE_PROTOCOL_INFO, *PFILE_REMOTE_PROTOCOL_INFO;
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetFileInformationByHandleEx( GetFileInformationByHandleEx(
__in HANDLE hFile, _In_ HANDLE hFile,
__in FILE_INFO_BY_HANDLE_CLASS FileInformationClass, _In_ FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
__out_bcount(dwBufferSize) LPVOID lpFileInformation, _Out_writes_bytes_(dwBufferSize) LPVOID lpFileInformation,
__in DWORD dwBufferSize _In_ DWORD dwBufferSize
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
typedef enum _FILE_ID_TYPE { typedef enum _FILE_ID_TYPE {
FileIdType, FileIdType,
ObjectIdType, ObjectIdType,
ExtendedFileIdType,
MaximumFileIdType MaximumFileIdType
} FILE_ID_TYPE, *PFILE_ID_TYPE; } FILE_ID_TYPE, *PFILE_ID_TYPE;
typedef struct FILE_ID_DESCRIPTOR { typedef struct FILE_ID_DESCRIPTOR {
DWORD dwSize; // Size of the struct DWORD dwSize; // Size of the struct
FILE_ID_TYPE Type; // Describes the type of identifier passed in. FILE_ID_TYPE Type; // Describes the type of identifier passed in.
union { union {
LARGE_INTEGER FileId; LARGE_INTEGER FileId;
GUID ObjectId; GUID ObjectId;
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
FILE_ID_128 ExtendedFileId;
#endif
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
} FILE_ID_DESCRIPTOR, *LPFILE_ID_DESCRIPTOR; } FILE_ID_DESCRIPTOR, *LPFILE_ID_DESCRIPTOR;
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenFileById ( OpenFileById (
__in HANDLE hVolumeHint, _In_ HANDLE hVolumeHint,
__in LPFILE_ID_DESCRIPTOR lpFileId, _In_ LPFILE_ID_DESCRIPTOR lpFileId,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwShareMode, _In_ DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwFlagsAndAttributes _In_ DWORD dwFlagsAndAttributes
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
// //
// Flags to be passed into CREATE_SYMBOLIC_LINK // Flags to be passed into CREATE_SYMBOLIC_LINK
// //
#define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1) #define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1)
#define VALID_SYMBOLIC_LINK_FLAGS SYMBOLIC_LINK_FLAG_DIRECTORY // & whatever ot her flags we think of! #define VALID_SYMBOLIC_LINK_FLAGS SYMBOLIC_LINK_FLAG_DIRECTORY // & whatever ot her flags we think of!
WINBASEAPI WINBASEAPI
BOOLEAN BOOLEAN
APIENTRY APIENTRY
CreateSymbolicLinkA ( CreateSymbolicLinkA (
__in LPCSTR lpSymlinkFileName, _In_ LPCSTR lpSymlinkFileName,
__in LPCSTR lpTargetFileName, _In_ LPCSTR lpTargetFileName,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
BOOLEAN BOOLEAN
APIENTRY APIENTRY
CreateSymbolicLinkW ( CreateSymbolicLinkW (
__in LPCWSTR lpSymlinkFileName, _In_ LPCWSTR lpSymlinkFileName,
__in LPCWSTR lpTargetFileName, _In_ LPCWSTR lpTargetFileName,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateSymbolicLink CreateSymbolicLinkW #define CreateSymbolicLink CreateSymbolicLinkW
#else #else
#define CreateSymbolicLink CreateSymbolicLinkA #define CreateSymbolicLink CreateSymbolicLinkA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
BOOLEAN BOOLEAN
APIENTRY APIENTRY
CreateSymbolicLinkTransactedA ( CreateSymbolicLinkTransactedA (
__in LPCSTR lpSymlinkFileName, _In_ LPCSTR lpSymlinkFileName,
__in LPCSTR lpTargetFileName, _In_ LPCSTR lpTargetFileName,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
WINBASEAPI WINBASEAPI
BOOLEAN BOOLEAN
APIENTRY APIENTRY
CreateSymbolicLinkTransactedW ( CreateSymbolicLinkTransactedW (
__in LPCWSTR lpSymlinkFileName, _In_ LPCWSTR lpSymlinkFileName,
__in LPCWSTR lpTargetFileName, _In_ LPCWSTR lpTargetFileName,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in HANDLE hTransaction _In_ HANDLE hTransaction
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateSymbolicLinkTransacted CreateSymbolicLinkTransactedW #define CreateSymbolicLinkTransacted CreateSymbolicLinkTransactedW
#else #else
#define CreateSymbolicLinkTransacted CreateSymbolicLinkTransactedA #define CreateSymbolicLinkTransacted CreateSymbolicLinkTransactedA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI
DWORD
WINAPI
GetFinalPathNameByHandleA (
__in HANDLE hFile,
__out_ecount(cchFilePath) LPSTR lpszFilePath,
__in DWORD cchFilePath,
__in DWORD dwFlags
);
WINBASEAPI
DWORD
WINAPI
GetFinalPathNameByHandleW (
__in HANDLE hFile,
__out_ecount(cchFilePath) LPWSTR lpszFilePath,
__in DWORD cchFilePath,
__in DWORD dwFlags
);
#ifdef UNICODE
#define GetFinalPathNameByHandle GetFinalPathNameByHandleW
#else
#define GetFinalPathNameByHandle GetFinalPathNameByHandleA
#endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0600) #endif // (_WIN32_WINNT >= 0x0600)
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryActCtxSettingsW( QueryActCtxSettingsW(
__in_opt DWORD dwFlags, _In_opt_ DWORD dwFlags,
__in_opt HANDLE hActCtx, _In_opt_ HANDLE hActCtx,
__in_opt PCWSTR settingsNameSpace, _In_opt_ PCWSTR settingsNameSpace,
__in PCWSTR settingName, _In_ PCWSTR settingName,
__out_bcount_part_opt(dwBuffer, *pdwWrittenOrRequired) PWSTR pvBuffer, _Out_writes_bytes_to_opt_(dwBuffer, *pdwWrittenOrRequired) PWSTR pvBuffer,
__in SIZE_T dwBuffer, _In_ SIZE_T dwBuffer,
__out_opt SIZE_T *pdwWrittenOrRequired _Out_opt_ SIZE_T *pdwWrittenOrRequired
); );
#endif #endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReplacePartitionUnit ( ReplacePartitionUnit (
__in PWSTR TargetPartition, _In_ PWSTR TargetPartition,
__in PWSTR SparePartition, _In_ PWSTR SparePartition,
__in ULONG Flags _In_ ULONG Flags
); );
#endif #endif
#if (_WIN32_WINNT >= 0x0600) #if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
AddSecureMemoryCacheCallback( AddSecureMemoryCacheCallback(
__in __callback PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack _In_ __callback PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RemoveSecureMemoryCacheCallback( RemoveSecureMemoryCacheCallback(
__in __callback PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack _In_ __callback PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack
); );
#endif #endif
#if (_WIN32_WINNT >= 0x0601) #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
__checkReturn #if (NTDDI_VERSION >= NTDDI_WIN7SP1)
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
_Must_inspect_result_
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CopyExtendedContext( CopyContext(
__out PCONTEXT_EX Destination, _Inout_ PCONTEXT Destination,
__in DWORD ContextFlags, _In_ DWORD ContextFlags,
__in PCONTEXT_EX Source _In_ PCONTEXT Source
); );
__checkReturn #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
_Success_(return != FALSE)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
InitializeExtendedContext( InitializeContext(
__out PVOID Context, _Out_writes_bytes_opt_(*ContextLength) PVOID Buffer,
__in DWORD ContextFlags, _In_ DWORD ContextFlags,
__out PCONTEXT_EX* ContextEx _Out_ PCONTEXT* Context,
_Inout_ PDWORD ContextLength
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#if defined(_AMD64_) || defined(_X86_)
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINBASEAPI WINBASEAPI
DWORD64 DWORD64
WINAPI WINAPI
GetEnabledExtendedFeatures( GetEnabledXStateFeatures(
__in DWORD64 FeatureMask VOID
); );
_Must_inspect_result_
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetExtendedContextLength( GetXStateFeaturesMask(
__in DWORD ContextFlags, _In_ PCONTEXT Context,
__out PDWORD ContextLength _Out_ PDWORD64 FeatureMask
);
WINBASEAPI
DWORD64
WINAPI
GetExtendedFeaturesMask(
__in PCONTEXT_EX ContextEx
); );
_Success_(return != NULL)
WINBASEAPI WINBASEAPI
PVOID PVOID
WINAPI WINAPI
LocateExtendedFeature( LocateXStateFeature(
__in PCONTEXT_EX ContextEx, _In_ PCONTEXT Context,
__in DWORD FeatureId, _In_ DWORD FeatureId,
__out_opt PDWORD Length _Out_opt_ PDWORD Length
); );
WINBASEAPI #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
PCONTEXT #pragma endregion
WINAPI
LocateLegacyContext( #pragma region Desktop Family
__in PCONTEXT_EX ContextEx, #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
__out_opt PDWORD Length
);
_Must_inspect_result_
WINBASEAPI WINBASEAPI
VOID BOOL
WINAPI WINAPI
SetExtendedFeaturesMask( SetXStateFeaturesMask(
__out PCONTEXT_EX ContextEx, _Inout_ PCONTEXT Context,
__in DWORD64 FeatureMask _In_ DWORD64 FeatureMask
); );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif /* defined(_AMD64_) || defined(_X86_) */
#endif /* (NTDDI_VERSION >= NTDDI_WIN7SP1) */
#if (_WIN32_WINNT >= 0x0601)
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
WINBASEAPI WINBASEAPI
DWORD DWORD
APIENTRY APIENTRY
EnableThreadProfiling( EnableThreadProfiling(
__in HANDLE ThreadHandle, _In_ HANDLE ThreadHandle,
__in DWORD Flags, _In_ DWORD Flags,
__in DWORD64 HardwareCounters, _In_ DWORD64 HardwareCounters,
__out HANDLE *PerformanceDataHandle _Out_ HANDLE *PerformanceDataHandle
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
APIENTRY APIENTRY
DisableThreadProfiling( DisableThreadProfiling(
__in HANDLE PerformanceDataHandle _In_ HANDLE PerformanceDataHandle
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
APIENTRY APIENTRY
QueryThreadProfiling( QueryThreadProfiling(
__in HANDLE ThreadHandle, _In_ HANDLE ThreadHandle,
__out PBOOLEAN Enabled _Out_ PBOOLEAN Enabled
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
APIENTRY APIENTRY
ReadThreadProfilingData( ReadThreadProfilingData(
__in HANDLE PerformanceDataHandle, _In_ HANDLE PerformanceDataHandle,
__in DWORD Flags, _In_ DWORD Flags,
__out PPERFORMANCE_DATA PerformanceData _Out_ PPERFORMANCE_DATA PerformanceData
); );
#endif #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif /* (_WIN32_WINNT >= 0x0601) */
#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */ #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0) #if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
#include "winbase.inl" #include "winbase.inl"
#endif /* ISOLATION_AWARE_ENABLED */ #endif /* ISOLATION_AWARE_ENABLED */
#endif /* RC */ #endif /* RC */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#if defined (_MSC_VER)
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning(default:4001) /* nonstandard extension : single line comment */
#pragma warning(default:4201) /* nonstandard extension used : nameless struct/un
ion */
#pragma warning(default:4214) /* nonstandard extension used : bit field types ot
her then int */
#endif
#endif
#endif // _WINBASE_ #endif // _WINBASE_
#if !defined(RC_INVOKED) #if !defined(RC_INVOKED)
#if !defined(NOWINBASEINTERLOCK) #if !defined(NOWINBASEINTERLOCK)
#if !defined(_NTOS_) #if !defined(_NTOS_)
/*++ /*++
Copyright (c) Microsoft Corporation. All rights reserved. Copyright (c) Microsoft Corporation. All rights reserved.
Module Name: Module Name:
skipping to change at line 15084 skipping to change at line 8757
#if MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS /* { */ #if MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS /* { */
#if defined(__cplusplus) /* { */ #if defined(__cplusplus) /* { */
extern "C++" { extern "C++" {
FORCEINLINE FORCEINLINE
unsigned unsigned
InterlockedIncrement( InterlockedIncrement(
__inout __drv_interlocked unsigned volatile *Addend _Inout_ _Interlocked_operand_ unsigned volatile *Addend
) )
{ {
return (unsigned) InterlockedIncrement((volatile long*) Addend); return (unsigned) _InterlockedIncrement((volatile long*) Addend);
} }
FORCEINLINE FORCEINLINE
unsigned long unsigned long
InterlockedIncrement( InterlockedIncrement(
__inout __drv_interlocked unsigned long volatile *Addend _Inout_ _Interlocked_operand_ unsigned long volatile *Addend
) )
{ {
return (unsigned long) InterlockedIncrement((volatile long*) Addend); return (unsigned long) _InterlockedIncrement((volatile long*) Addend);
} }
#if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_)) #if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_) && !defin ed(_MANAGED))
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedIncrement( InterlockedIncrement(
__inout __drv_interlocked unsigned __int64 volatile *Addend _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Addend
) )
{ {
return (unsigned __int64) InterlockedIncrement64((volatile __int64*) Addend) ; return (unsigned __int64) _InterlockedIncrement64((volatile long long*) Adde nd);
} }
#endif #endif
FORCEINLINE FORCEINLINE
unsigned unsigned
InterlockedDecrement( InterlockedDecrement(
__inout __drv_interlocked unsigned volatile *Addend _Inout_ _Interlocked_operand_ unsigned volatile *Addend
) )
{ {
return (unsigned long) InterlockedDecrement((volatile long*) Addend); return (unsigned long) _InterlockedDecrement((volatile long*) Addend);
} }
FORCEINLINE FORCEINLINE
unsigned long unsigned long
InterlockedDecrement( InterlockedDecrement(
__inout __drv_interlocked unsigned long volatile *Addend _Inout_ _Interlocked_operand_ unsigned long volatile *Addend
) )
{ {
return (unsigned long) InterlockedDecrement((volatile long*) Addend); return (unsigned long) _InterlockedDecrement((volatile long*) Addend);
} }
#if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_)) #if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_) && !defin ed(_MANAGED))
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedDecrement( InterlockedDecrement(
__inout __drv_interlocked unsigned __int64 volatile *Addend _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Addend
) )
{ {
return (unsigned __int64) InterlockedDecrement64((volatile __int64*) Addend) ; return (unsigned __int64) _InterlockedDecrement64((volatile long long*) Adde nd);
} }
#endif #endif
#if !defined(_M_CEE_PURE)
FORCEINLINE FORCEINLINE
unsigned unsigned
InterlockedExchange( InterlockedExchange(
__inout __drv_interlocked unsigned volatile *Target, _Inout_ _Interlocked_operand_ unsigned volatile *Target,
__in unsigned Value _In_ unsigned Value
) )
{ {
return (unsigned) InterlockedExchange((volatile long*) Target, (long) Value) ; return (unsigned) _InterlockedExchange((volatile long*) Target, (long) Value );
} }
FORCEINLINE FORCEINLINE
unsigned long unsigned long
InterlockedExchange( InterlockedExchange(
__inout __drv_interlocked unsigned long volatile *Target, _Inout_ _Interlocked_operand_ unsigned long volatile *Target,
__in unsigned long Value _In_ unsigned long Value
) )
{ {
return (unsigned long) InterlockedExchange((volatile long*) Target, (long) V alue); return (unsigned long) _InterlockedExchange((volatile long*) Target, (long) Value);
} }
#if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_)) #if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_) && !defin ed(_MANAGED))
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedExchange( InterlockedExchange(
__inout __drv_interlocked unsigned __int64 volatile *Target, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Target,
__in unsigned __int64 Value _In_ unsigned __int64 Value
) )
{ {
return (unsigned __int64) InterlockedExchange64((volatile __int64*) Target, (__int64) Value); return (unsigned __int64) _InterlockedExchange64((volatile long long*) Targe t, (long long) Value);
} }
#endif #endif
FORCEINLINE FORCEINLINE
unsigned unsigned
InterlockedExchangeAdd( InterlockedExchangeAdd(
__inout __drv_interlocked unsigned volatile *Addend, _Inout_ _Interlocked_operand_ unsigned volatile *Addend,
__in unsigned Value _In_ unsigned Value
) )
{ {
return (unsigned) InterlockedExchangeAdd((volatile long*) Addend, (long) Val ue); return (unsigned) _InterlockedExchangeAdd((volatile long*) Addend, (long) Va lue);
} }
FORCEINLINE FORCEINLINE
unsigned unsigned
InterlockedExchangeSubtract( InterlockedExchangeSubtract(
__inout __drv_interlocked unsigned volatile *Addend, _Inout_ _Interlocked_operand_ unsigned volatile *Addend,
__in unsigned Value _In_ unsigned Value
) )
{ {
return (unsigned) InterlockedExchangeAdd((volatile long*) Addend, - (long) Value); return (unsigned) _InterlockedExchangeAdd((volatile long*) Addend, - (long) Value);
} }
FORCEINLINE FORCEINLINE
unsigned long unsigned long
InterlockedExchangeAdd( InterlockedExchangeAdd(
__inout __drv_interlocked unsigned long volatile *Addend, _Inout_ _Interlocked_operand_ unsigned long volatile *Addend,
__in unsigned long Value _In_ unsigned long Value
) )
{ {
return (unsigned long) InterlockedExchangeAdd((volatile long*) Addend, (long ) Value); return (unsigned long) _InterlockedExchangeAdd((volatile long*) Addend, (lon g) Value);
} }
FORCEINLINE FORCEINLINE
unsigned long unsigned long
InterlockedExchangeSubtract( InterlockedExchangeSubtract(
__inout __drv_interlocked unsigned long volatile *Addend, _Inout_ _Interlocked_operand_ unsigned long volatile *Addend,
__in unsigned long Value _In_ unsigned long Value
) )
{ {
return (unsigned long) InterlockedExchangeAdd((volatile long*) Addend, - (l ong) Value); return (unsigned long) _InterlockedExchangeAdd((volatile long*) Addend, - ( long) Value);
} }
#if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_)) #if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_) && !defin ed(_MANAGED))
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedExchangeAdd( InterlockedExchangeAdd(
__inout __drv_interlocked unsigned __int64 volatile *Addend, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Addend,
__in unsigned __int64 Value _In_ unsigned __int64 Value
) )
{ {
return (unsigned __int64) InterlockedExchangeAdd64((volatile __int64*) Adden d, (__int64) Value); return (unsigned __int64) _InterlockedExchangeAdd64((volatile long long*) Ad dend, (long long) Value);
} }
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedExchangeSubtract( InterlockedExchangeSubtract(
__inout __drv_interlocked unsigned __int64 volatile *Addend, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Addend,
__in unsigned __int64 Value _In_ unsigned __int64 Value
) )
{ {
return (unsigned __int64) InterlockedExchangeAdd64((volatile __int64*) Adden d, - (__int64) Value); return (unsigned __int64) _InterlockedExchangeAdd64((volatile long long*) Ad dend, - (long long) Value);
} }
#endif #endif
FORCEINLINE FORCEINLINE
unsigned unsigned
InterlockedCompareExchange( InterlockedCompareExchange(
__inout __drv_interlocked unsigned volatile *Destination, _Inout_ _Interlocked_operand_ unsigned volatile *Destination,
__in unsigned Exchange, _In_ unsigned Exchange,
__in unsigned Comperand _In_ unsigned Comperand
) )
{ {
return (unsigned) InterlockedCompareExchange((volatile long*) Destination, ( long) Exchange, (long) Comperand); return (unsigned) _InterlockedCompareExchange((volatile long*) Destination, (long) Exchange, (long) Comperand);
} }
FORCEINLINE FORCEINLINE
unsigned long unsigned long
InterlockedCompareExchange( InterlockedCompareExchange(
__inout __drv_interlocked unsigned long volatile *Destination, _Inout_ _Interlocked_operand_ unsigned long volatile *Destination,
__in unsigned long Exchange, _In_ unsigned long Exchange,
__in unsigned long Comperand _In_ unsigned long Comperand
) )
{ {
return (unsigned long) InterlockedCompareExchange((volatile long*) Destinati on, (long) Exchange, (long) Comperand); return (unsigned long) _InterlockedCompareExchange((volatile long*) Destinat ion, (long) Exchange, (long) Comperand);
} }
#if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_)) #if defined(_WIN64) || ((_WIN32_WINNT >= 0x0502) && defined(_WINBASE_) && !defin ed(_MANAGED))
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedCompareExchange( InterlockedCompareExchange(
__inout __drv_interlocked unsigned __int64 volatile *Destination, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Destination,
__in unsigned __int64 Exchange, _In_ unsigned __int64 Exchange,
__in unsigned __int64 Comperand _In_ unsigned __int64 Comperand
) )
{ {
return (unsigned __int64) InterlockedCompareExchange64((volatile __int64*) D estination, (__int64) Exchange, (__int64) Comperand); return (unsigned __int64) _InterlockedCompareExchange64((volatile long long* ) Destination, (long long) Exchange, (long long) Comperand);
} }
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedAnd( InterlockedAnd(
__inout __drv_interlocked unsigned __int64 volatile *Destination, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Destination,
__in unsigned __int64 Value _In_ unsigned __int64 Value
) )
{ {
return (unsigned __int64) InterlockedAnd64((volatile __int64*) Destination, (__int64) Value); return (unsigned __int64) _InterlockedAnd64((volatile long long*) Destinatio n, (long long) Value);
} }
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedOr( InterlockedOr(
__inout __drv_interlocked unsigned __int64 volatile *Destination, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Destination,
__in unsigned __int64 Value _In_ unsigned __int64 Value
) )
{ {
return (unsigned __int64) InterlockedOr64((volatile __int64*) Destination, ( __int64) Value); return (unsigned __int64) _InterlockedOr64((volatile long long*) Destination , (long long) Value);
} }
FORCEINLINE FORCEINLINE
unsigned __int64 unsigned __int64
InterlockedXor( InterlockedXor(
__inout __drv_interlocked unsigned __int64 volatile *Destination, _Inout_ _Interlocked_operand_ unsigned __int64 volatile *Destination,
__in unsigned __int64 Value _In_ unsigned __int64 Value
) )
{ {
return (unsigned __int64) InterlockedXor64((volatile __int64*) Destination, (__int64) Value); return (unsigned __int64) _InterlockedXor64((volatile long long*) Destinatio n, (long long) Value);
} }
#endif #endif
#endif /* !defined(_M_CEE_PURE) */
} /* extern "C++" */ } /* extern "C++" */
#endif /* } __cplusplus */ #endif /* } __cplusplus */
#endif /* } MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS */ #endif /* } MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS */
#undef MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS #undef MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS
#define MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0 #define MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
#endif /* } MIDL_PASS */ #endif /* } MIDL_PASS */
#endif /* } MICROSOFT_WINDOWS_WINBASE_INTERLOCKED_CPLUSPLUS_H_INCLUDED */ #endif /* } MICROSOFT_WINDOWS_WINBASE_INTERLOCKED_CPLUSPLUS_H_INCLUDED */
 End of changes. 1024 change blocks. 
9319 lines changed or deleted 3014 lines changed or added


 wincred.h (6.1.7601.23418-Windows_7.0)   wincred.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 22 skipping to change at line 22
needed for the Credential Manager. needed for the Credential Manager.
Author: Author:
Revision History: Revision History:
--*/ --*/
#ifndef _WINCRED_H_ #ifndef _WINCRED_H_
#define _WINCRED_H_ #define _WINCRED_H_
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if !defined(_ADVAPI32_) #if !defined(_ADVAPI32_)
#define WINADVAPI DECLSPEC_IMPORT #define WINADVAPI DECLSPEC_IMPORT
#else #else
#define WINADVAPI #define WINADVAPI
#endif #endif
#if !defined(CREDUIAPI) #if !defined(CREDUIAPI)
#if !defined(_CREDUI_) #if !defined(_CREDUI_)
#define CREDUIAPI EXTERN_C DECLSPEC_IMPORT #define CREDUIAPI EXTERN_C DECLSPEC_IMPORT
skipping to change at line 81 skipping to change at line 85
typedef struct _FILETIME *LPFILETIME; typedef struct _FILETIME *LPFILETIME;
#endif // !_FILETIME #endif // !_FILETIME
#endif // _WINBASE_ #endif // _WINBASE_
// //
// Ensure NTSTATUS is defined // Ensure NTSTATUS is defined
// //
#ifndef _NTDEF_ #ifndef _NTDEF_
typedef LONG NTSTATUS, *PNTSTATUS; typedef _Return_type_success_(return >= 0) LONG NTSTATUS, *PNTSTATUS;
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Macros // Macros
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// Macro to determine whether CredUIPromptForCredentials should be called upon a failed // Macro to determine whether CredUIPromptForCredentials should be called upon a failed
// authentication attempt. // authentication attempt.
// //
skipping to change at line 420 skipping to change at line 424
// //
// A credential // A credential
// //
typedef struct _CREDENTIALA { typedef struct _CREDENTIALA {
DWORD Flags; DWORD Flags;
DWORD Type; DWORD Type;
LPSTR TargetName; LPSTR TargetName;
LPSTR Comment; LPSTR Comment;
FILETIME LastWritten; FILETIME LastWritten;
DWORD CredentialBlobSize; DWORD CredentialBlobSize;
__field_bcount(CredentialBlobSize) LPBYTE CredentialBlob; _Field_size_bytes_(CredentialBlobSize) LPBYTE CredentialBlob;
DWORD Persist; DWORD Persist;
DWORD AttributeCount; DWORD AttributeCount;
PCREDENTIAL_ATTRIBUTEA Attributes; PCREDENTIAL_ATTRIBUTEA Attributes;
LPSTR TargetAlias; LPSTR TargetAlias;
LPSTR UserName; LPSTR UserName;
} CREDENTIALA, *PCREDENTIALA; } CREDENTIALA, *PCREDENTIALA;
typedef struct _CREDENTIALW { typedef struct _CREDENTIALW {
DWORD Flags; DWORD Flags;
DWORD Type; DWORD Type;
skipping to change at line 606 skipping to change at line 610
CredUserProtection, CredUserProtection,
CredTrustedProtection CredTrustedProtection
} CRED_PROTECTION_TYPE, *PCRED_PROTECTION_TYPE; } CRED_PROTECTION_TYPE, *PCRED_PROTECTION_TYPE;
// //
// Values for authentication buffers packing // Values for authentication buffers packing
// //
#define CRED_PACK_PROTECTED_CREDENTIALS 0x1 #define CRED_PACK_PROTECTED_CREDENTIALS 0x1
#define CRED_PACK_WOW_BUFFER 0x2 #define CRED_PACK_WOW_BUFFER 0x2
#define CRED_PACK_GENERIC_CREDENTIALS 0x4 #define CRED_PACK_GENERIC_CREDENTIALS 0x4
#define CRED_PACK_ID_PROVIDER_CREDENTIALS 0x8
// //
// Credential UI info // Credential UI info
// //
#define _CREDUI_INFO_DEFINED #define _CREDUI_INFO_DEFINED
typedef struct _CREDUI_INFOA typedef struct _CREDUI_INFOA
{ {
DWORD cbSize; DWORD cbSize;
skipping to change at line 645 skipping to change at line 650
typedef CREDUI_INFOA CREDUI_INFO; typedef CREDUI_INFOA CREDUI_INFO;
typedef PCREDUI_INFOA PCREDUI_INFO; typedef PCREDUI_INFOA PCREDUI_INFO;
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Values // Values
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// String length limits: // String length limits:
#define CREDUI_MAX_MESSAGE_LENGTH 32767 #define CREDUI_MAX_MESSAGE_LENGTH 1024
#define CREDUI_MAX_CAPTION_LENGTH 128 #define CREDUI_MAX_CAPTION_LENGTH 128
#define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH #define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH
// //
// Username can be in <domain>\<user> or <user>@<domain> // Username can be in <domain>\<user> or <user>@<domain>
// Length in characters, not including NULL termination. // Length in characters, not including NULL termination.
// //
#define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
#define CREDUI_MAX_PASSWORD_LENGTH (512 / 2) #define CREDUI_MAX_PASSWORD_LENGTH (512 / 2)
//
// Packed credential returned by SspiEncodeAuthIdentityAsStrings(). // Packed credential returned by SspiEncodeAuthIdentityAsStrings().
// Length in characters, not including NULL termination. // Length in characters, not including NULL termination.
// //
#define CREDUI_MAX_PACKED_CREDENTIALS_LENGTH ((MAXUSHORT / 2) - 2) #define CREDUI_MAX_PACKED_CREDENTIALS_LENGTH ((MAXUSHORT / 2) - 2)
// maximum length in bytes for binary credential blobs // maximum length in bytes for binary credential blobs
#define CREDUI_MAX_CREDENTIALS_BLOB_SIZE (MAXUSHORT) #define CREDUI_MAX_CREDENTIALS_BLOB_SIZE (MAXUSHORT)
skipping to change at line 724 skipping to change at line 728
// Flags for CredUIPromptForWindowsCredentials and CPUS_CREDUI Usage Scenarios // Flags for CredUIPromptForWindowsCredentials and CPUS_CREDUI Usage Scenarios
// //
#define CREDUIWIN_GENERIC 0x00000001 // Plain text username/p assword is being requested #define CREDUIWIN_GENERIC 0x00000001 // Plain text username/p assword is being requested
#define CREDUIWIN_CHECKBOX 0x00000002 // Show the Save Credent ial checkbox #define CREDUIWIN_CHECKBOX 0x00000002 // Show the Save Credent ial checkbox
#define CREDUIWIN_AUTHPACKAGE_ONLY 0x00000010 // Only Cred Providers t hat support the input auth package should enumerate #define CREDUIWIN_AUTHPACKAGE_ONLY 0x00000010 // Only Cred Providers t hat support the input auth package should enumerate
#define CREDUIWIN_IN_CRED_ONLY 0x00000020 // Only the incoming cre d for the specific auth package should be enumerated #define CREDUIWIN_IN_CRED_ONLY 0x00000020 // Only the incoming cre d for the specific auth package should be enumerated
#define CREDUIWIN_ENUMERATE_ADMINS 0x00000100 // Cred Providers should enumerate administrators only #define CREDUIWIN_ENUMERATE_ADMINS 0x00000100 // Cred Providers should enumerate administrators only
#define CREDUIWIN_ENUMERATE_CURRENT_USER 0x00000200 // Only the incoming cre d for the specific auth package should be enumerated #define CREDUIWIN_ENUMERATE_CURRENT_USER 0x00000200 // Only the incoming cre d for the specific auth package should be enumerated
#define CREDUIWIN_SECURE_PROMPT 0x00001000 // The Credui prompt sho uld be displayed on the secure desktop #define CREDUIWIN_SECURE_PROMPT 0x00001000 // The Credui prompt sho uld be displayed on the secure desktop
#define CREDUIWIN_PREPROMPTING 0X00002000 // CredUI is invoked by SspiPromptForCredentials and the client is prompting before a prior handshake
#define CREDUIWIN_PACK_32_WOW 0x10000000 // Tell the credential p rovider it should be packing its Auth Blob 32 bit even though it is running 64 n ative #define CREDUIWIN_PACK_32_WOW 0x10000000 // Tell the credential p rovider it should be packing its Auth Blob 32 bit even though it is running 64 n ative
#define CREDUIWIN_VALID_FLAGS ( \ #define CREDUIWIN_VALID_FLAGS ( \
CREDUIWIN_GENERIC | \ CREDUIWIN_GENERIC | \
CREDUIWIN_CHECKBOX | \ CREDUIWIN_CHECKBOX | \
CREDUIWIN_AUTHPACKAGE_ONLY | \ CREDUIWIN_AUTHPACKAGE_ONLY | \
CREDUIWIN_IN_CRED_ONLY | \ CREDUIWIN_IN_CRED_ONLY | \
CREDUIWIN_ENUMERATE_ADMINS | \ CREDUIWIN_ENUMERATE_ADMINS | \
CREDUIWIN_ENUMERATE_CURRENT_USER | \ CREDUIWIN_ENUMERATE_CURRENT_USER | \
CREDUIWIN_SECURE_PROMPT | \ CREDUIWIN_SECURE_PROMPT | \
CREDUIWIN_PREPROMPTING | \
CREDUIWIN_PACK_32_WOW ) CREDUIWIN_PACK_32_WOW )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Functions // Functions
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// Values of flags to CredWrite and CredWriteDomainCredentials // Values of flags to CredWrite and CredWriteDomainCredentials
// //
#define CRED_PRESERVE_CREDENTIAL_BLOB 0x1 #define CRED_PRESERVE_CREDENTIAL_BLOB 0x1
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredWriteW ( CredWriteW (
__in PCREDENTIALW Credential, _In_ PCREDENTIALW Credential,
__in DWORD Flags _In_ DWORD Flags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredWriteA ( CredWriteA (
__in PCREDENTIALA Credential, _In_ PCREDENTIALA Credential,
__in DWORD Flags _In_ DWORD Flags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredWrite CredWriteW #define CredWrite CredWriteW
#else #else
#define CredWrite CredWriteA #define CredWrite CredWriteA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredReadW ( CredReadW (
__in LPCWSTR TargetName, _In_ LPCWSTR TargetName,
__in DWORD Type, _In_ DWORD Type,
__reserved DWORD Flags, _Reserved_ DWORD Flags,
__out PCREDENTIALW *Credential _Out_ PCREDENTIALW *Credential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredReadA ( CredReadA (
__in LPCSTR TargetName, _In_ LPCSTR TargetName,
__in DWORD Type, _In_ DWORD Type,
__reserved DWORD Flags, _Reserved_ DWORD Flags,
__out PCREDENTIALA *Credential _Out_ PCREDENTIALA *Credential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredRead CredReadW #define CredRead CredReadW
#else #else
#define CredRead CredReadA #define CredRead CredReadA
#endif // UNICODE #endif // UNICODE
// //
// Values of flags to CredEnumerate // Values of flags to CredEnumerate
// //
#define CRED_ENUMERATE_ALL_CREDENTIALS 0x1 #define CRED_ENUMERATE_ALL_CREDENTIALS 0x1
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredEnumerateW ( CredEnumerateW (
__in_opt LPCWSTR Filter, _In_opt_ LPCWSTR Filter,
__reserved DWORD Flags, _Reserved_ DWORD Flags,
__out DWORD *Count, _Out_ DWORD *Count,
__deref_out_ecount(*Count) PCREDENTIALW **Credential _Outptr_result_buffer_(*Count) PCREDENTIALW **Credential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredEnumerateA ( CredEnumerateA (
__in_opt LPCSTR Filter, _In_opt_ LPCSTR Filter,
__reserved DWORD Flags, _Reserved_ DWORD Flags,
__out DWORD *Count, _Out_ DWORD *Count,
__deref_out_ecount(*Count) PCREDENTIALA **Credential _Outptr_result_buffer_(*Count) PCREDENTIALA **Credential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredEnumerate CredEnumerateW #define CredEnumerate CredEnumerateW
#else #else
#define CredEnumerate CredEnumerateA #define CredEnumerate CredEnumerateA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredWriteDomainCredentialsW ( CredWriteDomainCredentialsW (
__in PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, _In_ PCREDENTIAL_TARGET_INFORMATIONW TargetInfo,
__in PCREDENTIALW Credential, _In_ PCREDENTIALW Credential,
__in DWORD Flags _In_ DWORD Flags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredWriteDomainCredentialsA ( CredWriteDomainCredentialsA (
__in PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, _In_ PCREDENTIAL_TARGET_INFORMATIONA TargetInfo,
__in PCREDENTIALA Credential, _In_ PCREDENTIALA Credential,
__in DWORD Flags _In_ DWORD Flags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredWriteDomainCredentials CredWriteDomainCredentialsW #define CredWriteDomainCredentials CredWriteDomainCredentialsW
#else #else
#define CredWriteDomainCredentials CredWriteDomainCredentialsA #define CredWriteDomainCredentials CredWriteDomainCredentialsA
#endif // UNICODE #endif // UNICODE
// //
// Values of flags to CredReadDomainCredentials // Values of flags to CredReadDomainCredentials
// //
#define CRED_CACHE_TARGET_INFORMATION 0x1 #define CRED_CACHE_TARGET_INFORMATION 0x1
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredReadDomainCredentialsW ( CredReadDomainCredentialsW (
__in PCREDENTIAL_TARGET_INFORMATIONW TargetInfo, _In_ PCREDENTIAL_TARGET_INFORMATIONW TargetInfo,
__in DWORD Flags, _In_ DWORD Flags,
__out DWORD *Count, _Out_ DWORD *Count,
__deref_out_ecount(*Count) PCREDENTIALW **Credential _Outptr_result_buffer_(*Count) PCREDENTIALW **Credential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredReadDomainCredentialsA ( CredReadDomainCredentialsA (
__in PCREDENTIAL_TARGET_INFORMATIONA TargetInfo, _In_ PCREDENTIAL_TARGET_INFORMATIONA TargetInfo,
__in DWORD Flags, _In_ DWORD Flags,
__out DWORD *Count, _Out_ DWORD *Count,
__deref_out_ecount(*Count) PCREDENTIALA **Credential _Outptr_result_buffer_(*Count) PCREDENTIALA **Credential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredReadDomainCredentials CredReadDomainCredentialsW #define CredReadDomainCredentials CredReadDomainCredentialsW
#else #else
#define CredReadDomainCredentials CredReadDomainCredentialsA #define CredReadDomainCredentials CredReadDomainCredentialsA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredDeleteW ( CredDeleteW (
__in LPCWSTR TargetName, _In_ LPCWSTR TargetName,
__in DWORD Type, _In_ DWORD Type,
__reserved DWORD Flags _Reserved_ DWORD Flags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredDeleteA ( CredDeleteA (
__in LPCSTR TargetName, _In_ LPCSTR TargetName,
__in DWORD Type, _In_ DWORD Type,
__reserved DWORD Flags _Reserved_ DWORD Flags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredDelete CredDeleteW #define CredDelete CredDeleteW
#else #else
#define CredDelete CredDeleteA #define CredDelete CredDeleteA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredRenameW ( CredRenameW (
__in LPCWSTR OldTargetName, _In_ LPCWSTR OldTargetName,
__in LPCWSTR NewTargetName, _In_ LPCWSTR NewTargetName,
__in DWORD Type, _In_ DWORD Type,
__reserved DWORD Flags _Reserved_ DWORD Flags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredRenameA ( CredRenameA (
__in LPCSTR OldTargetName, _In_ LPCSTR OldTargetName,
__in LPCSTR NewTargetName, _In_ LPCSTR NewTargetName,
__in DWORD Type, _In_ DWORD Type,
__reserved DWORD Flags _Reserved_ DWORD Flags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredRename CredRenameW #define CredRename CredRenameW
#else #else
#define CredRename CredRenameA #define CredRename CredRenameA
#endif // UNICODE #endif // UNICODE
// //
// Values of flags to CredGetTargetInfo // Values of flags to CredGetTargetInfo
// //
#define CRED_ALLOW_NAME_RESOLUTION 0x1 #define CRED_ALLOW_NAME_RESOLUTION 0x1
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredGetTargetInfoW ( CredGetTargetInfoW (
__in LPCWSTR TargetName, _In_ LPCWSTR TargetName,
__in DWORD Flags, _In_ DWORD Flags,
__out PCREDENTIAL_TARGET_INFORMATIONW *TargetInfo _Out_ PCREDENTIAL_TARGET_INFORMATIONW *TargetInfo
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredGetTargetInfoA ( CredGetTargetInfoA (
__in LPCSTR TargetName, _In_ LPCSTR TargetName,
__in DWORD Flags, _In_ DWORD Flags,
__out PCREDENTIAL_TARGET_INFORMATIONA *TargetInfo _Out_ PCREDENTIAL_TARGET_INFORMATIONA *TargetInfo
); );
#ifdef UNICODE #ifdef UNICODE
#define CredGetTargetInfo CredGetTargetInfoW #define CredGetTargetInfo CredGetTargetInfoW
#else #else
#define CredGetTargetInfo CredGetTargetInfoA #define CredGetTargetInfo CredGetTargetInfoA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredMarshalCredentialW( CredMarshalCredentialW(
__in CRED_MARSHAL_TYPE CredType, _In_ CRED_MARSHAL_TYPE CredType,
__in PVOID Credential, _In_ PVOID Credential,
__out LPWSTR *MarshaledCredential _Out_ LPWSTR *MarshaledCredential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredMarshalCredentialA( CredMarshalCredentialA(
__in CRED_MARSHAL_TYPE CredType, _In_ CRED_MARSHAL_TYPE CredType,
__in PVOID Credential, _In_ PVOID Credential,
__out LPSTR *MarshaledCredential _Out_ LPSTR *MarshaledCredential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredMarshalCredential CredMarshalCredentialW #define CredMarshalCredential CredMarshalCredentialW
#else #else
#define CredMarshalCredential CredMarshalCredentialA #define CredMarshalCredential CredMarshalCredentialA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredUnmarshalCredentialW( CredUnmarshalCredentialW(
__in LPCWSTR MarshaledCredential, _In_ LPCWSTR MarshaledCredential,
__out PCRED_MARSHAL_TYPE CredType, _Out_ PCRED_MARSHAL_TYPE CredType,
__out PVOID *Credential _Out_ PVOID *Credential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredUnmarshalCredentialA( CredUnmarshalCredentialA(
__in LPCSTR MarshaledCredential, _In_ LPCSTR MarshaledCredential,
__out PCRED_MARSHAL_TYPE CredType, _Out_ PCRED_MARSHAL_TYPE CredType,
__out PVOID *Credential _Out_ PVOID *Credential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUnmarshalCredential CredUnmarshalCredentialW #define CredUnmarshalCredential CredUnmarshalCredentialW
#else #else
#define CredUnmarshalCredential CredUnmarshalCredentialA #define CredUnmarshalCredential CredUnmarshalCredentialA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredIsMarshaledCredentialW( CredIsMarshaledCredentialW(
__in LPCWSTR MarshaledCredential _In_ LPCWSTR MarshaledCredential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredIsMarshaledCredentialA( CredIsMarshaledCredentialA(
__in LPCSTR MarshaledCredential _In_ LPCSTR MarshaledCredential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredIsMarshaledCredential CredIsMarshaledCredentialW #define CredIsMarshaledCredential CredIsMarshaledCredentialW
#else #else
#define CredIsMarshaledCredential CredIsMarshaledCredentialA #define CredIsMarshaledCredential CredIsMarshaledCredentialA
#endif // UNICODE #endif // UNICODE
CREDUIAPI CREDUIAPI
BOOL BOOL
WINAPI WINAPI
CredUnPackAuthenticationBufferW( CredUnPackAuthenticationBufferW(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_bcount(cbAuthBuffer) PVOID pAuthBuffer, _In_reads_bytes_(cbAuthBuffer) PVOID pAuthBuffer,
__in DWORD cbAuthBuffer, _In_ DWORD cbAuthBuffer,
__out_ecount_opt(*pcchMaxUserName) LPWSTR pszUserName, _Out_writes_opt_(*pcchMaxUserName) LPWSTR pszUserName,
__inout DWORD* pcchMaxUserName, _Inout_ DWORD* pcchMaxUserName,
__out_ecount_opt(*pcchMaxDomainName) LPWSTR pszDomainName, _Out_writes_opt_(*pcchMaxDomainName) LPWSTR pszDomainName,
__inout_opt DWORD* pcchMaxDomainName, _Inout_opt_ DWORD* pcchMaxDomainName,
__out_ecount_opt(*pcchMaxPassword) LPWSTR pszPassword, _Out_writes_opt_(*pcchMaxPassword) LPWSTR pszPassword,
__inout DWORD* pcchMaxPassword _Inout_ DWORD* pcchMaxPassword
); );
CREDUIAPI CREDUIAPI
BOOL BOOL
WINAPI WINAPI
CredUnPackAuthenticationBufferA( CredUnPackAuthenticationBufferA(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_bcount(cbAuthBuffer) PVOID pAuthBuffer, _In_reads_bytes_(cbAuthBuffer) PVOID pAuthBuffer,
__in DWORD cbAuthBuffer, _In_ DWORD cbAuthBuffer,
__out_ecount_opt(*pcchMaxUserName) LPSTR pszUserName, _Out_writes_opt_(*pcchMaxUserName) LPSTR pszUserName,
__inout DWORD* pcchlMaxUserName, _Inout_ DWORD* pcchlMaxUserName,
__out_ecount_opt(*pcchMaxDomainName) LPSTR pszDomainName, _Out_writes_opt_(*pcchMaxDomainName) LPSTR pszDomainName,
__inout_opt DWORD* pcchMaxDomainName, _Inout_opt_ DWORD* pcchMaxDomainName,
__out_ecount_opt(*pcchMaxPassword) LPSTR pszPassword, _Out_writes_opt_(*pcchMaxPassword) LPSTR pszPassword,
__inout DWORD* pcchMaxPassword _Inout_ DWORD* pcchMaxPassword
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUnPackAuthenticationBuffer CredUnPackAuthenticationBufferW #define CredUnPackAuthenticationBuffer CredUnPackAuthenticationBufferW
#else #else
#define CredUnPackAuthenticationBuffer CredUnPackAuthenticationBufferA #define CredUnPackAuthenticationBuffer CredUnPackAuthenticationBufferA
#endif //UNICODE #endif //UNICODE
CREDUIAPI CREDUIAPI
BOOL BOOL
WINAPI WINAPI
CredPackAuthenticationBufferW( CredPackAuthenticationBufferW(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in LPWSTR pszUserName, _In_ LPWSTR pszUserName,
__in LPWSTR pszPassword, _In_ LPWSTR pszPassword,
__out_bcount_opt(*pcbPackedCredentials) PBYTE pPackedCredentials, _Out_writes_bytes_opt_(*pcbPackedCredentials) PBYTE pPackedCredentials,
__inout DWORD* pcbPackedCredentials _Inout_ DWORD* pcbPackedCredentials
); );
CREDUIAPI CREDUIAPI
BOOL BOOL
WINAPI WINAPI
CredPackAuthenticationBufferA( CredPackAuthenticationBufferA(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in LPSTR pszUserName, _In_ LPSTR pszUserName,
__in LPSTR pszPassword, _In_ LPSTR pszPassword,
__out_bcount_opt(*pcbPackedCredentials) PBYTE pPackedCredentials, _Out_writes_bytes_opt_(*pcbPackedCredentials) PBYTE pPackedCredentials,
__inout DWORD* pcbPackedCredentials _Inout_ DWORD* pcbPackedCredentials
); );
#ifdef UNICODE #ifdef UNICODE
#define CredPackAuthenticationBuffer CredPackAuthenticationBufferW #define CredPackAuthenticationBuffer CredPackAuthenticationBufferW
#else #else
#define CredPackAuthenticationBuffer CredPackAuthenticationBufferA #define CredPackAuthenticationBuffer CredPackAuthenticationBufferA
#endif //UNICODE #endif //UNICODE
_Success_(return)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredProtectW( CredProtectW(
__in BOOL fAsSelf, _In_ BOOL fAsSelf,
__in_ecount(cchCredentials) LPWSTR pszCredentials, _In_reads_(cchCredentials) LPWSTR pszCredentials,
__in DWORD cchCredentials, _In_ DWORD cchCredentials,
__out_ecount(*pcchMaxChars) LPWSTR pszProtectedCredentials, _Out_writes_to_(*pcchMaxChars, *pcchMaxChars) LPWSTR pszProtectedCredentials
__inout DWORD* pcchMaxChars, ,
__out_opt CRED_PROTECTION_TYPE* ProtectionType _Inout_ DWORD* pcchMaxChars,
_Out_opt_ CRED_PROTECTION_TYPE* ProtectionType
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredProtectA( CredProtectA(
__in BOOL fAsSelf, _In_ BOOL fAsSelf,
__in_ecount(cchCredentials) LPSTR pszCredentials, _In_reads_(cchCredentials) LPSTR pszCredentials,
__in DWORD cchCredentials, _In_ DWORD cchCredentials,
__out_ecount(*pcchMaxChars) LPSTR pszProtectedCredentials, _Out_writes_(*pcchMaxChars) LPSTR pszProtectedCredentials,
__inout DWORD* pcchMaxChars, _Inout_ DWORD* pcchMaxChars,
__out_opt CRED_PROTECTION_TYPE* ProtectionType _Out_opt_ CRED_PROTECTION_TYPE* ProtectionType
); );
#ifdef UNICODE #ifdef UNICODE
#define CredProtect CredProtectW #define CredProtect CredProtectW
#else #else
#define CredProtect CredProtectA #define CredProtect CredProtectA
#endif //UNICODE #endif //UNICODE
_Success_(return)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredUnprotectW( CredUnprotectW(
__in BOOL fAsSelf, _In_ BOOL fAsSelf,
__in_ecount(cchProtectedCredentials) LPWSTR pszProtectedCredentials, _In_reads_(cchProtectedCredentials) LPWSTR pszProtectedCredentials,
__in DWORD cchProtectedCredentials, _In_ DWORD cchProtectedCredentials,
__out_ecount_opt(*pcchMaxChars) LPWSTR pszCredentials, _Out_writes_to_opt_(*pcchMaxChars, *pcchMaxChars) LPWSTR pszCredentials,
__inout DWORD* pcchMaxChars _Inout_ DWORD* pcchMaxChars
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredUnprotectA( CredUnprotectA(
__in BOOL fAsSelf, _In_ BOOL fAsSelf,
__in_ecount(cchProtectedCredentials) LPSTR pszProtectedCredentials, _In_reads_(cchProtectedCredentials) LPSTR pszProtectedCredentials,
__in DWORD cchProtectedCredentials, _In_ DWORD cchProtectedCredentials,
__out_ecount_opt(*pcchMaxChars) LPSTR pszCredentials, _Out_writes_opt_(*pcchMaxChars) LPSTR pszCredentials,
__inout DWORD* pcchMaxChars _Inout_ DWORD* pcchMaxChars
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUnprotect CredUnprotectW #define CredUnprotect CredUnprotectW
#else #else
#define CredUnprotect CredUnprotectA #define CredUnprotect CredUnprotectA
#endif //UNICODE #endif //UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredIsProtectedW( CredIsProtectedW(
__in LPWSTR pszProtectedCredentials, _In_ LPWSTR pszProtectedCredentials,
__out CRED_PROTECTION_TYPE* pProtectionType _Out_ CRED_PROTECTION_TYPE* pProtectionType
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredIsProtectedA( CredIsProtectedA(
__in LPSTR pszProtectedCredentials, _In_ LPSTR pszProtectedCredentials,
__out CRED_PROTECTION_TYPE* pProtectionType _Out_ CRED_PROTECTION_TYPE* pProtectionType
); );
#ifdef UNICODE #ifdef UNICODE
#define CredIsProtected CredIsProtectedW #define CredIsProtected CredIsProtectedW
#else #else
#define CredIsProtected CredIsProtectedA #define CredIsProtected CredIsProtectedA
#endif //UNICODE #endif //UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredFindBestCredentialW ( CredFindBestCredentialW (
IN LPCWSTR TargetName, _In_ LPCWSTR TargetName,
IN DWORD Type, _In_ DWORD Type,
IN DWORD Flags, _In_ DWORD Flags,
OUT PCREDENTIALW *Credential _Out_ PCREDENTIALW *Credential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredFindBestCredentialA ( CredFindBestCredentialA (
IN LPCSTR TargetName, _In_ LPCSTR TargetName,
IN DWORD Type, _In_ DWORD Type,
IN DWORD Flags, _In_ DWORD Flags,
OUT PCREDENTIALA *Credential _Out_ PCREDENTIALA *Credential
); );
#ifdef UNICODE #ifdef UNICODE
#define CredFindBestCredential CredFindBestCredentialW #define CredFindBestCredential CredFindBestCredentialW
#else #else
#define CredFindBestCredential CredFindBestCredentialA #define CredFindBestCredential CredFindBestCredentialA
#endif // UNICODE #endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredGetSessionTypes ( CredGetSessionTypes (
__in DWORD MaximumPersistCount, _In_ DWORD MaximumPersistCount,
__out LPDWORD MaximumPersist _Out_writes_(MaximumPersistCount) LPDWORD MaximumPersist
); );
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
CredFree ( CredFree (
__in PVOID Buffer _In_ PVOID Buffer
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIPromptForCredentialsW( CredUIPromptForCredentialsW(
__in_opt PCREDUI_INFOW pUiInfo, _In_opt_ PCREDUI_INFOW pUiInfo,
__in_opt PCWSTR pszTargetName, _In_opt_ PCWSTR pszTargetName,
__reserved PCtxtHandle pContext, _Reserved_ PCtxtHandle pContext,
__in DWORD dwAuthError, _In_ DWORD dwAuthError,
__inout_ecount(ulUserNameBufferSize) PWSTR pszUserName, _Inout_updates_(ulUserNameBufferSize) PWSTR pszUserName,
__in ULONG ulUserNameBufferSize, _In_ ULONG ulUserNameBufferSize,
__inout_ecount(ulPasswordBufferSize) PWSTR pszPassword, _Inout_updates_(ulPasswordBufferSize) PWSTR pszPassword,
__in ULONG ulPasswordBufferSize, _In_ ULONG ulPasswordBufferSize,
__inout_opt BOOL *save, _Inout_opt_ BOOL *save,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIPromptForCredentialsA( CredUIPromptForCredentialsA(
__in_opt PCREDUI_INFOA pUiInfo, _In_opt_ PCREDUI_INFOA pUiInfo,
__in_opt PCSTR pszTargetName, _In_opt_ PCSTR pszTargetName,
__reserved PCtxtHandle pContext, _Reserved_ PCtxtHandle pContext,
__in DWORD dwAuthError, _In_ DWORD dwAuthError,
__inout_ecount(ulUserNameBufferSize) PSTR pszUserName, _Inout_updates_(ulUserNameBufferSize) PSTR pszUserName,
__in ULONG ulUserNameBufferSize, _In_ ULONG ulUserNameBufferSize,
__inout_ecount(ulPasswordBufferSize) PSTR pszPassword, _Inout_updates_(ulPasswordBufferSize) PSTR pszPassword,
__in ULONG ulPasswordBufferSize, _In_ ULONG ulPasswordBufferSize,
__inout_opt BOOL *save, _Inout_opt_ BOOL *save,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUIPromptForCredentials CredUIPromptForCredentialsW #define CredUIPromptForCredentials CredUIPromptForCredentialsW
#else #else
#define CredUIPromptForCredentials CredUIPromptForCredentialsA #define CredUIPromptForCredentials CredUIPromptForCredentialsA
#endif #endif
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIPromptForWindowsCredentialsW( CredUIPromptForWindowsCredentialsW(
__in_opt PCREDUI_INFOW pUiInfo, _In_opt_ PCREDUI_INFOW pUiInfo,
__in DWORD dwAuthError, _In_ DWORD dwAuthError,
__inout ULONG *pulAuthPackage, _Inout_ ULONG *pulAuthPackage,
__in_bcount_opt(ulInAuthBufferSize) LPCVOID pvInAuthBuffer, _In_reads_bytes_opt_(ulInAuthBufferSize) LPCVOID pvInAuthBuffer,
__in ULONG ulInAuthBufferSize, _In_ ULONG ulInAuthBufferSize,
__deref_out_bcount_full(*pulOutAuthBufferSize) LPVOID * ppvOutAuthBuffer, _Outptr_result_bytebuffer_to_(*pulOutAuthBufferSize, *pulOutAuthBufferSize)
__out ULONG * pulOutAuthBufferSize, LPVOID * ppvOutAuthBuffer,
__inout_opt BOOL *pfSave, _Out_ ULONG * pulOutAuthBufferSize,
__in DWORD dwFlags _Inout_opt_ BOOL *pfSave,
_In_ DWORD dwFlags
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIPromptForWindowsCredentialsA( CredUIPromptForWindowsCredentialsA(
__in_opt PCREDUI_INFOA pUiInfo, _In_opt_ PCREDUI_INFOA pUiInfo,
__in DWORD dwAuthError, _In_ DWORD dwAuthError,
__inout ULONG *pulAuthPackage, _Inout_ ULONG *pulAuthPackage,
__in_bcount_opt(ulInAuthBufferSize) LPCVOID pvInAuthBuffer, _In_reads_bytes_opt_(ulInAuthBufferSize) LPCVOID pvInAuthBuffer,
__in ULONG ulInAuthBufferSize, _In_ ULONG ulInAuthBufferSize,
__deref_out_bcount_full(*pulOutAuthBufferSize) LPVOID * ppvOutAuthBuffer, _Outptr_result_bytebuffer_to_(*pulOutAuthBufferSize, *pulOutAuthBufferSize)
__out ULONG * pulOutAuthBufferSize, LPVOID * ppvOutAuthBuffer,
__inout_opt BOOL *pfSave, _Out_ ULONG * pulOutAuthBufferSize,
__in DWORD dwFlags _Inout_opt_ BOOL *pfSave,
_In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUIPromptForWindowsCredentials CredUIPromptForWindowsCredentialsW #define CredUIPromptForWindowsCredentials CredUIPromptForWindowsCredentialsW
#else #else
#define CredUIPromptForWindowsCredentials CredUIPromptForWindowsCredentialsA #define CredUIPromptForWindowsCredentials CredUIPromptForWindowsCredentialsA
#endif #endif
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIParseUserNameW( CredUIParseUserNameW(
__in CONST WCHAR *UserName, _In_ PCWSTR UserName,
__out_ecount(userBufferSize) WCHAR *user, _Out_writes_(userBufferSize) WCHAR *user,
__in ULONG userBufferSize, _In_ ULONG userBufferSize,
__out_ecount(domainBufferSize) WCHAR *domain, _Out_writes_(domainBufferSize) WCHAR *domain,
__in ULONG domainBufferSize _In_ ULONG domainBufferSize
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIParseUserNameA( CredUIParseUserNameA(
__in CONST CHAR *userName, _In_ PCSTR userName,
__out_ecount(userBufferSize) CHAR *user, _Out_writes_(userBufferSize) CHAR *user,
__in ULONG userBufferSize, _In_ ULONG userBufferSize,
__out_ecount(domainBufferSize) CHAR *domain, _Out_writes_(domainBufferSize) CHAR *domain,
__in ULONG domainBufferSize _In_ ULONG domainBufferSize
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUIParseUserName CredUIParseUserNameW #define CredUIParseUserName CredUIParseUserNameW
#else #else
#define CredUIParseUserName CredUIParseUserNameA #define CredUIParseUserName CredUIParseUserNameA
#endif #endif
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUICmdLinePromptForCredentialsW( CredUICmdLinePromptForCredentialsW(
__in_opt PCWSTR pszTargetName, _In_opt_ PCWSTR pszTargetName,
__reserved PCtxtHandle pContext, _Reserved_ PCtxtHandle pContext,
__in DWORD dwAuthError, _In_ DWORD dwAuthError,
__inout_ecount(ulUserBufferSize) PWSTR UserName, _Inout_updates_(ulUserBufferSize) PWSTR UserName,
__in ULONG ulUserBufferSize, _In_ ULONG ulUserBufferSize,
__inout_ecount(ulPasswordBufferSize) PWSTR pszPassword, _Inout_updates_(ulPasswordBufferSize) PWSTR pszPassword,
__in ULONG ulPasswordBufferSize, _In_ ULONG ulPasswordBufferSize,
__inout_opt PBOOL pfSave, _Inout_opt_ PBOOL pfSave,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUICmdLinePromptForCredentialsA( CredUICmdLinePromptForCredentialsA(
__in_opt PCSTR pszTargetName, _In_opt_ PCSTR pszTargetName,
__reserved PCtxtHandle pContext, _Reserved_ PCtxtHandle pContext,
__in DWORD dwAuthError, _In_ DWORD dwAuthError,
__inout_ecount(ulUserBufferSize) PSTR UserName, _Inout_updates_(ulUserBufferSize) PSTR UserName,
__in ULONG ulUserBufferSize, _In_ ULONG ulUserBufferSize,
__inout_ecount(ulPasswordBufferSize) PSTR pszPassword, _Inout_updates_(ulPasswordBufferSize) PSTR pszPassword,
__in ULONG ulPasswordBufferSize, _In_ ULONG ulPasswordBufferSize,
__inout_opt PBOOL pfSave, _Inout_opt_ PBOOL pfSave,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsW #define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsW
#else #else
#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsA #define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsA
#endif #endif
// //
// Call this API with bConfirm set to TRUE to confirm that the credential (previ ously created // Call this API with bConfirm set to TRUE to confirm that the credential (previ ously created
// via CredUIGetCredentials or CredUIPromptForCredentials worked, or with bConfi rm set to FALSE // via CredUIGetCredentials or CredUIPromptForCredentials worked, or with bConfi rm set to FALSE
// to indicate it didn't // to indicate it didn't
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIConfirmCredentialsW( CredUIConfirmCredentialsW(
__in PCWSTR pszTargetName, _In_ PCWSTR pszTargetName,
__in BOOL bConfirm _In_ BOOL bConfirm
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIConfirmCredentialsA( CredUIConfirmCredentialsA(
__in PCSTR pszTargetName, _In_ PCSTR pszTargetName,
__in BOOL bConfirm _In_ BOOL bConfirm
); );
#ifdef UNICODE #ifdef UNICODE
#define CredUIConfirmCredentials CredUIConfirmCredentialsW #define CredUIConfirmCredentials CredUIConfirmCredentialsW
#else #else
#define CredUIConfirmCredentials CredUIConfirmCredentialsA #define CredUIConfirmCredentials CredUIConfirmCredentialsA
#endif #endif
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIStoreSSOCredW ( CredUIStoreSSOCredW (
__in_opt PCWSTR pszRealm, _In_opt_ PCWSTR pszRealm,
__in PCWSTR pszUsername, _In_ PCWSTR pszUsername,
__in PCWSTR pszPassword, _In_ PCWSTR pszPassword,
__in BOOL bPersist _In_ BOOL bPersist
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
WINAPI WINAPI
CredUIReadSSOCredW ( CredUIReadSSOCredW (
__in_opt PCWSTR pszRealm, _In_opt_ PCWSTR pszRealm,
__deref_out PWSTR* ppszUsername _Outptr_ PWSTR* ppszUsername
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // _WINCRED_H_ #endif // _WINCRED_H_
 End of changes. 59 change blocks. 
213 lines changed or deleted 227 lines changed or added


 wincrypt.h (6.1.7601.23418-Windows_7.0)   wincrypt.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 32 skipping to change at line 32
#endif #endif
#pragma warning(disable:4201) /* Nameless struct/union */ #pragma warning(disable:4201) /* Nameless struct/union */
#endif #endif
#if (_MSC_VER > 1020) #if (_MSC_VER > 1020)
#pragma once #pragma once
#endif #endif
#endif #endif
#include <winapifamily.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifndef _HRESULT_DEFINED #ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED #define _HRESULT_DEFINED
typedef __success(return >= 0) long HRESULT; typedef _Return_type_success_(return >= 0) long HRESULT;
#endif #endif
#ifndef WINADVAPI #ifndef WINADVAPI
#define WINADVAPI #define WINADVAPI
#endif #endif
#ifndef WINAPI #ifndef WINAPI
#define WINAPI __stdcall #define WINAPI __stdcall
#endif #endif
skipping to change at line 73 skipping to change at line 78
#endif #endif
#ifndef OUT #ifndef OUT
#define OUT #define OUT
#endif #endif
#ifndef OPTIONAL #ifndef OPTIONAL
#define OPTIONAL #define OPTIONAL
#endif #endif
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#if !defined(WINCRYPT32API) #if !defined(WINCRYPT32API)
#if !defined(_CRYPT32_) #if !defined(_CRYPT32_)
#define WINCRYPT32API DECLSPEC_IMPORT #define WINCRYPT32API DECLSPEC_IMPORT
#else #else
#define WINCRYPT32API #define WINCRYPT32API
#endif #endif
#endif #endif
#else #else
#if !defined(_CRYPT32_) #if !defined(_CRYPT32_)
#define WINCRYPT32API DECLSPEC_IMPORT #define WINCRYPT32API DECLSPEC_IMPORT
#else #else
#define WINCRYPT32API #define WINCRYPT32API
#endif #endif
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if !defined(WINCRYPT32STRINGAPI) #if !defined(WINCRYPT32STRINGAPI)
#if !defined(_CRYPT32STRING_) #if !defined(_CRYPT32STRING_)
#define WINCRYPT32STRINGAPI WINCRYPT32API #define WINCRYPT32STRINGAPI WINCRYPT32API
#else #else
#define WINCRYPT32STRINGAPI #define WINCRYPT32STRINGAPI
#endif #endif
#endif #endif
// //
skipping to change at line 145 skipping to change at line 150
#define ALG_SID_RSA_PKCS 1 #define ALG_SID_RSA_PKCS 1
#define ALG_SID_RSA_MSATWORK 2 #define ALG_SID_RSA_MSATWORK 2
#define ALG_SID_RSA_ENTRUST 3 #define ALG_SID_RSA_ENTRUST 3
#define ALG_SID_RSA_PGP 4 #define ALG_SID_RSA_PGP 4
// Some DSS sub-ids // Some DSS sub-ids
// //
#define ALG_SID_DSS_ANY 0 #define ALG_SID_DSS_ANY 0
#define ALG_SID_DSS_PKCS 1 #define ALG_SID_DSS_PKCS 1
#define ALG_SID_DSS_DMS 2 #define ALG_SID_DSS_DMS 2
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define ALG_SID_ECDSA 3 #define ALG_SID_ECDSA 3
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
// Block cipher sub ids // Block cipher sub ids
// DES sub_ids // DES sub_ids
#define ALG_SID_DES 1 #define ALG_SID_DES 1
#define ALG_SID_3DES 3 #define ALG_SID_3DES 3
#define ALG_SID_DESX 4 #define ALG_SID_DESX 4
#define ALG_SID_IDEA 5 #define ALG_SID_IDEA 5
#define ALG_SID_CAST 6 #define ALG_SID_CAST 6
#define ALG_SID_SAFERSK64 7 #define ALG_SID_SAFERSK64 7
#define ALG_SID_SAFERSK128 8 #define ALG_SID_SAFERSK128 8
skipping to change at line 191 skipping to change at line 196
// Stream cipher sub-ids // Stream cipher sub-ids
#define ALG_SID_RC4 1 #define ALG_SID_RC4 1
#define ALG_SID_SEAL 2 #define ALG_SID_SEAL 2
// Diffie-Hellman sub-ids // Diffie-Hellman sub-ids
#define ALG_SID_DH_SANDF 1 #define ALG_SID_DH_SANDF 1
#define ALG_SID_DH_EPHEM 2 #define ALG_SID_DH_EPHEM 2
#define ALG_SID_AGREED_KEY_ANY 3 #define ALG_SID_AGREED_KEY_ANY 3
#define ALG_SID_KEA 4 #define ALG_SID_KEA 4
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define ALG_SID_ECDH 5 #define ALG_SID_ECDH 5
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
// Hash sub ids // Hash sub ids
#define ALG_SID_MD2 1 #define ALG_SID_MD2 1
#define ALG_SID_MD4 2 #define ALG_SID_MD4 2
#define ALG_SID_MD5 3 #define ALG_SID_MD5 3
#define ALG_SID_SHA 4 #define ALG_SID_SHA 4
#define ALG_SID_SHA1 4 #define ALG_SID_SHA1 4
#define ALG_SID_MAC 5 #define ALG_SID_MAC 5
#define ALG_SID_RIPEMD 6 #define ALG_SID_RIPEMD 6
#define ALG_SID_RIPEMD160 7 #define ALG_SID_RIPEMD160 7
skipping to change at line 225 skipping to change at line 230
// secure channel sub ids // secure channel sub ids
#define ALG_SID_SSL3_MASTER 1 #define ALG_SID_SSL3_MASTER 1
#define ALG_SID_SCHANNEL_MASTER_HASH 2 #define ALG_SID_SCHANNEL_MASTER_HASH 2
#define ALG_SID_SCHANNEL_MAC_KEY 3 #define ALG_SID_SCHANNEL_MAC_KEY 3
#define ALG_SID_PCT1_MASTER 4 #define ALG_SID_PCT1_MASTER 4
#define ALG_SID_SSL2_MASTER 5 #define ALG_SID_SSL2_MASTER 5
#define ALG_SID_TLS1_MASTER 6 #define ALG_SID_TLS1_MASTER 6
#define ALG_SID_SCHANNEL_ENC_KEY 7 #define ALG_SID_SCHANNEL_ENC_KEY 7
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
// misc ECC sub ids // misc ECC sub ids
#define ALG_SID_ECMQV 1 #define ALG_SID_ECMQV 1
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
// Our silly example sub-id // Our silly example sub-id
#define ALG_SID_EXAMPLE 80 #define ALG_SID_EXAMPLE 80
// certenrolls_begin -- PROV_ENUMALGS_EX // certenrolls_begin -- PROV_ENUMALGS_EX
#ifndef ALGIDDEF #ifndef ALGIDDEF
#define ALGIDDEF #define ALGIDDEF
typedef unsigned int ALG_ID; typedef unsigned int ALG_ID;
#endif #endif
// certenrolls_end // certenrolls_end
// algorithm identifier definitions // algorithm identifier definitions
#define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2) #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
#define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4) #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
#define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5) #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
#define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA) #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
#define CALG_SHA1 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1) #define CALG_SHA1 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1)
#define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC) #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC) // Deprecated. Don't use.
#define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RS A_ANY) #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RS A_ANY)
#define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DS S_ANY) #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DS S_ANY)
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
#define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_AN Y) #define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_AN Y)
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA _ANY) #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA _ANY)
#define CALG_DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_D ES) #define CALG_DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_D ES)
#define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3 DES_112) #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3 DES_112)
#define CALG_3DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3 DES) #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3 DES)
#define CALG_DESX (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_D ESX) #define CALG_DESX (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_D ESX)
#define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_R C2) #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_R C2)
#define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_ RC4) #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_ RC4)
#define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_ SEAL) #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_ SEAL)
#define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_S ANDF) #define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_S ANDF)
#define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_E PHEM) #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_E PHEM)
#define CALG_AGREEDKEY_ANY (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_AGRE ED_KEY_ANY) #define CALG_AGREEDKEY_ANY (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_AGRE ED_KEY_ANY)
#define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_KEA) #define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_KEA)
#define CALG_HUGHES_MD5 (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_ANY|ALG_SID_MD5 ) #define CALG_HUGHES_MD5 (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_ANY|ALG_SID_MD5 )
#define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_S KIPJACK) #define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_S KIPJACK)
#define CALG_TEK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_T EK) #define CALG_TEK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_T EK)
#define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_C YLINK_MEK) #define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_C YLINK_MEK) // Deprecated. Do not use
#define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHA MD5) #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHA MD5)
#define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SSL3_MASTER) #define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SSL3_MASTER)
#define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNE L|ALG_SID_SCHANNEL_MASTER_HASH) #define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNE L|ALG_SID_SCHANNEL_MASTER_HASH)
#define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SCHANNEL_MAC_KEY) #define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SCHANNEL_MAC_KEY)
#define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SCHANNEL_ENC_KEY) #define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SCHANNEL_ENC_KEY)
#define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_PCT1_MASTER) #define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_PCT1_MASTER)
#define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SSL2_MASTER) #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_SSL2_MASTER)
#define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_TLS1_MASTER) #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|AL G_SID_TLS1_MASTER)
#define CALG_RC5 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_R C5) #define CALG_RC5 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_R C5)
#define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC) #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
skipping to change at line 291 skipping to change at line 296
#define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES_128) #define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES_128)
#define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES_192) #define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES_192)
#define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES_256) #define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES_256)
#define CALG_AES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES) #define CALG_AES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_A ES)
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION > NTDDI_WINXPSP2) #if (NTDDI_VERSION > NTDDI_WINXPSP2)
#define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256 ) #define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256 )
#define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384 ) #define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384 )
#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512 ) #define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512 )
#endif //(NTDDI_VERSION > NTDDI_WINXPSP2) #endif //(NTDDI_VERSION > NTDDI_WINXPSP2)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define CALG_ECDH (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ ECDH) #define CALG_ECDH (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ ECDH)
#define CALG_ECMQV (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID _ECMQV) #define CALG_ECMQV (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID _ECMQV)
#define CALG_ECDSA (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_EC DSA) #define CALG_ECDSA (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_EC DSA)
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
// resource number for signatures in the CSP // resource number for signatures in the CSP
#define SIGNATURE_RESOURCE_NUMBER 0x29A #define SIGNATURE_RESOURCE_NUMBER 0x29A
typedef struct _VTableProvStruc { typedef struct _VTableProvStruc {
DWORD Version; DWORD Version;
FARPROC FuncVerifyImage; FARPROC FuncVerifyImage;
FARPROC FuncReturnhWnd; FARPROC FuncReturnhWnd;
DWORD dwProvType; DWORD dwProvType;
BYTE *pbContextInfo; BYTE *pbContextInfo;
DWORD cbContextInfo; DWORD cbContextInfo;
LPSTR pszProvName; LPSTR pszProvName;
} VTableProvStruc, *PVTableProvStruc; } VTableProvStruc, *PVTableProvStruc;
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
// Used for certenroll.idl: // Used for certenroll.idl:
// certenrolls_begin -- HCRYPT* // certenrolls_begin -- HCRYPT*
#ifndef HCRYPTPROV_DEFINED
#define HCRYPTPROV_DEFINED
typedef ULONG_PTR HCRYPTPROV; typedef ULONG_PTR HCRYPTPROV;
typedef ULONG_PTR HCRYPTKEY; typedef ULONG_PTR HCRYPTKEY;
typedef ULONG_PTR HCRYPTHASH; typedef ULONG_PTR HCRYPTHASH;
#endif
// certenrolls_end // certenrolls_end
// dwFlags definitions for CryptAcquireContext // dwFlags definitions for CryptAcquireContext
#define CRYPT_VERIFYCONTEXT 0xF0000000 #define CRYPT_VERIFYCONTEXT 0xF0000000
#define CRYPT_NEWKEYSET 0x00000008 #define CRYPT_NEWKEYSET 0x00000008
#define CRYPT_DELETEKEYSET 0x00000010 #define CRYPT_DELETEKEYSET 0x00000010
#define CRYPT_MACHINE_KEYSET 0x00000020 #define CRYPT_MACHINE_KEYSET 0x00000020
#define CRYPT_SILENT 0x00000040 #define CRYPT_SILENT 0x00000040
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define CRYPT_DEFAULT_CONTAINER_OPTIONAL 0x00000080 #define CRYPT_DEFAULT_CONTAINER_OPTIONAL 0x00000080
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
// dwFlag definitions for CryptGenKey // dwFlag definitions for CryptGenKey
#define CRYPT_EXPORTABLE 0x00000001 #define CRYPT_EXPORTABLE 0x00000001
#define CRYPT_USER_PROTECTED 0x00000002 #define CRYPT_USER_PROTECTED 0x00000002
#define CRYPT_CREATE_SALT 0x00000004 #define CRYPT_CREATE_SALT 0x00000004
#define CRYPT_UPDATE_KEY 0x00000008 #define CRYPT_UPDATE_KEY 0x00000008
#define CRYPT_NO_SALT 0x00000010 #define CRYPT_NO_SALT 0x00000010
#define CRYPT_PREGEN 0x00000040 #define CRYPT_PREGEN 0x00000040
#define CRYPT_RECIPIENT 0x00000010 #define CRYPT_RECIPIENT 0x00000010
#define CRYPT_INITIATOR 0x00000040 #define CRYPT_INITIATOR 0x00000040
#define CRYPT_ONLINE 0x00000080 #define CRYPT_ONLINE 0x00000080
#define CRYPT_SF 0x00000100 #define CRYPT_SF 0x00000100
#define CRYPT_CREATE_IV 0x00000200 #define CRYPT_CREATE_IV 0x00000200
#define CRYPT_KEK 0x00000400 #define CRYPT_KEK 0x00000400
#define CRYPT_DATA_KEY 0x00000800 #define CRYPT_DATA_KEY 0x00000800
#define CRYPT_VOLATILE 0x00001000 #define CRYPT_VOLATILE 0x00001000
#define CRYPT_SGCKEY 0x00002000 #define CRYPT_SGCKEY 0x00002000
//PKCS12_ALLOW_OVERWRITE_KEY 0x00004000
//PKCS12_NO_PERSIST_KEY 0x00008000
//should use other than these two
#define CRYPT_USER_PROTECTED_STRONG 0x00100000
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
#define CRYPT_ARCHIVABLE 0x00004000 #define CRYPT_ARCHIVABLE 0x00004000
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define CRYPT_FORCE_KEY_PROTECTION_HIGH 0x00008000 #define CRYPT_FORCE_KEY_PROTECTION_HIGH 0x00008000
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#define RSA1024BIT_KEY 0x04000000 #define RSA1024BIT_KEY 0x04000000
// dwFlags definitions for CryptDeriveKey // dwFlags definitions for CryptDeriveKey
#define CRYPT_SERVER 0x00000400 #define CRYPT_SERVER 0x00000400
#define KEY_LENGTH_MASK 0xFFFF0000 #define KEY_LENGTH_MASK 0xFFFF0000
// dwFlag definitions for CryptExportKey // dwFlag definitions for CryptExportKey
#define CRYPT_Y_ONLY 0x00000001 #define CRYPT_Y_ONLY 0x00000001
skipping to change at line 392 skipping to change at line 404
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
// dwFlags definitions for CryptHashData // dwFlags definitions for CryptHashData
#define CRYPT_OWF_REPL_LM_HASH 0x00000001 // this is only for the OWF replacem ent CSP #define CRYPT_OWF_REPL_LM_HASH 0x00000001 // this is only for the OWF replacem ent CSP
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
// dwFlags definitions for CryptHashSessionKey // dwFlags definitions for CryptHashSessionKey
#define CRYPT_LITTLE_ENDIAN 0x00000001 #define CRYPT_LITTLE_ENDIAN 0x00000001
// dwFlags definitions for CryptSignHash and CryptVerifySignature // dwFlags definitions for CryptSignHash and CryptVerifySignature
#define CRYPT_NOHASHOID 0x00000001 #define CRYPT_NOHASHOID 0x00000001
#define CRYPT_TYPE2_FORMAT 0x00000002 #define CRYPT_TYPE2_FORMAT 0x00000002 // Not supported
#define CRYPT_X931_FORMAT 0x00000004 #define CRYPT_X931_FORMAT 0x00000004 // Not supported
// dwFlag definitions for CryptSetProviderEx and CryptGetDefaultProvider // dwFlag definitions for CryptSetProviderEx and CryptGetDefaultProvider
#define CRYPT_MACHINE_DEFAULT 0x00000001 #define CRYPT_MACHINE_DEFAULT 0x00000001
#define CRYPT_USER_DEFAULT 0x00000002 #define CRYPT_USER_DEFAULT 0x00000002
#define CRYPT_DELETE_DEFAULT 0x00000004 #define CRYPT_DELETE_DEFAULT 0x00000004
// exported key blob definitions // exported key blob definitions
// certenrolld_begin -- *BLOB // certenrolld_begin -- *BLOB
#define SIMPLEBLOB 0x1 #define SIMPLEBLOB 0x1
#define PUBLICKEYBLOB 0x6 #define PUBLICKEYBLOB 0x6
skipping to change at line 545 skipping to change at line 557
#define PP_SIG_KEYSIZE_INC 34 #define PP_SIG_KEYSIZE_INC 34
#define PP_KEYX_KEYSIZE_INC 35 #define PP_KEYX_KEYSIZE_INC 35
#define PP_UNIQUE_CONTAINER 36 #define PP_UNIQUE_CONTAINER 36
#define PP_SGC_INFO 37 #define PP_SGC_INFO 37
#define PP_USE_HARDWARE_RNG 38 #define PP_USE_HARDWARE_RNG 38
#define PP_KEYSPEC 39 #define PP_KEYSPEC 39
#define PP_ENUMEX_SIGNING_PROT 40 #define PP_ENUMEX_SIGNING_PROT 40
#if (NTDDI_VERSION >= NTDDI_WS03) #if (NTDDI_VERSION >= NTDDI_WS03)
#define PP_CRYPT_COUNT_KEY_USE 41 #define PP_CRYPT_COUNT_KEY_USE 41
#endif //(NTDDI_VERSION >= NTDDI_WS03) #endif //(NTDDI_VERSION >= NTDDI_WS03)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define PP_USER_CERTSTORE 42 #define PP_USER_CERTSTORE 42
#define PP_SMARTCARD_READER 43 #define PP_SMARTCARD_READER 43
#define PP_SMARTCARD_GUID 45 #define PP_SMARTCARD_GUID 45
#define PP_ROOT_CERTSTORE 46 #define PP_ROOT_CERTSTORE 46
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define PP_SMARTCARD_READER_ICON 47
#endif // (NTDDI_VERSION >= NTDDI_WIN8)
#define CRYPT_FIRST 1 #define CRYPT_FIRST 1
#define CRYPT_NEXT 2 #define CRYPT_NEXT 2
#define CRYPT_SGC_ENUM 4 #define CRYPT_SGC_ENUM 4
#define CRYPT_IMPL_HARDWARE 1 #define CRYPT_IMPL_HARDWARE 1
#define CRYPT_IMPL_SOFTWARE 2 #define CRYPT_IMPL_SOFTWARE 2
#define CRYPT_IMPL_MIXED 3 #define CRYPT_IMPL_MIXED 3
#define CRYPT_IMPL_UNKNOWN 4 #define CRYPT_IMPL_UNKNOWN 4
#define CRYPT_IMPL_REMOVABLE 8 #define CRYPT_IMPL_REMOVABLE 8
skipping to change at line 589 skipping to change at line 604
// //
// CryptSetProvParam // CryptSetProvParam
// //
#define PP_CLIENT_HWND 1 #define PP_CLIENT_HWND 1
#define PP_CONTEXT_INFO 11 #define PP_CONTEXT_INFO 11
#define PP_KEYEXCHANGE_KEYSIZE 12 #define PP_KEYEXCHANGE_KEYSIZE 12
#define PP_SIGNATURE_KEYSIZE 13 #define PP_SIGNATURE_KEYSIZE 13
#define PP_KEYEXCHANGE_ALG 14 #define PP_KEYEXCHANGE_ALG 14
#define PP_SIGNATURE_ALG 15 #define PP_SIGNATURE_ALG 15
#define PP_DELETEKEY 24 #define PP_DELETEKEY 24
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
#define PP_PIN_PROMPT_STRING 44 #define PP_PIN_PROMPT_STRING 44
#define PP_SECURE_KEYEXCHANGE_PIN 47 #define PP_SECURE_KEYEXCHANGE_PIN 47
#define PP_SECURE_SIGNATURE_PIN 48 #define PP_SECURE_SIGNATURE_PIN 48
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
// certenrolld_begin -- PROV_RSA_* // certenrolld_begin -- PROV_RSA_*
#define PROV_RSA_FULL 1 #define PROV_RSA_FULL 1
#define PROV_RSA_SIG 2 #define PROV_RSA_SIG 2
#define PROV_DSS 3 #define PROV_DSS 3
#define PROV_FORTEZZA 4 #define PROV_FORTEZZA 4
#define PROV_MS_EXCHANGE 5 #define PROV_MS_EXCHANGE 5
#define PROV_SSL 6 #define PROV_SSL 6
#define PROV_RSA_SCHANNEL 12 #define PROV_RSA_SCHANNEL 12
#define PROV_DSS_DH 13 #define PROV_DSS_DH 13
skipping to change at line 736 skipping to change at line 751
#define MAXUIDLEN 64 #define MAXUIDLEN 64
// Exponentiation Offload Reg Location // Exponentiation Offload Reg Location
#define EXPO_OFFLOAD_REG_VALUE "ExpoOffload" #define EXPO_OFFLOAD_REG_VALUE "ExpoOffload"
#define EXPO_OFFLOAD_FUNC_NAME "OffloadModExpo" #define EXPO_OFFLOAD_FUNC_NAME "OffloadModExpo"
// //
// Registry key in which the following private key-related // Registry key in which the following private key-related
// values are created. // values are created.
// //
#ifndef szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS
#define szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS \ #define szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS \
"Software\\Policies\\Microsoft\\Cryptography" "Software\\Policies\\Microsoft\\Cryptography"
#endif
//
// Registry value for controlling Data Protection API (DPAPI) UI settings.
//
#define szFORCE_KEY_PROTECTION "ForceKeyProtection"
#define dwFORCE_KEY_PROTECTION_DISABLED 0x0
#define dwFORCE_KEY_PROTECTION_USER_SELECT 0x1
#define dwFORCE_KEY_PROTECTION_HIGH 0x2
// //
// Registry values for enabling and controlling the caching (and timeout) // Registry values for enabling and controlling the caching (and timeout)
// of private keys. This feature is intended for UI-protected private // of private keys. This feature is intended for UI-protected private
// keys. // keys.
// //
// Note that in Windows 2000 and later, private keys, once read from storage, // Note that in Windows 2000 and later, private keys, once read from storage,
// are cached in the associated HCRYPTPROV structure for subsequent use. // are cached in the associated HCRYPTPROV structure for subsequent use.
// //
// In Server 2003 and XP SP1, new key caching behavior is available. Keys // In Server 2003 and XP SP1, new key caching behavior is available. Keys
skipping to change at line 955 skipping to change at line 963
unsigned char Feedback[8]; unsigned char Feedback[8];
} CRYPT_DES_KEY_STATE, *PCRYPT_DES_KEY_STATE; } CRYPT_DES_KEY_STATE, *PCRYPT_DES_KEY_STATE;
typedef struct _CRYPT_3DES_KEY_STATE { typedef struct _CRYPT_3DES_KEY_STATE {
unsigned char Key[24]; unsigned char Key[24];
unsigned char IV[8]; unsigned char IV[8];
unsigned char Feedback[8]; unsigned char Feedback[8];
} CRYPT_3DES_KEY_STATE, *PCRYPT_3DES_KEY_STATE; } CRYPT_3DES_KEY_STATE, *PCRYPT_3DES_KEY_STATE;
#endif //(NTDDI_VERSION >= NTDDI_WS03) #endif //(NTDDI_VERSION >= NTDDI_WS03)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
typedef struct _CRYPT_AES_128_KEY_STATE { typedef struct _CRYPT_AES_128_KEY_STATE {
unsigned char Key[16]; unsigned char Key[16];
unsigned char IV[16]; unsigned char IV[16];
unsigned char EncryptionState[11][16]; // 10 rounds + 1 unsigned char EncryptionState[11][16]; // 10 rounds + 1
unsigned char DecryptionState[11][16]; unsigned char DecryptionState[11][16];
unsigned char Feedback[16]; unsigned char Feedback[16];
} CRYPT_AES_128_KEY_STATE, *PCRYPT_AES_128_KEY_STATE; } CRYPT_AES_128_KEY_STATE, *PCRYPT_AES_128_KEY_STATE;
typedef struct _CRYPT_AES_256_KEY_STATE { typedef struct _CRYPT_AES_256_KEY_STATE {
unsigned char Key[32]; unsigned char Key[32];
unsigned char IV[16]; unsigned char IV[16];
unsigned char EncryptionState[15][16]; // 14 rounds + 1 unsigned char EncryptionState[15][16]; // 14 rounds + 1
unsigned char DecryptionState[15][16]; unsigned char DecryptionState[15][16];
unsigned char Feedback[16]; unsigned char Feedback[16];
} CRYPT_AES_256_KEY_STATE, *PCRYPT_AES_256_KEY_STATE; } CRYPT_AES_256_KEY_STATE, *PCRYPT_AES_256_KEY_STATE;
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRYPTOAPI BLOB definitions // CRYPTOAPI BLOB definitions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- *_BLOB // certenrolls_begin -- *_BLOB
#ifndef CRYPTO_BLOBS_DEFINED #ifndef CRYPTO_BLOBS_DEFINED
#define CRYPTO_BLOBS_DEFINED #define CRYPTO_BLOBS_DEFINED
typedef struct _CRYPTOAPI_BLOB { typedef struct _CRYPTOAPI_BLOB {
DWORD cbData; DWORD cbData;
__field_bcount(cbData) BYTE *pbData; _Field_size_bytes_(cbData) BYTE *pbData;
} CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB, } CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB, CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB,
CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB, CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
CERT_NAME_BLOB, *PCERT_NAME_BLOB, CERT_NAME_BLOB, *PCERT_NAME_BLOB,
CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB, CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
CERT_BLOB, *PCERT_BLOB, CERT_BLOB, *PCERT_BLOB,
CRL_BLOB, *PCRL_BLOB, CRL_BLOB, *PCRL_BLOB,
DATA_BLOB, *PDATA_BLOB, DATA_BLOB, *PDATA_BLOB,
CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB, CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB,
CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB, CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB,
CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB, CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB,
CRYPT_DER_BLOB, *PCRYPT_DER_BLOB, CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB; CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
#endif #endif
// certenrolls_end // certenrolls_end
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// structure for use with CryptSetKeyParam for CMS keys // structure for use with CryptSetKeyParam for CMS keys
typedef struct _CMS_DH_KEY_INFO { typedef struct _CMS_DH_KEY_INFO {
DWORD dwVersion; // sizeof(CMS_DH_KEY_INF O) DWORD dwVersion; // sizeof(CMS_DH_KEY_INF O)
ALG_ID Algid; // algorithmm id for the key to be converted ALG_ID Algid; // algorithmm id for the key to be converted
LPSTR pszContentEncObjId; // pointer to OID to hash in with Z LPSTR pszContentEncObjId; // pointer to OID to hash in with Z
CRYPT_DATA_BLOB PubInfo; // OPTIONAL - public information CRYPT_DATA_BLOB PubInfo; // OPTIONAL - public information
void *pReserved; // reserved - should be NULL void *pReserved; // reserved - should be NULL
} CMS_DH_KEY_INFO, *PCMS_DH_KEY_INFO; } CMS_DH_KEY_INFO, *PCMS_DH_KEY_INFO;
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptAcquireContextA( CryptAcquireContextA(
__out HCRYPTPROV *phProv, _Out_ HCRYPTPROV *phProv,
__in_opt LPCSTR szContainer, _In_opt_ LPCSTR szContainer,
__in_opt LPCSTR szProvider, _In_opt_ LPCSTR szProvider,
__in DWORD dwProvType, _In_ DWORD dwProvType,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptAcquireContextW( CryptAcquireContextW(
__out HCRYPTPROV *phProv, _Out_ HCRYPTPROV *phProv,
__in_opt LPCWSTR szContainer, _In_opt_ LPCWSTR szContainer,
__in_opt LPCWSTR szProvider, _In_opt_ LPCWSTR szProvider,
__in DWORD dwProvType, _In_ DWORD dwProvType,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptAcquireContext CryptAcquireContextW #define CryptAcquireContext CryptAcquireContextW
#else #else
#define CryptAcquireContext CryptAcquireContextA #define CryptAcquireContext CryptAcquireContextA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptAcquireContextA( CryptAcquireContextA(
HCRYPTPROV *phProv, HCRYPTPROV *phProv,
LPCSTR szContainer, LPCSTR szContainer,
LPCSTR szProvider, LPCSTR szProvider,
DWORD dwProvType, DWORD dwProvType,
DWORD dwFlags DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptAcquireContextW( CryptAcquireContextW(
HCRYPTPROV *phProv, HCRYPTPROV *phProv,
LPCWSTR szContainer, LPCWSTR szContainer,
LPCWSTR szProvider, LPCWSTR szProvider,
DWORD dwProvType, DWORD dwProvType,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptAcquireContextA( CryptAcquireContextA(
HCRYPTPROV *phProv, HCRYPTPROV *phProv,
LPCSTR pszContainer, LPCSTR pszContainer,
LPCSTR pszProvider, LPCSTR pszProvider,
DWORD dwProvType, DWORD dwProvType,
skipping to change at line 1081 skipping to change at line 1101
WINAPI WINAPI
CryptAcquireContextW( CryptAcquireContextW(
HCRYPTPROV *phProv, HCRYPTPROV *phProv,
LPCWSTR pszContainer, LPCWSTR pszContainer,
LPCWSTR pszProvider, LPCWSTR pszProvider,
DWORD dwProvType, DWORD dwProvType,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
#ifdef UNICODE #ifdef UNICODE
#define CryptAcquireContext CryptAcquireContextW #define CryptAcquireContext CryptAcquireContextW
#else #else
#define CryptAcquireContext CryptAcquireContextA #define CryptAcquireContext CryptAcquireContextA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptReleaseContext( CryptReleaseContext(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptReleaseContext( CryptReleaseContext(
HCRYPTPROV hProv, HCRYPTPROV hProv,
ULONG_PTR dwFlags ULONG_PTR dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGenKey( CryptGenKey(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in ALG_ID Algid, _In_ ALG_ID Algid,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out HCRYPTKEY *phKey _Out_ HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDeriveKey( CryptDeriveKey(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in ALG_ID Algid, _In_ ALG_ID Algid,
__in HCRYPTHASH hBaseData, _In_ HCRYPTHASH hBaseData,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out HCRYPTKEY *phKey _Out_ HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDestroyKey( CryptDestroyKey(
__in HCRYPTKEY hKey _In_ HCRYPTKEY hKey
); );
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetKeyParam( CryptSetKeyParam(
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in DWORD dwParam, _In_ DWORD dwParam,
__in CONST BYTE *pbData, _In_ CONST BYTE *pbData,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetKeyParam( CryptSetKeyParam(
HCRYPTKEY hKey, HCRYPTKEY hKey,
DWORD dwParam, DWORD dwParam,
BYTE *pbData, BYTE *pbData,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetKeyParam( CryptGetKeyParam(
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in DWORD dwParam, _In_ DWORD dwParam,
__out_bcount_part_opt(*pdwDataLen, *pdwDataLen) BYTE *pbData, _Out_writes_bytes_to_opt_(*pdwDataLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen, _Inout_ DWORD *pdwDataLen,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetHashParam( CryptSetHashParam(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in DWORD dwParam, _In_ DWORD dwParam,
__in CONST BYTE *pbData, _In_ CONST BYTE *pbData,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetHashParam( CryptSetHashParam(
HCRYPTHASH hHash, HCRYPTHASH hHash,
DWORD dwParam, DWORD dwParam,
BYTE*pbData, BYTE*pbData,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetHashParam( CryptGetHashParam(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in DWORD dwParam, _In_ DWORD dwParam,
__out_bcount_part_opt(*pdwDataLen, *pdwDataLen) BYTE *pbData, _Out_writes_bytes_to_opt_(*pdwDataLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen, _Inout_ DWORD *pdwDataLen,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#if (NTDDI_VERSION >= NTDDI_WINXP) #if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProvParam( CryptSetProvParam(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in DWORD dwParam, _In_ DWORD dwParam,
__in CONST BYTE *pbData, _In_ CONST BYTE *pbData,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) #endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProvParam( CryptSetProvParam(
HCRYPTPROV hProv, HCRYPTPROV hProv,
DWORD dwParam, DWORD dwParam,
BYTE*pbData, BYTE*pbData,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetProvParam( CryptGetProvParam(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in DWORD dwParam, _In_ DWORD dwParam,
__out_bcount_part_opt(*pdwDataLen, *pdwDataLen) BYTE *pbData, _Out_writes_bytes_to_opt_(*pdwDataLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen, _Inout_ DWORD *pdwDataLen,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGenRandom( CryptGenRandom(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in DWORD dwLen, _In_ DWORD dwLen,
__inout_bcount(dwLen) BYTE *pbBuffer _Inout_updates_bytes_(dwLen) BYTE *pbBuffer
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetUserKey( CryptGetUserKey(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in DWORD dwKeySpec, _In_ DWORD dwKeySpec,
__out HCRYPTKEY *phUserKey _Out_ HCRYPTKEY *phUserKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptExportKey( CryptExportKey(
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in HCRYPTKEY hExpKey, _In_ HCRYPTKEY hExpKey,
__in DWORD dwBlobType, _In_ DWORD dwBlobType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pdwDataLen, *pdwDataLen) BYTE *pbData, _Out_writes_bytes_to_opt_(*pdwDataLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen _Inout_ DWORD *pdwDataLen
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptImportKey( CryptImportKey(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in_bcount(dwDataLen) CONST BYTE *pbData, _In_reads_bytes_(dwDataLen) CONST BYTE *pbData,
__in DWORD dwDataLen, _In_ DWORD dwDataLen,
__in HCRYPTKEY hPubKey, _In_ HCRYPTKEY hPubKey,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out HCRYPTKEY *phKey _Out_ HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptEncrypt( CryptEncrypt(
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in BOOL Final, _In_ BOOL Final,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_bcount_part_opt(dwBufLen, *pdwDataLen) BYTE *pbData, _Inout_updates_bytes_to_opt_(dwBufLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen, _Inout_ DWORD *pdwDataLen,
__in DWORD dwBufLen _In_ DWORD dwBufLen
); );
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptDecrypt( CryptDecrypt(
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in BOOL Final, _In_ BOOL Final,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_bcount_part(*pdwDataLen, *pdwDataLen) BYTE *pbData, _Inout_updates_bytes_to_(*pdwDataLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen _Inout_ DWORD *pdwDataLen
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptCreateHash( CryptCreateHash(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__in ALG_ID Algid, _In_ ALG_ID Algid,
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out HCRYPTHASH *phHash _Out_ HCRYPTHASH *phHash
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptHashData( CryptHashData(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in_bcount(dwDataLen) CONST BYTE *pbData, _In_reads_bytes_(dwDataLen) CONST BYTE *pbData,
__in DWORD dwDataLen, _In_ DWORD dwDataLen,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptHashSessionKey( CryptHashSessionKey(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDestroyHash( CryptDestroyHash(
__in HCRYPTHASH hHash _In_ HCRYPTHASH hHash
); );
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSignHashA( CryptSignHashA(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in DWORD dwKeySpec, _In_ DWORD dwKeySpec,
__in_opt LPCSTR szDescription, _In_opt_ LPCSTR szDescription,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pdwSigLen, *pdwSigLen) BYTE *pbSignature, _Out_writes_bytes_to_opt_(*pdwSigLen, *pdwSigLen) BYTE *pbSignature,
__inout DWORD *pdwSigLen _Inout_ DWORD *pdwSigLen
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSignHashW( CryptSignHashW(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in DWORD dwKeySpec, _In_ DWORD dwKeySpec,
__in_opt LPCWSTR szDescription, _In_opt_ LPCWSTR szDescription,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pdwSigLen, *pdwSigLen) BYTE *pbSignature, _Out_writes_bytes_to_opt_(*pdwSigLen, *pdwSigLen) BYTE *pbSignature,
__inout DWORD *pdwSigLen _Inout_ DWORD *pdwSigLen
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptSignHash CryptSignHashW #define CryptSignHash CryptSignHashW
#else #else
#define CryptSignHash CryptSignHashA #define CryptSignHash CryptSignHashA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSignHashA( CryptSignHashA(
HCRYPTHASH hHash, HCRYPTHASH hHash,
DWORD dwKeySpec, DWORD dwKeySpec,
LPCSTR szDescription, LPCSTR szDescription,
DWORD dwFlags, DWORD dwFlags,
BYTE *pbSignature, BYTE *pbSignature,
DWORD *pdwSigLen DWORD *pdwSigLen
skipping to change at line 1399 skipping to change at line 1419
BOOL BOOL
WINAPI WINAPI
CryptSignHashW( CryptSignHashW(
HCRYPTHASH hHash, HCRYPTHASH hHash,
DWORD dwKeySpec, DWORD dwKeySpec,
LPCWSTR szDescription, LPCWSTR szDescription,
DWORD dwFlags, DWORD dwFlags,
BYTE *pbSignature, BYTE *pbSignature,
DWORD *pdwSigLen DWORD *pdwSigLen
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSignHashA( CryptSignHashA(
HCRYPTHASH hHash, HCRYPTHASH hHash,
DWORD dwKeySpec, DWORD dwKeySpec,
LPCSTR sDescription, LPCSTR sDescription,
DWORD dwFlags, DWORD dwFlags,
skipping to change at line 1426 skipping to change at line 1446
CryptSignHashW( CryptSignHashW(
HCRYPTHASH hHash, HCRYPTHASH hHash,
DWORD dwKeySpec, DWORD dwKeySpec,
LPCWSTR sDescription, LPCWSTR sDescription,
DWORD dwFlags, DWORD dwFlags,
BYTE *pbSignature, BYTE *pbSignature,
DWORD *pdwSigLen DWORD *pdwSigLen
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
#ifdef UNICODE #ifdef UNICODE
#define CryptSignHash CryptSignHashW #define CryptSignHash CryptSignHashW
#else #else
#define CryptSignHash CryptSignHashA #define CryptSignHash CryptSignHashA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptVerifySignatureA( CryptVerifySignatureA(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in_bcount(dwSigLen) CONST BYTE *pbSignature, _In_reads_bytes_(dwSigLen) CONST BYTE *pbSignature,
__in DWORD dwSigLen, _In_ DWORD dwSigLen,
__in HCRYPTKEY hPubKey, _In_ HCRYPTKEY hPubKey,
__in_opt LPCSTR szDescription, _In_opt_ LPCSTR szDescription,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptVerifySignatureW( CryptVerifySignatureW(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__in_bcount(dwSigLen) CONST BYTE *pbSignature, _In_reads_bytes_(dwSigLen) CONST BYTE *pbSignature,
__in DWORD dwSigLen, _In_ DWORD dwSigLen,
__in HCRYPTKEY hPubKey, _In_ HCRYPTKEY hPubKey,
__in_opt LPCWSTR szDescription, _In_opt_ LPCWSTR szDescription,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptVerifySignature CryptVerifySignatureW #define CryptVerifySignature CryptVerifySignatureW
#else #else
#define CryptVerifySignature CryptVerifySignatureA #define CryptVerifySignature CryptVerifySignatureA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptVerifySignatureA( CryptVerifySignatureA(
HCRYPTHASH hHash, HCRYPTHASH hHash,
CONST BYTE *pbSignature, CONST BYTE *pbSignature,
DWORD dwSigLen, DWORD dwSigLen,
HCRYPTKEY hPubKey, HCRYPTKEY hPubKey,
LPCSTR szDescription, LPCSTR szDescription,
DWORD dwFlags DWORD dwFlags
skipping to change at line 1487 skipping to change at line 1507
BOOL BOOL
WINAPI WINAPI
CryptVerifySignatureW( CryptVerifySignatureW(
HCRYPTHASH hHash, HCRYPTHASH hHash,
CONST BYTE *pbSignature, CONST BYTE *pbSignature,
DWORD dwSigLen, DWORD dwSigLen,
HCRYPTKEY hPubKey, HCRYPTKEY hPubKey,
LPCWSTR szDescription, LPCWSTR szDescription,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptVerifySignatureA( CryptVerifySignatureA(
HCRYPTHASH hHash, HCRYPTHASH hHash,
CONST BYTE *pbSignature, CONST BYTE *pbSignature,
DWORD dwSigLen, DWORD dwSigLen,
HCRYPTKEY hPubKey, HCRYPTKEY hPubKey,
skipping to change at line 1514 skipping to change at line 1534
CryptVerifySignatureW( CryptVerifySignatureW(
HCRYPTHASH hHash, HCRYPTHASH hHash,
CONST BYTE *pbSignature, CONST BYTE *pbSignature,
DWORD dwSigLen, DWORD dwSigLen,
HCRYPTKEY hPubKey, HCRYPTKEY hPubKey,
LPCWSTR sDescription, LPCWSTR sDescription,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
#ifdef UNICODE #ifdef UNICODE
#define CryptVerifySignature CryptVerifySignatureW #define CryptVerifySignature CryptVerifySignatureW
#else #else
#define CryptVerifySignature CryptVerifySignatureA #define CryptVerifySignature CryptVerifySignatureA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderA( CryptSetProviderA(
__in LPCSTR pszProvName, _In_ LPCSTR pszProvName,
__in DWORD dwProvType _In_ DWORD dwProvType
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderW( CryptSetProviderW(
__in LPCWSTR pszProvName, _In_ LPCWSTR pszProvName,
__in DWORD dwProvType _In_ DWORD dwProvType
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptSetProvider CryptSetProviderW #define CryptSetProvider CryptSetProviderW
#else #else
#define CryptSetProvider CryptSetProviderA #define CryptSetProvider CryptSetProviderA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderA( CryptSetProviderA(
LPCSTR pszProvName, LPCSTR pszProvName,
DWORD dwProvType DWORD dwProvType
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderW( CryptSetProviderW(
LPCWSTR pszProvName, LPCWSTR pszProvName,
DWORD dwProvType DWORD dwProvType
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptSetProvider CryptSetProviderW #define CryptSetProvider CryptSetProviderW
#else #else
#define CryptSetProvider CryptSetProviderA #define CryptSetProvider CryptSetProviderA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderExA( CryptSetProviderExA(
__in LPCSTR pszProvName, _In_ LPCSTR pszProvName,
__in DWORD dwProvType, _In_ DWORD dwProvType,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderExW( CryptSetProviderExW(
__in LPCWSTR pszProvName, _In_ LPCWSTR pszProvName,
__in DWORD dwProvType, _In_ DWORD dwProvType,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptSetProviderEx CryptSetProviderExW #define CryptSetProviderEx CryptSetProviderExW
#else #else
#define CryptSetProviderEx CryptSetProviderExA #define CryptSetProviderEx CryptSetProviderExA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetProviderExA( CryptSetProviderExA(
LPCSTR pszProvName, LPCSTR pszProvName,
DWORD dwProvType, DWORD dwProvType,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags DWORD dwFlags
); );
WINADVAPI WINADVAPI
skipping to change at line 1616 skipping to change at line 1636
LPCWSTR pszProvName, LPCWSTR pszProvName,
DWORD dwProvType, DWORD dwProvType,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptSetProviderEx CryptSetProviderExW #define CryptSetProviderEx CryptSetProviderExW
#else #else
#define CryptSetProviderEx CryptSetProviderExA #define CryptSetProviderEx CryptSetProviderExA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptGetDefaultProviderA( CryptGetDefaultProviderA(
__in DWORD dwProvType, _In_ DWORD dwProvType,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbProvName, *pcbProvName) LPSTR pszProvName, _Out_writes_bytes_to_opt_(*pcbProvName, *pcbProvName) LPSTR pszProvName,
__inout DWORD *pcbProvName _Inout_ DWORD *pcbProvName
); );
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptGetDefaultProviderW( CryptGetDefaultProviderW(
__in DWORD dwProvType, _In_ DWORD dwProvType,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbProvName, *pcbProvName) LPWSTR pszProvName, _Out_writes_bytes_to_opt_(*pcbProvName, *pcbProvName) LPWSTR pszProvName,
__inout DWORD *pcbProvName _Inout_ DWORD *pcbProvName
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptGetDefaultProvider CryptGetDefaultProviderW #define CryptGetDefaultProvider CryptGetDefaultProviderW
#else #else
#define CryptGetDefaultProvider CryptGetDefaultProviderA #define CryptGetDefaultProvider CryptGetDefaultProviderA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetDefaultProviderA( CryptGetDefaultProviderA(
DWORD dwProvType, DWORD dwProvType,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags, DWORD dwFlags,
LPSTR pszProvName, LPSTR pszProvName,
DWORD *pcbProvName DWORD *pcbProvName
); );
skipping to change at line 1672 skipping to change at line 1692
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags, DWORD dwFlags,
LPWSTR pszProvName, LPWSTR pszProvName,
DWORD *pcbProvName DWORD *pcbProvName
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptGetDefaultProvider CryptGetDefaultProviderW #define CryptGetDefaultProvider CryptGetDefaultProviderW
#else #else
#define CryptGetDefaultProvider CryptGetDefaultProviderA #define CryptGetDefaultProvider CryptGetDefaultProviderA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptEnumProviderTypesA( CryptEnumProviderTypesA(
__in DWORD dwIndex, _In_ DWORD dwIndex,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out DWORD *pdwProvType, _Out_ DWORD *pdwProvType,
__out_bcount_part_opt(*pcbTypeName, *pcbTypeName) LPSTR szTypeName, _Out_writes_bytes_to_opt_(*pcbTypeName, *pcbTypeName) LPSTR szTypeName,
__inout DWORD *pcbTypeName _Inout_ DWORD *pcbTypeName
); );
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptEnumProviderTypesW( CryptEnumProviderTypesW(
__in DWORD dwIndex, _In_ DWORD dwIndex,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out DWORD *pdwProvType, _Out_ DWORD *pdwProvType,
__out_bcount_part_opt(*pcbTypeName, *pcbTypeName) LPWSTR szTypeName, _Out_writes_bytes_to_opt_(*pcbTypeName, *pcbTypeName) LPWSTR szTypeName,
__inout DWORD *pcbTypeName _Inout_ DWORD *pcbTypeName
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptEnumProviderTypes CryptEnumProviderTypesW #define CryptEnumProviderTypes CryptEnumProviderTypesW
#else #else
#define CryptEnumProviderTypes CryptEnumProviderTypesA #define CryptEnumProviderTypes CryptEnumProviderTypesA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptEnumProviderTypesA( CryptEnumProviderTypesA(
DWORD dwIndex, DWORD dwIndex,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD *pdwProvType, DWORD *pdwProvType,
LPSTR szTypeName, LPSTR szTypeName,
DWORD *pcbTypeName DWORD *pcbTypeName
skipping to change at line 1727 skipping to change at line 1747
BOOL BOOL
WINAPI WINAPI
CryptEnumProviderTypesW( CryptEnumProviderTypesW(
DWORD dwIndex, DWORD dwIndex,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD *pdwProvType, DWORD *pdwProvType,
LPWSTR szTypeName, LPWSTR szTypeName,
DWORD *pcbTypeName DWORD *pcbTypeName
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptEnumProviderTypesA( CryptEnumProviderTypesA(
DWORD dwIndex, DWORD dwIndex,
DWORD * pdwReserved, DWORD * pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD * pdwProvType, DWORD * pdwProvType,
skipping to change at line 1754 skipping to change at line 1774
CryptEnumProviderTypesW( CryptEnumProviderTypesW(
DWORD dwIndex, DWORD dwIndex,
DWORD * pdwReserved, DWORD * pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD * pdwProvType, DWORD * pdwProvType,
LPWSTR pszTypeName, LPWSTR pszTypeName,
DWORD * pcbTypeName DWORD * pcbTypeName
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
#ifdef UNICODE #ifdef UNICODE
#define CryptEnumProviderTypes CryptEnumProviderTypesW #define CryptEnumProviderTypes CryptEnumProviderTypesW
#else #else
#define CryptEnumProviderTypes CryptEnumProviderTypesA #define CryptEnumProviderTypes CryptEnumProviderTypesA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptEnumProvidersA( CryptEnumProvidersA(
__in DWORD dwIndex, _In_ DWORD dwIndex,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out DWORD *pdwProvType, _Out_ DWORD *pdwProvType,
__out_bcount_part_opt(*pcbProvName, *pcbProvName) LPSTR szProvName, _Out_writes_bytes_to_opt_(*pcbProvName, *pcbProvName) LPSTR szProvName,
__inout DWORD *pcbProvName _Inout_ DWORD *pcbProvName
); );
WINADVAPI WINADVAPI
__success(0 != return) BOOL _Success_(0 != return) BOOL
WINAPI WINAPI
CryptEnumProvidersW( CryptEnumProvidersW(
__in DWORD dwIndex, _In_ DWORD dwIndex,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out DWORD *pdwProvType, _Out_ DWORD *pdwProvType,
__out_bcount_part_opt(*pcbProvName, *pcbProvName) LPWSTR szProvName, _Out_writes_bytes_to_opt_(*pcbProvName, *pcbProvName) LPWSTR szProvName,
__inout DWORD *pcbProvName _Inout_ DWORD *pcbProvName
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptEnumProviders CryptEnumProvidersW #define CryptEnumProviders CryptEnumProvidersW
#else #else
#define CryptEnumProviders CryptEnumProvidersA #define CryptEnumProviders CryptEnumProvidersA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptEnumProvidersA( CryptEnumProvidersA(
DWORD dwIndex, DWORD dwIndex,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD *pdwProvType, DWORD *pdwProvType,
LPSTR szProvName, LPSTR szProvName,
DWORD *pcbProvName DWORD *pcbProvName
skipping to change at line 1815 skipping to change at line 1835
BOOL BOOL
WINAPI WINAPI
CryptEnumProvidersW( CryptEnumProvidersW(
DWORD dwIndex, DWORD dwIndex,
DWORD *pdwReserved, DWORD *pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD *pdwProvType, DWORD *pdwProvType,
LPWSTR szProvName, LPWSTR szProvName,
DWORD *pcbProvName DWORD *pcbProvName
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)
#if (NTDDI_VERSION < NTDDI_WINXP) #if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptEnumProvidersA( CryptEnumProvidersA(
DWORD dwIndex, DWORD dwIndex,
DWORD * pdwReserved, DWORD * pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD * pdwProvType, DWORD * pdwProvType,
skipping to change at line 1842 skipping to change at line 1862
CryptEnumProvidersW( CryptEnumProvidersW(
DWORD dwIndex, DWORD dwIndex,
DWORD * pdwReserved, DWORD * pdwReserved,
DWORD dwFlags, DWORD dwFlags,
DWORD * pdwProvType, DWORD * pdwProvType,
LPWSTR pszProvName, LPWSTR pszProvName,
DWORD * pcbProvName DWORD * pcbProvName
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP) #endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH) #if (NTDDI_VERSION < NTDDI_VISTA)
#ifdef UNICODE #ifdef UNICODE
#define CryptEnumProviders CryptEnumProvidersW #define CryptEnumProviders CryptEnumProvidersW
#else #else
#define CryptEnumProviders CryptEnumProvidersA #define CryptEnumProviders CryptEnumProvidersA
#endif // !UNICODE #endif // !UNICODE
#endif //(NTDDI_VERSION < NTDDI_WINLH) #endif //(NTDDI_VERSION < NTDDI_VISTA)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptContextAddRef( CryptContextAddRef(
__in HCRYPTPROV hProv, _In_ HCRYPTPROV hProv,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDuplicateKey( CryptDuplicateKey(
__in HCRYPTKEY hKey, _In_ HCRYPTKEY hKey,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out HCRYPTKEY *phKey _Out_ HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDuplicateHash( CryptDuplicateHash(
__in HCRYPTHASH hHash, _In_ HCRYPTHASH hHash,
__reserved DWORD *pdwReserved, _Reserved_ DWORD *pdwReserved,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out HCRYPTHASH *phHash _Out_ HCRYPTHASH *phHash
); );
#if (NTDDI_VERSION >= NTDDI_WS03) #if (NTDDI_VERSION >= NTDDI_WS03)
// //
// This function is provided in Microsoft Windows 2000 as a means of // This function is provided in Microsoft Windows 2000 as a means of
// installing the 128-bit encryption provider. This function is unavailable // installing the 128-bit encryption provider. This function is unavailable
// in Microsoft Windows XP, because Windows XP ships with the 128-bit // in Microsoft Windows XP, because Windows XP ships with the 128-bit
// encryption provider. // encryption provider.
// //
BOOL BOOL
__cdecl __cdecl
GetEncSChannel( GetEncSChannel(
BYTE **pData, _Outptr_result_buffer_(*dwDecSize) BYTE **pData,
DWORD *dwDecSize _Out_ DWORD *dwDecSize
); );
#endif //(NTDDI_VERSION >= NTDDI_WS03) #endif //(NTDDI_VERSION >= NTDDI_WS03)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#if !defined(_DDK_DRIVER_) #if !defined(_DDK_DRIVER_)
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// In Vista, the following APIs were updated to support the new // In Vista, the following APIs were updated to support the new
// CNG (Cryptography Next Generation) BCrypt* and NCrypt* APIs in addition // CNG (Cryptography Next Generation) BCrypt* and NCrypt* APIs in addition
// to the above CAPI1 APIs. // to the above CAPI1 APIs.
// Include the definitions for the CNG APIs // Include the definitions for the CNG APIs
#include <bcrypt.h> #include <bcrypt.h>
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#include <ncrypt.h> #include <ncrypt.h>
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// This type is used when the API can take either the CAPI1 HCRYPTPROV or // This type is used when the API can take either the CAPI1 HCRYPTPROV or
// the CNG NCRYPT_KEY_HANDLE. Where appropriate, the HCRYPTPROV will be // the CNG NCRYPT_KEY_HANDLE. Where appropriate, the HCRYPTPROV will be
// converted to a NCRYPT_KEY_HANDLE via the CNG NCryptTranslateHandle(). // converted to a NCRYPT_KEY_HANDLE via the CNG NCryptTranslateHandle().
typedef ULONG_PTR HCRYPTPROV_OR_NCRYPT_KEY_HANDLE; typedef ULONG_PTR HCRYPTPROV_OR_NCRYPT_KEY_HANDLE;
// This type is used where the HCRYPTPROV parameter is no longer used. // This type is used where the HCRYPTPROV parameter is no longer used.
// The caller should always pass in NULL. // The caller should always pass in NULL.
typedef ULONG_PTR HCRYPTPROV_LEGACY; typedef ULONG_PTR HCRYPTPROV_LEGACY;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// In a CRYPT_BIT_BLOB the last byte may contain 0-7 unused bits. Therefore, th e // In a CRYPT_BIT_BLOB the last byte may contain 0-7 unused bits. Therefore, th e
// overall bit length is cbData * 8 - cUnusedBits. // overall bit length is cbData * 8 - cUnusedBits.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_CONTEXT // certenrolls_begin -- CERT_CONTEXT
typedef struct _CRYPT_BIT_BLOB { typedef struct _CRYPT_BIT_BLOB {
DWORD cbData; DWORD cbData;
BYTE *pbData; BYTE *pbData;
DWORD cUnusedBits; DWORD cUnusedBits;
} CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB; } CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
skipping to change at line 1936 skipping to change at line 1981
// //
// Where the Parameters CRYPT_OBJID_BLOB is in its encoded representation. For most // Where the Parameters CRYPT_OBJID_BLOB is in its encoded representation. For most
// algorithm types, the Parameters CRYPT_OBJID_BLOB is NULL (Parameters.cbData = 0). // algorithm types, the Parameters CRYPT_OBJID_BLOB is NULL (Parameters.cbData = 0).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_ALGORITHM_IDENTIFIER { typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
LPSTR pszObjId; LPSTR pszObjId;
CRYPT_OBJID_BLOB Parameters; CRYPT_OBJID_BLOB Parameters;
} CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER; } CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
// certenrolls_end // certenrolls_end
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// Following are the definitions of various algorithm object identifiers // Following are the definitions of various algorithm object identifiers
// RSA // RSA
#define szOID_RSA "1.2.840.113549" #define szOID_RSA "1.2.840.113549"
#define szOID_PKCS "1.2.840.113549.1" #define szOID_PKCS "1.2.840.113549.1"
#define szOID_RSA_HASH "1.2.840.113549.2" #define szOID_RSA_HASH "1.2.840.113549.2"
#define szOID_RSA_ENCRYPT "1.2.840.113549.3" #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
#define szOID_PKCS_1 "1.2.840.113549.1.1" #define szOID_PKCS_1 "1.2.840.113549.1.1"
#define szOID_PKCS_2 "1.2.840.113549.1.2" #define szOID_PKCS_2 "1.2.840.113549.1.2"
#define szOID_PKCS_3 "1.2.840.113549.1.3" #define szOID_PKCS_3 "1.2.840.113549.1.3"
skipping to change at line 2171 skipping to change at line 2222
} CRYPT_OBJID_TABLE, *PCRYPT_OBJID_TABLE; } CRYPT_OBJID_TABLE, *PCRYPT_OBJID_TABLE;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PKCS #1 HashInfo (DigestInfo) // PKCS #1 HashInfo (DigestInfo)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_HASH_INFO { typedef struct _CRYPT_HASH_INFO {
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
CRYPT_HASH_BLOB Hash; CRYPT_HASH_BLOB Hash;
} CRYPT_HASH_INFO, *PCRYPT_HASH_INFO; } CRYPT_HASH_INFO, *PCRYPT_HASH_INFO;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Type used for an extension to an encoded content // Type used for an extension to an encoded content
// //
// Where the Value's CRYPT_OBJID_BLOB is in its encoded representation. // Where the Value's CRYPT_OBJID_BLOB is in its encoded representation.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_CONTEXT // certenrolls_begin -- CERT_CONTEXT
typedef struct _CERT_EXTENSION { typedef struct _CERT_EXTENSION {
LPSTR pszObjId; LPSTR pszObjId;
BOOL fCritical; BOOL fCritical;
CRYPT_OBJID_BLOB Value; CRYPT_OBJID_BLOB Value;
} CERT_EXTENSION, *PCERT_EXTENSION; } CERT_EXTENSION, *PCERT_EXTENSION;
typedef const CERT_EXTENSION* PCCERT_EXTENSION; typedef const CERT_EXTENSION* PCCERT_EXTENSION;
// certenrolls_end // certenrolls_end
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// AttributeTypeValue // AttributeTypeValue
// //
// Where the Value's CRYPT_OBJID_BLOB is in its encoded representation. // Where the Value's CRYPT_OBJID_BLOB is in its encoded representation.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CRYPT_ATTRIBUTE_TYPE_VALUE // certenrolls_begin -- CRYPT_ATTRIBUTE_TYPE_VALUE
typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE { typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
LPSTR pszObjId; LPSTR pszObjId;
CRYPT_OBJID_BLOB Value; CRYPT_OBJID_BLOB Value;
} CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE; } CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
skipping to change at line 2309 skipping to change at line 2372
// Pilot user attribute types: // Pilot user attribute types:
#define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25" // IA5, UTF8 string #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25" // IA5, UTF8 string
// used for PKCS 12 attributes // used for PKCS 12 attributes
#define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20" #define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20"
#define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21" #define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21"
#define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1" #define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1"
#define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2" #define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2"
#define szOID_PKCS_12_EXTENDED_ATTRIBUTES "1.3.6.1.4.1.311.17.3" #define szOID_PKCS_12_EXTENDED_ATTRIBUTES "1.3.6.1.4.1.311.17.3"
#define szOID_PKCS_12_PROTECTED_PASSWORD_SECRET_BAG_TYPE_ID "1.3.6.1.4.1.311.17. 4"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Microsoft CERT_RDN attribute Object Identifiers // Microsoft CERT_RDN attribute Object Identifiers
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Special RDN containing the KEY_ID. Its value type is CERT_RDN_OCTET_STRING. // Special RDN containing the KEY_ID. Its value type is CERT_RDN_OCTET_STRING.
#define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1" #define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// EV RDN OIDs // EV RDN OIDs
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 2432 skipping to change at line 2496
// Name attribute value without the Object Identifier // Name attribute value without the Object Identifier
// //
// The interpretation of the Value depends on the dwValueType. // The interpretation of the Value depends on the dwValueType.
// See above for a list of the types. // See above for a list of the types.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_NAME_VALUE { typedef struct _CERT_NAME_VALUE {
DWORD dwValueType; DWORD dwValueType;
CERT_RDN_VALUE_BLOB Value; CERT_RDN_VALUE_BLOB Value;
} CERT_NAME_VALUE, *PCERT_NAME_VALUE; } CERT_NAME_VALUE, *PCERT_NAME_VALUE;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Public Key Info // Public Key Info
// //
// The PublicKey is the encoded representation of the information as it is // The PublicKey is the encoded representation of the information as it is
// stored in the bit string // stored in the bit string
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_CONTEXT // certenrolls_begin -- CERT_CONTEXT
typedef struct _CERT_PUBLIC_KEY_INFO { typedef struct _CERT_PUBLIC_KEY_INFO {
CRYPT_ALGORITHM_IDENTIFIER Algorithm; CRYPT_ALGORITHM_IDENTIFIER Algorithm;
CRYPT_BIT_BLOB PublicKey; CRYPT_BIT_BLOB PublicKey;
} CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO; } CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
// certenrolls_end // certenrolls_end
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA #define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA
#define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA #define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA
#define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA #define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// ECC Private Key Info
//--------------------------------------------------------------------------
typedef struct _CRYPT_ECC_PRIVATE_KEY_INFO{
DWORD dwVersion; // ecPrivKeyVer1(1)
CRYPT_DER_BLOB PrivateKey; // d
LPSTR szCurveOid; // Optional
CRYPT_BIT_BLOB PublicKey; // Optional (x, y)
} CRYPT_ECC_PRIVATE_KEY_INFO, *PCRYPT_ECC_PRIVATE_KEY_INFO;
#define CRYPT_ECC_PRIVATE_KEY_INFO_v1 1
//+-------------------------------------------------------------------------
// structure that contains all the information in a PKCS#8 PrivateKeyInfo // structure that contains all the information in a PKCS#8 PrivateKeyInfo
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_PRIVATE_KEY_INFO{ typedef struct _CRYPT_PRIVATE_KEY_INFO{
DWORD Version; DWORD Version;
CRYPT_ALGORITHM_IDENTIFIER Algorithm; CRYPT_ALGORITHM_IDENTIFIER Algorithm;
CRYPT_DER_BLOB PrivateKey; CRYPT_DER_BLOB PrivateKey;
PCRYPT_ATTRIBUTES pAttributes; PCRYPT_ATTRIBUTES pAttributes;
} CRYPT_PRIVATE_KEY_INFO, *PCRYPT_PRIVATE_KEY_INFO; } CRYPT_PRIVATE_KEY_INFO, *PCRYPT_PRIVATE_KEY_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 2485 skipping to change at line 2573
// EncryptedPrivateKey - the encrypted private key blob // EncryptedPrivateKey - the encrypted private key blob
// pClearTextKey - a buffer to receive the clear text // pClearTextKey - a buffer to receive the clear text
// cbClearTextKey - the number of bytes of the pClearTextKey buffer // cbClearTextKey - the number of bytes of the pClearTextKey buffer
// note the if this is zero then this should be // note the if this is zero then this should be
// filled in with the size required to decrypt the // filled in with the size required to decrypt the
// key into, and pClearTextKey should be ignored // key into, and pClearTextKey should be ignored
// pVoidDecryptFunc - this is the pVoid that was passed into the call // pVoidDecryptFunc - this is the pVoid that was passed into the call
// and is preserved and passed back as context // and is preserved and passed back as context
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
typedef BOOL (CALLBACK *PCRYPT_DECRYPT_PRIVATE_KEY_FUNC)( typedef BOOL (CALLBACK *PCRYPT_DECRYPT_PRIVATE_KEY_FUNC)(
__in CRYPT_ALGORITHM_IDENTIFIER Algorithm, _In_ CRYPT_ALGORITHM_IDENTIFIER Algorithm,
__in CRYPT_DATA_BLOB EncryptedPrivateKey, _In_ CRYPT_DATA_BLOB EncryptedPrivateKey,
__out_bcount_opt (*pcbClearTextKey) BYTE* pbClearTextKey, _Out_writes_bytes_opt_ (*pcbClearTextKey) BYTE* pbClearTextKey,
__inout DWORD* pcbClearTextKey, _Inout_ DWORD* pcbClearTextKey,
__in LPVOID pVoidDecryptFunc); _In_ LPVOID pVoidDecryptFunc);
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// this callback is given when creating a PKCS8 EncryptedPrivateKeyInfo. // this callback is given when creating a PKCS8 EncryptedPrivateKeyInfo.
// The caller is then expected to encrypt the private key and hand back // The caller is then expected to encrypt the private key and hand back
// the encrypted contents. // the encrypted contents.
// //
// the parameters are: // the parameters are:
// Algorithm - the algorithm used to encrypt the PrivateKeyInfo // Algorithm - the algorithm used to encrypt the PrivateKeyInfo
// pClearTextPrivateKey - the cleartext private key to be encrypted // pClearTextPrivateKey - the cleartext private key to be encrypted
// pbEncryptedKey - the output encrypted private key blob // pbEncryptedKey - the output encrypted private key blob
// cbEncryptedKey - the number of bytes of the pbEncryptedKey buffer // cbEncryptedKey - the number of bytes of the pbEncryptedKey buffer
// note the if this is zero then this should be // note the if this is zero then this should be
// filled in with the size required to encrypt the // filled in with the size required to encrypt the
// key into, and pbEncryptedKey should be ignored // key into, and pbEncryptedKey should be ignored
// pVoidEncryptFunc - this is the pVoid that was passed into the call // pVoidEncryptFunc - this is the pVoid that was passed into the call
// and is preserved and passed back as context // and is preserved and passed back as context
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
typedef BOOL (CALLBACK *PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC)( typedef BOOL (CALLBACK *PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC)(
__out CRYPT_ALGORITHM_IDENTIFIER* pAlgorithm, _Out_ CRYPT_ALGORITHM_IDENTIFIER* pAlgorithm,
__in CRYPT_DATA_BLOB* pClearTextPrivateKey, _In_ CRYPT_DATA_BLOB* pClearTextPrivateKey,
__out_bcount_opt (*pcbEncryptedKey) BYTE* pbEncryptedKey, _Out_writes_bytes_opt_ (*pcbEncryptedKey) BYTE* pbEncryptedKey,
__inout DWORD* pcbEncryptedKey, _Inout_ DWORD* pcbEncryptedKey,
__in LPVOID pVoidEncryptFunc); _In_ LPVOID pVoidEncryptFunc);
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// this callback is given from the context of a ImportPKCS8 calls. the caller // this callback is given from the context of a ImportPKCS8 calls. the caller
// is then expected to hand back an HCRYPTPROV to receive the key being imported // is then expected to hand back an HCRYPTPROV to receive the key being imported
// //
// the parameters are: // the parameters are:
// pPrivateKeyInfo - pointer to a CRYPT_PRIVATE_KEY_INFO structure which // pPrivateKeyInfo - pointer to a CRYPT_PRIVATE_KEY_INFO structure which
// describes the key being imported // describes the key being imported
// EncryptedPrivateKey - the encrypted private key blob // EncryptedPrivateKey - the encrypted private key blob
// phCryptProv - a pointer to a HCRRYPTPROV to be filled in // phCryptProv - a pointer to a HCRRYPTPROV to be filled in
skipping to change at line 2564 skipping to change at line 2652
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
typedef struct _CRYPT_PKCS8_EXPORT_PARAMS{ typedef struct _CRYPT_PKCS8_EXPORT_PARAMS{
HCRYPTPROV hCryptProv; HCRYPTPROV hCryptProv;
DWORD dwKeySpec; DWORD dwKeySpec;
LPSTR pszPrivateKeyObjId; LPSTR pszPrivateKeyObjId;
PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC pEncryptPrivateKeyFunc; PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC pEncryptPrivateKeyFunc;
LPVOID pVoidEncryptFunc; LPVOID pVoidEncryptFunc;
} CRYPT_PKCS8_EXPORT_PARAMS, *PCRYPT_PKCS8_EXPORT_PARAMS; } CRYPT_PKCS8_EXPORT_PARAMS, *PCRYPT_PKCS8_EXPORT_PARAMS;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Information stored in a certificate // Information stored in a certificate
// //
// The Issuer, Subject, Algorithm, PublicKey and Extension BLOBs are the // The Issuer, Subject, Algorithm, PublicKey and Extension BLOBs are the
// encoded representation of the information. // encoded representation of the information.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_CONTEXT // certenrolls_begin -- CERT_CONTEXT
typedef struct _CERT_INFO { typedef struct _CERT_INFO {
DWORD dwVersion; DWORD dwVersion;
CRYPT_INTEGER_BLOB SerialNumber; CRYPT_INTEGER_BLOB SerialNumber;
skipping to change at line 2587 skipping to change at line 2681
FILETIME NotAfter; FILETIME NotAfter;
CERT_NAME_BLOB Subject; CERT_NAME_BLOB Subject;
CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo; CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
CRYPT_BIT_BLOB IssuerUniqueId; CRYPT_BIT_BLOB IssuerUniqueId;
CRYPT_BIT_BLOB SubjectUniqueId; CRYPT_BIT_BLOB SubjectUniqueId;
DWORD cExtension; DWORD cExtension;
PCERT_EXTENSION rgExtension; PCERT_EXTENSION rgExtension;
} CERT_INFO, *PCERT_INFO; } CERT_INFO, *PCERT_INFO;
// certenrolls_end // certenrolls_end
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate versions // Certificate versions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_V1 0 #define CERT_V1 0
#define CERT_V2 1 #define CERT_V2 1
#define CERT_V3 2 #define CERT_V3 2
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Information Flags // Certificate Information Flags
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 2654 skipping to change at line 2754
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Bundle // Certificate Bundle
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_BUNDLE_CERTIFICATE 0 #define CERT_BUNDLE_CERTIFICATE 0
#define CERT_BUNDLE_CRL 1 #define CERT_BUNDLE_CRL 1
typedef struct _CERT_OR_CRL_BLOB { typedef struct _CERT_OR_CRL_BLOB {
DWORD dwChoice; DWORD dwChoice;
DWORD cbEncoded; DWORD cbEncoded;
__field_bcount(cbEncoded) _Field_size_bytes_(cbEncoded)
BYTE *pbEncoded; BYTE *pbEncoded;
} CERT_OR_CRL_BLOB, * PCERT_OR_CRL_BLOB; } CERT_OR_CRL_BLOB, * PCERT_OR_CRL_BLOB;
typedef struct _CERT_OR_CRL_BUNDLE { typedef struct _CERT_OR_CRL_BUNDLE {
DWORD cItem; DWORD cItem;
__field_ecount(cItem) _Field_size_(cItem)
PCERT_OR_CRL_BLOB rgItem; PCERT_OR_CRL_BLOB rgItem;
} CERT_OR_CRL_BUNDLE, *PCERT_OR_CRL_BUNDLE; } CERT_OR_CRL_BUNDLE, *PCERT_OR_CRL_BUNDLE;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Information stored in a certificate request // Information stored in a certificate request
// //
// The Subject, Algorithm, PublicKey and Attribute BLOBs are the encoded // The Subject, Algorithm, PublicKey and Attribute BLOBs are the encoded
// representation of the information. // representation of the information.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_REQUEST_INFO { typedef struct _CERT_REQUEST_INFO {
skipping to change at line 2831 skipping to change at line 2931
// on a seperate line. // on a seperate line.
// //
// If there is no formatting routine installed or registered // If there is no formatting routine installed or registered
// for the lpszStructType, the hex dump of the encoded BLOB will be returned. // for the lpszStructType, the hex dump of the encoded BLOB will be returned.
// User can set the flag CRYPT_FORMAT_STR_NO_HEX to disable the hex dump. // User can set the flag CRYPT_FORMAT_STR_NO_HEX to disable the hex dump.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptFormatObject( CryptFormatObject(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in DWORD dwFormatType, _In_ DWORD dwFormatType,
__in DWORD dwFormatStrType, _In_ DWORD dwFormatStrType,
__in_opt void *pFormatStruct, _In_opt_ void *pFormatStruct,
__in_opt LPCSTR lpszStructType, _In_opt_ LPCSTR lpszStructType,
__in_bcount(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__out_bcount_part_opt(*pcbFormat, *pcbFormat) __typefix(WCHAR *) void *pbFor _At_((WCHAR *)pbFormat, _Out_writes_bytes_to_opt_(*pcbFormat, *pcbFormat)) v
mat, oid *pbFormat,
__inout DWORD *pcbFormat _Inout_ DWORD *pcbFormat
); );
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// constants for dwFormatStrType of function CryptFormatObject // constants for dwFormatStrType of function CryptFormatObject
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#define CRYPT_FORMAT_STR_MULTI_LINE 0x0001 #define CRYPT_FORMAT_STR_MULTI_LINE 0x0001
#define CRYPT_FORMAT_STR_NO_HEX 0x0010 #define CRYPT_FORMAT_STR_NO_HEX 0x0010
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// constants for dwFormatType of function CryptFormatObject // constants for dwFormatType of function CryptFormatObject
// when format X509_NAME or X509_UNICODE_NAME // when format X509_NAME or X509_UNICODE_NAME
skipping to change at line 2909 skipping to change at line 3009
#define CRYPT_FORMAT_CRLF CRYPT_FORMAT_RDN_CRLF #define CRYPT_FORMAT_CRLF CRYPT_FORMAT_RDN_CRLF
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Encode / decode the specified data structure according to the certificate // Encode / decode the specified data structure according to the certificate
// encoding type. // encoding type.
// //
// See below for a list of the predefined data structures. // See below for a list of the predefined data structures.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)( typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)(
__in size_t cbSize _In_ size_t cbSize
); );
typedef VOID (WINAPI *PFN_CRYPT_FREE)( typedef VOID (WINAPI *PFN_CRYPT_FREE)(
__in LPVOID pv _In_ LPVOID pv
); );
typedef struct _CRYPT_ENCODE_PARA { typedef struct _CRYPT_ENCODE_PARA {
DWORD cbSize; DWORD cbSize;
PFN_CRYPT_ALLOC pfnAlloc; // OPTIONAL PFN_CRYPT_ALLOC pfnAlloc; // OPTIONAL
PFN_CRYPT_FREE pfnFree; // OPTIONAL PFN_CRYPT_FREE pfnFree; // OPTIONAL
} CRYPT_ENCODE_PARA, *PCRYPT_ENCODE_PARA; } CRYPT_ENCODE_PARA, *PCRYPT_ENCODE_PARA;
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptEncodeObjectEx( CryptEncodeObjectEx(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCSTR lpszStructType, _In_ LPCSTR lpszStructType,
__in const void *pvStructInfo, _In_ const void *pvStructInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCRYPT_ENCODE_PARA pEncodePara, _In_opt_ PCRYPT_ENCODE_PARA pEncodePara,
__out_opt void *pvEncoded, _Out_opt_ void *pvEncoded,
__inout DWORD *pcbEncoded _Inout_ DWORD *pcbEncoded
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptEncodeObject( CryptEncodeObject(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCSTR lpszStructType, _In_ LPCSTR lpszStructType,
__in const void *pvStructInfo, _In_ const void *pvStructInfo,
__out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded, _Out_writes_bytes_to_opt_(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
__inout DWORD *pcbEncoded _Inout_ DWORD *pcbEncoded
); );
// By default the signature bytes are reversed. The following flag can // By default the signature bytes are reversed. The following flag can
// be set to inhibit the byte reversal. // be set to inhibit the byte reversal.
// //
// This flag is applicable to // This flag is applicable to
// X509_CERT_TO_BE_SIGNED // X509_CERT_TO_BE_SIGNED
#define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x8 #define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x8
// When the following flag is set the called encode function allocates // When the following flag is set the called encode function allocates
skipping to change at line 3002 skipping to change at line 3102
// The following flag is applicable when encoding the PKCS_SORTED_CTL. This // The following flag is applicable when encoding the PKCS_SORTED_CTL. This
// flag should be set if the identifier for the TrustedSubjects is a hash, // flag should be set if the identifier for the TrustedSubjects is a hash,
// such as, MD5 or SHA1. // such as, MD5 or SHA1.
#define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000 #define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000
// The following flag is applicable when encoding structures that require // The following flag is applicable when encoding structures that require
// IA5String encoding of host name(in DNS Name/ URL/ EmailAddress) containing // IA5String encoding of host name(in DNS Name/ URL/ EmailAddress) containing
// non-IA5 characters by encoding the host name in punycode first. // non-IA5 characters by encoding the host name in punycode first.
#define CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG 0x20000 #define CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG 0x20000
// The following flag is applicable when encoding structures that require
// IA5String encoding of a path (http URL/Ldap query) containing non-IA5
// characters by encoding the path part as UTF8 percent encoding.
#define CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG 0x40000
// The following flag is applicable when encoding structures that require
// IA5String encoding of the host name (URL) and path. If the data to be encoded
// contains non-IA5 characters then using this flag in during encoding will caus
e
// the hostname to be punycode and the path as UTF8-percent encoding
// For example: http://www.zzzzzz.com/yyyyy/qqqqq/rrrrrr.sssss
// If zzzzzz contains non-IA5 characters then using this flag will punycode
// encode the zzzzzz component.
// If yyyyy or qqqqq or rrrrrr or sssss contain non-IA5 characters then using
// this flag will UTF8 percent encode those characters which are not IA5.
#define CRYPT_ENCODE_ENABLE_IA5CONVERSION_FLAG (CRYPT_ENCODE_ENABLE_PUNYCODE_FLA
G | CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG)
typedef struct _CRYPT_DECODE_PARA { typedef struct _CRYPT_DECODE_PARA {
DWORD cbSize; DWORD cbSize;
PFN_CRYPT_ALLOC pfnAlloc; // OPTIONAL PFN_CRYPT_ALLOC pfnAlloc; // OPTIONAL
PFN_CRYPT_FREE pfnFree; // OPTIONAL PFN_CRYPT_FREE pfnFree; // OPTIONAL
} CRYPT_DECODE_PARA, *PCRYPT_DECODE_PARA; } CRYPT_DECODE_PARA, *PCRYPT_DECODE_PARA;
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptDecodeObjectEx( CryptDecodeObjectEx(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCSTR lpszStructType, _In_ LPCSTR lpszStructType,
__in_bcount(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCRYPT_DECODE_PARA pDecodePara, _In_opt_ PCRYPT_DECODE_PARA pDecodePara,
__out_opt void *pvStructInfo, _Out_opt_ void *pvStructInfo,
__inout DWORD *pcbStructInfo _Inout_ DWORD *pcbStructInfo
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptDecodeObject( CryptDecodeObject(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCSTR lpszStructType, _In_ LPCSTR lpszStructType,
__in_bcount(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbStructInfo, *pcbStructInfo) void *pvStructInfo, _Out_writes_bytes_to_opt_(*pcbStructInfo, *pcbStructInfo) void *pvStructInfo
__inout DWORD *pcbStructInfo ,
_Inout_ DWORD *pcbStructInfo
); );
// When the following flag is set the nocopy optimization is enabled. // When the following flag is set the nocopy optimization is enabled.
// This optimization where appropriate, updates the pvStructInfo fields // This optimization where appropriate, updates the pvStructInfo fields
// to point to content residing within pbEncoded instead of making a copy // to point to content residing within pbEncoded instead of making a copy
// of and appending to pvStructInfo. // of and appending to pvStructInfo.
// //
// Note, when set, pbEncoded can't be freed until pvStructInfo is freed. // Note, when set, pbEncoded can't be freed until pvStructInfo is freed.
#define CRYPT_DECODE_NOCOPY_FLAG 0x1 #define CRYPT_DECODE_NOCOPY_FLAG 0x1
skipping to change at line 3096 skipping to change at line 3212
// Setting this flag skips the initial attempt to decode as UTF8. // Setting this flag skips the initial attempt to decode as UTF8.
#define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \ #define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \
CERT_RDN_DISABLE_IE4_UTF8_FLAG CERT_RDN_DISABLE_IE4_UTF8_FLAG
// The following flag is applicable when decoding structures that contain // The following flag is applicable when decoding structures that contain
// IA5String encoding of punycode encoded host name (in DNS Name/ URL/ // IA5String encoding of punycode encoded host name (in DNS Name/ URL/
// EmailAddress). Decoded value contains the the unicode equivalent of // EmailAddress). Decoded value contains the the unicode equivalent of
// punycode encoded data. // punycode encoded data.
#define CRYPT_DECODE_ENABLE_PUNYCODE_FLAG 0x02000000 #define CRYPT_DECODE_ENABLE_PUNYCODE_FLAG 0x02000000
// The following flag is applicable when decoding structures that contain
// IA5String that is UTF8 percent encoded in the path part of a url.
#define CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG 0x04000000
// The following flag is applicable when decoding structures that contain
// an IA5String that is a punycode and UTF8-percent encoded host name and path (
URL). The decoded
// value contains the Unicode equivalent of the punycode encoded host name and U
TF8 percent
// encoded path.
#define CRYPT_DECODE_ENABLE_IA5CONVERSION_FLAG (CRYPT_DECODE_ENABLE_PUNYCODE_FLA
G | CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Predefined X509 certificate data structures that can be encoded / decoded. // Predefined X509 certificate data structures that can be encoded / decoded.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_ENCODE_DECODE_NONE 0 #define CRYPT_ENCODE_DECODE_NONE 0
#define X509_CERT ((LPCSTR) 1) #define X509_CERT ((LPCSTR) 1)
#define X509_CERT_TO_BE_SIGNED ((LPCSTR) 2) #define X509_CERT_TO_BE_SIGNED ((LPCSTR) 2)
#define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR) 3) #define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR) 3)
#define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR) 4) #define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR) 4)
#define X509_EXTENSIONS ((LPCSTR) 5) #define X509_EXTENSIONS ((LPCSTR) 5)
#define X509_NAME_VALUE ((LPCSTR) 6) #define X509_NAME_VALUE ((LPCSTR) 6)
skipping to change at line 3273 skipping to change at line 3399
#define TIMESTAMP_REQUEST ((LPCSTR) 78) #define TIMESTAMP_REQUEST ((LPCSTR) 78)
#define TIMESTAMP_RESPONSE ((LPCSTR) 79) #define TIMESTAMP_RESPONSE ((LPCSTR) 79)
#define TIMESTAMP_INFO ((LPCSTR) 80) #define TIMESTAMP_INFO ((LPCSTR) 80)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CertificateBundle // CertificateBundle
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define X509_CERT_BUNDLE ((LPCSTR) 81) #define X509_CERT_BUNDLE ((LPCSTR) 81)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// ECC Keys
//--------------------------------------------------------------------------
#define X509_ECC_PRIVATE_KEY ((LPCSTR) 82) // CRYPT_ECC_PRIVATE
_KEY_INFO
#define CNG_RSA_PRIVATE_KEY_BLOB ((LPCSTR) 83) // BCRYPT_RSAKEY_BLO
B
//+-------------------------------------------------------------------------
// Subject Directory Attributes extension
//--------------------------------------------------------------------------
#define X509_SUBJECT_DIR_ATTRS ((LPCSTR) 84)
//+-------------------------------------------------------------------------
// Predefined PKCS #7 data structures that can be encoded / decoded. // Predefined PKCS #7 data structures that can be encoded / decoded.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define PKCS7_SIGNER_INFO ((LPCSTR) 500) #define PKCS7_SIGNER_INFO ((LPCSTR) 500)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Predefined PKCS #7 data structures that can be encoded / decoded. // Predefined PKCS #7 data structures that can be encoded / decoded.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMS_SIGNER_INFO ((LPCSTR) 501) #define CMS_SIGNER_INFO ((LPCSTR) 501)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 3378 skipping to change at line 3516
// serialized serial numbers for PRS // serialized serial numbers for PRS
#ifndef szOID_SERIALIZED #ifndef szOID_SERIALIZED
#define szOID_SERIALIZED "1.3.6.1.4.1.311.10.3.3.1" #define szOID_SERIALIZED "1.3.6.1.4.1.311.10.3.3.1"
#endif #endif
// UPN principal name in SubjectAltName // UPN principal name in SubjectAltName
#ifndef szOID_NT_PRINCIPAL_NAME #ifndef szOID_NT_PRINCIPAL_NAME
#define szOID_NT_PRINCIPAL_NAME "1.3.6.1.4.1.311.20.2.3" #define szOID_NT_PRINCIPAL_NAME "1.3.6.1.4.1.311.20.2.3"
#endif #endif
// Internationalized Email Address in SubjectAltName (OtherName:UTF8)
#ifndef szOID_INTERNATIONALIZED_EMAIL_ADDRESS
#define szOID_INTERNATIONALIZED_EMAIL_ADDRESS "1.3.6.1.4.1.311.20.2.4"
#endif
// Windows product update unauthenticated attribute // Windows product update unauthenticated attribute
#ifndef szOID_PRODUCT_UPDATE #ifndef szOID_PRODUCT_UPDATE
#define szOID_PRODUCT_UPDATE "1.3.6.1.4.1.311.31.1" #define szOID_PRODUCT_UPDATE "1.3.6.1.4.1.311.31.1"
#endif #endif
// CryptUI // CryptUI
#define szOID_ANY_APPLICATION_POLICY "1.3.6.1.4.1.311.10.12.1" #define szOID_ANY_APPLICATION_POLICY "1.3.6.1.4.1.311.10.12.1"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Object Identifiers for use with Auto Enrollment // Object Identifiers for use with Auto Enrollment
skipping to change at line 3462 skipping to change at line 3605
#define szOID_REQUEST_CLIENT_INFO "1.3.6.1.4.1.311.21.20" #define szOID_REQUEST_CLIENT_INFO "1.3.6.1.4.1.311.21.20"
#define szOID_ENCRYPTED_KEY_HASH "1.3.6.1.4.1.311.21.21" #define szOID_ENCRYPTED_KEY_HASH "1.3.6.1.4.1.311.21.21"
#define szOID_CERTSRV_CROSSCA_VERSION "1.3.6.1.4.1.311.21.22" #define szOID_CERTSRV_CROSSCA_VERSION "1.3.6.1.4.1.311.21.22"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Object Identifiers for use with the MS Directory Service // Object Identifiers for use with the MS Directory Service
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define szOID_NTDS_REPLICATION "1.3.6.1.4.1.311.25.1" #define szOID_NTDS_REPLICATION "1.3.6.1.4.1.311.25.1"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Extension Object Identifiers (currently not implemented) // Extension Object Identifiers
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define szOID_SUBJECT_DIR_ATTRS "2.5.29.9" #define szOID_SUBJECT_DIR_ATTRS "2.5.29.9"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enhanced Key Usage (Purpose) Object Identifiers // Enhanced Key Usage (Purpose) Object Identifiers
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define szOID_PKIX_KP "1.3.6.1.5.5.7.3" #define szOID_PKIX_KP "1.3.6.1.5.5.7.3"
// Consistent key usage bits: DIGITAL_SIGNATURE, KEY_ENCIPHERMENT // Consistent key usage bits: DIGITAL_SIGNATURE, KEY_ENCIPHERMENT
// or KEY_AGREEMENT // or KEY_AGREEMENT
skipping to change at line 3600 skipping to change at line 3743
#ifndef szOID_LICENSE_SERVER #ifndef szOID_LICENSE_SERVER
#define szOID_LICENSE_SERVER "1.3.6.1.4.1.311.10.6.2" #define szOID_LICENSE_SERVER "1.3.6.1.4.1.311.10.6.2"
#endif #endif
#ifndef szOID_KP_SMARTCARD_LOGON #ifndef szOID_KP_SMARTCARD_LOGON
#define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2" #define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2"
#endif #endif
#define szOID_KP_KERNEL_MODE_CODE_SIGNING "1.3.6.1.4.1.311.61.1.1" #define szOID_KP_KERNEL_MODE_CODE_SIGNING "1.3.6.1.4.1.311.61.1.1"
#define szOID_KP_KERNEL_MODE_TRUSTED_BOOT_SIGNING "1.3.6.1.4.1.311.61.4.1"
// Signer of CRL // Signer of CRL
#define szOID_REVOKED_LIST_SIGNER "1.3.6.1.4.1.311.10.3.19" #define szOID_REVOKED_LIST_SIGNER "1.3.6.1.4.1.311.10.3.19"
// Signer of Kits-built code
#define szOID_WINDOWS_KITS_SIGNER "1.3.6.1.4.1.311.10.3.20"
// Signer of Windows RT code
#define szOID_WINDOWS_RT_SIGNER "1.3.6.1.4.1.311.10.3.21"
// Signer of Protected Process Light code
#define szOID_PROTECTED_PROCESS_LIGHT_SIGNER "1.3.6.1.4.1.311.10.3.22"
// Signer of Windows TCB code
#define szOID_WINDOWS_TCB_SIGNER "1.3.6.1.4.1.311.10.3.23"
// Signer of Protected Process code
#define szOID_PROTECTED_PROCESS_SIGNER "1.3.6.1.4.1.311.10.3.24"
// Signer of third-party components that are Windows in box
#define szOID_WINDOWS_THIRD_PARTY_COMPONENT_SIGNER "1.3.6.1.4.1.311.10.3.25"
// Signed by the Windows Software Portal
#define szOID_WINDOWS_SOFTWARE_EXTENSION_SIGNER "1.3.6.1.4.1.311.10.3.26"
// CTL containing disallowed entries
#define szOID_DISALLOWED_LIST "1.3.6.1.4.1.311.10.3.30"
// The following extension is set in the disallowed CTL to trigger
// a quicker sync of the autorootupdate CTL
#define szOID_SYNC_ROOT_CTL_EXT "1.3.6.1.4.1.311.10.3.50"
// HAL Extensions
#define szOID_KP_KERNEL_MODE_HAL_EXTENSION_SIGNING "1.3.6.1.4.1.311.61.5.1"
// Signer of Windows Store applications
#define szOID_WINDOWS_STORE_SIGNER "1.3.6.1.4.1.311.76.3.1"
// Signer of dynamic code generators
#define szOID_DYNAMIC_CODE_GEN_SIGNER "1.3.6.1.4.1.311.76.5.1"
// Signer of Microsoft code
#define szOID_MICROSOFT_PUBLISHER_SIGNER "1.3.6.1.4.1.311.76.8.1"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Microsoft Attribute Object Identifiers // Microsoft Attribute Object Identifiers
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
#define szOID_YESNO_TRUST_ATTR "1.3.6.1.4.1.311.10.4.1" #define szOID_YESNO_TRUST_ATTR "1.3.6.1.4.1.311.10.4.1"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Qualifiers that may be part of the szOID_CERT_POLICIES and // Qualifiers that may be part of the szOID_CERT_POLICIES and
// szOID_CERT_POLICIES95 extensions // szOID_CERT_POLICIES95 extensions
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
#define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1" #define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1"
skipping to change at line 3644 skipping to change at line 3829
// meets Root Program Requirements for display. // meets Root Program Requirements for display.
#define CERT_ROOT_PROGRAM_FLAG_OU 0x10 #define CERT_ROOT_PROGRAM_FLAG_OU 0x10
// Validation of the address field in the subject name meets Root // Validation of the address field in the subject name meets Root
// Program Requirements for display. // Program Requirements for display.
#define CERT_ROOT_PROGRAM_FLAG_ADDRESS 0x08 #define CERT_ROOT_PROGRAM_FLAG_ADDRESS 0x08
// OID for old qualifer // OID for old qualifer
#define szOID_CERT_POLICIES_95_QUALIFIER1 "2.16.840.1.113733.1.7.1.1 " #define szOID_CERT_POLICIES_95_QUALIFIER1 "2.16.840.1.113733.1.7.1.1 "
//+=========================================================================
// TPM Object Identifiers
//-=========================================================================
// Subject Alt Name Directory Name RDNs
#define szOID_RDN_TPM_MANUFACTURER "2.23.133.2.1"
#define szOID_RDN_TPM_MODEL "2.23.133.2.2"
#define szOID_RDN_TPM_VERSION "2.23.133.2.3"
// TPM Manufacturer ASCII Hex Strings
// AMD "AMD" 0x41 0x4D 0x44 0x00
// Atmel "ATML" 0x41 0x54 0x4D 0x4C
// Broadcom "BRCM" 0x42 0x52 0x43 0x4D
// IBM "IBM" 0x49 0x42 0x4d 0x00
// Infineon "IFX" 0x49 0x46 0x58 0x00
// Intel "INTC" 0x49 0x4E 0x54 0x43
// Lenovo "LEN" 0x4C 0x45 0x4E 0x00
// National Semiconductor "NSM " 0x4E 0x53 0x4D 0x20
// Qualcomm "QCOM" 0x51 0x43 0x4F 0x4D
// SMSC "SMSC" 0x53 0x4D 0x53 0x43
// ST Microelectronics "STM " 0x53 0x54 0x4D 0x20
// Samsung "SMSN" 0x53 0x4D 0x53 0x4E
// Sinosun "SNS" 0x53 0x4E 0x53 0x00
// Texas Instruments "TXN" 0x54 0x58 0x4E 0x00
// Winbond "WEC" 0x57 0x45 0x43 0x00
//
// Obtained from: http://www.trustedcomputinggroup.org/files/static_page_files/B
4D74EEA-1A4B-B294-D022691CD8A6FD41/Vendor_ID_Registry_0.5_clean.pdf
// pkcs10 attributes
#define szOID_ENROLL_EK_INFO "1.3.6.1.4.1.311.21.23"
#define szOID_ENROLL_ATTESTATION_STATEMENT "1.3.6.1.4.1.311.21.24"
#define szOID_ENROLL_KSP_NAME "1.3.6.1.4.1.311.21.25" // pkcs10 an
d cmc full response
// ksp_name
encoded as a unicode
// string. S
ee CERT_RDN_UNICODE_STRING.
// on CERT_N
AME_VALUE structure. It
// must be n
ull terminated.
// CMC Full Response Tagged Attributes
#define szOID_ENROLL_EKPUB_CHALLENGE "1.3.6.1.4.1.311.21.26"
#define szOID_ENROLL_CAXCHGCERT_HASH "1.3.6.1.4.1.311.21.27"
#define szOID_ENROLL_ATTESTATION_CHALLENGE "1.3.6.1.4.1.311.21.28"
#define szOID_ENROLL_ENCRYPTION_ALGORITHM "1.3.6.1.4.1.311.21.29" // algorithm
oid
// TPM certificate EKU OIDs
#define szOID_KP_TPM_EK_CERTIFICATE "2.23.133.8.1"
#define szOID_KP_TPM_PLATFORM_CERTIFICATE "2.23.133.8.2"
#define szOID_KP_TPM_AIK_CERTIFICATE "2.23.133.8.3"
// EK validation Issuance Policy OIDs
#define szOID_ENROLL_EKVERIFYKEY "1.3.6.1.4.1.311.21.30"
#define szOID_ENROLL_EKVERIFYCERT "1.3.6.1.4.1.311.21.31"
#define szOID_ENROLL_EKVERIFYCREDS "1.3.6.1.4.1.311.21.32"
// Signed decimal string encoded as a Printable String
#define szOID_ENROLL_SCEP_ERROR "1.3.6.1.4.1.311.21.33"
// Subject Directory Attributes
#define szOID_ATTR_SUPPORTED_ALGORITHMS "2.5.4.52"
#define szOID_ATTR_TPM_SPECIFICATION "2.23.133.2.16"
#define szOID_ATTR_TPM_SECURITY_ASSERTIONS "2.23.133.2.18"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_CERT // X509_CERT
// //
// The "to be signed" encoded content plus its signature. The ToBeSigned // The "to be signed" encoded content plus its signature. The ToBeSigned
// content is the CryptEncodeObject() output for one of the following: // content is the CryptEncodeObject() output for one of the following:
// X509_CERT_TO_BE_SIGNED, X509_CERT_CRL_TO_BE_SIGNED or // X509_CERT_TO_BE_SIGNED, X509_CERT_CRL_TO_BE_SIGNED or
// X509_CERT_REQUEST_TO_BE_SIGNED. // X509_CERT_REQUEST_TO_BE_SIGNED.
// //
// pvStructInfo points to CERT_SIGNED_CONTENT_INFO. // pvStructInfo points to CERT_SIGNED_CONTENT_INFO.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 4189 skipping to change at line 4435
// pvStructInfo points to a CRYPT_ATTRIBUTE. // pvStructInfo points to a CRYPT_ATTRIBUTE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PKCS_ATTRIBUTES data structure // PKCS_ATTRIBUTES data structure
// //
// pvStructInfo points to a CRYPT_ATTRIBUTES. // pvStructInfo points to a CRYPT_ATTRIBUTES.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// szOID_SUBJECT_DIR_ATTRS
// X509_SUBJECT_DIR_ATTRS
//
// pvStructInfo points to a CRYPT_ATTRIBUTES.
//
// Encoded as a "SEQUENCE OF" instead of "SET OF"
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// PKCS_CONTENT_INFO_SEQUENCE_OF_ANY data structure // PKCS_CONTENT_INFO_SEQUENCE_OF_ANY data structure
// //
// pvStructInfo points to following CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY. // pvStructInfo points to following CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY.
// //
// For X509_ASN_ENCODING: encoded as a PKCS#7 ContentInfo structure wrapping // For X509_ASN_ENCODING: encoded as a PKCS#7 ContentInfo structure wrapping
// a sequence of ANY. The value of the contentType field is pszObjId, // a sequence of ANY. The value of the contentType field is pszObjId,
// while the content field is the following structure: // while the content field is the following structure:
// SequenceOfAny ::= SEQUENCE OF ANY // SequenceOfAny ::= SEQUENCE OF ANY
// //
// The CRYPT_DER_BLOBs point to the already encoded ANY content. // The CRYPT_DER_BLOBs point to the already encoded ANY content.
skipping to change at line 4906 skipping to change at line 5161
// Octet String containing IA5 string: lower case 32 char hex string // Octet String containing IA5 string: lower case 32 char hex string
#define szOID_VERISIGN_ONSITE_JURISDICTION_HASH "2.16.840.1.113733.1.6.11" #define szOID_VERISIGN_ONSITE_JURISDICTION_HASH "2.16.840.1.113733.1.6.11"
// Octet String containing Bit string // Octet String containing Bit string
#define szOID_VERISIGN_BITSTRING_6_13 "2.16.840.1.113733.1.6.13" #define szOID_VERISIGN_BITSTRING_6_13 "2.16.840.1.113733.1.6.13"
// EKU // EKU
#define szOID_VERISIGN_ISS_STRONG_CRYPTO "2.16.840.1.113733.1.8.1" #define szOID_VERISIGN_ISS_STRONG_CRYPTO "2.16.840.1.113733.1.8.1"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verisign SCEP Signed Pkcs7 authenticated attribute Object Identifiers
//--------------------------------------------------------------------------
// Signed decimal strings encoded as Printable String
#define szOIDVerisign_MessageType "2.16.840.1.113733.1.9.2"
#define szOIDVerisign_PkiStatus "2.16.840.1.113733.1.9.3"
#define szOIDVerisign_FailInfo "2.16.840.1.113733.1.9.4"
// Binary data encoded as Octet String
#define szOIDVerisign_SenderNonce "2.16.840.1.113733.1.9.5"
#define szOIDVerisign_RecipientNonce "2.16.840.1.113733.1.9.6"
// Binary data converted to hexadecimal string and encoded as Printable String
#define szOIDVerisign_TransactionID "2.16.840.1.113733.1.9.7"
//+-------------------------------------------------------------------------
// Netscape Certificate Extension Object Identifiers // Netscape Certificate Extension Object Identifiers
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define szOID_NETSCAPE "2.16.840.1.113730" #define szOID_NETSCAPE "2.16.840.1.113730"
#define szOID_NETSCAPE_CERT_EXTENSION "2.16.840.1.113730.1" #define szOID_NETSCAPE_CERT_EXTENSION "2.16.840.1.113730.1"
#define szOID_NETSCAPE_CERT_TYPE "2.16.840.1.113730.1.1" #define szOID_NETSCAPE_CERT_TYPE "2.16.840.1.113730.1.1"
#define szOID_NETSCAPE_BASE_URL "2.16.840.1.113730.1.2" #define szOID_NETSCAPE_BASE_URL "2.16.840.1.113730.1.2"
#define szOID_NETSCAPE_REVOCATION_URL "2.16.840.1.113730.1.3" #define szOID_NETSCAPE_REVOCATION_URL "2.16.840.1.113730.1.3"
#define szOID_NETSCAPE_CA_REVOCATION_URL "2.16.840.1.113730.1.4" #define szOID_NETSCAPE_CA_REVOCATION_URL "2.16.840.1.113730.1.4"
#define szOID_NETSCAPE_CERT_RENEWAL_URL "2.16.840.1.113730.1.7" #define szOID_NETSCAPE_CERT_RENEWAL_URL "2.16.840.1.113730.1.7"
#define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8" #define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8"
skipping to change at line 5631 skipping to change at line 5902
DWORD cExtension; DWORD cExtension;
PCERT_EXTENSION rgExtension; PCERT_EXTENSION rgExtension;
} OCSP_BASIC_RESPONSE_INFO, *POCSP_BASIC_RESPONSE_INFO; } OCSP_BASIC_RESPONSE_INFO, *POCSP_BASIC_RESPONSE_INFO;
#define OCSP_BASIC_RESPONSE_V1 0 #define OCSP_BASIC_RESPONSE_V1 0
#define OCSP_BASIC_BY_NAME_RESPONDER_ID 1 #define OCSP_BASIC_BY_NAME_RESPONDER_ID 1
#define OCSP_BASIC_BY_KEY_RESPONDER_ID 2 #define OCSP_BASIC_BY_KEY_RESPONDER_ID 2
//+========================================================================= //+=========================================================================
// TPM CryptEncodeObject/CryptDecodeObject Data Structures
//==========================================================================
//+-------------------------------------------------------------------------
// szOID_ATTR_SUPPORTED_ALGORITHMS
//
// pvStructInfo points to following CERT_SUPPORTED_ALGORITHM_INFO.
//--------------------------------------------------------------------------
typedef struct _CERT_SUPPORTED_ALGORITHM_INFO {
CRYPT_ALGORITHM_IDENTIFIER Algorithm;
CRYPT_BIT_BLOB IntendedKeyUsage; // OPTIONAL
CERT_POLICIES_INFO IntendedCertPolicies; // OPTIONAL
} CERT_SUPPORTED_ALGORITHM_INFO, *PCERT_SUPPORTED_ALGORITHM_INFO;
//+-------------------------------------------------------------------------
// szOID_ATTR_TPM_SPECIFICATION
//
// pvStructInfo points to following CERT_TPM_SPECIFICATION_INFO.
//--------------------------------------------------------------------------
typedef struct _CERT_TPM_SPECIFICATION_INFO {
LPWSTR pwszFamily; // Encoded as UTF8
DWORD dwLevel;
DWORD dwRevision;
} CERT_TPM_SPECIFICATION_INFO, *PCERT_TPM_SPECIFICATION_INFO;
//+=========================================================================
// Object IDentifier (OID) Installable Functions: Data Structures and APIs // Object IDentifier (OID) Installable Functions: Data Structures and APIs
//========================================================================== //==========================================================================
typedef void *HCRYPTOIDFUNCSET; typedef void *HCRYPTOIDFUNCSET;
typedef void *HCRYPTOIDFUNCADDR; typedef void *HCRYPTOIDFUNCADDR;
// Predefined OID Function Names // Predefined OID Function Names
#define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject" #define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject"
#define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject" #define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject"
#define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx" #define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx"
skipping to change at line 5669 skipping to change at line 5966
// CryptDllDecodeObjectEx has same function signature as CryptDecodeObjectEx. // CryptDllDecodeObjectEx has same function signature as CryptDecodeObjectEx.
// The Ex version MUST support the CRYPT_DECODE_ALLOC_FLAG option. // The Ex version MUST support the CRYPT_DECODE_ALLOC_FLAG option.
// //
// If an Ex function isn't installed or registered, then, attempts to find // If an Ex function isn't installed or registered, then, attempts to find
// a non-EX version. If the ALLOC flag is set, then, CryptDecodeObjectEx, // a non-EX version. If the ALLOC flag is set, then, CryptDecodeObjectEx,
// does the allocation and calls the non-EX version twice. // does the allocation and calls the non-EX version twice.
// CryptDllCreateCOMObject has the following signature: // CryptDllCreateCOMObject has the following signature:
// BOOL WINAPI CryptDllCreateCOMObject( // BOOL WINAPI CryptDllCreateCOMObject(
// __in DWORD dwEncodingType, // _In_ DWORD dwEncodingType,
// __in LPCSTR pszOID, // _In_ LPCSTR pszOID,
// __In PCRYPT_DATA_BLOB pEncodedContent, // __In PCRYPT_DATA_BLOB pEncodedContent,
// __in DWORD dwFlags, // _In_ DWORD dwFlags,
// __in REFIID riid, // _In_ REFIID riid,
// __deref_out void **ppvObj); // _Outptr_ void **ppvObj);
// CertDllVerifyRevocation has the same signature as CertVerifyRevocation // CertDllVerifyRevocation has the same signature as CertVerifyRevocation
// (See CertVerifyRevocation for details on when called) // (See CertVerifyRevocation for details on when called)
// CertDllVerifyCTLUsage has the same signature as CertVerifyCTLUsage // CertDllVerifyCTLUsage has the same signature as CertVerifyCTLUsage
// CryptDllFindOIDInfo currently is only used to store values used by // CryptDllFindOIDInfo currently is only used to store values used by
// CryptFindOIDInfo. See CryptFindOIDInfo() for more details. // CryptFindOIDInfo. See CryptFindOIDInfo() for more details.
// CryptDllFindLocalizedName is only used to store localized string // CryptDllFindLocalizedName is only used to store localized string
skipping to change at line 5736 skipping to change at line 6033
// case when the Dll has also regsvr32'ed OID functions via // case when the Dll has also regsvr32'ed OID functions via
// CryptRegisterOIDFunction. // CryptRegisterOIDFunction.
// //
// DEFAULT functions are installed by setting rgFuncEntry[].pszOID = // DEFAULT functions are installed by setting rgFuncEntry[].pszOID =
// CRYPT_DEFAULT_OID. // CRYPT_DEFAULT_OID.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptInstallOIDFunctionAddress( CryptInstallOIDFunctionAddress(
__in_opt HMODULE hModule, // hModule passed to DllMain _In_opt_ HMODULE hModule, // hModule passed to DllMain
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in DWORD cFuncEntry, _In_ DWORD cFuncEntry,
__in_ecount(cFuncEntry) const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], _In_reads_(cFuncEntry) const CRYPT_OID_FUNC_ENTRY rgFuncEntry[],
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Initialize and return handle to the OID function set identified by its // Initialize and return handle to the OID function set identified by its
// function name. // function name.
// //
// If the set already exists, a handle to the existing set is returned. // If the set already exists, a handle to the existing set is returned.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCRYPTOIDFUNCSET HCRYPTOIDFUNCSET
WINAPI WINAPI
CryptInitOIDFunctionSet( CryptInitOIDFunctionSet(
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Search the list of installed functions for an encoding type and OID match. // Search the list of installed functions for an encoding type and OID match.
// If not found, search the registry. // If not found, search the registry.
// //
// For success, returns TRUE with *ppvFuncAddr updated with the function's // For success, returns TRUE with *ppvFuncAddr updated with the function's
// address and *phFuncAddr updated with the function address's handle. // address and *phFuncAddr updated with the function address's handle.
// The function's handle is AddRef'ed. CryptFreeOIDFunctionAddress needs to // The function's handle is AddRef'ed. CryptFreeOIDFunctionAddress needs to
// be called to release it. // be called to release it.
skipping to change at line 5777 skipping to change at line 6074
// For a registry match, the Dll containing the function is loaded. // For a registry match, the Dll containing the function is loaded.
// //
// By default, both the registered and installed function lists are searched. // By default, both the registered and installed function lists are searched.
// Set CRYPT_GET_INSTALLED_OID_FUNC_FLAG to only search the installed list // Set CRYPT_GET_INSTALLED_OID_FUNC_FLAG to only search the installed list
// of functions. This flag would be set by a registered function to get // of functions. This flag would be set by a registered function to get
// the address of a pre-installed function it was replacing. For example, // the address of a pre-installed function it was replacing. For example,
// the registered function might handle a new special case and call the // the registered function might handle a new special case and call the
// pre-installed function to handle the remaining cases. // pre-installed function to handle the remaining cases.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CryptGetOIDFunctionAddress( CryptGetOIDFunctionAddress(
__in HCRYPTOIDFUNCSET hFuncSet, _In_ HCRYPTOIDFUNCSET hFuncSet,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszOID, _In_ LPCSTR pszOID,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_out void **ppvFuncAddr, _Outptr_ void **ppvFuncAddr,
__out HCRYPTOIDFUNCADDR *phFuncAddr _Out_ HCRYPTOIDFUNCADDR *phFuncAddr
); );
#define CRYPT_GET_INSTALLED_OID_FUNC_FLAG 0x1 #define CRYPT_GET_INSTALLED_OID_FUNC_FLAG 0x1
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the list of registered default Dll entries for the specified // Get the list of registered default Dll entries for the specified
// function set and encoding type. // function set and encoding type.
// //
// The returned list consists of none, one or more null terminated Dll file // The returned list consists of none, one or more null terminated Dll file
// names. The list is terminated with an empty (L"\0") Dll file name. // names. The list is terminated with an empty (L"\0") Dll file name.
// For example: L"first.dll" L"\0" L"second.dll" L"\0" L"\0" // For example: L"first.dll" L"\0" L"second.dll" L"\0" L"\0"
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
_Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CryptGetDefaultOIDDllList( CryptGetDefaultOIDDllList(
__in HCRYPTOIDFUNCSET hFuncSet, _In_ HCRYPTOIDFUNCSET hFuncSet,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__out_ecount_part_opt(*pcchDllList, *pcchDllList) __nullnullterminated WCHAR _Out_writes_to_opt_(*pcchDllList, *pcchDllList) _Post_ _NullNull_terminated_
*pwszDllList, WCHAR *pwszDllList,
__inout DWORD *pcchDllList _Inout_ DWORD *pcchDllList
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Either: get the first or next installed DEFAULT function OR // Either: get the first or next installed DEFAULT function OR
// load the Dll containing the DEFAULT function. // load the Dll containing the DEFAULT function.
// //
// If pwszDll is NULL, search the list of installed DEFAULT functions. // If pwszDll is NULL, search the list of installed DEFAULT functions.
// *phFuncAddr must be set to NULL to get the first installed function. // *phFuncAddr must be set to NULL to get the first installed function.
// Successive installed functions are returned by setting *phFuncAddr // Successive installed functions are returned by setting *phFuncAddr
// to the hFuncAddr returned by the previous call. // to the hFuncAddr returned by the previous call.
skipping to change at line 5833 skipping to change at line 6131
// function. *phFuncAddr is ignored upon entry and isn't // function. *phFuncAddr is ignored upon entry and isn't
// CryptFreeOIDFunctionAddress'ed. // CryptFreeOIDFunctionAddress'ed.
// //
// For success, returns TRUE with *ppvFuncAddr updated with the function's // For success, returns TRUE with *ppvFuncAddr updated with the function's
// address and *phFuncAddr updated with the function address's handle. // address and *phFuncAddr updated with the function address's handle.
// The function's handle is AddRef'ed. CryptFreeOIDFunctionAddress needs to // The function's handle is AddRef'ed. CryptFreeOIDFunctionAddress needs to
// be called to release it or CryptGetDefaultOIDFunctionAddress can also // be called to release it or CryptGetDefaultOIDFunctionAddress can also
// be called for a NULL pwszDll. // be called for a NULL pwszDll.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CryptGetDefaultOIDFunctionAddress( CryptGetDefaultOIDFunctionAddress(
__in HCRYPTOIDFUNCSET hFuncSet, _In_ HCRYPTOIDFUNCSET hFuncSet,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_opt LPCWSTR pwszDll, _In_opt_ LPCWSTR pwszDll,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_out void **ppvFuncAddr, _Outptr_ void **ppvFuncAddr,
__inout HCRYPTOIDFUNCADDR *phFuncAddr _Inout_ HCRYPTOIDFUNCADDR *phFuncAddr
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Releases the handle AddRef'ed and returned by CryptGetOIDFunctionAddress // Releases the handle AddRef'ed and returned by CryptGetOIDFunctionAddress
// or CryptGetDefaultOIDFunctionAddress. // or CryptGetDefaultOIDFunctionAddress.
// //
// If a Dll was loaded for the function its unloaded. However, before doing // If a Dll was loaded for the function its unloaded. However, before doing
// the unload, the DllCanUnloadNow function exported by the loaded Dll is // the unload, the DllCanUnloadNow function exported by the loaded Dll is
// called. It should return S_FALSE to inhibit the unload or S_TRUE to enable // called. It should return S_FALSE to inhibit the unload or S_TRUE to enable
// the unload. If the Dll doesn't export DllCanUnloadNow, the Dll is unloaded. // the unload. If the Dll doesn't export DllCanUnloadNow, the Dll is unloaded.
// //
// DllCanUnloadNow has the following signature: // DllCanUnloadNow has the following signature:
// STDAPI DllCanUnloadNow(void); // STDAPI DllCanUnloadNow(void);
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptFreeOIDFunctionAddress( CryptFreeOIDFunctionAddress(
__in HCRYPTOIDFUNCADDR hFuncAddr, _In_ HCRYPTOIDFUNCADDR hFuncAddr,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Register the Dll containing the function to be called for the specified // Register the Dll containing the function to be called for the specified
// encoding type, function name and OID. // encoding type, function name and OID.
// //
// pwszDll may contain environment-variable strings // pwszDll may contain environment-variable strings
// which are ExpandEnvironmentStrings()'ed before loading the Dll. // which are ExpandEnvironmentStrings()'ed before loading the Dll.
// //
// In addition to registering the DLL, you may override the // In addition to registering the DLL, you may override the
// name of the function to be called. For example, // name of the function to be called. For example,
// pszFuncName = "CryptDllEncodeObject", // pszFuncName = "CryptDllEncodeObject",
// pszOverrideFuncName = "MyEncodeXyz". // pszOverrideFuncName = "MyEncodeXyz".
// This allows a Dll to export multiple OID functions for the same // This allows a Dll to export multiple OID functions for the same
// function name without needing to interpose its own OID dispatcher function. // function name without needing to interpose its own OID dispatcher function.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptRegisterOIDFunction( CryptRegisterOIDFunction(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in LPCSTR pszOID, _In_ LPCSTR pszOID,
__in_opt LPCWSTR pwszDll, _In_opt_ LPCWSTR pwszDll,
__in_opt LPCSTR pszOverrideFuncName _In_opt_ LPCSTR pszOverrideFuncName
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Unregister the Dll containing the function to be called for the specified // Unregister the Dll containing the function to be called for the specified
// encoding type, function name and OID. // encoding type, function name and OID.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUnregisterOIDFunction( CryptUnregisterOIDFunction(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in LPCSTR pszOID _In_ LPCSTR pszOID
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Register the Dll containing the default function to be called for the // Register the Dll containing the default function to be called for the
// specified encoding type and function name. // specified encoding type and function name.
// //
// Unlike CryptRegisterOIDFunction, you can't override the function name // Unlike CryptRegisterOIDFunction, you can't override the function name
// needing to be exported by the Dll. // needing to be exported by the Dll.
// //
// The Dll is inserted before the entry specified by dwIndex. // The Dll is inserted before the entry specified by dwIndex.
// dwIndex == 0, inserts at the beginning. // dwIndex == 0, inserts at the beginning.
// dwIndex == CRYPT_REGISTER_LAST_INDEX, appends at the end. // dwIndex == CRYPT_REGISTER_LAST_INDEX, appends at the end.
// //
// pwszDll may contain environment-variable strings // pwszDll may contain environment-variable strings
// which are ExpandEnvironmentStrings()'ed before loading the Dll. // which are ExpandEnvironmentStrings()'ed before loading the Dll.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptRegisterDefaultOIDFunction( CryptRegisterDefaultOIDFunction(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__in LPCWSTR pwszDll _In_ LPCWSTR pwszDll
); );
#define CRYPT_REGISTER_FIRST_INDEX 0 #define CRYPT_REGISTER_FIRST_INDEX 0
#define CRYPT_REGISTER_LAST_INDEX 0xFFFFFFFF #define CRYPT_REGISTER_LAST_INDEX 0xFFFFFFFF
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Unregister the Dll containing the default function to be called for // Unregister the Dll containing the default function to be called for
// the specified encoding type and function name. // the specified encoding type and function name.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUnregisterDefaultOIDFunction( CryptUnregisterDefaultOIDFunction(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in LPCWSTR pwszDll _In_ LPCWSTR pwszDll
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Set the value for the specified encoding type, function name, OID and // Set the value for the specified encoding type, function name, OID and
// value name. // value name.
// //
// See RegSetValueEx for the possible value types. // See RegSetValueEx for the possible value types.
// //
// String types are UNICODE. // String types are UNICODE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSetOIDFunctionValue( CryptSetOIDFunctionValue(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in LPCSTR pszOID, _In_ LPCSTR pszOID,
__in_opt LPCWSTR pwszValueName, _In_opt_ LPCWSTR pwszValueName,
__in DWORD dwValueType, _In_ DWORD dwValueType,
__in_bcount_opt(cbValueData) const BYTE *pbValueData, _In_reads_bytes_opt_(cbValueData) const BYTE *pbValueData,
__in DWORD cbValueData _In_ DWORD cbValueData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the value for the specified encoding type, function name, OID and // Get the value for the specified encoding type, function name, OID and
// value name. // value name.
// //
// See RegEnumValue for the possible value types. // See RegEnumValue for the possible value types.
// //
// String types are UNICODE. // String types are UNICODE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptGetOIDFunctionValue( CryptGetOIDFunctionValue(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in LPCSTR pszOID, _In_ LPCSTR pszOID,
__in_opt LPCWSTR pwszValueName, _In_opt_ LPCWSTR pwszValueName,
__out_opt DWORD *pdwValueType, _Out_opt_ DWORD *pdwValueType,
__out_bcount_part_opt(*pcbValueData, *pcbValueData) BYTE *pbValueData, _Out_writes_bytes_to_opt_(*pcbValueData, *pcbValueData) BYTE *pbValueData,
__inout_opt DWORD *pcbValueData _Inout_opt_ DWORD *pcbValueData
); );
typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_FUNC)( typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_FUNC)(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in LPCSTR pszFuncName, _In_ LPCSTR pszFuncName,
__in LPCSTR pszOID, _In_ LPCSTR pszOID,
__in DWORD cValue, _In_ DWORD cValue,
__in_ecount(cValue) const DWORD rgdwValueType[], _In_reads_(cValue) const DWORD rgdwValueType[],
__in_ecount(cValue) LPCWSTR const rgpwszValueName[], _In_reads_(cValue) LPCWSTR const rgpwszValueName[],
__in_ecount(cValue) const BYTE * const rgpbValueData[], _In_reads_(cValue) const BYTE * const rgpbValueData[],
__in_ecount(cValue) const DWORD rgcbValueData[], _In_reads_(cValue) const DWORD rgcbValueData[],
__inout_opt void *pvArg _Inout_opt_ void *pvArg
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the OID functions identified by their encoding type, // Enumerate the OID functions identified by their encoding type,
// function name and OID. // function name and OID.
// //
// pfnEnumOIDFunc is called for each registry key matching the input // pfnEnumOIDFunc is called for each registry key matching the input
// parameters. Setting dwEncodingType to CRYPT_MATCH_ANY_ENCODING_TYPE matches // parameters. Setting dwEncodingType to CRYPT_MATCH_ANY_ENCODING_TYPE matches
// any. Setting pszFuncName or pszOID to NULL matches any. // any. Setting pszFuncName or pszOID to NULL matches any.
// //
// Set pszOID == CRYPT_DEFAULT_OID to restrict the enumeration to only the // Set pszOID == CRYPT_DEFAULT_OID to restrict the enumeration to only the
// DEFAULT functions // DEFAULT functions
// //
// String types are UNICODE. // String types are UNICODE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptEnumOIDFunction( CryptEnumOIDFunction(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_opt LPCSTR pszFuncName, _In_opt_ LPCSTR pszFuncName,
__in_opt LPCSTR pszOID, _In_opt_ LPCSTR pszOID,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__callback PFN_CRYPT_ENUM_OID_FUNC pfnEnumOIDFunc __callback PFN_CRYPT_ENUM_OID_FUNC pfnEnumOIDFunc
); );
#define CRYPT_MATCH_ANY_ENCODING_TYPE 0xFFFFFFFF #define CRYPT_MATCH_ANY_ENCODING_TYPE 0xFFFFFFFF
//+========================================================================= //+=========================================================================
// Object IDentifier (OID) Information: Data Structures and APIs // Object IDentifier (OID) Information: Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 6050 skipping to change at line 6348
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Special CNG Algorithms used in CRYPT_OID_INFO // Special CNG Algorithms used in CRYPT_OID_INFO
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM L"CryptOIDInfoHashParameters" #define CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM L"CryptOIDInfoHashParameters"
#define CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM L"CryptOIDInfoECCParameters" #define CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM L"CryptOIDInfoECCParameters"
#define CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM L"CryptOIDInfoMgf1Parameters" #define CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM L"CryptOIDInfoMgf1Parameters"
#define CRYPT_OID_INFO_NO_SIGN_ALGORITHM L"CryptOIDInfoNoSign" #define CRYPT_OID_INFO_NO_SIGN_ALGORITHM L"CryptOIDInfoNoSign"
#define CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM L"CryptOIDInfoOAEPParameters" #define CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM L"CryptOIDInfoOAEPParameters"
#define CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM L"CryptOIDInfoECCWrapParame ters" #define CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM L"CryptOIDInfoECCWrapParame ters"
#define CRYPT_OID_INFO_NO_PARAMETERS_ALGORITHM L"CryptOIDInfoNoParameters"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// OID Information // OID Information
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_OID_INFO { typedef struct _CRYPT_OID_INFO {
DWORD cbSize; DWORD cbSize;
LPCSTR pszOID; LPCSTR pszOID;
LPCWSTR pwszName; LPCWSTR pwszName;
DWORD dwGroupId; DWORD dwGroupId;
union { union {
skipping to change at line 6188 skipping to change at line 6487
// For CRYPT_OID_INFO_NAME_KEY, CRYPT_OID_INFO_CNG_ALGID_KEY and // For CRYPT_OID_INFO_NAME_KEY, CRYPT_OID_INFO_CNG_ALGID_KEY and
// CRYPT_OID_INFO_CNG_SIGN_KEY the string comparison is case insensitive. // CRYPT_OID_INFO_CNG_SIGN_KEY the string comparison is case insensitive.
// //
// Setting dwGroupId to 0, searches all groups according to the dwKeyType. // Setting dwGroupId to 0, searches all groups according to the dwKeyType.
// Otherwise, only the dwGroupId is searched. // Otherwise, only the dwGroupId is searched.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRYPT_OID_INFO PCCRYPT_OID_INFO
WINAPI WINAPI
CryptFindOIDInfo( CryptFindOIDInfo(
__in DWORD dwKeyType, _In_ DWORD dwKeyType,
__in void *pvKey, _In_ void *pvKey,
__in DWORD dwGroupId _In_ DWORD dwGroupId
); );
#define CRYPT_OID_INFO_OID_KEY 1 #define CRYPT_OID_INFO_OID_KEY 1
#define CRYPT_OID_INFO_NAME_KEY 2 #define CRYPT_OID_INFO_NAME_KEY 2
#define CRYPT_OID_INFO_ALGID_KEY 3 #define CRYPT_OID_INFO_ALGID_KEY 3
#define CRYPT_OID_INFO_SIGN_KEY 4 #define CRYPT_OID_INFO_SIGN_KEY 4
#define CRYPT_OID_INFO_CNG_ALGID_KEY 5 #define CRYPT_OID_INFO_CNG_ALGID_KEY 5
#define CRYPT_OID_INFO_CNG_SIGN_KEY 6 #define CRYPT_OID_INFO_CNG_SIGN_KEY 6
// Set the following in the above dwKeyType parameter to restrict public keys // Set the following in the above dwKeyType parameter to restrict public keys
skipping to change at line 6258 skipping to change at line 6557
// allows applications to augment crypt32.dll's OID information. During // allows applications to augment crypt32.dll's OID information. During
// CryptFindOIDInfo's first call, the registered OID information is installed. // CryptFindOIDInfo's first call, the registered OID information is installed.
// //
// By default the registered OID information is installed after crypt32.dll's // By default the registered OID information is installed after crypt32.dll's
// OID entries. Set CRYPT_INSTALL_OID_INFO_BEFORE_FLAG to install before. // OID entries. Set CRYPT_INSTALL_OID_INFO_BEFORE_FLAG to install before.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptRegisterOIDInfo( CryptRegisterOIDInfo(
__in PCCRYPT_OID_INFO pInfo, _In_ PCCRYPT_OID_INFO pInfo,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#define CRYPT_INSTALL_OID_INFO_BEFORE_FLAG 1 #define CRYPT_INSTALL_OID_INFO_BEFORE_FLAG 1
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Unregister OID information. Only the pszOID and dwGroupId fields are // Unregister OID information. Only the pszOID and dwGroupId fields are
// used to identify the OID information to be unregistered. // used to identify the OID information to be unregistered.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUnregisterOIDInfo( CryptUnregisterOIDInfo(
__in PCCRYPT_OID_INFO pInfo _In_ PCCRYPT_OID_INFO pInfo
); );
// If the callback returns FALSE, stops the enumeration. // If the callback returns FALSE, stops the enumeration.
typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_INFO)( typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_INFO)(
__in PCCRYPT_OID_INFO pInfo, _In_ PCCRYPT_OID_INFO pInfo,
__inout_opt void *pvArg _Inout_opt_ void *pvArg
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the OID information. // Enumerate the OID information.
// //
// pfnEnumOIDInfo is called for each OID information entry. // pfnEnumOIDInfo is called for each OID information entry.
// //
// Setting dwGroupId to 0 matches all groups. Otherwise, only enumerates // Setting dwGroupId to 0 matches all groups. Otherwise, only enumerates
// entries in the specified group. // entries in the specified group.
// //
// dwFlags currently isn't used and must be set to 0. // dwFlags currently isn't used and must be set to 0.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptEnumOIDInfo( CryptEnumOIDInfo(
__in DWORD dwGroupId, _In_ DWORD dwGroupId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__callback PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo __callback PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find the localized name for the specified name. For example, find the // Find the localized name for the specified name. For example, find the
// localized name for the "Root" system store name. A case insensitive // localized name for the "Root" system store name. A case insensitive
// string comparison is done. // string comparison is done.
// //
// Returns NULL if unable to find the the specified name. // Returns NULL if unable to find the the specified name.
// //
skipping to change at line 6328 skipping to change at line 6627
// cbValueData = (wcslen(UNICODE localized string) + 1) * sizeof(WCHAR) // cbValueData = (wcslen(UNICODE localized string) + 1) * sizeof(WCHAR)
// //
// To unregister, set pbValueData to NULL and cbValueData to 0. // To unregister, set pbValueData to NULL and cbValueData to 0.
// //
// The registered names are searched before the pre-installed names. // The registered names are searched before the pre-installed names.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
LPCWSTR LPCWSTR
WINAPI WINAPI
CryptFindLocalizedName( CryptFindLocalizedName(
__in LPCWSTR pwszCryptName _In_ LPCWSTR pwszCryptName
); );
#define CRYPT_LOCALIZED_NAME_ENCODING_TYPE 0 #define CRYPT_LOCALIZED_NAME_ENCODING_TYPE 0
#define CRYPT_LOCALIZED_NAME_OID "LocalizedNames" #define CRYPT_LOCALIZED_NAME_OID "LocalizedNames"
//+========================================================================= //+=========================================================================
// Certificate Strong Signature Defines and Data Structures
//==========================================================================
typedef struct _CERT_STRONG_SIGN_SERIALIZED_INFO {
DWORD dwFlags;
LPWSTR pwszCNGSignHashAlgids;
LPWSTR pwszCNGPubKeyMinBitLengths; // Optional
} CERT_STRONG_SIGN_SERIALIZED_INFO, *PCERT_STRONG_SIGN_SERIALIZED_INFO;
#define CERT_STRONG_SIGN_ECDSA_ALGORITHM L"ECDSA"
//
// Following CNG Signature Algorithms are supported
//
// #define BCRYPT_RSA_ALGORITHM L"RSA"
// #define BCRYPT_DSA_ALGORITHM L"DSA"
// #define CERT_STRONG_SIGN_ECDSA_ALGORITHM L"ECDSA"
//
//
// Following CNG Hash Algorithms are supported
//
// #define BCRYPT_MD5_ALGORITHM L"MD5"
// #define BCRYPT_SHA1_ALGORITHM L"SHA1"
// #define BCRYPT_SHA256_ALGORITHM L"SHA256"
// #define BCRYPT_SHA384_ALGORITHM L"SHA384"
// #define BCRYPT_SHA512_ALGORITHM L"SHA512"
//
typedef struct _CERT_STRONG_SIGN_PARA {
DWORD cbSize;
DWORD dwInfoChoice;
union {
void *pvInfo;
// CERT_STRONG_SIGN_SERIALIZED_INFO_CHOICE
PCERT_STRONG_SIGN_SERIALIZED_INFO pSerializedInfo;
// CERT_STRONG_SIGN_OID_INFO_CHOICE
LPSTR pszOID;
} DUMMYUNIONNAME;
} CERT_STRONG_SIGN_PARA, *PCERT_STRONG_SIGN_PARA;
typedef const CERT_STRONG_SIGN_PARA *PCCERT_STRONG_SIGN_PARA;
#define CERT_STRONG_SIGN_SERIALIZED_INFO_CHOICE 1
#define CERT_STRONG_SIGN_OID_INFO_CHOICE 2
// By default, strong signature checking isn't enabled for either
// CRLs or OCSP responses.
#define CERT_STRONG_SIGN_ENABLE_CRL_CHECK 0x1
#define CERT_STRONG_SIGN_ENABLE_OCSP_CHECK 0x2
//
// OID Strong Sign Parameters used by Windows OS Components
//
#define szOID_CERT_STRONG_SIGN_OS_PREFIX "1.3.6.1.4.1.311.72.1."
// OS_1 was supported starting with Windows 8
// Requires
// RSA keys >= 2047 or ECDSA >= 256 (DSA not allowed)
// SHA2 hashes (MD2, MD4, MD5 or SHA1 not allowed)
// Both CERT_STRONG_SIGN_ENABLE_CRL_CHECK and
// CERT_STRONG_SIGN_ENABLE_OCSP_CHECK are set
#define szOID_CERT_STRONG_SIGN_OS_1 "1.3.6.1.4.1.311.72.1.1"
#define szOID_CERT_STRONG_SIGN_OS_CURRENT szOID_CERT_STRONG_SIGN_OS_1
#define CERT_STRONG_SIGN_PARA_OS_1 \
{ \
sizeof(CERT_STRONG_SIGN_PARA), \
CERT_STRONG_SIGN_OID_INFO_CHOICE, \
szOID_CERT_STRONG_SIGN_OS_1 \
}
#define CERT_STRONG_SIGN_PARA_OS_CURRENT \
{ \
sizeof(CERT_STRONG_SIGN_PARA), \
CERT_STRONG_SIGN_OID_INFO_CHOICE, \
szOID_CERT_STRONG_SIGN_OS_CURRENT \
}
#define szOID_CERT_STRONG_KEY_OS_PREFIX "1.3.6.1.4.1.311.72.2."
// OS_1 was supported starting with Windows 8
// Requires
// RSA keys >= 2047 or ECDSA >= 256 (DSA not allowed)
// SHA1 or SHA2 hashes (MD2, MD4 or MD5 not allowed)
// Both CERT_STRONG_SIGN_ENABLE_CRL_CHECK and
// CERT_STRONG_SIGN_ENABLE_OCSP_CHECK are set
#define szOID_CERT_STRONG_KEY_OS_1 "1.3.6.1.4.1.311.72.2.1"
#define szOID_CERT_STRONG_KEY_OS_CURRENT szOID_CERT_STRONG_KEY_OS_1
#define CERT_STRONG_KEY_PARA_OS_1 \
{ \
sizeof(CERT_STRONG_SIGN_PARA), \
CERT_STRONG_SIGN_OID_INFO_CHOICE, \
szOID_CERT_STRONG_KEY_OS_1 \
}
#define CERT_STRONG_KEY_PARA_OS_CURRENT \
{ \
sizeof(CERT_STRONG_SIGN_PARA), \
CERT_STRONG_SIGN_OID_INFO_CHOICE, \
szOID_CERT_STRONG_KEY_OS_CURRENT \
}
//+=========================================================================
// Low Level Cryptographic Message Data Structures and APIs // Low Level Cryptographic Message Data Structures and APIs
//========================================================================== //==========================================================================
typedef void *HCRYPTMSG; typedef void *HCRYPTMSG;
#define szOID_PKCS_7_DATA "1.2.840.113549.1.7.1" #define szOID_PKCS_7_DATA "1.2.840.113549.1.7.1"
#define szOID_PKCS_7_SIGNED "1.2.840.113549.1.7.2" #define szOID_PKCS_7_SIGNED "1.2.840.113549.1.7.2"
#define szOID_PKCS_7_ENVELOPED "1.2.840.113549.1.7.3" #define szOID_PKCS_7_ENVELOPED "1.2.840.113549.1.7.3"
#define szOID_PKCS_7_SIGNEDANDENVELOPED "1.2.840.113549.1.7.4" #define szOID_PKCS_7_SIGNEDANDENVELOPED "1.2.840.113549.1.7.4"
#define szOID_PKCS_7_DIGESTED "1.2.840.113549.1.7.5" #define szOID_PKCS_7_DIGESTED "1.2.840.113549.1.7.5"
skipping to change at line 6871 skipping to change at line 7279
// called to get the cryptographically processed content. Until closed, // called to get the cryptographically processed content. Until closed,
// the handle keeps a copy of the processed content. // the handle keeps a copy of the processed content.
// //
// With streamed output, the processed content can be freed as its streamed. // With streamed output, the processed content can be freed as its streamed.
// //
// If the length of the content to be updated is known at the time of the // If the length of the content to be updated is known at the time of the
// open, then, ContentLength should be set to that length. Otherwise, it // open, then, ContentLength should be set to that length. Otherwise, it
// should be set to CMSG_INDEFINITE_LENGTH. // should be set to CMSG_INDEFINITE_LENGTH.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_CMSG_STREAM_OUTPUT)( typedef BOOL (WINAPI *PFN_CMSG_STREAM_OUTPUT)(
__in_opt const void *pvArg, _In_opt_ const void *pvArg,
__in_bcount_opt(cbData) BYTE *pbData, _In_reads_bytes_opt_(cbData) BYTE *pbData,
__in DWORD cbData, _In_ DWORD cbData,
__in BOOL fFinal _In_ BOOL fFinal
); );
#define CMSG_INDEFINITE_LENGTH (0xFFFFFFFF) #define CMSG_INDEFINITE_LENGTH (0xFFFFFFFF)
typedef struct _CMSG_STREAM_INFO { typedef struct _CMSG_STREAM_INFO {
DWORD cbContent; DWORD cbContent;
PFN_CMSG_STREAM_OUTPUT pfnStreamOutput; PFN_CMSG_STREAM_OUTPUT pfnStreamOutput;
void *pvArg; void *pvArg;
} CMSG_STREAM_INFO, *PCMSG_STREAM_INFO; } CMSG_STREAM_INFO, *PCMSG_STREAM_INFO;
skipping to change at line 6922 skipping to change at line 7330
// the streamed output will not have an outer ContentInfo wrapper. This // the streamed output will not have an outer ContentInfo wrapper. This
// makes it suitable to be streamed into an enclosing message. // makes it suitable to be streamed into an enclosing message.
// //
// The pStreamInfo parameter needs to be set to stream the encoded message // The pStreamInfo parameter needs to be set to stream the encoded message
// output. // output.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCRYPTMSG HCRYPTMSG
WINAPI WINAPI
CryptMsgOpenToEncode( CryptMsgOpenToEncode(
__in DWORD dwMsgEncodingType, _In_ DWORD dwMsgEncodingType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwMsgType, _In_ DWORD dwMsgType,
__in void const *pvMsgEncodeInfo, _In_ void const *pvMsgEncodeInfo,
__in_opt LPSTR pszInnerContentObjID, _In_opt_ LPSTR pszInnerContentObjID,
__in_opt PCMSG_STREAM_INFO pStreamInfo _In_opt_ PCMSG_STREAM_INFO pStreamInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Calculate the length of an encoded cryptographic message. // Calculate the length of an encoded cryptographic message.
// //
// Calculates the length of the encoded message given the // Calculates the length of the encoded message given the
// message type, encoding parameters and total length of // message type, encoding parameters and total length of
// the data to be updated. Note, this might not be the exact length. However, // the data to be updated. Note, this might not be the exact length. However,
// it will always be greater than or equal to the actual length. // it will always be greater than or equal to the actual length.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CryptMsgCalculateEncodedLength( CryptMsgCalculateEncodedLength(
__in DWORD dwMsgEncodingType, _In_ DWORD dwMsgEncodingType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwMsgType, _In_ DWORD dwMsgType,
__in void const *pvMsgEncodeInfo, _In_ void const *pvMsgEncodeInfo,
__in_opt LPSTR pszInnerContentObjID, _In_opt_ LPSTR pszInnerContentObjID,
__in DWORD cbData _In_ DWORD cbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Open a cryptographic message for decoding // Open a cryptographic message for decoding
// //
// hCryptProv specifies the crypto provider to use for hashing and/or // hCryptProv specifies the crypto provider to use for hashing and/or
// decrypting the message. If hCryptProv is NULL, a default crypt provider // decrypting the message. If hCryptProv is NULL, a default crypt provider
// is used. // is used.
// //
// Currently pRecipientInfo isn't used and should be set to NULL. // Currently pRecipientInfo isn't used and should be set to NULL.
// //
// The pStreamInfo parameter needs to be set to stream the decoded content // The pStreamInfo parameter needs to be set to stream the decoded content
// output. // output.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCRYPTMSG HCRYPTMSG
WINAPI WINAPI
CryptMsgOpenToDecode( CryptMsgOpenToDecode(
__in DWORD dwMsgEncodingType, _In_ DWORD dwMsgEncodingType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwMsgType, _In_ DWORD dwMsgType,
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__reserved PCERT_INFO pRecipientInfo, _Reserved_ PCERT_INFO pRecipientInfo,
__in_opt PCMSG_STREAM_INFO pStreamInfo _In_opt_ PCMSG_STREAM_INFO pStreamInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a cryptographic message handle // Duplicate a cryptographic message handle
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCRYPTMSG HCRYPTMSG
WINAPI WINAPI
CryptMsgDuplicate( CryptMsgDuplicate(
__in_opt HCRYPTMSG hCryptMsg _In_opt_ HCRYPTMSG hCryptMsg
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Close a cryptographic message handle // Close a cryptographic message handle
// //
// LastError is preserved unless FALSE is returned. // LastError is preserved unless FALSE is returned.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptMsgClose( CryptMsgClose(
__in_opt HCRYPTMSG hCryptMsg _In_opt_ HCRYPTMSG hCryptMsg
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Update the content of a cryptographic message. Depending on how the // Update the content of a cryptographic message. Depending on how the
// message was opened, the content is either encoded or decoded. // message was opened, the content is either encoded or decoded.
// //
// This function is repetitively called to append to the message content. // This function is repetitively called to append to the message content.
// fFinal is set to identify the last update. On fFinal, the encode/decode // fFinal is set to identify the last update. On fFinal, the encode/decode
// is completed. The encoded/decoded content and the decoded parameters // is completed. The encoded/decoded content and the decoded parameters
// are valid until the open and all duplicated handles are closed. // are valid until the open and all duplicated handles are closed.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptMsgUpdate( CryptMsgUpdate(
__in HCRYPTMSG hCryptMsg, _In_ HCRYPTMSG hCryptMsg,
__in_bcount_opt(cbData) const BYTE *pbData, _In_reads_bytes_opt_(cbData) const BYTE *pbData,
__in DWORD cbData, _In_ DWORD cbData,
__in BOOL fFinal _In_ BOOL fFinal
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get a parameter after encoding/decoding a cryptographic message. Called // Get a parameter after encoding/decoding a cryptographic message. Called
// after the final CryptMsgUpdate. Only the CMSG_CONTENT_PARAM and // after the final CryptMsgUpdate. Only the CMSG_CONTENT_PARAM and
// CMSG_COMPUTED_HASH_PARAM are valid for an encoded message. // CMSG_COMPUTED_HASH_PARAM are valid for an encoded message.
// //
// For an encoded HASHED message, the CMSG_COMPUTED_HASH_PARAM can be got // For an encoded HASHED message, the CMSG_COMPUTED_HASH_PARAM can be got
// before any CryptMsgUpdates to get its length. // before any CryptMsgUpdates to get its length.
// //
skipping to change at line 7043 skipping to change at line 7451
// The OBJID BLOBs returned in the pvData structures point to // The OBJID BLOBs returned in the pvData structures point to
// their still encoded representation. The appropriate functions // their still encoded representation. The appropriate functions
// must be called to decode the information. // must be called to decode the information.
// //
// See below for a list of the parameters to get. // See below for a list of the parameters to get.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptMsgGetParam( CryptMsgGetParam(
__in HCRYPTMSG hCryptMsg, _In_ HCRYPTMSG hCryptMsg,
__in DWORD dwParamType, _In_ DWORD dwParamType,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get parameter types and their corresponding data structure definitions. // Get parameter types and their corresponding data structure definitions.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMSG_TYPE_PARAM 1 #define CMSG_TYPE_PARAM 1
#define CMSG_CONTENT_PARAM 2 #define CMSG_CONTENT_PARAM 2
#define CMSG_BARE_CONTENT_PARAM 3 #define CMSG_BARE_CONTENT_PARAM 3
#define CMSG_INNER_CONTENT_TYPE_PARAM 4 #define CMSG_INNER_CONTENT_TYPE_PARAM 4
#define CMSG_SIGNER_COUNT_PARAM 5 #define CMSG_SIGNER_COUNT_PARAM 5
skipping to change at line 7576 skipping to change at line 7984
// //
// The pvCtrlPara definition depends on the dwCtrlType value. // The pvCtrlPara definition depends on the dwCtrlType value.
// //
// See below for a list of the control operations and their pvCtrlPara // See below for a list of the control operations and their pvCtrlPara
// type definition. // type definition.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptMsgControl( CryptMsgControl(
__in HCRYPTMSG hCryptMsg, _In_ HCRYPTMSG hCryptMsg,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwCtrlType, _In_ DWORD dwCtrlType,
__in_opt void const *pvCtrlPara _In_opt_ void const *pvCtrlPara
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Message control types // Message control types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMSG_CTRL_VERIFY_SIGNATURE 1 #define CMSG_CTRL_VERIFY_SIGNATURE 1
#define CMSG_CTRL_DECRYPT 2 #define CMSG_CTRL_DECRYPT 2
#define CMSG_CTRL_VERIFY_HASH 5 #define CMSG_CTRL_VERIFY_HASH 5
#define CMSG_CTRL_ADD_SIGNER 6 #define CMSG_CTRL_ADD_SIGNER 6
#define CMSG_CTRL_DEL_SIGNER 7 #define CMSG_CTRL_DEL_SIGNER 7
skipping to change at line 7603 skipping to change at line 8011
#define CMSG_CTRL_DEL_CERT 11 #define CMSG_CTRL_DEL_CERT 11
#define CMSG_CTRL_ADD_CRL 12 #define CMSG_CTRL_ADD_CRL 12
#define CMSG_CTRL_DEL_CRL 13 #define CMSG_CTRL_DEL_CRL 13
#define CMSG_CTRL_ADD_ATTR_CERT 14 #define CMSG_CTRL_ADD_ATTR_CERT 14
#define CMSG_CTRL_DEL_ATTR_CERT 15 #define CMSG_CTRL_DEL_ATTR_CERT 15
#define CMSG_CTRL_KEY_TRANS_DECRYPT 16 #define CMSG_CTRL_KEY_TRANS_DECRYPT 16
#define CMSG_CTRL_KEY_AGREE_DECRYPT 17 #define CMSG_CTRL_KEY_AGREE_DECRYPT 17
#define CMSG_CTRL_MAIL_LIST_DECRYPT 18 #define CMSG_CTRL_MAIL_LIST_DECRYPT 18
#define CMSG_CTRL_VERIFY_SIGNATURE_EX 19 #define CMSG_CTRL_VERIFY_SIGNATURE_EX 19
#define CMSG_CTRL_ADD_CMS_SIGNER_INFO 20 #define CMSG_CTRL_ADD_CMS_SIGNER_INFO 20
#define CMSG_CTRL_ENABLE_STRONG_SIGNATURE 21
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_VERIFY_SIGNATURE // CMSG_CTRL_VERIFY_SIGNATURE
// //
// Verify the signature of a SIGNED or SIGNED_AND_ENVELOPED // Verify the signature of a SIGNED or SIGNED_AND_ENVELOPED
// message after it has been decoded. // message after it has been decoded.
// //
// For a SIGNED_AND_ENVELOPED message, called after // For a SIGNED_AND_ENVELOPED message, called after
// CryptMsgControl(CMSG_CTRL_DECRYPT), if CryptMsgOpenToDecode was called // CryptMsgControl(CMSG_CTRL_DECRYPT), if CryptMsgOpenToDecode was called
// with a NULL pRecipientInfo. // with a NULL pRecipientInfo.
skipping to change at line 7669 skipping to change at line 8078
#define CMSG_VERIFY_SIGNER_PUBKEY 1 #define CMSG_VERIFY_SIGNER_PUBKEY 1
// pvSigner :: PCERT_PUBLIC_KEY_INFO // pvSigner :: PCERT_PUBLIC_KEY_INFO
#define CMSG_VERIFY_SIGNER_CERT 2 #define CMSG_VERIFY_SIGNER_CERT 2
// pvSigner :: PCCERT_CONTEXT // pvSigner :: PCCERT_CONTEXT
#define CMSG_VERIFY_SIGNER_CHAIN 3 #define CMSG_VERIFY_SIGNER_CHAIN 3
// pvSigner :: PCCERT_CHAIN_CONTEXT // pvSigner :: PCCERT_CHAIN_CONTEXT
#define CMSG_VERIFY_SIGNER_NULL 4 #define CMSG_VERIFY_SIGNER_NULL 4
// pvSigner :: NULL // pvSigner :: NULL
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_ENABLE_STRONG_SIGNATURE
//
// Enables Strong Signature Checking for subsequent verifies.
//
// pvCtrlPara points to a const CERT_STRONG_SIGN_PARA struct.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// CMSG_CTRL_DECRYPT // CMSG_CTRL_DECRYPT
// //
// Decrypt an ENVELOPED or SIGNED_AND_ENVELOPED message after it has been // Decrypt an ENVELOPED or SIGNED_AND_ENVELOPED message after it has been
// decoded. // decoded.
// //
// This decrypt is only applicable to key transport recipients. // This decrypt is only applicable to key transport recipients.
// //
// hCryptProv and dwKeySpec specify the private key to use. For dwKeySpec == // hCryptProv and dwKeySpec specify the private key to use. For dwKeySpec ==
// 0, defaults to AT_KEYEXCHANGE. // 0, defaults to AT_KEYEXCHANGE.
// //
skipping to change at line 7968 skipping to change at line 8385
// ie. verify that pbSignerInfoCountersignature contains the encrypted // ie. verify that pbSignerInfoCountersignature contains the encrypted
// hash of the encryptedDigest field of pbSignerInfo. // hash of the encryptedDigest field of pbSignerInfo.
// //
// hCryptProv is used to hash the encryptedDigest field of pbSignerInfo. // hCryptProv is used to hash the encryptedDigest field of pbSignerInfo.
// The only fields referenced from pciCountersigner are SerialNumber, Issuer, // The only fields referenced from pciCountersigner are SerialNumber, Issuer,
// and SubjectPublicKeyInfo. // and SubjectPublicKeyInfo.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
BOOL BOOL
WINAPI WINAPI
CryptMsgVerifyCountersignatureEncoded( CryptMsgVerifyCountersignatureEncoded(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_bcount(cbSignerInfo) PBYTE pbSignerInfo, _In_reads_bytes_(cbSignerInfo) PBYTE pbSignerInfo,
__in DWORD cbSignerInfo, _In_ DWORD cbSignerInfo,
__in_bcount(cbSignerInfoCountersignature) PBYTE pbSignerInfoCountersignature _In_reads_bytes_(cbSignerInfoCountersignature) PBYTE pbSignerInfoCountersign
, ature,
__in DWORD cbSignerInfoCountersignature, _In_ DWORD cbSignerInfoCountersignature,
__in PCERT_INFO pciCountersigner _In_ PCERT_INFO pciCountersigner
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify a countersignature, at the SignerInfo level. // Verify a countersignature, at the SignerInfo level.
// ie. verify that pbSignerInfoCountersignature contains the encrypted // ie. verify that pbSignerInfoCountersignature contains the encrypted
// hash of the encryptedDigest field of pbSignerInfo. // hash of the encryptedDigest field of pbSignerInfo.
// //
// hCryptProv is used to hash the encryptedDigest field of pbSignerInfo. // hCryptProv is used to hash the encryptedDigest field of pbSignerInfo.
// //
// The signer can be a CERT_PUBLIC_KEY_INFO, certificate context or a // The signer can be a CERT_PUBLIC_KEY_INFO, certificate context or a
// chain context. // chain context.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
BOOL BOOL
WINAPI WINAPI
CryptMsgVerifyCountersignatureEncodedEx( CryptMsgVerifyCountersignatureEncodedEx(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_bcount(cbSignerInfo) PBYTE pbSignerInfo, _In_reads_bytes_(cbSignerInfo) PBYTE pbSignerInfo,
__in DWORD cbSignerInfo, _In_ DWORD cbSignerInfo,
__in_bcount(cbSignerInfoCountersignature) PBYTE pbSignerInfoCountersignature _In_reads_bytes_(cbSignerInfoCountersignature) PBYTE pbSignerInfoCountersign
, ature,
__in DWORD cbSignerInfoCountersignature, _In_ DWORD cbSignerInfoCountersignature,
__in DWORD dwSignerType, _In_ DWORD dwSignerType,
__in void *pvSigner, _In_ void *pvSigner,
__reserved DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Inout_opt_ void *pvExtra
); );
// See CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA for dwSignerType definitions // See CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA for dwSignerType definitions
// When set, pvExtra points to const CERT_STRONG_SIGN_PARA struct
#define CMSG_VERIFY_COUNTER_SIGN_ENABLE_STRONG_FLAG 0x00000001
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Countersign an already-existing signature in a message // Countersign an already-existing signature in a message
// //
// dwIndex is a zero-based index of the SignerInfo to be countersigned. // dwIndex is a zero-based index of the SignerInfo to be countersigned.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
BOOL BOOL
WINAPI WINAPI
CryptMsgCountersign( CryptMsgCountersign(
__in HCRYPTMSG hCryptMsg, _In_ HCRYPTMSG hCryptMsg,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__in DWORD cCountersigners, _In_ DWORD cCountersigners,
__in_ecount(cCountersigners) PCMSG_SIGNER_ENCODE_INFO rgCountersigners _In_reads_(cCountersigners) PCMSG_SIGNER_ENCODE_INFO rgCountersigners
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Countersign an already-existing signature (encoded SignerInfo). // Countersign an already-existing signature (encoded SignerInfo).
// Output an encoded SignerInfo blob, suitable for use as a countersignature // Output an encoded SignerInfo blob, suitable for use as a countersignature
// attribute in the unauthenticated attributes of a signed-data or // attribute in the unauthenticated attributes of a signed-data or
// signed-and-enveloped-data message. // signed-and-enveloped-data message.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
BOOL BOOL
WINAPI WINAPI
CryptMsgCountersignEncoded( CryptMsgCountersignEncoded(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_bcount(cbSignerInfo) PBYTE pbSignerInfo, _In_reads_bytes_(cbSignerInfo) PBYTE pbSignerInfo,
__in DWORD cbSignerInfo, _In_ DWORD cbSignerInfo,
__in DWORD cCountersigners, _In_ DWORD cCountersigners,
__in_ecount(cCountersigners) PCMSG_SIGNER_ENCODE_INFO rgCountersigners, _In_reads_(cCountersigners) PCMSG_SIGNER_ENCODE_INFO rgCountersigners,
__out_bcount_part_opt(*pcbCountersignature, *pcbCountersignature) PBYTE pbCo _Out_writes_bytes_to_opt_(*pcbCountersignature, *pcbCountersignature) PBYTE
untersignature, pbCountersignature,
__inout PDWORD pcbCountersignature _Inout_ PDWORD pcbCountersignature
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CryptMsg OID installable functions // CryptMsg OID installable functions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef void * (WINAPI *PFN_CMSG_ALLOC) ( typedef void * (WINAPI *PFN_CMSG_ALLOC) (
__in size_t cb _In_ size_t cb
); );
typedef void (WINAPI *PFN_CMSG_FREE)( typedef void (WINAPI *PFN_CMSG_FREE)(
__inout void *pv _Inout_ void *pv
); );
// Note, the following 3 installable functions are obsolete and have been // Note, the following 3 installable functions are obsolete and have been
// replaced with GenContentEncryptKey, ExportKeyTrans, ExportKeyAgree, // replaced with GenContentEncryptKey, ExportKeyTrans, ExportKeyAgree,
// ExportMailList, ImportKeyTrans, ImportKeyAgree and ImportMailList // ExportMailList, ImportKeyTrans, ImportKeyAgree and ImportMailList
// installable functions. // installable functions.
// If *phCryptProv is NULL upon entry, then, if supported, the installable // If *phCryptProv is NULL upon entry, then, if supported, the installable
// function should acquire a default provider and return. Note, its up // function should acquire a default provider and return. Note, its up
// to the installable function to release at process detach. // to the installable function to release at process detach.
// //
// If paiEncrypt->Parameters.cbData is 0, then, the callback may optionally // If paiEncrypt->Parameters.cbData is 0, then, the callback may optionally
// return default encoded parameters in *ppbEncryptParameters and // return default encoded parameters in *ppbEncryptParameters and
// *pcbEncryptParameters. pfnAlloc must be called for the allocation. // *pcbEncryptParameters. pfnAlloc must be called for the allocation.
#define CMSG_OID_GEN_ENCRYPT_KEY_FUNC "CryptMsgDllGenEncryptKey" #define CMSG_OID_GEN_ENCRYPT_KEY_FUNC "CryptMsgDllGenEncryptKey"
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CMSG_GEN_ENCRYPT_KEY) ( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CMSG_GEN_ENCRYPT_KEY) (
__inout HCRYPTPROV *phCryptProv, _Inout_ HCRYPTPROV *phCryptProv,
__in PCRYPT_ALGORITHM_IDENTIFIER paiEncrypt, _In_ PCRYPT_ALGORITHM_IDENTIFIER paiEncrypt,
__in_opt PVOID pvEncryptAuxInfo, _In_opt_ PVOID pvEncryptAuxInfo,
__in PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, _In_ PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
__callback PFN_CMSG_ALLOC pfnAlloc, __callback PFN_CMSG_ALLOC pfnAlloc,
__out HCRYPTKEY *phEncryptKey, _Out_ HCRYPTKEY *phEncryptKey,
__deref_out_bcount(*pcbEncryptParameters) PBYTE *ppbEncryptParameters, _Outptr_result_bytebuffer_(*pcbEncryptParameters) PBYTE *ppbEncryptParameter
__out PDWORD pcbEncryptParameters s,
_Out_ PDWORD pcbEncryptParameters
); );
#define CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC "CryptMsgDllExportEncryptKey" #define CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC "CryptMsgDllExportEncryptKey"
typedef BOOL (WINAPI *PFN_CMSG_EXPORT_ENCRYPT_KEY) ( typedef BOOL (WINAPI *PFN_CMSG_EXPORT_ENCRYPT_KEY) (
__in HCRYPTPROV hCryptProv, _In_ HCRYPTPROV hCryptProv,
__in HCRYPTKEY hEncryptKey, _In_ HCRYPTKEY hEncryptKey,
__in PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, _In_ PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
__out_bcount_part_opt(*pcbData, *pcbData) PBYTE pbData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) PBYTE pbData,
__inout PDWORD pcbData _Inout_ PDWORD pcbData
); );
#define CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC "CryptMsgDllImportEncryptKey" #define CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC "CryptMsgDllImportEncryptKey"
typedef BOOL (WINAPI *PFN_CMSG_IMPORT_ENCRYPT_KEY) ( typedef BOOL (WINAPI *PFN_CMSG_IMPORT_ENCRYPT_KEY) (
__in HCRYPTPROV hCryptProv, _In_ HCRYPTPROV hCryptProv,
__in DWORD dwKeySpec, _In_ DWORD dwKeySpec,
__in PCRYPT_ALGORITHM_IDENTIFIER paiEncrypt, _In_ PCRYPT_ALGORITHM_IDENTIFIER paiEncrypt,
__in PCRYPT_ALGORITHM_IDENTIFIER paiPubKey, _In_ PCRYPT_ALGORITHM_IDENTIFIER paiPubKey,
__in_bcount(cbEncodedKey) PBYTE pbEncodedKey, _In_reads_bytes_(cbEncodedKey) PBYTE pbEncodedKey,
__in DWORD cbEncodedKey, _In_ DWORD cbEncodedKey,
__out HCRYPTKEY *phEncryptKey _Out_ HCRYPTKEY *phEncryptKey
); );
// To get the default installable function for GenContentEncryptKey, // To get the default installable function for GenContentEncryptKey,
// ExportKeyTrans, ExportKeyAgree, ExportMailList, ImportKeyTrans, // ExportKeyTrans, ExportKeyAgree, ExportMailList, ImportKeyTrans,
// ImportKeyAgree or ImportMailList call CryptGetOIDFunctionAddress() // ImportKeyAgree or ImportMailList call CryptGetOIDFunctionAddress()
// with the pszOID argument set to the following constant. dwEncodingType // with the pszOID argument set to the following constant. dwEncodingType
// should be set to CRYPT_ASN_ENCODING or X509_ASN_ENCODING. // should be set to CRYPT_ASN_ENCODING or X509_ASN_ENCODING.
#define CMSG_DEFAULT_INSTALLABLE_FUNC_OID ((LPCSTR) 1) #define CMSG_DEFAULT_INSTALLABLE_FUNC_OID ((LPCSTR) 1)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 8203 skipping to change at line 8623
// pfnFree must be used for doing the allocation. // pfnFree must be used for doing the allocation.
// //
// ContentEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress. // ContentEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The following CAPI1 installable function is called when fCNG == FALSE. // The following CAPI1 installable function is called when fCNG == FALSE.
#define CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllGenContentEncryptKey" #define CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllGenContentEncryptKey"
#define CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC CMSG_OID_GEN_CONTENT_ENCRYPT _KEY_FUNC #define CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC CMSG_OID_GEN_CONTENT_ENCRYPT _KEY_FUNC
typedef BOOL (WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY) ( typedef BOOL (WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY) (
__inout PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, _Inout_ PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
// The following installable function is called when fCNG == TRUE. It has the // The following installable function is called when fCNG == TRUE. It has the
// same API signature as for the above // same API signature as for the above
// CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC. // CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC.
#define CMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllCNGGenContentEncr yptKey" #define CMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllCNGGenContentEncr yptKey"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Key Transport Encrypt Info // Key Transport Encrypt Info
// //
skipping to change at line 8260 skipping to change at line 8680
// for doing the allocation. // for doing the allocation.
// //
// KeyEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress. // KeyEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The following CAPI1 installable function is called when // The following CAPI1 installable function is called when
// pContentEncryptInfo->fCNG == FALSE. // pContentEncryptInfo->fCNG == FALSE.
#define CMSG_OID_EXPORT_KEY_TRANS_FUNC "CryptMsgDllExportKeyTrans" #define CMSG_OID_EXPORT_KEY_TRANS_FUNC "CryptMsgDllExportKeyTrans"
#define CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC CMSG_OID_EXPORT_KEY_TRANS_FUNC #define CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC CMSG_OID_EXPORT_KEY_TRANS_FUNC
typedef BOOL (WINAPI *PFN_CMSG_EXPORT_KEY_TRANS) ( typedef BOOL (WINAPI *PFN_CMSG_EXPORT_KEY_TRANS) (
__in PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, _In_ PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
__in PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTransEncodeInfo, _In_ PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTransEncodeInfo,
__inout PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo, _Inout_ PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
// The following CNG installable function is called when // The following CNG installable function is called when
// pContentEncryptInfo->fCNG == TRUE. It has the same API signature as for // pContentEncryptInfo->fCNG == TRUE. It has the same API signature as for
// the above CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC. // the above CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC.
#define CMSG_OID_CNG_EXPORT_KEY_TRANS_FUNC "CryptMsgDllCNGExportKeyTrans" #define CMSG_OID_CNG_EXPORT_KEY_TRANS_FUNC "CryptMsgDllCNGExportKeyTrans"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Key Agree Key Encrypt Info // Key Agree Key Encrypt Info
// //
skipping to change at line 8366 skipping to change at line 8786
// ContentEncryptInfo must be used for doing the allocation. // ContentEncryptInfo must be used for doing the allocation.
// //
// KeyEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress. // KeyEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The following CAPI1 installable function is called when // The following CAPI1 installable function is called when
// pContentEncryptInfo->fCNG == FALSE. // pContentEncryptInfo->fCNG == FALSE.
#define CMSG_OID_EXPORT_KEY_AGREE_FUNC "CryptMsgDllExportKeyAgree" #define CMSG_OID_EXPORT_KEY_AGREE_FUNC "CryptMsgDllExportKeyAgree"
#define CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC CMSG_OID_EXPORT_KEY_AGREE_FUNC #define CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC CMSG_OID_EXPORT_KEY_AGREE_FUNC
typedef BOOL (WINAPI *PFN_CMSG_EXPORT_KEY_AGREE) ( typedef BOOL (WINAPI *PFN_CMSG_EXPORT_KEY_AGREE) (
__in PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, _In_ PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
__in PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO pKeyAgreeEncodeInfo, _In_ PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO pKeyAgreeEncodeInfo,
__inout PCMSG_KEY_AGREE_ENCRYPT_INFO pKeyAgreeEncryptInfo, _Inout_ PCMSG_KEY_AGREE_ENCRYPT_INFO pKeyAgreeEncryptInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
// The following CNG installable function is called when // The following CNG installable function is called when
// pContentEncryptInfo->fCNG == TRUE. It has the same API signature as for // pContentEncryptInfo->fCNG == TRUE. It has the same API signature as for
// the above CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC. // the above CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC.
#define CMSG_OID_CNG_EXPORT_KEY_AGREE_FUNC "CryptMsgDllCNGExportKeyAgree" #define CMSG_OID_CNG_EXPORT_KEY_AGREE_FUNC "CryptMsgDllCNGExportKeyAgree"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Mail List Encrypt Info // Mail List Encrypt Info
// //
skipping to change at line 8426 skipping to change at line 8846
// //
// KeyEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress. // KeyEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress.
// //
// Note, only has a CAPI1 installable function. No CNG installable function. // Note, only has a CAPI1 installable function. No CNG installable function.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The following CAPI1 installable function is called when // The following CAPI1 installable function is called when
// pContentEncryptInfo->fCNG == FALSE. // pContentEncryptInfo->fCNG == FALSE.
#define CMSG_OID_EXPORT_MAIL_LIST_FUNC "CryptMsgDllExportMailList" #define CMSG_OID_EXPORT_MAIL_LIST_FUNC "CryptMsgDllExportMailList"
#define CMSG_OID_CAPI1_EXPORT_MAIL_LIST_FUNC CMSG_OID_EXPORT_MAIL_LIST_FUNC #define CMSG_OID_CAPI1_EXPORT_MAIL_LIST_FUNC CMSG_OID_EXPORT_MAIL_LIST_FUNC
typedef BOOL (WINAPI *PFN_CMSG_EXPORT_MAIL_LIST) ( typedef BOOL (WINAPI *PFN_CMSG_EXPORT_MAIL_LIST) (
__in PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, _In_ PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
__in PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO pMailListEncodeInfo, _In_ PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO pMailListEncodeInfo,
__inout PCMSG_MAIL_LIST_ENCRYPT_INFO pMailListEncryptInfo, _Inout_ PCMSG_MAIL_LIST_ENCRYPT_INFO pMailListEncryptInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CAPI1 OID Installable functions for importing an encoded and encrypted // CAPI1 OID Installable functions for importing an encoded and encrypted
// content encryption key. // content encryption key.
// //
// There's a different installable function for each CMS Recipient choice: // There's a different installable function for each CMS Recipient choice:
// ImportKeyTrans // ImportKeyTrans
// ImportKeyAgree // ImportKeyAgree
// ImportMailList // ImportMailList
skipping to change at line 8454 skipping to change at line 8874
// KeyEncryptionOID // KeyEncryptionOID
// ContentEncryptionOID // ContentEncryptionOID
// //
// If the OID installable function doesn't support the specified // If the OID installable function doesn't support the specified
// KeyEncryption and ContentEncryption OIDs, then, return FALSE with // KeyEncryption and ContentEncryption OIDs, then, return FALSE with
// LastError set to E_NOTIMPL. // LastError set to E_NOTIMPL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMSG_OID_IMPORT_KEY_TRANS_FUNC "CryptMsgDllImportKeyTrans" #define CMSG_OID_IMPORT_KEY_TRANS_FUNC "CryptMsgDllImportKeyTrans"
#define CMSG_OID_CAPI1_IMPORT_KEY_TRANS_FUNC CMSG_OID_IMPORT_KEY_TRANS_FUNC #define CMSG_OID_CAPI1_IMPORT_KEY_TRANS_FUNC CMSG_OID_IMPORT_KEY_TRANS_FUNC
typedef BOOL (WINAPI *PFN_CMSG_IMPORT_KEY_TRANS) ( typedef BOOL (WINAPI *PFN_CMSG_IMPORT_KEY_TRANS) (
__in PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm,
__in PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA pKeyTransDecryptPara, _In_ PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA pKeyTransDecryptPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out HCRYPTKEY *phContentEncryptKey _Out_ HCRYPTKEY *phContentEncryptKey
); );
#define CMSG_OID_IMPORT_KEY_AGREE_FUNC "CryptMsgDllImportKeyAgree" #define CMSG_OID_IMPORT_KEY_AGREE_FUNC "CryptMsgDllImportKeyAgree"
#define CMSG_OID_CAPI1_IMPORT_KEY_AGREE_FUNC CMSG_OID_IMPORT_KEY_AGREE_FUNC #define CMSG_OID_CAPI1_IMPORT_KEY_AGREE_FUNC CMSG_OID_IMPORT_KEY_AGREE_FUNC
typedef BOOL (WINAPI *PFN_CMSG_IMPORT_KEY_AGREE) ( typedef BOOL (WINAPI *PFN_CMSG_IMPORT_KEY_AGREE) (
__in PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm,
__in PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA pKeyAgreeDecryptPara, _In_ PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA pKeyAgreeDecryptPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out HCRYPTKEY *phContentEncryptKey _Out_ HCRYPTKEY *phContentEncryptKey
); );
#define CMSG_OID_IMPORT_MAIL_LIST_FUNC "CryptMsgDllImportMailList" #define CMSG_OID_IMPORT_MAIL_LIST_FUNC "CryptMsgDllImportMailList"
#define CMSG_OID_CAPI1_IMPORT_MAIL_LIST_FUNC CMSG_OID_IMPORT_MAIL_LIST_FUNC #define CMSG_OID_CAPI1_IMPORT_MAIL_LIST_FUNC CMSG_OID_IMPORT_MAIL_LIST_FUNC
typedef BOOL (WINAPI *PFN_CMSG_IMPORT_MAIL_LIST) ( typedef BOOL (WINAPI *PFN_CMSG_IMPORT_MAIL_LIST) (
__in PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm,
__in PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA pMailListDecryptPara, _In_ PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA pMailListDecryptPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out HCRYPTKEY *phContentEncryptKey _Out_ HCRYPTKEY *phContentEncryptKey
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CNG Content Decrypt Info // CNG Content Decrypt Info
// //
// The following data structure contains the information shared between // The following data structure contains the information shared between
// CNGImportKeyTrans, CNGImportKeyAgree and CNGImportContentEncryptKey // CNGImportKeyTrans, CNGImportKeyAgree and CNGImportContentEncryptKey
// installable functions. // installable functions.
// //
// pbContentEncryptKey and pbCNGContentEncryptKeyObject are allocated // pbContentEncryptKey and pbCNGContentEncryptKeyObject are allocated
skipping to change at line 8527 skipping to change at line 8947
// pbContentEncryptKey (pfnAlloc'ed) // pbContentEncryptKey (pfnAlloc'ed)
// cbContentEncryptKey // cbContentEncryptKey
// //
// All other fields in the CNGContentEncryptInfo are READONLY. // All other fields in the CNGContentEncryptInfo are READONLY.
// //
// pKeyTransDecryptPara->pKeyTrans->KeyEncryptionAlgorithm.pszObjId is used // pKeyTransDecryptPara->pKeyTrans->KeyEncryptionAlgorithm.pszObjId is used
// to get the OIDFunctionAddress. // to get the OIDFunctionAddress.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMSG_OID_CNG_IMPORT_KEY_TRANS_FUNC "CryptMsgDllCNGImportKeyTrans" #define CMSG_OID_CNG_IMPORT_KEY_TRANS_FUNC "CryptMsgDllCNGImportKeyTrans"
typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_KEY_TRANS) ( typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_KEY_TRANS) (
__inout PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo, _Inout_ PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
__in PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA pKeyTransDecryptPara, _In_ PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA pKeyTransDecryptPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CNG OID Installable function for importing and decrypting a key agreement // CNG OID Installable function for importing and decrypting a key agreement
// recipient encrypted content encryption key. // recipient encrypted content encryption key.
// //
// Upon input, CNGContentDecryptInfo has been initialized. // Upon input, CNGContentDecryptInfo has been initialized.
// //
// The following fields must be updated using hNCryptKey to decrypt // The following fields must be updated using hNCryptKey to decrypt
// pKeyAgreeDecryptPara->pKeyAgree->rgpRecipientEncryptedKeys[ // pKeyAgreeDecryptPara->pKeyAgree->rgpRecipientEncryptedKeys[
skipping to change at line 8552 skipping to change at line 8972
// pbContentEncryptKey (pfnAlloc'ed) // pbContentEncryptKey (pfnAlloc'ed)
// cbContentEncryptKey // cbContentEncryptKey
// //
// All other fields in the CNGContentEncryptInfo are READONLY. // All other fields in the CNGContentEncryptInfo are READONLY.
// //
// pKeyAgreeDecryptPara->pKeyAgree->KeyEncryptionAlgorithm.pszObjId is used // pKeyAgreeDecryptPara->pKeyAgree->KeyEncryptionAlgorithm.pszObjId is used
// to get the OIDFunctionAddress. // to get the OIDFunctionAddress.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMSG_OID_CNG_IMPORT_KEY_AGREE_FUNC "CryptMsgDllCNGImportKeyAgree" #define CMSG_OID_CNG_IMPORT_KEY_AGREE_FUNC "CryptMsgDllCNGImportKeyAgree"
typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_KEY_AGREE) ( typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_KEY_AGREE) (
__inout PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo, _Inout_ PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
__in PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA pKeyAgreeDecryptPara, _In_ PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA pKeyAgreeDecryptPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CNG OID Installable function for importing an already decrypted // CNG OID Installable function for importing an already decrypted
// content encryption key. // content encryption key.
// //
// Upon input, CNGContentDecryptInfo has been initialized. // Upon input, CNGContentDecryptInfo has been initialized.
// //
// The following fields must be updated using pbContentEncryptKey and // The following fields must be updated using pbContentEncryptKey and
// cbContentEncryptKey: // cbContentEncryptKey:
skipping to change at line 8577 skipping to change at line 8997
// pbCNGContentEncryptKeyObject (pfnAlloc'ed) // pbCNGContentEncryptKeyObject (pfnAlloc'ed)
// //
// The hCNGContentEncryptKey will be destroyed when hCryptMsg is closed. // The hCNGContentEncryptKey will be destroyed when hCryptMsg is closed.
// //
// All other fields in the CNGContentEncryptInfo are READONLY. // All other fields in the CNGContentEncryptInfo are READONLY.
// //
// ContentEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress. // ContentEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllCNGImportConte ntEncryptKey" #define CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllCNGImportConte ntEncryptKey"
typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY) ( typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY) (
__inout PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo, _Inout_ PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+========================================================================= //+=========================================================================
// Certificate Store Data Structures and APIs // Certificate Store Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// In its most basic implementation, a cert store is simply a // In its most basic implementation, a cert store is simply a
// collection of certificates and/or CRLs. This is the case when // collection of certificates and/or CRLs. This is the case when
// a cert store is opened with all of its certificates and CRLs // a cert store is opened with all of its certificates and CRLs
skipping to change at line 8655 skipping to change at line 9075
// If these properties don't already exist, then, a hash of the // If these properties don't already exist, then, a hash of the
// content is computed. (CERT_HASH_PROP_ID maps to the default // content is computed. (CERT_HASH_PROP_ID maps to the default
// hash algorithm, currently, CERT_SHA1_HASH_PROP_ID). // hash algorithm, currently, CERT_SHA1_HASH_PROP_ID).
// //
// There are additional APIs for creating certificate and CRL // There are additional APIs for creating certificate and CRL
// contexts not in a store (CertCreateCertificateContext and // contexts not in a store (CertCreateCertificateContext and
// CertCreateCRLContext). // CertCreateCRLContext).
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
typedef void *HCERTSTORE; typedef void *HCERTSTORE;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate context. // Certificate context.
// //
// A certificate context contains both the encoded and decoded representation // A certificate context contains both the encoded and decoded representation
// of a certificate. A certificate context returned by a cert store function // of a certificate. A certificate context returned by a cert store function
// must be freed by calling the CertFreeCertificateContext function. The // must be freed by calling the CertFreeCertificateContext function. The
// CertDuplicateCertificateContext function can be called to make a duplicate // CertDuplicateCertificateContext function can be called to make a duplicate
// copy (which also must be freed by calling CertFreeCertificateContext). // copy (which also must be freed by calling CertFreeCertificateContext).
skipping to change at line 8677 skipping to change at line 9103
typedef struct _CERT_CONTEXT { typedef struct _CERT_CONTEXT {
DWORD dwCertEncodingType; DWORD dwCertEncodingType;
BYTE *pbCertEncoded; BYTE *pbCertEncoded;
DWORD cbCertEncoded; DWORD cbCertEncoded;
PCERT_INFO pCertInfo; PCERT_INFO pCertInfo;
HCERTSTORE hCertStore; HCERTSTORE hCertStore;
} CERT_CONTEXT, *PCERT_CONTEXT; } CERT_CONTEXT, *PCERT_CONTEXT;
typedef const CERT_CONTEXT *PCCERT_CONTEXT; typedef const CERT_CONTEXT *PCCERT_CONTEXT;
// certenrolls_end // certenrolls_end
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRL context. // CRL context.
// //
// A CRL context contains both the encoded and decoded representation // A CRL context contains both the encoded and decoded representation
// of a CRL. A CRL context returned by a cert store function // of a CRL. A CRL context returned by a cert store function
// must be freed by calling the CertFreeCRLContext function. The // must be freed by calling the CertFreeCRLContext function. The
// CertDuplicateCRLContext function can be called to make a duplicate // CertDuplicateCRLContext function can be called to make a duplicate
// copy (which also must be freed by calling CertFreeCRLContext). // copy (which also must be freed by calling CertFreeCRLContext).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRL_CONTEXT { typedef struct _CRL_CONTEXT {
skipping to change at line 8752 skipping to change at line 9184
#define CERT_EFS_PROP_ID 17 #define CERT_EFS_PROP_ID 17
#define CERT_FORTEZZA_DATA_PROP_ID 18 #define CERT_FORTEZZA_DATA_PROP_ID 18
#define CERT_ARCHIVED_PROP_ID 19 #define CERT_ARCHIVED_PROP_ID 19
#define CERT_KEY_IDENTIFIER_PROP_ID 20 #define CERT_KEY_IDENTIFIER_PROP_ID 20
#define CERT_AUTO_ENROLL_PROP_ID 21 // string:Template name #define CERT_AUTO_ENROLL_PROP_ID 21 // string:Template name
#define CERT_PUBKEY_ALG_PARA_PROP_ID 22 #define CERT_PUBKEY_ALG_PARA_PROP_ID 22
#define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23 #define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23
#define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24 #define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24
#define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25 #define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25
#define CERT_ENROLLMENT_PROP_ID 26 // RequestId+CADNS+CACN+Friendly Name #define CERT_ENROLLMENT_PROP_ID 26 // RequestId+CADNS+CACN+Friendly Name
#define CERT_DATE_STAMP_PROP_ID 27 #define CERT_DATE_STAMP_PROP_ID 27 // FILETIME
#define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28 #define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28
#define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29 #define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29
#define CERT_EXTENDED_ERROR_INFO_PROP_ID 30 // string #define CERT_EXTENDED_ERROR_INFO_PROP_ID 30 // string
// Note, 32 - 35 are reserved for the CERT, CRL, CTL and KeyId file element IDs. // Note, 32 - 35 are reserved for the CERT, CRL, CTL and KeyId file element IDs.
// 36 - 62 are reserved for future element IDs. // 36 - 62 are reserved for future element IDs.
#define CERT_RENEWAL_PROP_ID 64 #define CERT_RENEWAL_PROP_ID 64
#define CERT_ARCHIVED_KEY_HASH_PROP_ID 65 // Encrypted key hash #define CERT_ARCHIVED_KEY_HASH_PROP_ID 65 // Encrypted key hash
#define CERT_AUTO_ENROLL_RETRY_PROP_ID 66 // AE_RETRY_INFO:cb+cRetry+FILETI ME #define CERT_AUTO_ENROLL_RETRY_PROP_ID 66 // AE_RETRY_INFO:cb+cRetry+FILETI ME
skipping to change at line 8786 skipping to change at line 9218
#define CERT_SUBJECT_INFO_ACCESS_PROP_ID 80 #define CERT_SUBJECT_INFO_ACCESS_PROP_ID 80
#define CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 81 #define CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 81
#define CERT_CA_DISABLE_CRL_PROP_ID 82 #define CERT_CA_DISABLE_CRL_PROP_ID 82
#define CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID 83 #define CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID 83
#define CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID 84 #define CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID 84
#define CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 85 #define CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 85
#define CERT_SUBJECT_DISABLE_CRL_PROP_ID 86 #define CERT_SUBJECT_DISABLE_CRL_PROP_ID 86
#define CERT_CEP_PROP_ID 87 // Version+PropFlags+AuthType+Url Flags+CESAuthType+Url+Id+CESUrl+ReqId #define CERT_CEP_PROP_ID 87 // Version+PropFlags+AuthType+Url Flags+CESAuthType+Url+Id+CESUrl+ReqId
// 88 reserved, originally used for CERT_CEP_PROP_ID // 88 reserved, originally used for CERT_CEP_PROP_ID
#define CERT_SIGN_HASH_CNG_ALG_PROP_ID 89
#define CERT_SIGN_HASH_CNG_ALG_PROP_ID 89 // eg: "RSA/SHA1"
#define CERT_SCARD_PIN_ID_PROP_ID 90 #define CERT_SCARD_PIN_ID_PROP_ID 90
#define CERT_SCARD_PIN_INFO_PROP_ID 91 #define CERT_SCARD_PIN_INFO_PROP_ID 91
#define CERT_FIRST_RESERVED_PROP_ID 92 #define CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID 92
#define CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID 93
#define CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID 94
#define CERT_ISSUER_CHAIN_SIGN_HASH_CNG_ALG_PROP_ID 95
#define CERT_ISSUER_CHAIN_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID 96
#define CERT_NO_EXPIRE_NOTIFICATION_PROP_ID 97
// Following property isn't implicitly created via a GetProperty.
#define CERT_AUTH_ROOT_SHA256_HASH_PROP_ID 98
#define CERT_NCRYPT_KEY_HANDLE_TRANSFER_PROP_ID 99
#define CERT_HCRYPTPROV_TRANSFER_PROP_ID 100
// Smart card reader image path
#define CERT_SMART_CARD_READER_PROP_ID 101 //string
// Send as trusted issuer
#define CERT_SEND_AS_TRUSTED_ISSUER_PROP_ID 102 //boolean
#define CERT_KEY_REPAIR_ATTEMPTED_PROP_ID 103 // FILETME
#define CERT_DISALLOWED_FILETIME_PROP_ID 104
#define CERT_ROOT_PROGRAM_CHAIN_POLICIES_PROP_ID 105
// Smart card reader removable capabilities
#define CERT_SMART_CARD_READER_NON_REMOVABLE_PROP_ID 106 // boolean
#define CERT_SHA256_HASH_PROP_ID 107
#define CERT_SCEP_SERVER_CERTS_PROP_ID 108 // Pkcs7
#define CERT_SCEP_RA_SIGNATURE_CERT_PROP_ID 109 // sha1 Thumbprint
#define CERT_SCEP_RA_ENCRYPTION_CERT_PROP_ID 110 // sha1 Thumbprint
#define CERT_SCEP_CA_CERT_PROP_ID 111 // sha1 Thumbprint
#define CERT_SCEP_SIGNER_CERT_PROP_ID 112 // sha1 Thumbprint
#define CERT_SCEP_NONCE_PROP_ID 113 // blob
// string: "CNGEncryptAlgId/CNGHashAlgId" example: "3DES/SHA1"
#define CERT_SCEP_ENCRYPT_HASH_CNG_ALG_PROP_ID 114
#define CERT_SCEP_FLAGS_PROP_ID 115 // DWORD
#define CERT_FIRST_RESERVED_PROP_ID 116
#define CERT_LAST_RESERVED_PROP_ID 0x00007FFF #define CERT_LAST_RESERVED_PROP_ID 0x00007FFF
#define CERT_FIRST_USER_PROP_ID 0x00008000 #define CERT_FIRST_USER_PROP_ID 0x00008000
#define CERT_LAST_USER_PROP_ID 0x0000FFFF #define CERT_LAST_USER_PROP_ID 0x0000FFFF
// certenrolld_end // certenrolld_end
#define IS_CERT_HASH_PROP_ID(X) (CERT_SHA1_HASH_PROP_ID == (X) || \ #define IS_CERT_HASH_PROP_ID(X) (CERT_SHA1_HASH_PROP_ID == (X) || \
CERT_MD5_HASH_PROP_ID == (X) || \ CERT_MD5_HASH_PROP_ID == (X) || \
CERT_SHA256_HASH_PROP_ID == (X) || \
CERT_SIGNATURE_HASH_PROP_ID == (X)) CERT_SIGNATURE_HASH_PROP_ID == (X))
#define IS_PUBKEY_HASH_PROP_ID(X) (CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID = = (X) || \ #define IS_PUBKEY_HASH_PROP_ID(X) (CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID = = (X) || \
CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == (X)) CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == (X))
#define IS_CHAIN_HASH_PROP_ID(X) (CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID == (X) || \ #define IS_CHAIN_HASH_PROP_ID(X) (CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID == (X) || \
CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == (X) || \ CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == (X) || \
CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ ID == (X) || \ CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ ID == (X) || \
CERT_SUBJECT_NAME_MD5_HASH_PROP_ID == (X )) CERT_SUBJECT_NAME_MD5_HASH_PROP_ID == (X ))
#define IS_STRONG_SIGN_PROP_ID(X) (CERT_SIGN_HASH_CNG_ALG_PROP_ID == (X) ||
\
CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID
== (X) || \
CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID
== (X))
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Property OIDs // Property OIDs
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The OID component following the prefix contains the PROP_ID (decimal) // The OID component following the prefix contains the PROP_ID (decimal)
#define szOID_CERT_PROP_ID_PREFIX "1.3.6.1.4.1.311.10.11." #define szOID_CERT_PROP_ID_PREFIX "1.3.6.1.4.1.311.10.11."
#define _szPROP_ID(PropId) #PropId #define _szPROP_ID(PropId) #PropId
// Ansi OID string from Property Id: // Ansi OID string from Property Id:
#define szOID_CERT_PROP_ID(PropId) szOID_CERT_PROP_ID_PREFIX _szPROP_ID(PropId) #define szOID_CERT_PROP_ID(PropId) szOID_CERT_PROP_ID_PREFIX _szPROP_ID(PropId)
skipping to change at line 8839 skipping to change at line 9319
// Use szOID_CERT_PROP_ID(CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID) instead: // Use szOID_CERT_PROP_ID(CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID) instead:
#define szOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID \ #define szOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID \
"1.3.6.1.4.1.311.10.11.28" "1.3.6.1.4.1.311.10.11.28"
// Use szOID_CERT_PROP_ID(CERT_SUBJECT_NAME_MD5_HASH_PROP_ID) instead: // Use szOID_CERT_PROP_ID(CERT_SUBJECT_NAME_MD5_HASH_PROP_ID) instead:
#define szOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID \ #define szOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID \
"1.3.6.1.4.1.311.10.11.29" "1.3.6.1.4.1.311.10.11.29"
// Use szOID_CERT_PROP_ID(CERT_MD5_HASH_PROP_ID) instead: // Use szOID_CERT_PROP_ID(CERT_MD5_HASH_PROP_ID) instead:
#define szOID_CERT_MD5_HASH_PROP_ID "1.3.6.1.4.1.311.10.11.4" #define szOID_CERT_MD5_HASH_PROP_ID "1.3.6.1.4.1.311.10.11.4"
// Use szOID_CERT_PROP_ID(CERT_SIGNATURE_HASH_PROP_ID) instead:
#define szOID_CERT_SIGNATURE_HASH_PROP_ID "1.3.6.1.4.1.311.10.11.15"
// The CERT_SIGNATURE_HASH_PROP_ID and CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID
// properties are used for disallowed hashes.
#define szOID_DISALLOWED_HASH szOID_CERT_SIGNATURE_HASH_PROP_ID
// Use szOID_CERT_PROP_ID(CERT_DISALLOWED_FILETIME_PROP_ID) instead:
#define szOID_CERT_DISALLOWED_FILETIME_PROP_ID \
"1.3.6.1.4.1.311.10.11.104"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Access State flags returned by CERT_ACCESS_STATE_PROP_ID. Note, // Access State flags returned by CERT_ACCESS_STATE_PROP_ID. Note,
// CERT_ACCESS_PROP_ID is read only. // CERT_ACCESS_PROP_ID is read only.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Set if context property writes are persisted. For instance, not set for // Set if context property writes are persisted. For instance, not set for
// memory store contexts. Set for registry based stores opened as read or write. // memory store contexts. Set for registry based stores opened as read or write.
// Not set for registry based stores opened as read only. // Not set for registry based stores opened as read only.
#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1 #define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1
// Set if context resides in a SYSTEM or SYSTEM_REGISTRY store. // Set if context resides in a SYSTEM or SYSTEM_REGISTRY store.
#define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2 #define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2
// Set if context resides in a LocalMachine SYSTEM or SYSTEM_REGISTRY store. // Set if context resides in a LocalMachine SYSTEM or SYSTEM_REGISTRY store.
#define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4 #define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4
// Set if context resides in a GroupPolicy SYSTEM or SYSTEM_REGISTRY store. // Set if context resides in a GroupPolicy SYSTEM or SYSTEM_REGISTRY store.
#define CERT_ACCESS_STATE_GP_SYSTEM_STORE_FLAG 0x8 #define CERT_ACCESS_STATE_GP_SYSTEM_STORE_FLAG 0x8
// Set if context resides in a SHARED_USER physical store.
#define CERT_ACCESS_STATE_SHARED_USER_FLAG 0x10
//+-------------------------------------------------------------------------
// CERT_ROOT_PROGRAM_CHAIN_POLICIES_PROP_ID Property
//
// Encoded as an X509_ENHANCED_KEY_USAGE: sequence of Policy OIDs.
//--------------------------------------------------------------------------
// Supported Root Program Chain Policies:
#define szOID_ROOT_PROGRAM_AUTO_UPDATE_CA_REVOCATION "1.3.6.1.4.1.311.60.3.1"
#define szOID_ROOT_PROGRAM_AUTO_UPDATE_END_REVOCATION "1.3.6.1.4.1.311.60.3.2"
#define szOID_ROOT_PROGRAM_NO_OCSP_FAILOVER_TO_CRL "1.3.6.1.4.1.311.60.3.3"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Cryptographic Key Provider Information // Cryptographic Key Provider Information
// //
// CRYPT_KEY_PROV_INFO defines the CERT_KEY_PROV_INFO_PROP_ID's pvData. // CRYPT_KEY_PROV_INFO defines the CERT_KEY_PROV_INFO_PROP_ID's pvData.
// //
// The CRYPT_KEY_PROV_INFO fields are passed to CryptAcquireContext // The CRYPT_KEY_PROV_INFO fields are passed to CryptAcquireContext
// to get a HCRYPTPROV handle. The optional CRYPT_KEY_PROV_PARAM fields are // to get a HCRYPTPROV handle. The optional CRYPT_KEY_PROV_PARAM fields are
// passed to CryptSetProvParam to further initialize the provider. // passed to CryptSetProvParam to further initialize the provider.
// //
// The dwKeySpec field identifies the private key to use from the container // The dwKeySpec field identifies the private key to use from the container
skipping to change at line 9053 skipping to change at line 9558
LPCWSTR pwszSystemStore; LPCWSTR pwszSystemStore;
} DUMMYUNIONNAME2; } DUMMYUNIONNAME2;
} CERT_SYSTEM_STORE_RELOCATE_PARA, *PCERT_SYSTEM_STORE_RELOCATE_PARA; } CERT_SYSTEM_STORE_RELOCATE_PARA, *PCERT_SYSTEM_STORE_RELOCATE_PARA;
// By default, when the CurrentUser "Root" store is opened, any SystemRegistry // By default, when the CurrentUser "Root" store is opened, any SystemRegistry
// roots not also on the protected root list are deleted from the cache before // roots not also on the protected root list are deleted from the cache before
// CertOpenStore() returns. Set the following flag to return all the roots // CertOpenStore() returns. Set the following flag to return all the roots
// in the SystemRegistry without checking the protected root list. // in the SystemRegistry without checking the protected root list.
#define CERT_SYSTEM_STORE_UNPROTECTED_FLAG 0x40000000 #define CERT_SYSTEM_STORE_UNPROTECTED_FLAG 0x40000000
#define CERT_SYSTEM_STORE_DEFER_READ_FLAG 0x20000000
// Location of the system store: // Location of the system store:
#define CERT_SYSTEM_STORE_LOCATION_MASK 0x00FF0000 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00FF0000
#define CERT_SYSTEM_STORE_LOCATION_SHIFT 16 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
// Registry: HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE // Registry: HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE
#define CERT_SYSTEM_STORE_CURRENT_USER_ID 1 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
// Registry: HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Services // Registry: HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Services
#define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
#define CERT_SYSTEM_STORE_SERVICES_ID 5 #define CERT_SYSTEM_STORE_SERVICES_ID 5
skipping to change at line 9244 skipping to change at line 9751
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Registry path to the OCM Subcomponents local machine subkey // Registry path to the OCM Subcomponents local machine subkey
#define CERT_OCM_SUBCOMPONENTS_LOCAL_MACHINE_REGPATH \ #define CERT_OCM_SUBCOMPONENTS_LOCAL_MACHINE_REGPATH \
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OC Manager\\Subcompon ents" L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OC Manager\\Subcompon ents"
// REG_DWORD, 1 is installed, 0 is NOT installed // REG_DWORD, 1 is installed, 0 is NOT installed
#define CERT_OCM_SUBCOMPONENTS_ROOT_AUTO_UPDATE_VALUE_NAME L"RootAutoUpdate" #define CERT_OCM_SUBCOMPONENTS_ROOT_AUTO_UPDATE_VALUE_NAME L"RootAutoUpdate"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// DisableRootAutoUpdate Defines // Root and Disallowed Certificate AutoUpdate Defines
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Registry path to the DisableRootAutoUpdate SubKey // Registry path to the DisableRootAutoUpdate SubKey
#define CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH \ #define CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH \
CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\AuthRoot" CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\AuthRoot"
// The following disables both Root and Disallowed Certificate AutoUpdate
// REG_DWORD Value Name, 1 - disables, 0 - enables // REG_DWORD Value Name, 1 - disables, 0 - enables
#define CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME L"DisableRootAutoUpdate" #define CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME L"DisableRootAutoUpdate"
// The following enables Disallowed Certificate AutoUpdate. It takes precedence
// over the above registry setting.
// REG_DWORD Value Name, 1 - enables
#define CERT_ENABLE_DISALLOWED_CERT_AUTO_UPDATE_VALUE_NAME L"EnableDisallowedCer
tAutoUpdate"
//+-------------------------------------------------------------------------
// Auto Update Definitions
//--------------------------------------------------------------------------
// Registry path to the "Auto Update" local machine subkey
#define CERT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH \
CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH L"\\AuthRoot\\AutoUpdate"
// Auto Update subkey value names.
// REG_SZ, URL to the directory containing the AutoUpdate files
#define CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME L"RootDirUrl"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// AuthRoot Auto Update Definitions // AuthRoot Auto Update Definitions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Registry path to the AuthRoot "Auto Update" local machine subkey // Registry path to the AuthRoot "Auto Update" local machine subkey
#define CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH \ #define CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH \
CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH L"\\AuthRoot\\AutoUpdate" CERT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH
// AuthRoot Auto Update subkey value names. // AuthRoot Auto Update subkey value names.
// REG_SZ, URL to the directory containing the AuthRoots, CTL and Seq files // REG_SZ, URL to the directory containing the AuthRoots, CTL and Seq files
#define CERT_AUTH_ROOT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME L"RootDirUrl" #define CERT_AUTH_ROOT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME \
CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME
// REG_DWORD, seconds between syncs. 0 implies use default. // REG_DWORD, seconds between syncs. 0 implies use default.
#define CERT_AUTH_ROOT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME L"SyncDeltaTime" #define CERT_AUTH_ROOT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME L"SyncDeltaTime"
// REG_DWORD, misc flags // REG_DWORD, misc flags
#define CERT_AUTH_ROOT_AUTO_UPDATE_FLAGS_VALUE_NAME L"Flags" #define CERT_AUTH_ROOT_AUTO_UPDATE_FLAGS_VALUE_NAME L"Flags"
#define CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG 0x1 #define CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG 0x1
#define CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG 0x2 #define CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG 0x2
// By default a random query string is appended to the Auto Update URLs
// passed to CryptRetrieveObjectByUrlW. See the
// CRYPT_RANDOM_QUERY_STRING_RETRIEVAL flag for more details. Set
// this flag to not set this random query string. This might be the
// case when setting CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME where the
// server doesn't strip off the query string.
#define CERT_AUTO_UPDATE_DISABLE_RANDOM_QUERY_STRING_FLAG 0x4
// REG_BINARY, updated with FILETIME of last wire retrieval of authroot cab/ctl
#define CERT_AUTH_ROOT_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME L"LastSyncTime"
// REG_BINARY, updated with last retrieved and verified authroot ctl
#define CERT_AUTH_ROOT_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME L"EncodedCtl"
// AuthRoot Auto Update filenames // AuthRoot Auto Update filenames
// CTL containing the list of certs in the AuthRoot store // CTL containing the list of certs in the AuthRoot store
#define CERT_AUTH_ROOT_CTL_FILENAME L"authroot.stl" #define CERT_AUTH_ROOT_CTL_FILENAME L"authroot.stl"
#define CERT_AUTH_ROOT_CTL_FILENAME_A "authroot.stl" #define CERT_AUTH_ROOT_CTL_FILENAME_A "authroot.stl"
// Cab containing the above CTL // Cab containing the above CTL
#define CERT_AUTH_ROOT_CAB_FILENAME L"authrootstl.ca b" #define CERT_AUTH_ROOT_CAB_FILENAME L"authrootstl.ca b"
// SequenceNumber (Formatted as big endian ascii hex) // SequenceNumber (Formatted as big endian ascii hex)
#define CERT_AUTH_ROOT_SEQ_FILENAME L"authrootseq.tx t" #define CERT_AUTH_ROOT_SEQ_FILENAME L"authrootseq.tx t"
// Root certs extension // Root certs extension
#define CERT_AUTH_ROOT_CERT_EXT L".crt" #define CERT_AUTH_ROOT_CERT_EXT L".crt"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// DisallowedCert Auto Update Definitions
//--------------------------------------------------------------------------
//
// DisallowedCert Auto Update subkey value names.
//
// REG_DWORD, seconds between syncs. 0 implies use default.
#define CERT_DISALLOWED_CERT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME \
L"DisallowedCertSyncDeltaTime"
// REG_BINARY, updated with FILETIME of last wire retrieval of disallowed cert
// CTL
#define CERT_DISALLOWED_CERT_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME \
L"DisallowedCertLastSyncTime"
// REG_BINARY, updated with last retrieved and verified disallowed cert ctl
#define CERT_DISALLOWED_CERT_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME \
L"DisallowedCertEncodedCtl"
//
// DisallowedCert Auto Update filenames
//
// CTL containing the list of disallowed certs
#define CERT_DISALLOWED_CERT_CTL_FILENAME L"disallowedcert.stl"
#define CERT_DISALLOWED_CERT_CTL_FILENAME_A "disallowedcert.stl"
// Cab containing disallowed certs CTL
#define CERT_DISALLOWED_CERT_CAB_FILENAME L"disallowedcertstl.cab"
//
// DisallowedCert Auto Update CTL List Identifiers
//
// Disallowed Cert CTL List Identifier
#define CERT_DISALLOWED_CERT_AUTO_UPDATE_LIST_IDENTIFIER \
L"DisallowedCert_AutoUpdate_1"
//+-------------------------------------------------------------------------
// Certificate Registry Store Flag Values (CERT_STORE_REG) // Certificate Registry Store Flag Values (CERT_STORE_REG)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Set this flag if the HKEY passed in pvPara points to a remote computer // Set this flag if the HKEY passed in pvPara points to a remote computer
// registry key. // registry key.
#define CERT_REGISTRY_STORE_REMOTE_FLAG 0x10000 #define CERT_REGISTRY_STORE_REMOTE_FLAG 0x10000
// Set this flag if the contexts are to be persisted as a single serialized // Set this flag if the contexts are to be persisted as a single serialized
// store in the registry. Mainly used for stores downloaded from the GPT. // store in the registry. Mainly used for stores downloaded from the GPT.
// Such as the CurrentUserGroupPolicy or LocalMachineGroupPolicy stores. // Such as the CurrentUserGroupPolicy or LocalMachineGroupPolicy stores.
skipping to change at line 9335 skipping to change at line 9916
LPWSTR pwszStoreDirectory; LPWSTR pwszStoreDirectory;
} CERT_REGISTRY_STORE_ROAMING_PARA, *PCERT_REGISTRY_STORE_ROAMING_PARA; } CERT_REGISTRY_STORE_ROAMING_PARA, *PCERT_REGISTRY_STORE_ROAMING_PARA;
// The following flag is for internal use. When set, the "My" DWORD value // The following flag is for internal use. When set, the "My" DWORD value
// at HKLM\Software\Microsoft\Cryptography\IEDirtyFlags is set to 0x1 // at HKLM\Software\Microsoft\Cryptography\IEDirtyFlags is set to 0x1
// whenever a certificate is added to the registry store. // whenever a certificate is added to the registry store.
// //
// Legacy definition, no longer supported after 01-May-02 (Server 2003) // Legacy definition, no longer supported after 01-May-02 (Server 2003)
#define CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG 0x80000 #define CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG 0x80000
#define CERT_REGISTRY_STORE_EXTERNAL_FLAG 0x100000
// Registry path to the subkey containing the "My" DWORD value to be set // Registry path to the subkey containing the "My" DWORD value to be set
// //
// Legacy definition, no longer supported after 01-May-02 (Server 2003) // Legacy definition, no longer supported after 01-May-02 (Server 2003)
#define CERT_IE_DIRTY_FLAGS_REGPATH \ #define CERT_IE_DIRTY_FLAGS_REGPATH \
L"Software\\Microsoft\\Cryptography\\IEDirtyFlags" L"Software\\Microsoft\\Cryptography\\IEDirtyFlags"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate File Store Flag Values for the providers: // Certificate File Store Flag Values for the providers:
// CERT_STORE_PROV_FILE // CERT_STORE_PROV_FILE
// CERT_STORE_PROV_FILENAME // CERT_STORE_PROV_FILENAME
skipping to change at line 9769 skipping to change at line 10352
// CERT_STORE_PROV_LDAP // CERT_STORE_PROV_LDAP
// sz_CERT_STORE_PROV_LDAP_W // sz_CERT_STORE_PROV_LDAP_W
// sz_CERT_STORE_PROV_LDAP // sz_CERT_STORE_PROV_LDAP
// Opens a store over the results of the query specified by and LDAP // Opens a store over the results of the query specified by and LDAP
// URL which is passed in via pvPara. In order to do writes to the // URL which is passed in via pvPara. In order to do writes to the
// store the URL must specify a BASE query, no filter and a single // store the URL must specify a BASE query, no filter and a single
// attribute. // attribute.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__checkReturn _Must_inspect_result_
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CertOpenStore( CertOpenStore(
__in LPCSTR lpszStoreProvider, _In_ LPCSTR lpszStoreProvider,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvPara _In_opt_ const void *pvPara
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// OID Installable Certificate Store Provider Data Structures // OID Installable Certificate Store Provider Data Structures
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Handle returned by the store provider when opened. // Handle returned by the store provider when opened.
typedef void *HCERTSTOREPROV; typedef void *HCERTSTOREPROV;
// Store Provider OID function's pszFuncName. // Store Provider OID function's pszFuncName.
skipping to change at line 9813 skipping to change at line 10396
} CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO; } CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO;
// Definition of the store provider's open function. // Definition of the store provider's open function.
// //
// *pStoreProvInfo has been zeroed before the call. // *pStoreProvInfo has been zeroed before the call.
// //
// Note, pStoreProvInfo->cStoreProvFunc should be set last. Once set, // Note, pStoreProvInfo->cStoreProvFunc should be set last. Once set,
// all subsequent store calls, such as CertAddSerializedElementToStore will // all subsequent store calls, such as CertAddSerializedElementToStore will
// call the appropriate provider callback function. // call the appropriate provider callback function.
typedef BOOL (WINAPI *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)( typedef BOOL (WINAPI *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(
__in LPCSTR lpszStoreProvider, _In_ LPCSTR lpszStoreProvider,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvPara, _In_opt_ const void *pvPara,
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__inout PCERT_STORE_PROV_INFO pStoreProvInfo _Inout_ PCERT_STORE_PROV_INFO pStoreProvInfo
); );
// The open callback sets the following flag, if it maintains its // The open callback sets the following flag, if it maintains its
// contexts externally and not in the cached store. // contexts externally and not in the cached store.
#define CERT_STORE_PROV_EXTERNAL_FLAG 0x1 #define CERT_STORE_PROV_EXTERNAL_FLAG 0x1
// The open callback sets the following flag for a successful delete. // The open callback sets the following flag for a successful delete.
// When set, the close callback isn't called. // When set, the close callback isn't called.
#define CERT_STORE_PROV_DELETED_FLAG 0x2 #define CERT_STORE_PROV_DELETED_FLAG 0x2
skipping to change at line 9846 skipping to change at line 10429
#define CERT_STORE_PROV_SYSTEM_STORE_FLAG 0x8 #define CERT_STORE_PROV_SYSTEM_STORE_FLAG 0x8
// The open callback sets the following flag if the contexts are persisted // The open callback sets the following flag if the contexts are persisted
// to a LocalMachine system store. // to a LocalMachine system store.
#define CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG 0x10 #define CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG 0x10
// The open callback sets the following flag if the contexts are persisted // The open callback sets the following flag if the contexts are persisted
// to a GroupPolicy system store. // to a GroupPolicy system store.
#define CERT_STORE_PROV_GP_SYSTEM_STORE_FLAG 0x20 #define CERT_STORE_PROV_GP_SYSTEM_STORE_FLAG 0x20
// The open callback sets the following flag if the contexts are from
// a Shared User physical store.
#define CERT_STORE_PROV_SHARED_USER_FLAG 0x40
// Indices into the store provider's array of callback functions. // Indices into the store provider's array of callback functions.
// //
// The provider can implement any subset of the following functions. It // The provider can implement any subset of the following functions. It
// sets pStoreProvInfo->cStoreProvFunc to the last index + 1 and any // sets pStoreProvInfo->cStoreProvFunc to the last index + 1 and any
// preceding not implemented functions to NULL. // preceding not implemented functions to NULL.
#define CERT_STORE_PROV_CLOSE_FUNC 0 #define CERT_STORE_PROV_CLOSE_FUNC 0
#define CERT_STORE_PROV_READ_CERT_FUNC 1 #define CERT_STORE_PROV_READ_CERT_FUNC 1
#define CERT_STORE_PROV_WRITE_CERT_FUNC 2 #define CERT_STORE_PROV_WRITE_CERT_FUNC 2
#define CERT_STORE_PROV_DELETE_CERT_FUNC 3 #define CERT_STORE_PROV_DELETE_CERT_FUNC 3
#define CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC 4 #define CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC 4
skipping to change at line 9878 skipping to change at line 10465
#define CERT_STORE_PROV_FIND_CRL_FUNC 17 #define CERT_STORE_PROV_FIND_CRL_FUNC 17
#define CERT_STORE_PROV_FREE_FIND_CRL_FUNC 18 #define CERT_STORE_PROV_FREE_FIND_CRL_FUNC 18
#define CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC 19 #define CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC 19
#define CERT_STORE_PROV_FIND_CTL_FUNC 20 #define CERT_STORE_PROV_FIND_CTL_FUNC 20
#define CERT_STORE_PROV_FREE_FIND_CTL_FUNC 21 #define CERT_STORE_PROV_FREE_FIND_CTL_FUNC 21
#define CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC 22 #define CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC 22
// Called by CertCloseStore when the store's reference count is // Called by CertCloseStore when the store's reference count is
// decremented to 0. // decremented to 0.
typedef void (WINAPI *PFN_CERT_STORE_PROV_CLOSE)( typedef void (WINAPI *PFN_CERT_STORE_PROV_CLOSE)(
__inout_opt HCERTSTOREPROV hStoreProv, _Inout_opt_ HCERTSTOREPROV hStoreProv,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Currently not called directly by the store APIs. However, may be exported // Currently not called directly by the store APIs. However, may be exported
// to support other providers based on it. // to support other providers based on it.
// //
// Reads the provider's copy of the certificate context. If it exists, // Reads the provider's copy of the certificate context. If it exists,
// creates a new certificate context. // creates a new certificate context.
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_CONTEXT pStoreCertContext, _In_ PCCERT_CONTEXT pStoreCertContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_out PCCERT_CONTEXT *ppProvCertContext _Outptr_ PCCERT_CONTEXT *ppProvCertContext
); );
#define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1 #define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1
// Called by CertAddEncodedCertificateToStore, // Called by CertAddEncodedCertificateToStore,
// CertAddCertificateContextToStore or CertAddSerializedElementToStore before // CertAddCertificateContextToStore or CertAddSerializedElementToStore before
// adding to the store. The CERT_STORE_PROV_WRITE_ADD_FLAG is set. In // adding to the store. The CERT_STORE_PROV_WRITE_ADD_FLAG is set. In
// addition to the encoded certificate, the added pCertContext might also // addition to the encoded certificate, the added pCertContext might also
// have properties. // have properties.
// //
// Returns TRUE if its OK to update the the store. // Returns TRUE if its OK to update the the store.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CERT)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CERT)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Called by CertDeleteCertificateFromStore before deleting from the // Called by CertDeleteCertificateFromStore before deleting from the
// store. // store.
// //
// Returns TRUE if its OK to delete from the store. // Returns TRUE if its OK to delete from the store.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CERT)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CERT)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Called by CertSetCertificateContextProperty before setting the // Called by CertSetCertificateContextProperty before setting the
// certificate's property. Also called by CertGetCertificateContextProperty, // certificate's property. Also called by CertGetCertificateContextProperty,
// when getting a hash property that needs to be created and then persisted // when getting a hash property that needs to be created and then persisted
// via the set. // via the set.
// //
// Upon input, the property hasn't been set for the pCertContext parameter. // Upon input, the property hasn't been set for the pCertContext parameter.
// //
// Returns TRUE if its OK to set the property. // Returns TRUE if its OK to set the property.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CERT_PROPERTY)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CERT_PROPERTY)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
// Currently not called directly by the store APIs. However, may be exported // Currently not called directly by the store APIs. However, may be exported
// to support other providers based on it. // to support other providers based on it.
// //
// Reads the provider's copy of the CRL context. If it exists, // Reads the provider's copy of the CRL context. If it exists,
// creates a new CRL context. // creates a new CRL context.
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCRL_CONTEXT pStoreCrlContext, _In_ PCCRL_CONTEXT pStoreCrlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_out PCCRL_CONTEXT *ppProvCrlContext _Outptr_ PCCRL_CONTEXT *ppProvCrlContext
); );
// Called by CertAddEncodedCRLToStore, // Called by CertAddEncodedCRLToStore,
// CertAddCRLContextToStore or CertAddSerializedElementToStore before // CertAddCRLContextToStore or CertAddSerializedElementToStore before
// adding to the store. The CERT_STORE_PROV_WRITE_ADD_FLAG is set. In // adding to the store. The CERT_STORE_PROV_WRITE_ADD_FLAG is set. In
// addition to the encoded CRL, the added pCertContext might also // addition to the encoded CRL, the added pCertContext might also
// have properties. // have properties.
// //
// Returns TRUE if its OK to update the the store. // Returns TRUE if its OK to update the the store.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CRL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CRL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Called by CertDeleteCRLFromStore before deleting from the store. // Called by CertDeleteCRLFromStore before deleting from the store.
// //
// Returns TRUE if its OK to delete from the store. // Returns TRUE if its OK to delete from the store.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CRL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CRL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Called by CertSetCRLContextProperty before setting the // Called by CertSetCRLContextProperty before setting the
// CRL's property. Also called by CertGetCRLContextProperty, // CRL's property. Also called by CertGetCRLContextProperty,
// when getting a hash property that needs to be created and then persisted // when getting a hash property that needs to be created and then persisted
// via the set. // via the set.
// //
// Upon input, the property hasn't been set for the pCrlContext parameter. // Upon input, the property hasn't been set for the pCrlContext parameter.
// //
// Returns TRUE if its OK to set the property. // Returns TRUE if its OK to set the property.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CRL_PROPERTY)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CRL_PROPERTY)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
// Currently not called directly by the store APIs. However, may be exported // Currently not called directly by the store APIs. However, may be exported
// to support other providers based on it. // to support other providers based on it.
// //
// Reads the provider's copy of the CTL context. If it exists, // Reads the provider's copy of the CTL context. If it exists,
// creates a new CTL context. // creates a new CTL context.
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCTL_CONTEXT pStoreCtlContext, _In_ PCCTL_CONTEXT pStoreCtlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_out PCCTL_CONTEXT *ppProvCtlContext _Outptr_ PCCTL_CONTEXT *ppProvCtlContext
); );
// Called by CertAddEncodedCTLToStore, // Called by CertAddEncodedCTLToStore,
// CertAddCTLContextToStore or CertAddSerializedElementToStore before // CertAddCTLContextToStore or CertAddSerializedElementToStore before
// adding to the store. The CERT_STORE_PROV_WRITE_ADD_FLAG is set. In // adding to the store. The CERT_STORE_PROV_WRITE_ADD_FLAG is set. In
// addition to the encoded CTL, the added pCertContext might also // addition to the encoded CTL, the added pCertContext might also
// have properties. // have properties.
// //
// Returns TRUE if its OK to update the the store. // Returns TRUE if its OK to update the the store.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CTL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CTL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Called by CertDeleteCTLFromStore before deleting from the store. // Called by CertDeleteCTLFromStore before deleting from the store.
// //
// Returns TRUE if its OK to delete from the store. // Returns TRUE if its OK to delete from the store.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CTL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CTL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Called by CertSetCTLContextProperty before setting the // Called by CertSetCTLContextProperty before setting the
// CTL's property. Also called by CertGetCTLContextProperty, // CTL's property. Also called by CertGetCTLContextProperty,
// when getting a hash property that needs to be created and then persisted // when getting a hash property that needs to be created and then persisted
// via the set. // via the set.
// //
// Upon input, the property hasn't been set for the pCtlContext parameter. // Upon input, the property hasn't been set for the pCtlContext parameter.
// //
// Returns TRUE if its OK to set the property. // Returns TRUE if its OK to set the property.
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CTL_PROPERTY)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CTL_PROPERTY)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwCtrlType, _In_ DWORD dwCtrlType,
__in_opt void const *pvCtrlPara _In_opt_ void const *pvCtrlPara
); );
typedef struct _CERT_STORE_PROV_FIND_INFO { typedef struct _CERT_STORE_PROV_FIND_INFO {
DWORD cbSize; DWORD cbSize;
DWORD dwMsgAndCertEncodingType; DWORD dwMsgAndCertEncodingType;
DWORD dwFindFlags; DWORD dwFindFlags;
DWORD dwFindType; DWORD dwFindType;
const void *pvFindPara; const void *pvFindPara;
} CERT_STORE_PROV_FIND_INFO, *PCERT_STORE_PROV_FIND_INFO; } CERT_STORE_PROV_FIND_INFO, *PCERT_STORE_PROV_FIND_INFO;
typedef const CERT_STORE_PROV_FIND_INFO CCERT_STORE_PROV_FIND_INFO, typedef const CERT_STORE_PROV_FIND_INFO CCERT_STORE_PROV_FIND_INFO,
*PCCERT_STORE_PROV_FIND_INFO; *PCCERT_STORE_PROV_FIND_INFO;
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CERT)( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CERT)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_STORE_PROV_FIND_INFO pFindInfo, _In_ PCCERT_STORE_PROV_FIND_INFO pFindInfo,
__in PCCERT_CONTEXT pPrevCertContext, _In_ PCCERT_CONTEXT pPrevCertContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_inout void **ppvStoreProvFindInfo, _Inout_ void **ppvStoreProvFindInfo,
__deref_out PCCERT_CONTEXT *ppProvCertContext _Outptr_ PCCERT_CONTEXT *ppProvCertContext
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CERT)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CERT)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in void *pvStoreProvFindInfo, _In_ void *pvStoreProvFindInfo,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CERT_PROPERTY)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CERT_PROPERTY)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CRL)( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CRL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCERT_STORE_PROV_FIND_INFO pFindInfo, _In_ PCCERT_STORE_PROV_FIND_INFO pFindInfo,
__in PCCRL_CONTEXT pPrevCrlContext, _In_ PCCRL_CONTEXT pPrevCrlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_inout void **ppvStoreProvFindInfo, _Inout_ void **ppvStoreProvFindInfo,
__deref_out PCCRL_CONTEXT *ppProvCrlContext _Outptr_ PCCRL_CONTEXT *ppProvCrlContext
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CRL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CRL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in void *pvStoreProvFindInfo, _In_ void *pvStoreProvFindInfo,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CRL_PROPERTY)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CRL_PROPERTY)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CTL)( typedef _Success_(return != FALSE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CTL)(
__in HCERTSTOREPROV hStoreProv, _In_ HCERTSTOREPROV hStoreProv,
__in PCCERT_STORE_PROV_FIND_INFO pFindInfo, _In_ PCCERT_STORE_PROV_FIND_INFO pFindInfo,
__in PCCTL_CONTEXT pPrevCtlContext, _In_ PCCTL_CONTEXT pPrevCtlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_inout void **ppvStoreProvFindInfo, _Inout_ void **ppvStoreProvFindInfo,
__deref_out PCCTL_CONTEXT *ppProvCtlContext _Outptr_ PCCTL_CONTEXT *ppProvCtlContext
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CTL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CTL)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in void *pvStoreProvFindInfo, _In_ void *pvStoreProvFindInfo,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CTL_PROPERTY)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CTL_PROPERTY)(
__inout HCERTSTOREPROV hStoreProv, _Inout_ HCERTSTOREPROV hStoreProv,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a cert store handle // Duplicate a cert store handle
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CertDuplicateStore( CertDuplicateStore(
__in HCERTSTORE hCertStore _In_ HCERTSTORE hCertStore
); );
#define CERT_STORE_SAVE_AS_STORE 1 #define CERT_STORE_SAVE_AS_STORE 1
#define CERT_STORE_SAVE_AS_PKCS7 2 #define CERT_STORE_SAVE_AS_PKCS7 2
#define CERT_STORE_SAVE_AS_PKCS12 3 #define CERT_STORE_SAVE_AS_PKCS12 3
#define CERT_STORE_SAVE_TO_FILE 1 #define CERT_STORE_SAVE_TO_FILE 1
#define CERT_STORE_SAVE_TO_MEMORY 2 #define CERT_STORE_SAVE_TO_MEMORY 2
#define CERT_STORE_SAVE_TO_FILENAME_A 3 #define CERT_STORE_SAVE_TO_FILENAME_A 3
#define CERT_STORE_SAVE_TO_FILENAME_W 4 #define CERT_STORE_SAVE_TO_FILENAME_W 4
skipping to change at line 10203 skipping to change at line 10790
// For "_A": given, // For "_A": given,
// LPCSTR pszFilename; pvSaveToPara = (void *) pszFilename; // LPCSTR pszFilename; pvSaveToPara = (void *) pszFilename;
// //
// Note, the default (without "_A" or "_W") is UNICODE. // Note, the default (without "_A" or "_W") is UNICODE.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSaveStore( CertSaveStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in DWORD dwSaveAs, _In_ DWORD dwSaveAs,
__in DWORD dwSaveTo, _In_ DWORD dwSaveTo,
__inout void *pvSaveToPara, _Inout_ void *pvSaveToPara,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Store close flags // Certificate Store close flags
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_CLOSE_STORE_FORCE_FLAG 0x00000001 #define CERT_CLOSE_STORE_FORCE_FLAG 0x00000001
#define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002 #define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Close a cert store handle. // Close a cert store handle.
skipping to change at line 10245 skipping to change at line 10832
// returned with LastError set to CRYPT_E_PENDING_CLOSE. Note, for FALSE, // returned with LastError set to CRYPT_E_PENDING_CLOSE. Note, for FALSE,
// the store is still closed. This is a diagnostic flag. // the store is still closed. This is a diagnostic flag.
// //
// LastError is preserved unless CERT_CLOSE_STORE_CHECK_FLAG is set and FALSE // LastError is preserved unless CERT_CLOSE_STORE_CHECK_FLAG is set and FALSE
// is returned. // is returned.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertCloseStore( CertCloseStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the subject certificate context uniquely identified by its Issuer and // Get the subject certificate context uniquely identified by its Issuer and
// SerialNumber from the store. // SerialNumber from the store.
// //
// If the certificate isn't found, NULL is returned. Otherwise, a pointer to // If the certificate isn't found, NULL is returned. Otherwise, a pointer to
// a read only CERT_CONTEXT is returned. CERT_CONTEXT must be freed by calling // a read only CERT_CONTEXT is returned. CERT_CONTEXT must be freed by calling
// CertFreeCertificateContext. CertDuplicateCertificateContext can be called to make a // CertFreeCertificateContext. CertDuplicateCertificateContext can be called to make a
// duplicate. // duplicate.
// //
// The returned certificate might not be valid. Normally, it would be // The returned certificate might not be valid. Normally, it would be
// verified when getting its issuer certificate (CertGetIssuerCertificateFromSt ore). // verified when getting its issuer certificate (CertGetIssuerCertificateFromSt ore).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertGetSubjectCertificateFromStore( CertGetSubjectCertificateFromStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_INFO pCertId // Only the Issuer and SerialNumber _In_ PCERT_INFO pCertId // Only the Issuer and SerialNumber
// fields are used // fields are used
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the certificate contexts in the store. // Enumerate the certificate contexts in the store.
// //
// If a certificate isn't found, NULL is returned. // If a certificate isn't found, NULL is returned.
// Otherwise, a pointer to a read only CERT_CONTEXT is returned. CERT_CONTEXT // Otherwise, a pointer to a read only CERT_CONTEXT is returned. CERT_CONTEXT
// must be freed by calling CertFreeCertificateContext or is freed when passed as the // must be freed by calling CertFreeCertificateContext or is freed when passed as the
// pPrevCertContext on a subsequent call. CertDuplicateCertificateContext // pPrevCertContext on a subsequent call. CertDuplicateCertificateContext
skipping to change at line 10291 skipping to change at line 10878
// certificate in the store. Successive certificates are enumerated by setting // certificate in the store. Successive certificates are enumerated by setting
// pPrevCertContext to the CERT_CONTEXT returned by a previous call. // pPrevCertContext to the CERT_CONTEXT returned by a previous call.
// //
// NOTE: a NON-NULL pPrevCertContext is always CertFreeCertificateContext'ed by // NOTE: a NON-NULL pPrevCertContext is always CertFreeCertificateContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertEnumCertificatesInStore( CertEnumCertificatesInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in_opt PCCERT_CONTEXT pPrevCertContext _In_opt_ PCCERT_CONTEXT pPrevCertContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find the first or next certificate context in the store. // Find the first or next certificate context in the store.
// //
// The certificate is found according to the dwFindType and its pvFindPara. // The certificate is found according to the dwFindType and its pvFindPara.
// See below for a list of the find types and its parameters. // See below for a list of the find types and its parameters.
// //
// Currently dwFindFlags is only used for CERT_FIND_SUBJECT_ATTR, // Currently dwFindFlags is only used for CERT_FIND_SUBJECT_ATTR,
// CERT_FIND_ISSUER_ATTR or CERT_FIND_CTL_USAGE. Otherwise, must be set to 0. // CERT_FIND_ISSUER_ATTR or CERT_FIND_CTL_USAGE. Otherwise, must be set to 0.
skipping to change at line 10323 skipping to change at line 10910
// call to find the certificate. To find the next certificate, the // call to find the certificate. To find the next certificate, the
// pPrevCertContext is set to the CERT_CONTEXT returned by a previous call. // pPrevCertContext is set to the CERT_CONTEXT returned by a previous call.
// //
// NOTE: a NON-NULL pPrevCertContext is always CertFreeCertificateContext'ed by // NOTE: a NON-NULL pPrevCertContext is always CertFreeCertificateContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertFindCertificateInStore( CertFindCertificateInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in DWORD dwFindFlags, _In_ DWORD dwFindFlags,
__in DWORD dwFindType, _In_ DWORD dwFindType,
__in_opt const void *pvFindPara, _In_opt_ const void *pvFindPara,
__in_opt PCCERT_CONTEXT pPrevCertContext _In_opt_ PCCERT_CONTEXT pPrevCertContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate comparison functions // Certificate comparison functions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_COMPARE_MASK 0xFFFF #define CERT_COMPARE_MASK 0xFFFF
#define CERT_COMPARE_SHIFT 16 #define CERT_COMPARE_SHIFT 16
#define CERT_COMPARE_ANY 0 #define CERT_COMPARE_ANY 0
#define CERT_COMPARE_SHA1_HASH 1 #define CERT_COMPARE_SHA1_HASH 1
#define CERT_COMPARE_NAME 2 #define CERT_COMPARE_NAME 2
skipping to change at line 10360 skipping to change at line 10947
#define CERT_COMPARE_ISSUER_OF 12 #define CERT_COMPARE_ISSUER_OF 12
#define CERT_COMPARE_EXISTING 13 #define CERT_COMPARE_EXISTING 13
#define CERT_COMPARE_SIGNATURE_HASH 14 #define CERT_COMPARE_SIGNATURE_HASH 14
#define CERT_COMPARE_KEY_IDENTIFIER 15 #define CERT_COMPARE_KEY_IDENTIFIER 15
#define CERT_COMPARE_CERT_ID 16 #define CERT_COMPARE_CERT_ID 16
#define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17 #define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17
#define CERT_COMPARE_PUBKEY_MD5_HASH 18 #define CERT_COMPARE_PUBKEY_MD5_HASH 18
#define CERT_COMPARE_SUBJECT_INFO_ACCESS 19 #define CERT_COMPARE_SUBJECT_INFO_ACCESS 19
#define CERT_COMPARE_HASH_STR 20
#define CERT_COMPARE_HAS_PRIVATE_KEY 21
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// dwFindType // dwFindType
// //
// The dwFindType definition consists of two components: // The dwFindType definition consists of two components:
// - comparison function // - comparison function
// - certificate information flag // - certificate information flag
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_FIND_ANY (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT) #define CERT_FIND_ANY (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT)
#define CERT_FIND_SHA1_HASH (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT) #define CERT_FIND_SHA1_HASH (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT)
skipping to change at line 10411 skipping to change at line 11000
#define CERT_FIND_CERT_ID (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT) #define CERT_FIND_CERT_ID (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT)
#define CERT_FIND_CROSS_CERT_DIST_POINTS \ #define CERT_FIND_CROSS_CERT_DIST_POINTS \
(CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT) (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT)
#define CERT_FIND_PUBKEY_MD5_HASH \ #define CERT_FIND_PUBKEY_MD5_HASH \
(CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT) (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT)
#define CERT_FIND_SUBJECT_INFO_ACCESS \ #define CERT_FIND_SUBJECT_INFO_ACCESS \
(CERT_COMPARE_SUBJECT_INFO_ACCESS << CERT_COMPARE_SHIFT) (CERT_COMPARE_SUBJECT_INFO_ACCESS << CERT_COMPARE_SHIFT)
#define CERT_FIND_HASH_STR (CERT_COMPARE_HASH_STR << CERT_COMPARE_SHIFT)
#define CERT_FIND_HAS_PRIVATE_KEY (CERT_COMPARE_HAS_PRIVATE_KEY << CERT_COMPARE_
SHIFT)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_FIND_ANY // CERT_FIND_ANY
// //
// Find any certificate. // Find any certificate.
// //
// pvFindPara isn't used. // pvFindPara isn't used.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_FIND_HASH // CERT_FIND_HASH
skipping to change at line 10611 skipping to change at line 11203
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_FIND_SUBJECT_INFO_ACCESS // CERT_FIND_SUBJECT_INFO_ACCESS
// //
// Find a certificate having either a SubjectInfoAccess extension or // Find a certificate having either a SubjectInfoAccess extension or
// property. // property.
// //
// pvFindPara isn't used. // pvFindPara isn't used.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_FIND_HASH_STR
//
// Find a certificate with the specified hash.
//
// pvFindPara points to a null terminated wide character string, containing
// 40 hexadecimal digits that CryptStringToBinary(CRYPT_STRING_HEXRAW) can
// convert to a 20 byte SHA1 CRYPT_HASH_BLOB.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// Get the certificate context from the store for the first or next issuer // Get the certificate context from the store for the first or next issuer
// of the specified subject certificate. Perform the enabled // of the specified subject certificate. Perform the enabled
// verification checks on the subject. (Note, the checks are on the subject // verification checks on the subject. (Note, the checks are on the subject
// using the returned issuer certificate.) // using the returned issuer certificate.)
// //
// If the first or next issuer certificate isn't found, NULL is returned. // If the first or next issuer certificate isn't found, NULL is returned.
// Otherwise, a pointer to a read only CERT_CONTEXT is returned. CERT_CONTEXT // Otherwise, a pointer to a read only CERT_CONTEXT is returned. CERT_CONTEXT
// must be freed by calling CertFreeCertificateContext or is freed when passed as the // must be freed by calling CertFreeCertificateContext or is freed when passed as the
// pPrevIssuerContext on a subsequent call. CertDuplicateCertificateContext // pPrevIssuerContext on a subsequent call. CertDuplicateCertificateContext
// can be called to make a duplicate. // can be called to make a duplicate.
skipping to change at line 10668 skipping to change at line 11270
// CERT_STORE_NO_ISSUER_FLAG is set if it doesn't have an issuer certificate // CERT_STORE_NO_ISSUER_FLAG is set if it doesn't have an issuer certificate
// in the store. // in the store.
// //
// For a verification check failure, a pointer to the issuer's CERT_CONTEXT // For a verification check failure, a pointer to the issuer's CERT_CONTEXT
// is still returned and SetLastError isn't updated. // is still returned and SetLastError isn't updated.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertGetIssuerCertificateFromStore( CertGetIssuerCertificateFromStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in PCCERT_CONTEXT pSubjectContext, _In_ PCCERT_CONTEXT pSubjectContext,
__in_opt PCCERT_CONTEXT pPrevIssuerContext, _In_opt_ PCCERT_CONTEXT pPrevIssuerContext,
__inout DWORD *pdwFlags _Inout_ DWORD *pdwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Perform the enabled verification checks on the subject certificate // Perform the enabled verification checks on the subject certificate
// using the issuer. Same checks and flags definitions as for the above // using the issuer. Same checks and flags definitions as for the above
// CertGetIssuerCertificateFromStore. // CertGetIssuerCertificateFromStore.
// //
// If you are only checking CERT_STORE_TIME_VALIDITY_FLAG, then, the // If you are only checking CERT_STORE_TIME_VALIDITY_FLAG, then, the
// issuer can be NULL. // issuer can be NULL.
// //
// For a verification check failure, SUCCESS is still returned. // For a verification check failure, SUCCESS is still returned.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertVerifySubjectCertificateContext( CertVerifySubjectCertificateContext(
__in PCCERT_CONTEXT pSubject, _In_ PCCERT_CONTEXT pSubject,
__in_opt PCCERT_CONTEXT pIssuer, _In_opt_ PCCERT_CONTEXT pIssuer,
__inout DWORD *pdwFlags _Inout_ DWORD *pdwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a certificate context // Duplicate a certificate context
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertDuplicateCertificateContext( CertDuplicateCertificateContext(
__in_opt PCCERT_CONTEXT pCertContext _In_opt_ PCCERT_CONTEXT pCertContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Create a certificate context from the encoded certificate. The created // Create a certificate context from the encoded certificate. The created
// context isn't put in a store. // context isn't put in a store.
// //
// Makes a copy of the encoded certificate in the created context. // Makes a copy of the encoded certificate in the created context.
// //
// If unable to decode and create the certificate context, NULL is returned. // If unable to decode and create the certificate context, NULL is returned.
// Otherwise, a pointer to a read only CERT_CONTEXT is returned. // Otherwise, a pointer to a read only CERT_CONTEXT is returned.
// CERT_CONTEXT must be freed by calling CertFreeCertificateContext. // CERT_CONTEXT must be freed by calling CertFreeCertificateContext.
// CertDuplicateCertificateContext can be called to make a duplicate. // CertDuplicateCertificateContext can be called to make a duplicate.
// //
// CertSetCertificateContextProperty and CertGetCertificateContextProperty can be called // CertSetCertificateContextProperty and CertGetCertificateContextProperty can be called
// to store properties for the certificate. // to store properties for the certificate.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertCreateCertificateContext( CertCreateCertificateContext(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbCertEncoded) const BYTE *pbCertEncoded, _In_reads_bytes_(cbCertEncoded) const BYTE *pbCertEncoded,
__in DWORD cbCertEncoded _In_ DWORD cbCertEncoded
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Free a certificate context // Free a certificate context
// //
// There needs to be a corresponding free for each context obtained by a // There needs to be a corresponding free for each context obtained by a
// get, find, duplicate or create. // get, find, duplicate or create.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertFreeCertificateContext( CertFreeCertificateContext(
__in_opt PCCERT_CONTEXT pCertContext _In_opt_ PCCERT_CONTEXT pCertContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Set the property for the specified certificate context. // Set the property for the specified certificate context.
// //
// The type definition for pvData depends on the dwPropId value. There are // The type definition for pvData depends on the dwPropId value. There are
// five predefined types: // five predefined types:
// CERT_KEY_PROV_HANDLE_PROP_ID - a HCRYPTPROV for the certificate's // CERT_KEY_PROV_HANDLE_PROP_ID - a HCRYPTPROV for the certificate's
// private key is passed in pvData. Updates the hCryptProv field // private key is passed in pvData. Updates the hCryptProv field
// of the CERT_KEY_CONTEXT_PROP_ID. If the CERT_KEY_CONTEXT_PROP_ID // of the CERT_KEY_CONTEXT_PROP_ID. If the CERT_KEY_CONTEXT_PROP_ID
skipping to change at line 10868 skipping to change at line 11470
// next 4 bytes - Property Flags // next 4 bytes - Property Flags
// next 4 bytes - Authentication Type // next 4 bytes - Authentication Type
// next 4 bytes - Url Flags // next 4 bytes - Url Flags
// next 4 bytes - CES Authentication Type // next 4 bytes - CES Authentication Type
// followed by Url string with null-terminator, // followed by Url string with null-terminator,
// followed by Id string with null-terminator, // followed by Id string with null-terminator,
// followed by CES Url string with null-terminator, // followed by CES Url string with null-terminator,
// followed by RequestId string with null-terminator. // followed by RequestId string with null-terminator.
// a single null-terminator indicates no string is present. // a single null-terminator indicates no string is present.
// //
// CERT_KEY_REPAIR_ATTEMPTED_PROP_ID - contains the time when repair of
// a missing CERT_KEY_PROV_INFO_PROP_ID property was attempted and failed.
// pvData points to a CRYPT_DATA_BLOB containing the FILETIME.
//
// For all the other PROP_IDs: an encoded PCRYPT_DATA_BLOB is passed in pvData. // For all the other PROP_IDs: an encoded PCRYPT_DATA_BLOB is passed in pvData.
// //
// If the property already exists, then, the old value is deleted and silently // If the property already exists, then, the old value is deleted and silently
// replaced. Setting, pvData to NULL, deletes the property. // replaced. Setting, pvData to NULL, deletes the property.
// //
// CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG can be set to ignore any // CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG can be set to ignore any
// provider write errors and always update the cached context's property. // provider write errors and always update the cached context's property.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSetCertificateContextProperty( CertSetCertificateContextProperty(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
// Set this flag to ignore any store provider write errors and always update // Set this flag to ignore any store provider write errors and always update
// the cached context's property // the cached context's property
#define CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG 0x80000000 #define CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG 0x80000000
// Set this flag to inhibit the persisting of this property // Set this flag to inhibit the persisting of this property
#define CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG 0x40000000 #define CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG 0x40000000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 10957 skipping to change at line 11563
// //
// For CERT_SOURCE_LOCATION_PROP_ID and CERT_SOURCE_URL_PROP_ID, // For CERT_SOURCE_LOCATION_PROP_ID and CERT_SOURCE_URL_PROP_ID,
// pvPara points to a NULL terminated unicode, wide character string. // pvPara points to a NULL terminated unicode, wide character string.
// //
// For all other PROP_IDs, pvData points to an encoded array of bytes. // For all other PROP_IDs, pvData points to an encoded array of bytes.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertGetCertificateContextProperty( CertGetCertificateContextProperty(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the properties for the specified certificate context. // Enumerate the properties for the specified certificate context.
// //
// To get the first property, set dwPropId to 0. The ID of the first // To get the first property, set dwPropId to 0. The ID of the first
// property is returned. To get the next property, set dwPropId to the // property is returned. To get the next property, set dwPropId to the
// ID returned by the last call. To enumerate all the properties continue // ID returned by the last call. To enumerate all the properties continue
// until 0 is returned. // until 0 is returned.
// //
// CertGetCertificateContextProperty is called to get the property's data. // CertGetCertificateContextProperty is called to get the property's data.
// //
// Note, since, the CERT_KEY_PROV_HANDLE_PROP_ID and CERT_KEY_SPEC_PROP_ID // Note, since, the CERT_KEY_PROV_HANDLE_PROP_ID and CERT_KEY_SPEC_PROP_ID
// properties are stored as fields in the CERT_KEY_CONTEXT_PROP_ID // properties are stored as fields in the CERT_KEY_CONTEXT_PROP_ID
// property, they aren't enumerated individually. // property, they aren't enumerated individually.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertEnumCertificateContextProperties( CertEnumCertificateContextProperties(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwPropId _In_ DWORD dwPropId
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Creates a CTL entry whose attributes are the certificate context's // Creates a CTL entry whose attributes are the certificate context's
// properties. // properties.
// //
// The SubjectIdentifier in the CTL entry is the SHA1 hash of the certificate. // The SubjectIdentifier in the CTL entry is the SHA1 hash of the certificate.
// //
// The certificate properties are added as attributes. The property attribute // The certificate properties are added as attributes. The property attribute
// OID is the decimal PROP_ID preceded by szOID_CERT_PROP_ID_PREFIX. Each // OID is the decimal PROP_ID preceded by szOID_CERT_PROP_ID_PREFIX. Each
// property value is copied as a single attribute value. // property value is copied as a single attribute value.
// //
// Any additional attributes to be included in the CTL entry can be passed // Any additional attributes to be included in the CTL entry can be passed
// in via the cOptAttr and rgOptAttr parameters. // in via the cOptAttr and rgOptAttr parameters.
// //
// CTL_ENTRY_FROM_PROP_CHAIN_FLAG can be set in dwFlags, to force the // CTL_ENTRY_FROM_PROP_CHAIN_FLAG can be set in dwFlags, to force the
// inclusion of the chain building hash properties as attributes. // inclusion of the chain building hash properties as attributes.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
_Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertCreateCTLEntryFromCertificateContextProperties( CertCreateCTLEntryFromCertificateContextProperties(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD cOptAttr, _In_ DWORD cOptAttr,
__in_ecount_opt(cOptAttr) PCRYPT_ATTRIBUTE rgOptAttr, _In_reads_opt_(cOptAttr) PCRYPT_ATTRIBUTE rgOptAttr,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out_bcount_part_opt(*pcbCtlEntry, *pcbCtlEntry) PCTL_ENTRY pCtlEntry, _Out_writes_bytes_to_opt_(*pcbCtlEntry, *pcbCtlEntry) PCTL_ENTRY pCtlEntry,
__inout DWORD *pcbCtlEntry _Inout_ DWORD *pcbCtlEntry
); );
// Set this flag to get and include the chain building hash properties // Set this flag to get and include the chain building hash properties
// as attributes in the CTL entry // as attributes in the CTL entry
#define CTL_ENTRY_FROM_PROP_CHAIN_FLAG 0x1 #define CTL_ENTRY_FROM_PROP_CHAIN_FLAG 0x1
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sets properties on the certificate context using the attributes in // Sets properties on the certificate context using the attributes in
// the CTL entry. // the CTL entry.
// //
// The property attribute OID is the decimal PROP_ID preceded by // The property attribute OID is the decimal PROP_ID preceded by
// szOID_CERT_PROP_ID_PREFIX. Only attributes containing such an OID are // szOID_CERT_PROP_ID_PREFIX. Only attributes containing such an OID are
// copied. // copied.
// //
// CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG may be set in dwFlags. // CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG may be set in dwFlags.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSetCertificateContextPropertiesFromCTLEntry( CertSetCertificateContextPropertiesFromCTLEntry(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in PCTL_ENTRY pCtlEntry, _In_ PCTL_ENTRY pCtlEntry,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the first or next CRL context from the store for the specified // Get the first or next CRL context from the store for the specified
// issuer certificate. Perform the enabled verification checks on the CRL. // issuer certificate. Perform the enabled verification checks on the CRL.
// //
// If the first or next CRL isn't found, NULL is returned. // If the first or next CRL isn't found, NULL is returned.
// Otherwise, a pointer to a read only CRL_CONTEXT is returned. CRL_CONTEXT // Otherwise, a pointer to a read only CRL_CONTEXT is returned. CRL_CONTEXT
// must be freed by calling CertFreeCRLContext. However, the free must be // must be freed by calling CertFreeCRLContext. However, the free must be
// pPrevCrlContext on a subsequent call. CertDuplicateCRLContext // pPrevCrlContext on a subsequent call. CertDuplicateCRLContext
skipping to change at line 11093 skipping to change at line 11700
// If pIssuerContext == NULL, then, an enabled CERT_STORE_SIGNATURE_FLAG // If pIssuerContext == NULL, then, an enabled CERT_STORE_SIGNATURE_FLAG
// always fails and the CERT_STORE_NO_ISSUER_FLAG is also set. // always fails and the CERT_STORE_NO_ISSUER_FLAG is also set.
// //
// For a verification check failure, a pointer to the first or next // For a verification check failure, a pointer to the first or next
// CRL_CONTEXT is still returned and SetLastError isn't updated. // CRL_CONTEXT is still returned and SetLastError isn't updated.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRL_CONTEXT PCCRL_CONTEXT
WINAPI WINAPI
CertGetCRLFromStore( CertGetCRLFromStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in_opt PCCERT_CONTEXT pIssuerContext, _In_opt_ PCCERT_CONTEXT pIssuerContext,
__in_opt PCCRL_CONTEXT pPrevCrlContext, _In_opt_ PCCRL_CONTEXT pPrevCrlContext,
__inout DWORD *pdwFlags _Inout_ DWORD *pdwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the CRL contexts in the store. // Enumerate the CRL contexts in the store.
// //
// If a CRL isn't found, NULL is returned. // If a CRL isn't found, NULL is returned.
// Otherwise, a pointer to a read only CRL_CONTEXT is returned. CRL_CONTEXT // Otherwise, a pointer to a read only CRL_CONTEXT is returned. CRL_CONTEXT
// must be freed by calling CertFreeCRLContext or is freed when passed as the // must be freed by calling CertFreeCRLContext or is freed when passed as the
// pPrevCrlContext on a subsequent call. CertDuplicateCRLContext // pPrevCrlContext on a subsequent call. CertDuplicateCRLContext
// can be called to make a duplicate. // can be called to make a duplicate.
skipping to change at line 11119 skipping to change at line 11726
// CRL in the store. Successive CRLs are enumerated by setting // CRL in the store. Successive CRLs are enumerated by setting
// pPrevCrlContext to the CRL_CONTEXT returned by a previous call. // pPrevCrlContext to the CRL_CONTEXT returned by a previous call.
// //
// NOTE: a NON-NULL pPrevCrlContext is always CertFreeCRLContext'ed by // NOTE: a NON-NULL pPrevCrlContext is always CertFreeCRLContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRL_CONTEXT PCCRL_CONTEXT
WINAPI WINAPI
CertEnumCRLsInStore( CertEnumCRLsInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in_opt PCCRL_CONTEXT pPrevCrlContext _In_opt_ PCCRL_CONTEXT pPrevCrlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find the first or next CRL context in the store. // Find the first or next CRL context in the store.
// //
// The CRL is found according to the dwFindType and its pvFindPara. // The CRL is found according to the dwFindType and its pvFindPara.
// See below for a list of the find types and its parameters. // See below for a list of the find types and its parameters.
// //
// Currently dwFindFlags isn't used and must be set to 0. // Currently dwFindFlags isn't used and must be set to 0.
// //
skipping to change at line 11150 skipping to change at line 11757
// call to find the CRL. To find the next CRL, the // call to find the CRL. To find the next CRL, the
// pPrevCrlContext is set to the CRL_CONTEXT returned by a previous call. // pPrevCrlContext is set to the CRL_CONTEXT returned by a previous call.
// //
// NOTE: a NON-NULL pPrevCrlContext is always CertFreeCRLContext'ed by // NOTE: a NON-NULL pPrevCrlContext is always CertFreeCRLContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRL_CONTEXT PCCRL_CONTEXT
WINAPI WINAPI
CertFindCRLInStore( CertFindCRLInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in DWORD dwFindFlags, _In_ DWORD dwFindFlags,
__in DWORD dwFindType, _In_ DWORD dwFindType,
__in_opt const void *pvFindPara, _In_opt_ const void *pvFindPara,
__in_opt PCCRL_CONTEXT pPrevCrlContext _In_opt_ PCCRL_CONTEXT pPrevCrlContext
); );
#define CRL_FIND_ANY 0 #define CRL_FIND_ANY 0
#define CRL_FIND_ISSUED_BY 1 #define CRL_FIND_ISSUED_BY 1
#define CRL_FIND_EXISTING 2 #define CRL_FIND_EXISTING 2
#define CRL_FIND_ISSUED_FOR 3 #define CRL_FIND_ISSUED_FOR 3
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRL_FIND_ANY // CRL_FIND_ANY
// //
skipping to change at line 11236 skipping to change at line 11843
// certificate may not match the issuer name in the subject certificate and // certificate may not match the issuer name in the subject certificate and
// its corresponding CRL. // its corresponding CRL.
// //
// All of the above CRL_FIND_ISSUED_BY_*_FLAGS apply to this find type. // All of the above CRL_FIND_ISSUED_BY_*_FLAGS apply to this find type.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRL_FIND_ISSUED_FOR_PARA { typedef struct _CRL_FIND_ISSUED_FOR_PARA {
PCCERT_CONTEXT pSubjectCert; PCCERT_CONTEXT pSubjectCert;
PCCERT_CONTEXT pIssuerCert; PCCERT_CONTEXT pIssuerCert;
} CRL_FIND_ISSUED_FOR_PARA, *PCRL_FIND_ISSUED_FOR_PARA; } CRL_FIND_ISSUED_FOR_PARA, *PCRL_FIND_ISSUED_FOR_PARA;
//
// When the following flag is set, the strong signature properties
// are also set on the returned CRL.
//
// The strong signature properties are:
// - CERT_SIGN_HASH_CNG_ALG_PROP_ID
// - CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID
//
#define CRL_FIND_ISSUED_FOR_SET_STRONG_PROPERTIES_FLAG 0x10
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a CRL context // Duplicate a CRL context
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRL_CONTEXT PCCRL_CONTEXT
WINAPI WINAPI
CertDuplicateCRLContext( CertDuplicateCRLContext(
__in_opt PCCRL_CONTEXT pCrlContext _In_opt_ PCCRL_CONTEXT pCrlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Create a CRL context from the encoded CRL. The created // Create a CRL context from the encoded CRL. The created
// context isn't put in a store. // context isn't put in a store.
// //
// Makes a copy of the encoded CRL in the created context. // Makes a copy of the encoded CRL in the created context.
// //
// If unable to decode and create the CRL context, NULL is returned. // If unable to decode and create the CRL context, NULL is returned.
// Otherwise, a pointer to a read only CRL_CONTEXT is returned. // Otherwise, a pointer to a read only CRL_CONTEXT is returned.
// CRL_CONTEXT must be freed by calling CertFreeCRLContext. // CRL_CONTEXT must be freed by calling CertFreeCRLContext.
// CertDuplicateCRLContext can be called to make a duplicate. // CertDuplicateCRLContext can be called to make a duplicate.
// //
// CertSetCRLContextProperty and CertGetCRLContextProperty can be called // CertSetCRLContextProperty and CertGetCRLContextProperty can be called
// to store properties for the CRL. // to store properties for the CRL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRL_CONTEXT PCCRL_CONTEXT
WINAPI WINAPI
CertCreateCRLContext( CertCreateCRLContext(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbCrlEncoded) const BYTE *pbCrlEncoded, _In_reads_bytes_(cbCrlEncoded) const BYTE *pbCrlEncoded,
__in DWORD cbCrlEncoded _In_ DWORD cbCrlEncoded
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Free a CRL context // Free a CRL context
// //
// There needs to be a corresponding free for each context obtained by a // There needs to be a corresponding free for each context obtained by a
// get, duplicate or create. // get, duplicate or create.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertFreeCRLContext( CertFreeCRLContext(
__in_opt PCCRL_CONTEXT pCrlContext _In_opt_ PCCRL_CONTEXT pCrlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Set the property for the specified CRL context. // Set the property for the specified CRL context.
// //
// Same Property Ids and semantics as CertSetCertificateContextProperty. // Same Property Ids and semantics as CertSetCertificateContextProperty.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSetCRLContextProperty( CertSetCRLContextProperty(
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the property for the specified CRL context. // Get the property for the specified CRL context.
// //
// Same Property Ids and semantics as CertGetCertificateContextProperty. // Same Property Ids and semantics as CertGetCertificateContextProperty.
// //
// CERT_SHA1_HASH_PROP_ID, CERT_MD5_HASH_PROP_ID or // CERT_SHA1_HASH_PROP_ID, CERT_MD5_HASH_PROP_ID or
// CERT_SIGNATURE_HASH_PROP_ID is the predefined property of most interest. // CERT_SIGNATURE_HASH_PROP_ID is the predefined property of most interest.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertGetCRLContextProperty( CertGetCRLContextProperty(
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the properties for the specified CRL context. // Enumerate the properties for the specified CRL context.
// //
// To get the first property, set dwPropId to 0. The ID of the first // To get the first property, set dwPropId to 0. The ID of the first
// property is returned. To get the next property, set dwPropId to the // property is returned. To get the next property, set dwPropId to the
// ID returned by the last call. To enumerate all the properties continue // ID returned by the last call. To enumerate all the properties continue
// until 0 is returned. // until 0 is returned.
// //
// CertGetCRLContextProperty is called to get the property's data. // CertGetCRLContextProperty is called to get the property's data.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertEnumCRLContextProperties( CertEnumCRLContextProperties(
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwPropId _In_ DWORD dwPropId
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Search the CRL's list of entries for the specified certificate. // Search the CRL's list of entries for the specified certificate.
// //
// TRUE is returned if we were able to search the list. Otherwise, FALSE is // TRUE is returned if we were able to search the list. Otherwise, FALSE is
// returned, // returned,
// //
// For success, if the certificate was found in the list, *ppCrlEntry is // For success, if the certificate was found in the list, *ppCrlEntry is
// updated with a pointer to the entry. Otherwise, *ppCrlEntry is set to NULL. // updated with a pointer to the entry. Otherwise, *ppCrlEntry is set to NULL.
// The returned entry isn't allocated and must not be freed. // The returned entry isn't allocated and must not be freed.
// //
// dwFlags and pvReserved currently aren't used and must be set to 0 or NULL. // dwFlags and pvReserved currently aren't used and must be set to 0 or NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertFindCertificateInCRL( CertFindCertificateInCRL(
__in PCCERT_CONTEXT pCert, _In_ PCCERT_CONTEXT pCert,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__deref_out_opt PCRL_ENTRY *ppCrlEntry _Outptr_result_maybenull_ PCRL_ENTRY *ppCrlEntry
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Is the specified CRL valid for the certificate. // Is the specified CRL valid for the certificate.
// //
// Returns TRUE if the CRL's list of entries would contain the certificate // Returns TRUE if the CRL's list of entries would contain the certificate
// if it was revoked. Note, doesn't check that the certificate is in the // if it was revoked. Note, doesn't check that the certificate is in the
// list of entries. // list of entries.
// //
// If the CRL has an Issuing Distribution Point (IDP) extension, checks // If the CRL has an Issuing Distribution Point (IDP) extension, checks
// that it's valid for the subject certificate. // that it's valid for the subject certificate.
// //
// dwFlags and pvReserved currently aren't used and must be set to 0 and NULL. // dwFlags and pvReserved currently aren't used and must be set to 0 and NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertIsValidCRLForCertificate( CertIsValidCRLForCertificate(
__in PCCERT_CONTEXT pCert, _In_ PCCERT_CONTEXT pCert,
__in PCCRL_CONTEXT pCrl, _In_ PCCRL_CONTEXT pCrl,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Add certificate/CRL, encoded, context or element disposition values. // Add certificate/CRL, encoded, context or element disposition values.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_STORE_ADD_NEW 1 #define CERT_STORE_ADD_NEW 1
#define CERT_STORE_ADD_USE_EXISTING 2 #define CERT_STORE_ADD_USE_EXISTING 2
#define CERT_STORE_ADD_REPLACE_EXISTING 3 #define CERT_STORE_ADD_REPLACE_EXISTING 3
#define CERT_STORE_ADD_ALWAYS 4 #define CERT_STORE_ADD_ALWAYS 4
#define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5 #define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5
skipping to change at line 11435 skipping to change at line 12052
// Same as CERT_STORE_ADD_NEWER. However, if an older certificate is // Same as CERT_STORE_ADD_NEWER. However, if an older certificate is
// replaced, same as CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES. // replaced, same as CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES.
// //
// CertGetSubjectCertificateFromStore is called to determine if the // CertGetSubjectCertificateFromStore is called to determine if the
// certificate already exists in the store. // certificate already exists in the store.
// //
// ppCertContext can be NULL, indicating the caller isn't interested // ppCertContext can be NULL, indicating the caller isn't interested
// in getting the CERT_CONTEXT of the added or existing certificate. // in getting the CERT_CONTEXT of the added or existing certificate.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCertificateToStore( CertAddEncodedCertificateToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbCertEncoded) const BYTE *pbCertEncoded, _In_reads_bytes_(cbCertEncoded) const BYTE *pbCertEncoded,
__in DWORD cbCertEncoded, _In_ DWORD cbCertEncoded,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCERT_CONTEXT *ppCertContext _Outptr_opt_ PCCERT_CONTEXT *ppCertContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Add the certificate context to the store according to the specified // Add the certificate context to the store according to the specified
// disposition action. // disposition action.
// //
// In addition to the encoded certificate, the context's properties are // In addition to the encoded certificate, the context's properties are
// also copied. Note, the CERT_KEY_CONTEXT_PROP_ID property (and its // also copied. Note, the CERT_KEY_CONTEXT_PROP_ID property (and its
// CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_SPEC_PROP_ID) isn't copied. // CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_SPEC_PROP_ID) isn't copied.
// //
skipping to change at line 11505 skipping to change at line 12122
// Same as CERT_STORE_ADD_NEWER. However, if an older context is // Same as CERT_STORE_ADD_NEWER. However, if an older context is
// replaced, same as CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES. // replaced, same as CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES.
// //
// CertGetSubjectCertificateFromStore is called to determine if the // CertGetSubjectCertificateFromStore is called to determine if the
// certificate already exists in the store. // certificate already exists in the store.
// //
// ppStoreContext can be NULL, indicating the caller isn't interested // ppStoreContext can be NULL, indicating the caller isn't interested
// in getting the CERT_CONTEXT of the added or existing certificate. // in getting the CERT_CONTEXT of the added or existing certificate.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddCertificateContextToStore( CertAddCertificateContextToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCERT_CONTEXT *ppStoreContext _Outptr_opt_ PCCERT_CONTEXT *ppStoreContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Store Context Types // Certificate Store Context Types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_STORE_CERTIFICATE_CONTEXT 1 #define CERT_STORE_CERTIFICATE_CONTEXT 1
#define CERT_STORE_CRL_CONTEXT 2 #define CERT_STORE_CRL_CONTEXT 2
#define CERT_STORE_CTL_CONTEXT 3 #define CERT_STORE_CTL_CONTEXT 3
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 11559 skipping to change at line 12176
// add either a certificate or CRL, set dwContextTypeFlags to: // add either a certificate or CRL, set dwContextTypeFlags to:
// CERT_STORE_CERTIFICATE_CONTEXT_FLAG | CERT_STORE_CRL_CONTEXT_FLAG // CERT_STORE_CERTIFICATE_CONTEXT_FLAG | CERT_STORE_CRL_CONTEXT_FLAG
// //
// *pdwContextType is updated with the type of the context returned in // *pdwContextType is updated with the type of the context returned in
// *ppvContxt. pdwContextType or ppvContext can be NULL, indicating the // *ppvContxt. pdwContextType or ppvContext can be NULL, indicating the
// caller isn't interested in getting the output. If *ppvContext is // caller isn't interested in getting the output. If *ppvContext is
// returned it must be freed by calling CertFreeCertificateContext or // returned it must be freed by calling CertFreeCertificateContext or
// CertFreeCRLContext. // CertFreeCRLContext.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddSerializedElementToStore( CertAddSerializedElementToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in_bcount(cbElement) const BYTE *pbElement, _In_reads_bytes_(cbElement) const BYTE *pbElement,
__in DWORD cbElement, _In_ DWORD cbElement,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwContextTypeFlags, _In_ DWORD dwContextTypeFlags,
__out_opt DWORD *pdwContextType, _Out_opt_ DWORD *pdwContextType,
__deref_opt_out const void **ppvContext _Outptr_opt_ const void **ppvContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Delete the specified certificate from the store. // Delete the specified certificate from the store.
// //
// All subsequent gets or finds for the certificate will fail. However, // All subsequent gets or finds for the certificate will fail. However,
// memory allocated for the certificate isn't freed until all of its contexts // memory allocated for the certificate isn't freed until all of its contexts
// have also been freed. // have also been freed.
// //
// The pCertContext is obtained from a get, enum, find or duplicate. // The pCertContext is obtained from a get, enum, find or duplicate.
skipping to change at line 11592 skipping to change at line 12209
// Some store provider implementations might also delete the issuer's CRLs // Some store provider implementations might also delete the issuer's CRLs
// if this is the last certificate for the issuer in the store. // if this is the last certificate for the issuer in the store.
// //
// NOTE: the pCertContext is always CertFreeCertificateContext'ed by // NOTE: the pCertContext is always CertFreeCertificateContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertDeleteCertificateFromStore( CertDeleteCertificateFromStore(
__in PCCERT_CONTEXT pCertContext _In_ PCCERT_CONTEXT pCertContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Add the encoded CRL to the store according to the specified // Add the encoded CRL to the store according to the specified
// disposition option. // disposition option.
// //
// Makes a copy of the encoded CRL before adding to the store. // Makes a copy of the encoded CRL before adding to the store.
// //
// dwAddDispostion specifies the action to take if the CRL // dwAddDispostion specifies the action to take if the CRL
// already exists in the store. See CertAddEncodedCertificateToStore for a // already exists in the store. See CertAddEncodedCertificateToStore for a
// list of and actions taken. // list of and actions taken.
// //
// Compares the CRL's Issuer to determine if the CRL already exists in the // Compares the CRL's Issuer to determine if the CRL already exists in the
// store. // store.
// //
// ppCrlContext can be NULL, indicating the caller isn't interested // ppCrlContext can be NULL, indicating the caller isn't interested
// in getting the CRL_CONTEXT of the added or existing CRL. // in getting the CRL_CONTEXT of the added or existing CRL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCRLToStore( CertAddEncodedCRLToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbCrlEncoded) const BYTE *pbCrlEncoded, _In_reads_bytes_(cbCrlEncoded) const BYTE *pbCrlEncoded,
__in DWORD cbCrlEncoded, _In_ DWORD cbCrlEncoded,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCRL_CONTEXT *ppCrlContext _Outptr_opt_ PCCRL_CONTEXT *ppCrlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Add the CRL context to the store according to the specified // Add the CRL context to the store according to the specified
// disposition option. // disposition option.
// //
// In addition to the encoded CRL, the context's properties are // In addition to the encoded CRL, the context's properties are
// also copied. Note, the CERT_KEY_CONTEXT_PROP_ID property (and its // also copied. Note, the CERT_KEY_CONTEXT_PROP_ID property (and its
// CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_SPEC_PROP_ID) isn't copied. // CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_SPEC_PROP_ID) isn't copied.
// //
skipping to change at line 11645 skipping to change at line 12262
// already exists in the store. See CertAddCertificateContextToStore for a // already exists in the store. See CertAddCertificateContextToStore for a
// list of and actions taken. // list of and actions taken.
// //
// Compares the CRL's Issuer, ThisUpdate and NextUpdate to determine // Compares the CRL's Issuer, ThisUpdate and NextUpdate to determine
// if the CRL already exists in the store. // if the CRL already exists in the store.
// //
// ppStoreContext can be NULL, indicating the caller isn't interested // ppStoreContext can be NULL, indicating the caller isn't interested
// in getting the CRL_CONTEXT of the added or existing CRL. // in getting the CRL_CONTEXT of the added or existing CRL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddCRLContextToStore( CertAddCRLContextToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCRL_CONTEXT *ppStoreContext _Outptr_opt_ PCCRL_CONTEXT *ppStoreContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Delete the specified CRL from the store. // Delete the specified CRL from the store.
// //
// All subsequent gets for the CRL will fail. However, // All subsequent gets for the CRL will fail. However,
// memory allocated for the CRL isn't freed until all of its contexts // memory allocated for the CRL isn't freed until all of its contexts
// have also been freed. // have also been freed.
// //
// The pCrlContext is obtained from a get or duplicate. // The pCrlContext is obtained from a get or duplicate.
// //
// NOTE: the pCrlContext is always CertFreeCRLContext'ed by // NOTE: the pCrlContext is always CertFreeCRLContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertDeleteCRLFromStore( CertDeleteCRLFromStore(
__in PCCRL_CONTEXT pCrlContext _In_ PCCRL_CONTEXT pCrlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Serialize the certificate context's encoded certificate and its // Serialize the certificate context's encoded certificate and its
// properties. // properties.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSerializeCertificateStoreElement( CertSerializeCertificateStoreElement(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbElement, *pcbElement) BYTE *pbElement, _Out_writes_bytes_to_opt_(*pcbElement, *pcbElement) BYTE *pbElement,
__inout DWORD *pcbElement _Inout_ DWORD *pcbElement
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Serialize the CRL context's encoded CRL and its properties. // Serialize the CRL context's encoded CRL and its properties.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSerializeCRLStoreElement( CertSerializeCRLStoreElement(
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbElement, *pcbElement) BYTE *pbElement, _Out_writes_bytes_to_opt_(*pcbElement, *pcbElement) BYTE *pbElement,
__inout DWORD *pcbElement _Inout_ DWORD *pcbElement
); );
//+========================================================================= //+=========================================================================
// Certificate Trust List (CTL) Store Data Structures and APIs // Certificate Trust List (CTL) Store Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a CTL context // Duplicate a CTL context
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCTL_CONTEXT PCCTL_CONTEXT
WINAPI WINAPI
CertDuplicateCTLContext( CertDuplicateCTLContext(
__in_opt PCCTL_CONTEXT pCtlContext _In_opt_ PCCTL_CONTEXT pCtlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Create a CTL context from the encoded CTL. The created // Create a CTL context from the encoded CTL. The created
// context isn't put in a store. // context isn't put in a store.
// //
// Makes a copy of the encoded CTL in the created context. // Makes a copy of the encoded CTL in the created context.
// //
// If unable to decode and create the CTL context, NULL is returned. // If unable to decode and create the CTL context, NULL is returned.
// Otherwise, a pointer to a read only CTL_CONTEXT is returned. // Otherwise, a pointer to a read only CTL_CONTEXT is returned.
// CTL_CONTEXT must be freed by calling CertFreeCTLContext. // CTL_CONTEXT must be freed by calling CertFreeCTLContext.
// CertDuplicateCTLContext can be called to make a duplicate. // CertDuplicateCTLContext can be called to make a duplicate.
// //
// CertSetCTLContextProperty and CertGetCTLContextProperty can be called // CertSetCTLContextProperty and CertGetCTLContextProperty can be called
// to store properties for the CTL. // to store properties for the CTL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCTL_CONTEXT PCCTL_CONTEXT
WINAPI WINAPI
CertCreateCTLContext( CertCreateCTLContext(
__in DWORD dwMsgAndCertEncodingType, _In_ DWORD dwMsgAndCertEncodingType,
__in_bcount(cbCtlEncoded) const BYTE *pbCtlEncoded, _In_reads_bytes_(cbCtlEncoded) const BYTE *pbCtlEncoded,
__in DWORD cbCtlEncoded _In_ DWORD cbCtlEncoded
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Free a CTL context // Free a CTL context
// //
// There needs to be a corresponding free for each context obtained by a // There needs to be a corresponding free for each context obtained by a
// get, duplicate or create. // get, duplicate or create.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertFreeCTLContext( CertFreeCTLContext(
__in_opt PCCTL_CONTEXT pCtlContext _In_opt_ PCCTL_CONTEXT pCtlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Set the property for the specified CTL context. // Set the property for the specified CTL context.
// //
// Same Property Ids and semantics as CertSetCertificateContextProperty. // Same Property Ids and semantics as CertSetCertificateContextProperty.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSetCTLContextProperty( CertSetCTLContextProperty(
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the property for the specified CTL context. // Get the property for the specified CTL context.
// //
// Same Property Ids and semantics as CertGetCertificateContextProperty. // Same Property Ids and semantics as CertGetCertificateContextProperty.
// //
// CERT_SHA1_HASH_PROP_ID or CERT_NEXT_UPDATE_LOCATION_PROP_ID are the // CERT_SHA1_HASH_PROP_ID or CERT_NEXT_UPDATE_LOCATION_PROP_ID are the
// predefined properties of most interest. // predefined properties of most interest.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertGetCTLContextProperty( CertGetCTLContextProperty(
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the properties for the specified CTL context. // Enumerate the properties for the specified CTL context.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertEnumCTLContextProperties( CertEnumCTLContextProperties(
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwPropId _In_ DWORD dwPropId
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the CTL contexts in the store. // Enumerate the CTL contexts in the store.
// //
// If a CTL isn't found, NULL is returned. // If a CTL isn't found, NULL is returned.
// Otherwise, a pointer to a read only CTL_CONTEXT is returned. CTL_CONTEXT // Otherwise, a pointer to a read only CTL_CONTEXT is returned. CTL_CONTEXT
// must be freed by calling CertFreeCTLContext or is freed when passed as the // must be freed by calling CertFreeCTLContext or is freed when passed as the
// pPrevCtlContext on a subsequent call. CertDuplicateCTLContext // pPrevCtlContext on a subsequent call. CertDuplicateCTLContext
// can be called to make a duplicate. // can be called to make a duplicate.
skipping to change at line 11815 skipping to change at line 12432
// CTL in the store. Successive CTLs are enumerated by setting // CTL in the store. Successive CTLs are enumerated by setting
// pPrevCtlContext to the CTL_CONTEXT returned by a previous call. // pPrevCtlContext to the CTL_CONTEXT returned by a previous call.
// //
// NOTE: a NON-NULL pPrevCtlContext is always CertFreeCTLContext'ed by // NOTE: a NON-NULL pPrevCtlContext is always CertFreeCTLContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCTL_CONTEXT PCCTL_CONTEXT
WINAPI WINAPI
CertEnumCTLsInStore( CertEnumCTLsInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in_opt PCCTL_CONTEXT pPrevCtlContext _In_opt_ PCCTL_CONTEXT pPrevCtlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Attempt to find the specified subject in the CTL. // Attempt to find the specified subject in the CTL.
// //
// For CTL_CERT_SUBJECT_TYPE, pvSubject points to a CERT_CONTEXT. The CTL's // For CTL_CERT_SUBJECT_TYPE, pvSubject points to a CERT_CONTEXT. The CTL's
// SubjectAlgorithm is examined to determine the representation of the // SubjectAlgorithm is examined to determine the representation of the
// subject's identity. Initially, only SHA1 or MD5 hash will be supported. // subject's identity. Initially, only SHA1 or MD5 hash will be supported.
// The appropriate hash property is obtained from the CERT_CONTEXT. // The appropriate hash property is obtained from the CERT_CONTEXT.
// //
skipping to change at line 11841 skipping to change at line 12458
// The certificate's hash or the CTL_ANY_SUBJECT_INFO's SubjectIdentifier // The certificate's hash or the CTL_ANY_SUBJECT_INFO's SubjectIdentifier
// is used as the key in searching the subject entries. A binary // is used as the key in searching the subject entries. A binary
// memory comparison is done between the key and the entry's SubjectIdentifer. // memory comparison is done between the key and the entry's SubjectIdentifer.
// //
// dwEncodingType isn't used for either of the above SubjectTypes. // dwEncodingType isn't used for either of the above SubjectTypes.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCTL_ENTRY PCTL_ENTRY
WINAPI WINAPI
CertFindSubjectInCTL( CertFindSubjectInCTL(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in DWORD dwSubjectType, _In_ DWORD dwSubjectType,
__in void *pvSubject, _In_ void *pvSubject,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
// Subject Types: // Subject Types:
// CTL_ANY_SUBJECT_TYPE, pvSubject points to following CTL_ANY_SUBJECT_INFO. // CTL_ANY_SUBJECT_TYPE, pvSubject points to following CTL_ANY_SUBJECT_INFO.
// CTL_CERT_SUBJECT_TYPE, pvSubject points to CERT_CONTEXT. // CTL_CERT_SUBJECT_TYPE, pvSubject points to CERT_CONTEXT.
#define CTL_ANY_SUBJECT_TYPE 1 #define CTL_ANY_SUBJECT_TYPE 1
#define CTL_CERT_SUBJECT_TYPE 2 #define CTL_CERT_SUBJECT_TYPE 2
typedef struct _CTL_ANY_SUBJECT_INFO { typedef struct _CTL_ANY_SUBJECT_INFO {
CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm; CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm;
skipping to change at line 11886 skipping to change at line 12503
// call to find the CTL. To find the next CTL, the // call to find the CTL. To find the next CTL, the
// pPrevCtlContext is set to the CTL_CONTEXT returned by a previous call. // pPrevCtlContext is set to the CTL_CONTEXT returned by a previous call.
// //
// NOTE: a NON-NULL pPrevCtlContext is always CertFreeCTLContext'ed by // NOTE: a NON-NULL pPrevCtlContext is always CertFreeCTLContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCTL_CONTEXT PCCTL_CONTEXT
WINAPI WINAPI
CertFindCTLInStore( CertFindCTLInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwMsgAndCertEncodingType, _In_ DWORD dwMsgAndCertEncodingType,
__in DWORD dwFindFlags, _In_ DWORD dwFindFlags,
__in DWORD dwFindType, _In_ DWORD dwFindType,
__in_opt const void *pvFindPara, _In_opt_ const void *pvFindPara,
__in_opt PCCTL_CONTEXT pPrevCtlContext _In_opt_ PCCTL_CONTEXT pPrevCtlContext
); );
#define CTL_FIND_ANY 0 #define CTL_FIND_ANY 0
#define CTL_FIND_SHA1_HASH 1 #define CTL_FIND_SHA1_HASH 1
#define CTL_FIND_MD5_HASH 2 #define CTL_FIND_MD5_HASH 2
#define CTL_FIND_USAGE 3 #define CTL_FIND_USAGE 3
#define CTL_FIND_SUBJECT 4 #define CTL_FIND_SUBJECT 4
#define CTL_FIND_EXISTING 5 #define CTL_FIND_EXISTING 5
typedef struct _CTL_FIND_USAGE_PARA { typedef struct _CTL_FIND_USAGE_PARA {
skipping to change at line 11987 skipping to change at line 12604
// already exists in the store. See CertAddEncodedCertificateToStore for a // already exists in the store. See CertAddEncodedCertificateToStore for a
// list of and actions taken. // list of and actions taken.
// //
// Compares the CTL's SubjectUsage, ListIdentifier and any of its signers // Compares the CTL's SubjectUsage, ListIdentifier and any of its signers
// to determine if the CTL already exists in the store. // to determine if the CTL already exists in the store.
// //
// ppCtlContext can be NULL, indicating the caller isn't interested // ppCtlContext can be NULL, indicating the caller isn't interested
// in getting the CTL_CONTEXT of the added or existing CTL. // in getting the CTL_CONTEXT of the added or existing CTL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCTLToStore( CertAddEncodedCTLToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in DWORD dwMsgAndCertEncodingType, _In_ DWORD dwMsgAndCertEncodingType,
__in_bcount(cbCtlEncoded) const BYTE *pbCtlEncoded, _In_reads_bytes_(cbCtlEncoded) const BYTE *pbCtlEncoded,
__in DWORD cbCtlEncoded, _In_ DWORD cbCtlEncoded,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCTL_CONTEXT *ppCtlContext _Outptr_opt_ PCCTL_CONTEXT *ppCtlContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Add the CTL context to the store according to the specified // Add the CTL context to the store according to the specified
// disposition option. // disposition option.
// //
// In addition to the encoded CTL, the context's properties are // In addition to the encoded CTL, the context's properties are
// also copied. Note, the CERT_KEY_CONTEXT_PROP_ID property (and its // also copied. Note, the CERT_KEY_CONTEXT_PROP_ID property (and its
// CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_SPEC_PROP_ID) isn't copied. // CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_SPEC_PROP_ID) isn't copied.
// //
skipping to change at line 12020 skipping to change at line 12637
// already exists in the store. See CertAddCertificateContextToStore for a // already exists in the store. See CertAddCertificateContextToStore for a
// list of and actions taken. // list of and actions taken.
// //
// Compares the CTL's SubjectUsage, ListIdentifier and any of its signers // Compares the CTL's SubjectUsage, ListIdentifier and any of its signers
// to determine if the CTL already exists in the store. // to determine if the CTL already exists in the store.
// //
// ppStoreContext can be NULL, indicating the caller isn't interested // ppStoreContext can be NULL, indicating the caller isn't interested
// in getting the CTL_CONTEXT of the added or existing CTL. // in getting the CTL_CONTEXT of the added or existing CTL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddCTLContextToStore( CertAddCTLContextToStore(
__in_opt HCERTSTORE hCertStore, _In_opt_ HCERTSTORE hCertStore,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCTL_CONTEXT *ppStoreContext _Outptr_opt_ PCCTL_CONTEXT *ppStoreContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Serialize the CTL context's encoded CTL and its properties. // Serialize the CTL context's encoded CTL and its properties.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSerializeCTLStoreElement( CertSerializeCTLStoreElement(
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbElement, *pcbElement) BYTE *pbElement, _Out_writes_bytes_to_opt_(*pcbElement, *pcbElement) BYTE *pbElement,
__inout DWORD *pcbElement _Inout_ DWORD *pcbElement
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Delete the specified CTL from the store. // Delete the specified CTL from the store.
// //
// All subsequent gets for the CTL will fail. However, // All subsequent gets for the CTL will fail. However,
// memory allocated for the CTL isn't freed until all of its contexts // memory allocated for the CTL isn't freed until all of its contexts
// have also been freed. // have also been freed.
// //
// The pCtlContext is obtained from a get or duplicate. // The pCtlContext is obtained from a get or duplicate.
// //
// NOTE: the pCtlContext is always CertFreeCTLContext'ed by // NOTE: the pCtlContext is always CertFreeCTLContext'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertDeleteCTLFromStore( CertDeleteCTLFromStore(
__in PCCTL_CONTEXT pCtlContext _In_ PCCTL_CONTEXT pCtlContext
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddCertificateLinkToStore( CertAddCertificateLinkToStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCERT_CONTEXT *ppStoreContext _Outptr_opt_ PCCERT_CONTEXT *ppStoreContext
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddCRLLinkToStore( CertAddCRLLinkToStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in PCCRL_CONTEXT pCrlContext, _In_ PCCRL_CONTEXT pCrlContext,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCRL_CONTEXT *ppStoreContext _Outptr_opt_ PCCRL_CONTEXT *ppStoreContext
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertAddCTLLinkToStore( CertAddCTLLinkToStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwAddDisposition, _In_ DWORD dwAddDisposition,
__deref_opt_out PCCTL_CONTEXT *ppStoreContext _Outptr_opt_ PCCTL_CONTEXT *ppStoreContext
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertAddStoreToCollection( CertAddStoreToCollection(
__in HCERTSTORE hCollectionStore, _In_ HCERTSTORE hCollectionStore,
__in_opt HCERTSTORE hSiblingStore, _In_opt_ HCERTSTORE hSiblingStore,
__in DWORD dwUpdateFlags, _In_ DWORD dwUpdateFlags,
__in DWORD dwPriority _In_ DWORD dwPriority
); );
WINCRYPT32API WINCRYPT32API
void void
WINAPI WINAPI
CertRemoveStoreFromCollection( CertRemoveStoreFromCollection(
__in HCERTSTORE hCollectionStore, _In_ HCERTSTORE hCollectionStore,
__in HCERTSTORE hSiblingStore _In_ HCERTSTORE hSiblingStore
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertControlStore( CertControlStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwCtrlType, _In_ DWORD dwCtrlType,
__in_opt void const *pvCtrlPara _In_opt_ void const *pvCtrlPara
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Store control types // Certificate Store control types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_STORE_CTRL_RESYNC 1 #define CERT_STORE_CTRL_RESYNC 1
#define CERT_STORE_CTRL_NOTIFY_CHANGE 2 #define CERT_STORE_CTRL_NOTIFY_CHANGE 2
#define CERT_STORE_CTRL_COMMIT 3 #define CERT_STORE_CTRL_COMMIT 3
#define CERT_STORE_CTRL_AUTO_RESYNC 4 #define CERT_STORE_CTRL_AUTO_RESYNC 4
#define CERT_STORE_CTRL_CANCEL_NOTIFY 5 #define CERT_STORE_CTRL_CANCEL_NOTIFY 5
skipping to change at line 12252 skipping to change at line 12869
// //
// For all the other PROP_IDs: an encoded PCRYPT_DATA_BLOB is passed in pvData. // For all the other PROP_IDs: an encoded PCRYPT_DATA_BLOB is passed in pvData.
// //
// If the property already exists, then, the old value is deleted and silently // If the property already exists, then, the old value is deleted and silently
// replaced. Setting, pvData to NULL, deletes the property. // replaced. Setting, pvData to NULL, deletes the property.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSetStoreProperty( CertSetStoreProperty(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get a store property. // Get a store property.
// //
// The type definition for pvData depends on the dwPropId value. // The type definition for pvData depends on the dwPropId value.
// CERT_STORE_LOCALIZED_NAME_PROP_ID - localized name of the store. // CERT_STORE_LOCALIZED_NAME_PROP_ID - localized name of the store.
// pvData points to a NULL terminated unicode, wide character string. // pvData points to a NULL terminated unicode, wide character string.
// cbData = (wcslen((LPWSTR) pvData) + 1) * sizeof(WCHAR). // cbData = (wcslen((LPWSTR) pvData) + 1) * sizeof(WCHAR).
// //
// For all other PROP_IDs, pvData points to an array of bytes. // For all other PROP_IDs, pvData points to an array of bytes.
// //
// If the property doesn't exist, returns FALSE and sets LastError to // If the property doesn't exist, returns FALSE and sets LastError to
// CRYPT_E_NOT_FOUND. // CRYPT_E_NOT_FOUND.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
_Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertGetStoreProperty( CertGetStoreProperty(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// If the callback returns FALSE, stops the sort. CertCreateContext // If the callback returns FALSE, stops the sort. CertCreateContext
// will return FALSE and set last error to ERROR_CANCELLED if the sort // will return FALSE and set last error to ERROR_CANCELLED if the sort
// was stopped. // was stopped.
// //
// Where: // Where:
// cbTotalEncoded - total byte count of the encoded entries. // cbTotalEncoded - total byte count of the encoded entries.
// cbRemainEncoded - remaining byte count of the encoded entries. // cbRemainEncoded - remaining byte count of the encoded entries.
// cEntry - running count of sorted entries // cEntry - running count of sorted entries
// pvSort - value passed in pCreatePara // pvSort - value passed in pCreatePara
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_CERT_CREATE_CONTEXT_SORT_FUNC)( typedef BOOL (WINAPI *PFN_CERT_CREATE_CONTEXT_SORT_FUNC)(
__in DWORD cbTotalEncoded, _In_ DWORD cbTotalEncoded,
__in DWORD cbRemainEncoded, _In_ DWORD cbRemainEncoded,
__in DWORD cEntry, _In_ DWORD cEntry,
__inout_opt void *pvSort _Inout_opt_ void *pvSort
); );
typedef struct _CERT_CREATE_CONTEXT_PARA { typedef struct _CERT_CREATE_CONTEXT_PARA {
DWORD cbSize; DWORD cbSize;
PFN_CRYPT_FREE pfnFree; // OPTIONAL PFN_CRYPT_FREE pfnFree; // OPTIONAL
void *pvFree; // OPTIONAL void *pvFree; // OPTIONAL
// Only applicable to CERT_STORE_CTL_CONTEXT when // Only applicable to CERT_STORE_CTL_CONTEXT when
// CERT_CREATE_CONTEXT_SORTED_FLAG is set in dwFlags. // CERT_CREATE_CONTEXT_SORTED_FLAG is set in dwFlags.
PFN_CERT_CREATE_CONTEXT_SORT_FUNC pfnSort; // OPTIONAL PFN_CERT_CREATE_CONTEXT_SORT_FUNC pfnSort; // OPTIONAL
skipping to change at line 12347 skipping to change at line 12965
// If unable to decode and create the context, NULL is returned. // If unable to decode and create the context, NULL is returned.
// Otherwise, a pointer to a read only CERT_CONTEXT, CRL_CONTEXT or // Otherwise, a pointer to a read only CERT_CONTEXT, CRL_CONTEXT or
// CTL_CONTEXT is returned. The context must be freed by the appropriate // CTL_CONTEXT is returned. The context must be freed by the appropriate
// free context API. The context can be duplicated by calling the // free context API. The context can be duplicated by calling the
// appropriate duplicate context API. // appropriate duplicate context API.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
const void * const void *
WINAPI WINAPI
CertCreateContext( CertCreateContext(
__in DWORD dwContextType, _In_ DWORD dwContextType,
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in_bcount(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCERT_CREATE_CONTEXT_PARA pCreatePara _In_opt_ PCERT_CREATE_CONTEXT_PARA pCreatePara
); );
// When the following flag is set, the created context points directly to the // When the following flag is set, the created context points directly to the
// pbEncoded instead of an allocated copy. If pCreatePara and // pbEncoded instead of an allocated copy. If pCreatePara and
// pCreatePara->pfnFree are non-NULL, then, pfnFree is called to free // pCreatePara->pfnFree are non-NULL, then, pfnFree is called to free
// the pbEncoded when the context is last freed. Otherwise, no attempt is // the pbEncoded when the context is last freed. Otherwise, no attempt is
// made to free the pbEncoded. If pCreatePara->pvFree is non-NULL, then its // made to free the pbEncoded. If pCreatePara->pvFree is non-NULL, then its
// passed to pfnFree instead of pbEncoded. // passed to pfnFree instead of pbEncoded.
// //
// Note, if CertCreateContext fails, pfnFree is still called. // Note, if CertCreateContext fails, pfnFree is still called.
skipping to change at line 12497 skipping to change at line 13115
// "\\ComputerName\ServiceName\Trust". The leading "\\" backslashes are // "\\ComputerName\ServiceName\Trust". The leading "\\" backslashes are
// optional in the ComputerName. // optional in the ComputerName.
// //
// Set CERT_STORE_CREATE_NEW_FLAG to cause a failure if the system store // Set CERT_STORE_CREATE_NEW_FLAG to cause a failure if the system store
// already exists in the store location. // already exists in the store location.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertRegisterSystemStore( CertRegisterSystemStore(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCERT_SYSTEM_STORE_INFO pStoreInfo, _In_opt_ PCERT_SYSTEM_STORE_INFO pStoreInfo,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Register a physical store for the specified system store. // Register a physical store for the specified system store.
// //
// The upper word of the dwFlags parameter is used to specify the location of // The upper word of the dwFlags parameter is used to specify the location of
// the system store. // the system store.
// //
// If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore // If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore
// points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise, // points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise,
skipping to change at line 12523 skipping to change at line 13141
// See CertRegisterSystemStore for details on prepending a ServiceName // See CertRegisterSystemStore for details on prepending a ServiceName
// and/or ComputerName to the system store name. // and/or ComputerName to the system store name.
// //
// Set CERT_STORE_CREATE_NEW_FLAG to cause a failure if the physical store // Set CERT_STORE_CREATE_NEW_FLAG to cause a failure if the physical store
// already exists in the system store. // already exists in the system store.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertRegisterPhysicalStore( CertRegisterPhysicalStore(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in LPCWSTR pwszStoreName, _In_ LPCWSTR pwszStoreName,
__in PCERT_PHYSICAL_STORE_INFO pStoreInfo, _In_ PCERT_PHYSICAL_STORE_INFO pStoreInfo,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Unregister the specified system store. // Unregister the specified system store.
// //
// The upper word of the dwFlags parameter is used to specify the location of // The upper word of the dwFlags parameter is used to specify the location of
// the system store. // the system store.
// //
// If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore // If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore
// points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise, // points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise,
skipping to change at line 12549 skipping to change at line 13167
// //
// See CertRegisterSystemStore for details on prepending a ServiceName // See CertRegisterSystemStore for details on prepending a ServiceName
// and/or ComputerName to the system store name. // and/or ComputerName to the system store name.
// //
// CERT_STORE_DELETE_FLAG can optionally be set in dwFlags. // CERT_STORE_DELETE_FLAG can optionally be set in dwFlags.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertUnregisterSystemStore( CertUnregisterSystemStore(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Unregister the physical store from the specified system store. // Unregister the physical store from the specified system store.
// //
// The upper word of the dwFlags parameter is used to specify the location of // The upper word of the dwFlags parameter is used to specify the location of
// the system store. // the system store.
// //
// If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore // If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore
// points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise, // points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise,
skipping to change at line 12572 skipping to change at line 13190
// //
// See CertRegisterSystemStore for details on prepending a ServiceName // See CertRegisterSystemStore for details on prepending a ServiceName
// and/or ComputerName to the system store name. // and/or ComputerName to the system store name.
// //
// CERT_STORE_DELETE_FLAG can optionally be set in dwFlags. // CERT_STORE_DELETE_FLAG can optionally be set in dwFlags.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertUnregisterPhysicalStore( CertUnregisterPhysicalStore(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in LPCWSTR pwszStoreName _In_ LPCWSTR pwszStoreName
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enum callbacks // Enum callbacks
// //
// The CERT_SYSTEM_STORE_LOCATION_MASK bits in the dwFlags parameter // The CERT_SYSTEM_STORE_LOCATION_MASK bits in the dwFlags parameter
// specifies the location of the system store // specifies the location of the system store
// //
// If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore // If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore
// points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise, // points to a CERT_SYSTEM_STORE_RELOCATE_PARA data structure. Otherwise,
// pvSystemStore points to a null terminated UNICODE string. // pvSystemStore points to a null terminated UNICODE string.
// //
// The callback returns FALSE and sets LAST_ERROR to stop the enumeration. // The callback returns FALSE and sets LAST_ERROR to stop the enumeration.
// The LAST_ERROR is returned to the caller of the enumeration. // The LAST_ERROR is returned to the caller of the enumeration.
// //
// The pvSystemStore passed to the callback has leading ComputerName and/or // The pvSystemStore passed to the callback has leading ComputerName and/or
// ServiceName prefixes where appropriate. // ServiceName prefixes where appropriate.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)( typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)(
__in LPCWSTR pwszStoreLocation, _In_ LPCWSTR pwszStoreLocation,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__inout_opt void *pvArg _Inout_opt_ void *pvArg
); );
typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE)( typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE)(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in PCERT_SYSTEM_STORE_INFO pStoreInfo, _In_ PCERT_SYSTEM_STORE_INFO pStoreInfo,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__inout_opt void *pvArg _Inout_opt_ void *pvArg
); );
typedef BOOL (WINAPI *PFN_CERT_ENUM_PHYSICAL_STORE)( typedef BOOL (WINAPI *PFN_CERT_ENUM_PHYSICAL_STORE)(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in LPCWSTR pwszStoreName, _In_ LPCWSTR pwszStoreName,
__in PCERT_PHYSICAL_STORE_INFO pStoreInfo, _In_ PCERT_PHYSICAL_STORE_INFO pStoreInfo,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__inout_opt void *pvArg _Inout_opt_ void *pvArg
); );
// In the PFN_CERT_ENUM_PHYSICAL_STORE callback the following flag is // In the PFN_CERT_ENUM_PHYSICAL_STORE callback the following flag is
// set if the physical store wasn't registered and is an implicitly created // set if the physical store wasn't registered and is an implicitly created
// predefined physical store. // predefined physical store.
#define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
// Names of implicitly created predefined physical stores // Names of implicitly created predefined physical stores
#define CERT_PHYSICAL_STORE_DEFAULT_NAME L".Default" #define CERT_PHYSICAL_STORE_DEFAULT_NAME L".Default"
#define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME L".GroupPolicy" #define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME L".GroupPolicy"
skipping to change at line 12641 skipping to change at line 13259
#define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME L".AuthRoot" #define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME L".AuthRoot"
#define CERT_PHYSICAL_STORE_SMART_CARD_NAME L".SmartCard" #define CERT_PHYSICAL_STORE_SMART_CARD_NAME L".SmartCard"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the system store locations. // Enumerate the system store locations.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertEnumSystemStoreLocation( CertEnumSystemStoreLocation(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__callback PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum __callback PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the system stores. // Enumerate the system stores.
// //
// The upper word of the dwFlags parameter is used to specify the location of // The upper word of the dwFlags parameter is used to specify the location of
// the system store. // the system store.
// //
// If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, // If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags,
skipping to change at line 12681 skipping to change at line 13299
// "\\ComputerName" or "ComputerName\" // "\\ComputerName" or "ComputerName\"
// "ComputerName\ServiceName" // "ComputerName\ServiceName"
// Note, if only the ComputerName is specified, then, it must have either // Note, if only the ComputerName is specified, then, it must have either
// the leading "\\" backslashes or a trailing backslash. Otherwise, its // the leading "\\" backslashes or a trailing backslash. Otherwise, its
// interpretted as the ServiceName or UserName. // interpretted as the ServiceName or UserName.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertEnumSystemStore( CertEnumSystemStore(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvSystemStoreLocationPara, _In_opt_ void *pvSystemStoreLocationPara,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__callback PFN_CERT_ENUM_SYSTEM_STORE pfnEnum __callback PFN_CERT_ENUM_SYSTEM_STORE pfnEnum
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the physical stores for the specified system store. // Enumerate the physical stores for the specified system store.
// //
// The upper word of the dwFlags parameter is used to specify the location of // The upper word of the dwFlags parameter is used to specify the location of
// the system store. // the system store.
// //
// If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore // If CERT_SYSTEM_STORE_RELOCATE_FLAG is set in dwFlags, pvSystemStore
skipping to change at line 12707 skipping to change at line 13325
// See CertRegisterSystemStore for details on prepending a ServiceName // See CertRegisterSystemStore for details on prepending a ServiceName
// and/or ComputerName to the system store name. // and/or ComputerName to the system store name.
// //
// If the system store location only supports system stores and doesn't // If the system store location only supports system stores and doesn't
// support physical stores, LastError is set to ERROR_CALL_NOT_IMPLEMENTED. // support physical stores, LastError is set to ERROR_CALL_NOT_IMPLEMENTED.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertEnumPhysicalStore( CertEnumPhysicalStore(
__in const void *pvSystemStore, _In_ const void *pvSystemStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__callback PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum __callback PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate System Store Installable Functions // Certificate System Store Installable Functions
// //
// The CERT_SYSTEM_STORE_LOCATION_MASK bits in the dwFlags parameter passed // The CERT_SYSTEM_STORE_LOCATION_MASK bits in the dwFlags parameter passed
// to the CertOpenStore(for "System", "SystemRegistry" or "Physical" // to the CertOpenStore(for "System", "SystemRegistry" or "Physical"
// Provider), CertRegisterSystemStore, // Provider), CertRegisterSystemStore,
// CertUnregisterSystemStore, CertEnumSystemStore, CertRegisterPhysicalStore, // CertUnregisterSystemStore, CertEnumSystemStore, CertRegisterPhysicalStore,
skipping to change at line 12768 skipping to change at line 13386
// If the CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG is set, then, only get the // If the CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG is set, then, only get the
// extension. // extension.
// //
// If the CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG is set, then, only get the // If the CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG is set, then, only get the
// property. // property.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertGetEnhancedKeyUsage( CertGetEnhancedKeyUsage(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbUsage, *pcbUsage) PCERT_ENHKEY_USAGE pUsage, _Out_writes_bytes_to_opt_(*pcbUsage, *pcbUsage) PCERT_ENHKEY_USAGE pUsage,
__inout DWORD *pcbUsage _Inout_ DWORD *pcbUsage
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Set the enhanced key usage property for the certificate. // Set the enhanced key usage property for the certificate.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertSetEnhancedKeyUsage( CertSetEnhancedKeyUsage(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in_opt PCERT_ENHKEY_USAGE pUsage _In_opt_ PCERT_ENHKEY_USAGE pUsage
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Add the usage identifier to the certificate's enhanced key usage property. // Add the usage identifier to the certificate's enhanced key usage property.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertAddEnhancedKeyUsageIdentifier( CertAddEnhancedKeyUsageIdentifier(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in LPCSTR pszUsageIdentifier _In_ LPCSTR pszUsageIdentifier
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Remove the usage identifier from the certificate's enhanced key usage // Remove the usage identifier from the certificate's enhanced key usage
// property. // property.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertRemoveEnhancedKeyUsageIdentifier( CertRemoveEnhancedKeyUsageIdentifier(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in LPCSTR pszUsageIdentifier _In_ LPCSTR pszUsageIdentifier
); );
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// //
// Takes an array of certs and returns an array of usages // Takes an array of certs and returns an array of usages
// which consists of the intersection of the valid usages for each cert. // which consists of the intersection of the valid usages for each cert.
// If each cert is good for all possible usages then the cNumOIDs is set to -1. // If each cert is good for all possible usages then the cNumOIDs is set to -1.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
_Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertGetValidUsages( CertGetValidUsages(
__in DWORD cCerts, _In_ DWORD cCerts,
__in_ecount(cCerts) PCCERT_CONTEXT *rghCerts, _In_reads_(cCerts) PCCERT_CONTEXT *rghCerts,
__out int *cNumOIDs, _Out_ int *cNumOIDs,
__out_bcount_part_opt(*pcbOIDs, *pcbOIDs) LPSTR *rghOIDs, _Out_writes_bytes_to_opt_(*pcbOIDs, *pcbOIDs) LPSTR *rghOIDs,
__inout DWORD *pcbOIDs); _Inout_ DWORD *pcbOIDs);
//+========================================================================= //+=========================================================================
// Cryptographic Message helper functions for verifying and signing a // Cryptographic Message helper functions for verifying and signing a
// CTL. // CTL.
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get and verify the signer of a cryptographic message. // Get and verify the signer of a cryptographic message.
// //
// To verify a CTL, the hCryptMsg is obtained from the CTL_CONTEXT's // To verify a CTL, the hCryptMsg is obtained from the CTL_CONTEXT's
skipping to change at line 12855 skipping to change at line 13474
// If CMSG_USE_SIGNER_INDEX_FLAG is set, then, only get the signer specified // If CMSG_USE_SIGNER_INDEX_FLAG is set, then, only get the signer specified
// by *pdwSignerIndex. Otherwise, iterate through all the signers // by *pdwSignerIndex. Otherwise, iterate through all the signers
// until a signer verifies or no more signers. // until a signer verifies or no more signers.
// //
// For a verified signature, *ppSigner is updated with certificate context // For a verified signature, *ppSigner is updated with certificate context
// of the signer and *pdwSignerIndex is updated with the index of the signer. // of the signer and *pdwSignerIndex is updated with the index of the signer.
// ppSigner and/or pdwSignerIndex can be NULL, indicating the caller isn't // ppSigner and/or pdwSignerIndex can be NULL, indicating the caller isn't
// interested in getting the CertContext and/or index of the signer. // interested in getting the CertContext and/or index of the signer.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptMsgGetAndVerifySigner( CryptMsgGetAndVerifySigner(
__in HCRYPTMSG hCryptMsg, _In_ HCRYPTMSG hCryptMsg,
__in DWORD cSignerStore, _In_ DWORD cSignerStore,
__in_ecount_opt(cSignerStore) HCERTSTORE *rghSignerStore, _In_reads_opt_(cSignerStore) HCERTSTORE *rghSignerStore,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__deref_opt_out PCCERT_CONTEXT *ppSigner, _Outptr_opt_ PCCERT_CONTEXT *ppSigner,
__inout_opt DWORD *pdwSignerIndex _Inout_opt_ DWORD *pdwSignerIndex
); );
#define CMSG_TRUSTED_SIGNER_FLAG 0x1 #define CMSG_TRUSTED_SIGNER_FLAG 0x1
#define CMSG_SIGNER_ONLY_FLAG 0x2 #define CMSG_SIGNER_ONLY_FLAG 0x2
#define CMSG_USE_SIGNER_INDEX_FLAG 0x4 #define CMSG_USE_SIGNER_INDEX_FLAG 0x4
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sign an encoded CTL. // Sign an encoded CTL.
// //
// The pbCtlContent can be obtained via a CTL_CONTEXT's pbCtlContent // The pbCtlContent can be obtained via a CTL_CONTEXT's pbCtlContent
// field or via a CryptEncodeObject(PKCS_CTL or PKCS_SORTED_CTL). // field or via a CryptEncodeObject(PKCS_CTL or PKCS_SORTED_CTL).
// //
// CMSG_CMS_ENCAPSULATED_CTL_FLAG can be set to encode a CMS compatible // CMSG_CMS_ENCAPSULATED_CTL_FLAG can be set to encode a CMS compatible
// V3 SignedData message. // V3 SignedData message.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptMsgSignCTL( CryptMsgSignCTL(
__in DWORD dwMsgEncodingType, _In_ DWORD dwMsgEncodingType,
__in_bcount(cbCtlContent) BYTE *pbCtlContent, _In_reads_bytes_(cbCtlContent) BYTE *pbCtlContent,
__in DWORD cbCtlContent, _In_ DWORD cbCtlContent,
__in PCMSG_SIGNED_ENCODE_INFO pSignInfo, _In_ PCMSG_SIGNED_ENCODE_INFO pSignInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded, _Out_writes_bytes_to_opt_(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
__inout DWORD *pcbEncoded _Inout_ DWORD *pcbEncoded
); );
// When set, CTL inner content is encapsulated within an OCTET STRING // When set, CTL inner content is encapsulated within an OCTET STRING
#define CMSG_CMS_ENCAPSULATED_CTL_FLAG 0x00008000 #define CMSG_CMS_ENCAPSULATED_CTL_FLAG 0x00008000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Encode the CTL and create a signed message containing the encoded CTL. // Encode the CTL and create a signed message containing the encoded CTL.
// //
// Set CMSG_ENCODE_SORTED_CTL_FLAG if the CTL entries are to be sorted // Set CMSG_ENCODE_SORTED_CTL_FLAG if the CTL entries are to be sorted
// before encoding. This flag should be set, if the // before encoding. This flag should be set, if the
skipping to change at line 12913 skipping to change at line 13532
// MD5 or SHA1, then, CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG should // MD5 or SHA1, then, CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG should
// also be set. // also be set.
// //
// CMSG_CMS_ENCAPSULATED_CTL_FLAG can be set to encode a CMS compatible // CMSG_CMS_ENCAPSULATED_CTL_FLAG can be set to encode a CMS compatible
// V3 SignedData message. // V3 SignedData message.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptMsgEncodeAndSignCTL( CryptMsgEncodeAndSignCTL(
__in DWORD dwMsgEncodingType, _In_ DWORD dwMsgEncodingType,
__in PCTL_INFO pCtlInfo, _In_ PCTL_INFO pCtlInfo,
__in PCMSG_SIGNED_ENCODE_INFO pSignInfo, _In_ PCMSG_SIGNED_ENCODE_INFO pSignInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded, _Out_writes_bytes_to_opt_(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
__inout DWORD *pcbEncoded _Inout_ DWORD *pcbEncoded
); );
// The following flag is set if the CTL is to be encoded with sorted // The following flag is set if the CTL is to be encoded with sorted
// trusted subjects and the szOID_SORTED_CTL extension is inserted containing // trusted subjects and the szOID_SORTED_CTL extension is inserted containing
// sorted offsets to the encoded subjects. // sorted offsets to the encoded subjects.
#define CMSG_ENCODE_SORTED_CTL_FLAG 0x1 #define CMSG_ENCODE_SORTED_CTL_FLAG 0x1
// If the above sorted flag is set, then, the following flag should also // If the above sorted flag is set, then, the following flag should also
// be set if the identifier for the TrustedSubjects is a hash, // be set if the identifier for the TrustedSubjects is a hash,
// such as, MD5 or SHA1. // such as, MD5 or SHA1.
#define CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x2 #define CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x2
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Returns TRUE if the SubjectIdentifier exists in the CTL. Optionally // Returns TRUE if the SubjectIdentifier exists in the CTL. Optionally
// returns a pointer to and byte count of the Subject's encoded attributes. // returns a pointer to and byte count of the Subject's encoded attributes.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertFindSubjectInSortedCTL( CertFindSubjectInSortedCTL(
__in PCRYPT_DATA_BLOB pSubjectIdentifier, _In_ PCRYPT_DATA_BLOB pSubjectIdentifier,
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out_opt PCRYPT_DER_BLOB pEncodedAttributes _Out_opt_ PCRYPT_DER_BLOB pEncodedAttributes
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerates through the sequence of TrustedSubjects in a CTL context // Enumerates through the sequence of TrustedSubjects in a CTL context
// created with CERT_CREATE_CONTEXT_SORTED_FLAG set. // created with CERT_CREATE_CONTEXT_SORTED_FLAG set.
// //
// To start the enumeration, *ppvNextSubject must be NULL. Upon return, // To start the enumeration, *ppvNextSubject must be NULL. Upon return,
// *ppvNextSubject is updated to point to the next TrustedSubject in // *ppvNextSubject is updated to point to the next TrustedSubject in
// the encoded sequence. // the encoded sequence.
// //
// Returns FALSE for no more subjects or invalid arguments. // Returns FALSE for no more subjects or invalid arguments.
// //
// Note, the returned DER_BLOBs point directly into the encoded // Note, the returned DER_BLOBs point directly into the encoded
// bytes (not allocated, and must not be freed). // bytes (not allocated, and must not be freed).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertEnumSubjectInSortedCTL( CertEnumSubjectInSortedCTL(
__in PCCTL_CONTEXT pCtlContext, _In_ PCCTL_CONTEXT pCtlContext,
__deref_inout_opt void **ppvNextSubject, _Inout_ void **ppvNextSubject,
__out_opt PCRYPT_DER_BLOB pSubjectIdentifier, _Out_opt_ PCRYPT_DER_BLOB pSubjectIdentifier,
__out_opt PCRYPT_DER_BLOB pEncodedAttributes _Out_opt_ PCRYPT_DER_BLOB pEncodedAttributes
); );
//+========================================================================= //+=========================================================================
// Certificate Verify CTL Usage Data Structures and APIs // Certificate Verify CTL Usage Data Structures and APIs
//========================================================================== //==========================================================================
typedef struct _CTL_VERIFY_USAGE_PARA { typedef struct _CTL_VERIFY_USAGE_PARA {
DWORD cbSize; DWORD cbSize;
CRYPT_DATA_BLOB ListIdentifier; // OPTIONAL CRYPT_DATA_BLOB ListIdentifier; // OPTIONAL
DWORD cCtlStore; DWORD cCtlStore;
skipping to change at line 13052 skipping to change at line 13671
// CRYPT_E_NO_VERIFY_USAGE_DLL // CRYPT_E_NO_VERIFY_USAGE_DLL
// CRYPT_E_NO_VERIFY_USAGE_CHECK // CRYPT_E_NO_VERIFY_USAGE_CHECK
// CRYPT_E_VERIFY_USAGE_OFFLINE // CRYPT_E_VERIFY_USAGE_OFFLINE
// CRYPT_E_NOT_IN_CTL // CRYPT_E_NOT_IN_CTL
// CRYPT_E_NO_TRUSTED_SIGNER // CRYPT_E_NO_TRUSTED_SIGNER
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertVerifyCTLUsage( CertVerifyCTLUsage(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in DWORD dwSubjectType, _In_ DWORD dwSubjectType,
__in void *pvSubject, _In_ void *pvSubject,
__in PCTL_USAGE pSubjectUsage, _In_ PCTL_USAGE pSubjectUsage,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCTL_VERIFY_USAGE_PARA pVerifyUsagePara, _In_opt_ PCTL_VERIFY_USAGE_PARA pVerifyUsagePara,
__inout PCTL_VERIFY_USAGE_STATUS pVerifyUsageStatus _Inout_ PCTL_VERIFY_USAGE_STATUS pVerifyUsageStatus
); );
//+========================================================================= //+=========================================================================
// Certificate Revocation Data Structures and APIs // Certificate Revocation Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// This data structure is updated by a CRL revocation type handler // This data structure is updated by a CRL revocation type handler
// with the base and possibly the delta CRL used. // with the base and possibly the delta CRL used.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 13267 skipping to change at line 13886
// CRYPT_E_REVOKED, then, CertVerifyRevocation either continues on to the // CRYPT_E_REVOKED, then, CertVerifyRevocation either continues on to the
// next DLL in the list for a returned dwIndex of 0 or for a returned // next DLL in the list for a returned dwIndex of 0 or for a returned
// dwIndex > 0, restarts the process of finding a verify function by // dwIndex > 0, restarts the process of finding a verify function by
// advancing the start of the context array to the returned dwIndex and // advancing the start of the context array to the returned dwIndex and
// decrementing the count of remaining contexts. // decrementing the count of remaining contexts.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertVerifyRevocation( CertVerifyRevocation(
__in DWORD dwEncodingType, _In_ DWORD dwEncodingType,
__in DWORD dwRevType, _In_ DWORD dwRevType,
__in DWORD cContext, _In_ DWORD cContext,
__in_ecount(cContext) PVOID rgpvContext[], _In_reads_(cContext) PVOID rgpvContext[],
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCERT_REVOCATION_PARA pRevPara, _In_opt_ PCERT_REVOCATION_PARA pRevPara,
__inout PCERT_REVOCATION_STATUS pRevStatus _Inout_ PCERT_REVOCATION_STATUS pRevStatus
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Revocation types // Revocation types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_CONTEXT_REVOCATION_TYPE 1 #define CERT_CONTEXT_REVOCATION_TYPE 1
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// When the following flag is set, rgpvContext[] consists of a chain // When the following flag is set, rgpvContext[] consists of a chain
// of certificates, where rgpvContext[i + 1] is the issuer of rgpvContext[i]. // of certificates, where rgpvContext[i + 1] is the issuer of rgpvContext[i].
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_VERIFY_REV_CHAIN_FLAG 0x00000001 #define CERT_VERIFY_REV_CHAIN_FLAG 0x00000001
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION prevents the revocation handler from // CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION prevents the revocation handler from
// accessing any network based resources for revocation checking // accessing any network based resources for revocation checking
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION 0x00000002 #define CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION 0x00000002
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// By default, the dwUrlRetrievalTimeout in pRevPara is the timeout used // By default, the dwUrlRetrievalTimeout in pRevPara is the timeout used
// for each URL wire retrieval. When the following flag is set, // for each URL wire retrieval. When the following flag is set,
// dwUrlRetrievalTimeout is the accumulative timeout across all URL wire // dwUrlRetrievalTimeout is the accumulative timeout across all URL wire
// retrievals. // retrievals.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG 0x00000004 #define CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG 0x00000004
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// When the following flag is set, only OCSP responses are used for // When the following flag is set, only OCSP responses are used for
// doing revocation checking. If the certificate doesn't have any // doing revocation checking. If the certificate doesn't have any
// OCSP AIA URLs, dwError is set to CRYPT_E_NOT_IN_REVOCATION_DATABASE. // OCSP AIA URLs, dwError is set to CRYPT_E_NOT_IN_REVOCATION_DATABASE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_VERIFY_REV_SERVER_OCSP_FLAG 0x00000008 #define CERT_VERIFY_REV_SERVER_OCSP_FLAG 0x00000008
//+-------------------------------------------------------------------------
// When the following flag is set, only the OCSP AIA URL is used if
// present in the subject. If the subject doesn't have an OCSP AIA URL, then,
// the CDP URLs are used.
//--------------------------------------------------------------------------
#define CERT_VERIFY_REV_NO_OCSP_FAILOVER_TO_CRL_FLAG 0x00000010
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_CONTEXT_REVOCATION_TYPE // CERT_CONTEXT_REVOCATION_TYPE
// //
// pvContext points to a const CERT_CONTEXT. // pvContext points to a const CERT_CONTEXT.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+========================================================================= //+=========================================================================
// Certificate Helper APIs // Certificate Helper APIs
//========================================================================== //==========================================================================
skipping to change at line 13335 skipping to change at line 13961
// The multiple byte integers are treated as Little Endian. pbData[0] is the // The multiple byte integers are treated as Little Endian. pbData[0] is the
// least significant byte and pbData[cbData - 1] is the most significant // least significant byte and pbData[cbData - 1] is the most significant
// byte. // byte.
// //
// Returns TRUE if the integer blobs are identical after removing leading // Returns TRUE if the integer blobs are identical after removing leading
// 0 or 0xFF bytes. // 0 or 0xFF bytes.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
BOOL BOOL
WINAPI WINAPI
CertCompareIntegerBlob( CertCompareIntegerBlob(
__in PCRYPT_INTEGER_BLOB pInt1, _In_ PCRYPT_INTEGER_BLOB pInt1,
__in PCRYPT_INTEGER_BLOB pInt2 _In_ PCRYPT_INTEGER_BLOB pInt2
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Compare two certificates to see if they are identical. // Compare two certificates to see if they are identical.
// //
// Since a certificate is uniquely identified by its Issuer and SerialNumber, // Since a certificate is uniquely identified by its Issuer and SerialNumber,
// these are the only fields needing to be compared. // these are the only fields needing to be compared.
// //
// Returns TRUE if the certificates are identical. // Returns TRUE if the certificates are identical.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertCompareCertificate( CertCompareCertificate(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_INFO pCertId1, _In_ PCERT_INFO pCertId1,
__in PCERT_INFO pCertId2 _In_ PCERT_INFO pCertId2
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Compare two certificate names to see if they are identical. // Compare two certificate names to see if they are identical.
// //
// Returns TRUE if the names are identical. // Returns TRUE if the names are identical.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertCompareCertificateName( CertCompareCertificateName(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_NAME_BLOB pCertName1, _In_ PCERT_NAME_BLOB pCertName1,
__in PCERT_NAME_BLOB pCertName2 _In_ PCERT_NAME_BLOB pCertName2
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Compare the attributes in the certificate name with the specified // Compare the attributes in the certificate name with the specified
// Relative Distinguished Name's (CERT_RDN) array of attributes. // Relative Distinguished Name's (CERT_RDN) array of attributes.
// The comparison iterates through the CERT_RDN attributes and looks for an // The comparison iterates through the CERT_RDN attributes and looks for an
// attribute match in any of the certificate name's RDNs. // attribute match in any of the certificate name's RDNs.
// Returns TRUE if all the attributes are found and match. // Returns TRUE if all the attributes are found and match.
// //
// The CERT_RDN_ATTR fields can have the following special values: // The CERT_RDN_ATTR fields can have the following special values:
skipping to change at line 13392 skipping to change at line 14018
// a case insensitive match. Otherwise, defaults to an exact, case sensitive // a case insensitive match. Otherwise, defaults to an exact, case sensitive
// match. // match.
// //
// CERT_UNICODE_IS_RDN_ATTRS_FLAG should be set if the pRDN was initialized // CERT_UNICODE_IS_RDN_ATTRS_FLAG should be set if the pRDN was initialized
// with unicode strings as for CryptEncodeObject(X509_UNICODE_NAME). // with unicode strings as for CryptEncodeObject(X509_UNICODE_NAME).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertIsRDNAttrsInCertificateName( CertIsRDNAttrsInCertificateName(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in PCERT_NAME_BLOB pCertName, _In_ PCERT_NAME_BLOB pCertName,
__in PCERT_RDN pRDN _In_ PCERT_RDN pRDN
); );
#define CERT_UNICODE_IS_RDN_ATTRS_FLAG 0x1 #define CERT_UNICODE_IS_RDN_ATTRS_FLAG 0x1
#define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 0x2 #define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 0x2
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Compare two public keys to see if they are identical. // Compare two public keys to see if they are identical.
// //
// Returns TRUE if the keys are identical. // Returns TRUE if the keys are identical.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertComparePublicKeyInfo( CertComparePublicKeyInfo(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pPublicKey1, _In_ PCERT_PUBLIC_KEY_INFO pPublicKey1,
__in PCERT_PUBLIC_KEY_INFO pPublicKey2 _In_ PCERT_PUBLIC_KEY_INFO pPublicKey2
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the public/private key's bit length. // Get the public/private key's bit length.
// //
// Returns 0 if unable to determine the key's length. // Returns 0 if unable to determine the key's length.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertGetPublicKeyLength( CertGetPublicKeyLength(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pPublicKey _In_ PCERT_PUBLIC_KEY_INFO pPublicKey
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify the signature of a subject certificate or a CRL using the // Verify the signature of a subject certificate or a CRL using the
// public key info // public key info
// //
// Returns TRUE for a valid signature. // Returns TRUE for a valid signature.
// //
// hCryptProv specifies the crypto provider to use to verify the signature. // hCryptProv specifies the crypto provider to use to verify the signature.
// It doesn't need to use a private key. // It doesn't need to use a private key.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__checkReturn _Must_inspect_result_
BOOL BOOL
WINAPI WINAPI
CryptVerifyCertificateSignature( CryptVerifyCertificateSignature(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__in PCERT_PUBLIC_KEY_INFO pPublicKey _In_ PCERT_PUBLIC_KEY_INFO pPublicKey
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify the signature of a subject certificate, CRL, certificate request // Verify the signature of a subject certificate, CRL, certificate request
// or keygen request using the issuer's public key. // or keygen request using the issuer's public key.
// //
// Returns TRUE for a valid signature. // Returns TRUE for a valid signature.
// //
// The subject can be an encoded blob or a context for a certificate or CRL. // The subject can be an encoded blob or a context for a certificate or CRL.
// For a subject certificate context, if the certificate is missing // For a subject certificate context, if the certificate is missing
skipping to change at line 13475 skipping to change at line 14101
// Its private key isn't used. If hCryptProv is NULL, a default // Its private key isn't used. If hCryptProv is NULL, a default
// provider is picked according to the PublicKey Algorithm OID. // provider is picked according to the PublicKey Algorithm OID.
// //
// If the signature algorithm is a hashing algorithm, then, the // If the signature algorithm is a hashing algorithm, then, the
// signature is expected to contain the hash octets. Only dwIssuerType // signature is expected to contain the hash octets. Only dwIssuerType
// of CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL may be specified // of CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL may be specified
// to verify this no signature case. If any other dwIssuerType is // to verify this no signature case. If any other dwIssuerType is
// specified, the verify will fail with LastError set to E_INVALIDARG. // specified, the verify will fail with LastError set to E_INVALIDARG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__checkReturn _Must_inspect_result_
BOOL BOOL
WINAPI WINAPI
CryptVerifyCertificateSignatureEx( CryptVerifyCertificateSignatureEx(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in DWORD dwSubjectType, _In_ DWORD dwSubjectType,
__in void *pvSubject, _In_ void *pvSubject,
__in DWORD dwIssuerType, _In_ DWORD dwIssuerType,
__in_opt void *pvIssuer, _In_opt_ void *pvIssuer,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Inout_opt_ void *pvExtra
); );
// Subject Types // Subject Types
#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1
// pvSubject :: PCRYPT_DATA_BLOB // pvSubject :: PCRYPT_DATA_BLOB
#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2
// pvSubject :: PCCERT_CONTEXT // pvSubject :: PCCERT_CONTEXT
#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3
// pvSubject :: PCCRL_CONTEXT // pvSubject :: PCCRL_CONTEXT
#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_OCSP_BASIC_SIGNED_RESPONSE 4 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_OCSP_BASIC_SIGNED_RESPONSE 4
skipping to change at line 13509 skipping to change at line 14135
// Issuer Types // Issuer Types
#define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1
// pvIssuer :: PCERT_PUBLIC_KEY_INFO // pvIssuer :: PCERT_PUBLIC_KEY_INFO
#define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2
// pvIssuer :: PCCERT_CONTEXT // pvIssuer :: PCCERT_CONTEXT
#define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3
// pvIssuer :: PCCERT_CHAIN_CONTEXT // pvIssuer :: PCCERT_CHAIN_CONTEXT
#define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4
// pvIssuer :: NULL // pvIssuer :: NULL
//
// If the following flag is set and a MD2 or MD4 signature hash is
// detected, then, this API fails and sets LastError to NTE_BAD_ALGID
//
// This API first does the signature verification check. If the signature
// verification succeeds and the following flag is set, it then checks for a
// MD2 or MD4 hash. For a MD2 or MD4 hash FALSE is returned with LastError set
// to NTE_BAD_ALGID. This error will only be set if MD2 or MD4 is detected.
// If NTE_BAD_ALGID is returned, then, the MD2 or MD4 signature verified.
// This allows the caller to conditionally allow MD2 or MD4.
//
#define CRYPT_VERIFY_CERT_SIGN_DISABLE_MD2_MD4_FLAG 0x00000001
//
// When the following flag is set, the strong signature properties are
// also set on the Subject. Only applicable to the
// CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL Subject Type.
//
// The strong signature properties are:
// - CERT_SIGN_HASH_CNG_ALG_PROP_ID
// - CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID
//
#define CRYPT_VERIFY_CERT_SIGN_SET_STRONG_PROPERTIES_FLAG 0x00000002
//
// When the following flag is set, the strong signature properties are also
// returned. Only applicable to the
// CRYPT_VERIFY_CERT_SIGN_SUBJECT_OCSP_BASIC_SIGNED_RESPONSE Subject Type.
//
// pvExtra points to a pointer to CRYPT_VERIFY_CERT_SIGN_VERIFY_PROPERTIES_INFO.
// ie, PCRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO *ppStrongPropertiesInfo.
// The returned pointer is freed via CryptMemFree().
//
// The strong signature properties are:
// - CERT_SIGN_HASH_CNG_ALG_PROP_ID
// - CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID
//
#define CRYPT_VERIFY_CERT_SIGN_RETURN_STRONG_PROPERTIES_FLAG 0x00000004
typedef struct _CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO {
// CERT_SIGN_HASH_CNG_ALG_PROP_ID
CRYPT_DATA_BLOB CertSignHashCNGAlgPropData;
// CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID
CRYPT_DATA_BLOB CertIssuerPubKeyBitLengthPropData;
} CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO,
*PCRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO;
#define CRYPT_VERIFY_CERT_SIGN_CHECK_WEAK_HASH_FLAG 0x00000008
typedef struct _CRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO {
DWORD cCNGHashAlgid;
PCWSTR *rgpwszCNGHashAlgid;
// If not weak, dwWeakIndex is set to cCNGHashAlgid. Otherwise,
// index into the above array.
DWORD dwWeakIndex;
} CRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO,
*PCRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO;
//+-------------------------------------------------------------------------
// Checks if the specified hash algorithm and the signing certificate's
// public key algorithm can be used to do a strong signature.
//
// Returns TRUE if the hash algorithm and certificate public key algorithm
// satisfy the strong signature requirements.
//
// pwszCNGHashAlgid is the CNG hash algorithm identifier string, for example,
// BCRYPT_SHA256_ALGORITHM (L"SHA256")
//
// The CNG hash algorithm identifier string can be empty (L"") to only check
// if the certificate's public key is strong.
//
// The SigningCert can be NULL to only check if the CNG hash algorithm is
// strong.
//--------------------------------------------------------------------------
WINCRYPT32API
BOOL
WINAPI
CertIsStrongHashToSign(
_In_ PCCERT_STRONG_SIGN_PARA pStrongSignPara,
_In_ LPCWSTR pwszCNGHashAlgid,
_In_opt_ PCCERT_CONTEXT pSigningCert
);
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Compute the hash of the "to be signed" information in the encoded // Compute the hash of the "to be signed" information in the encoded
// signed content (CERT_SIGNED_CONTENT_INFO). // signed content (CERT_SIGNED_CONTENT_INFO).
// //
// hCryptProv specifies the crypto provider to use to compute the hash. // hCryptProv specifies the crypto provider to use to compute the hash.
// It doesn't need to use a private key. // It doesn't need to use a private key.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptHashToBeSigned( CryptHashToBeSigned(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
sh, edHash,
__inout DWORD *pcbComputedHash _Inout_ DWORD *pcbComputedHash
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Hash the encoded content. // Hash the encoded content.
// //
// hCryptProv specifies the crypto provider to use to compute the hash. // hCryptProv specifies the crypto provider to use to compute the hash.
// It doesn't need to use a private key. // It doesn't need to use a private key.
// //
// Algid specifies the CAPI hash algorithm to use. If Algid is 0, then, the // Algid specifies the CAPI hash algorithm to use. If Algid is 0, then, the
// default hash algorithm (currently SHA1) is used. // default hash algorithm (currently SHA1) is used.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptHashCertificate( CryptHashCertificate(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in ALG_ID Algid, _In_ ALG_ID Algid,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_bcount_opt(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
sh, edHash,
__inout DWORD *pcbComputedHash _Inout_ DWORD *pcbComputedHash
); );
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Hash the encoded content using the CNG hash algorithm provider. // Hash the encoded content using the CNG hash algorithm provider.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
_Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CryptHashCertificate2( CryptHashCertificate2(
__in LPCWSTR pwszCNGHashAlgid, _In_ LPCWSTR pwszCNGHashAlgid,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__in_bcount_opt(cbEncoded) const BYTE *pbEncoded, _In_reads_bytes_opt_(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded, _In_ DWORD cbEncoded,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
sh, edHash,
__inout DWORD *pcbComputedHash _Inout_ DWORD *pcbComputedHash
); );
#endif // (NTDDI_VERSION >= NTDDI_WINLH) #endif // (NTDDI_VERSION >= NTDDI_VISTA)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sign the "to be signed" information in the encoded signed content. // Sign the "to be signed" information in the encoded signed content.
// //
// hCryptProvOrNCryptKey specifies the crypto provider to use to do the // hCryptProvOrNCryptKey specifies the crypto provider to use to do the
// signature. It uses the specified private key. // signature. It uses the specified private key.
// //
// If the SignatureAlgorithm is a hash algorithm, then, the signature // If the SignatureAlgorithm is a hash algorithm, then, the signature
// contains the hash octets. A private key isn't used to encrypt the hash. // contains the hash octets. A private key isn't used to encrypt the hash.
// dwKeySpec isn't used and hCryptProvOrNCryptKey can be NULL where an // dwKeySpec isn't used and hCryptProvOrNCryptKey can be NULL where an
// appropriate default provider will be used for hashing. // appropriate default provider will be used for hashing.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSignCertificate( CryptSignCertificate(
__in_opt HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, _In_opt_ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
__in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE _In_opt_ DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_bcount(cbEncodedToBeSigned) const BYTE *pbEncodedToBeSigned, _In_reads_bytes_(cbEncodedToBeSigned) const BYTE *pbEncodedToBeSigned,
__in DWORD cbEncodedToBeSigned, _In_ DWORD cbEncodedToBeSigned,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt const void *pvHashAuxInfo, _In_opt_ const void *pvHashAuxInfo,
__out_bcount_part_opt(*pcbSignature, *pcbSignature) BYTE *pbSignature, _Out_writes_bytes_to_opt_(*pcbSignature, *pcbSignature) BYTE *pbSignature,
__inout DWORD *pcbSignature _Inout_ DWORD *pcbSignature
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Encode the "to be signed" information. Sign the encoded "to be signed". // Encode the "to be signed" information. Sign the encoded "to be signed".
// Encode the "to be signed" and the signature. // Encode the "to be signed" and the signature.
// //
// hCryptProv specifies the crypto provider to use to do the signature. // hCryptProv specifies the crypto provider to use to do the signature.
// It uses the specified private key. // It uses the specified private key.
// //
// If the SignatureAlgorithm is a hash algorithm, then, the signature // If the SignatureAlgorithm is a hash algorithm, then, the signature
// contains the hash octets. A private key isn't used to encrypt the hash. // contains the hash octets. A private key isn't used to encrypt the hash.
// dwKeySpec isn't used and hCryptProv can be NULL where an appropriate // dwKeySpec isn't used and hCryptProv can be NULL where an appropriate
// default provider will be used for hashing. // default provider will be used for hashing.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSignAndEncodeCertificate( CryptSignAndEncodeCertificate(
__in_opt HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, _In_opt_ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
__in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE _In_opt_ DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCSTR lpszStructType, // "to be signed" _In_ LPCSTR lpszStructType, // "to be signed"
__in const void *pvStructInfo, _In_ const void *pvStructInfo,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt const void *pvHashAuxInfo, _In_opt_ const void *pvHashAuxInfo,
__out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded, _Out_writes_bytes_to_opt_(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
__inout DWORD *pcbEncoded _Inout_ DWORD *pcbEncoded
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate and CryptMsg encoded signature OID installable functions // Certificate and CryptMsg encoded signature OID installable functions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The dwCertEncodingType and pSignatureAlgorithm->pszObjId are used // The dwCertEncodingType and pSignatureAlgorithm->pszObjId are used
// to call the signature OID installable functions. // to call the signature OID installable functions.
// //
// If the OID installable function doesn't support the signature, // If the OID installable function doesn't support the signature,
skipping to change at line 13642 skipping to change at line 14353
// Called if the signature has encoded parameters. Returns the CNG // Called if the signature has encoded parameters. Returns the CNG
// hash algorithm identifier string. Optionally returns the decoded // hash algorithm identifier string. Optionally returns the decoded
// signature parameters passed to either the SignAndEncodeHash or // signature parameters passed to either the SignAndEncodeHash or
// VerifyEncodedSignature OID installable function. // VerifyEncodedSignature OID installable function.
// //
// Returned allocated parameters are freed via LocalFree(). // Returned allocated parameters are freed via LocalFree().
#define CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC \ #define CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC \
"CryptDllExtractEncodedSignatureParameters" "CryptDllExtractEncodedSignatureParameters"
typedef BOOL (WINAPI *PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC)( typedef BOOL (WINAPI *PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC)(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__deref_out_opt void **ppvDecodedSignPara, // LocalFree() _Outptr_result_maybenull_ void **ppvDecodedSignPara, // LocalFree()
__deref_out LPWSTR *ppwszCNGHashAlgid // LocalFree() _Outptr_ LPWSTR *ppwszCNGHashAlgid // LocalFree()
); );
// Called to sign the computed hash and encode it. // Called to sign the computed hash and encode it.
#define CRYPT_OID_SIGN_AND_ENCODE_HASH_FUNC \ #define CRYPT_OID_SIGN_AND_ENCODE_HASH_FUNC \
"CryptDllSignAndEncodeHash" "CryptDllSignAndEncodeHash"
typedef BOOL (WINAPI *PFN_CRYPT_SIGN_AND_ENCODE_HASH_FUNC)( typedef BOOL (WINAPI *PFN_CRYPT_SIGN_AND_ENCODE_HASH_FUNC)(
__in NCRYPT_KEY_HANDLE hKey, _In_ NCRYPT_KEY_HANDLE hKey,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt void *pvDecodedSignPara, _In_opt_ void *pvDecodedSignPara,
__in LPCWSTR pwszCNGPubKeyAlgid, // obtained from signature OID _In_ LPCWSTR pwszCNGPubKeyAlgid, // obtained from signature OID
__in LPCWSTR pwszCNGHashAlgid, _In_ LPCWSTR pwszCNGHashAlgid,
__in_bcount(cbComputedHash) BYTE *pbComputedHash, _In_reads_bytes_(cbComputedHash) BYTE *pbComputedHash,
__in DWORD cbComputedHash, _In_ DWORD cbComputedHash,
__out_bcount_part_opt(*pcbSignature, *pcbSignature) BYTE *pbSignature, _Out_writes_bytes_to_opt_(*pcbSignature, *pcbSignature) BYTE *pbSignature,
__inout DWORD *pcbSignature _Inout_ DWORD *pcbSignature
); );
// Called to decode and decrypt the encoded signature and compare it with the // Called to decode and decrypt the encoded signature and compare it with the
// computed hash. // computed hash.
#define CRYPT_OID_VERIFY_ENCODED_SIGNATURE_FUNC \ #define CRYPT_OID_VERIFY_ENCODED_SIGNATURE_FUNC \
"CryptDllVerifyEncodedSignature" "CryptDllVerifyEncodedSignature"
typedef BOOL (WINAPI *PFN_CRYPT_VERIFY_ENCODED_SIGNATURE_FUNC)( typedef BOOL (WINAPI *PFN_CRYPT_VERIFY_ENCODED_SIGNATURE_FUNC)(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pPubKeyInfo, _In_ PCERT_PUBLIC_KEY_INFO pPubKeyInfo,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, _In_ PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt void *pvDecodedSignPara, _In_opt_ void *pvDecodedSignPara,
__in LPCWSTR pwszCNGPubKeyAlgid, // obtained from signature OID _In_ LPCWSTR pwszCNGPubKeyAlgid, // obtained from signature OID
__in LPCWSTR pwszCNGHashAlgid, _In_ LPCWSTR pwszCNGHashAlgid,
__in_bcount(cbComputedHash) BYTE *pbComputedHash, _In_reads_bytes_(cbComputedHash) BYTE *pbComputedHash,
__in DWORD cbComputedHash, _In_ DWORD cbComputedHash,
__in_bcount(cbSignature) BYTE *pbSignature, _In_reads_bytes_(cbSignature) BYTE *pbSignature,
__in DWORD cbSignature _In_ DWORD cbSignature
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify the time validity of a certificate. // Verify the time validity of a certificate.
// //
// Returns -1 if before NotBefore, +1 if after NotAfter and otherwise 0 for // Returns -1 if before NotBefore, +1 if after NotAfter and otherwise 0 for
// a valid certificate // a valid certificate
// //
// If pTimeToVerify is NULL, uses the current time. // If pTimeToVerify is NULL, uses the current time.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
LONG LONG
WINAPI WINAPI
CertVerifyTimeValidity( CertVerifyTimeValidity(
__in_opt LPFILETIME pTimeToVerify, _In_opt_ LPFILETIME pTimeToVerify,
__in PCERT_INFO pCertInfo _In_ PCERT_INFO pCertInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify the time validity of a CRL. // Verify the time validity of a CRL.
// //
// Returns -1 if before ThisUpdate, +1 if after NextUpdate and otherwise 0 for // Returns -1 if before ThisUpdate, +1 if after NextUpdate and otherwise 0 for
// a valid CRL // a valid CRL
// //
// If pTimeToVerify is NULL, uses the current time. // If pTimeToVerify is NULL, uses the current time.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
LONG LONG
WINAPI WINAPI
CertVerifyCRLTimeValidity( CertVerifyCRLTimeValidity(
__in_opt LPFILETIME pTimeToVerify, _In_opt_ LPFILETIME pTimeToVerify,
__in PCRL_INFO pCrlInfo _In_ PCRL_INFO pCrlInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify that the subject's time validity nests within the issuer's time // Verify that the subject's time validity nests within the issuer's time
// validity. // validity.
// //
// Returns TRUE if it nests. Otherwise, returns FALSE. // Returns TRUE if it nests. Otherwise, returns FALSE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertVerifyValidityNesting( CertVerifyValidityNesting(
__in PCERT_INFO pSubjectInfo, _In_ PCERT_INFO pSubjectInfo,
__in PCERT_INFO pIssuerInfo _In_ PCERT_INFO pIssuerInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify that the subject certificate isn't on its issuer CRL. // Verify that the subject certificate isn't on its issuer CRL.
// //
// Returns true if the certificate isn't on the CRL. // Returns true if the certificate isn't on the CRL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertVerifyCRLRevocation( CertVerifyCRLRevocation(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_INFO pCertId, // Only the Issuer and SerialNumber _In_ PCERT_INFO pCertId, // Only the Issuer and SerialNumber
// fields are used // fields are used
__in DWORD cCrlInfo, _In_ DWORD cCrlInfo,
__in_ecount(cCrlInfo) PCRL_INFO rgpCrlInfo[] _In_reads_(cCrlInfo) PCRL_INFO rgpCrlInfo[]
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert the CAPI AlgId to the ASN.1 Object Identifier string // Convert the CAPI AlgId to the ASN.1 Object Identifier string
// //
// Returns NULL if there isn't an ObjId corresponding to the AlgId. // Returns NULL if there isn't an ObjId corresponding to the AlgId.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
LPCSTR LPCSTR
WINAPI WINAPI
CertAlgIdToOID( CertAlgIdToOID(
__in DWORD dwAlgId _In_ DWORD dwAlgId
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert the ASN.1 Object Identifier string to the CAPI AlgId. // Convert the ASN.1 Object Identifier string to the CAPI AlgId.
// //
// Returns 0 if there isn't an AlgId corresponding to the ObjId. // Returns 0 if there isn't an AlgId corresponding to the ObjId.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertOIDToAlgId( CertOIDToAlgId(
__in LPCSTR pszObjId _In_ LPCSTR pszObjId
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find an extension identified by its Object Identifier. // Find an extension identified by its Object Identifier.
// //
// If found, returns pointer to the extension. Otherwise, returns NULL. // If found, returns pointer to the extension. Otherwise, returns NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCERT_EXTENSION PCERT_EXTENSION
WINAPI WINAPI
CertFindExtension( CertFindExtension(
__in LPCSTR pszObjId, _In_ LPCSTR pszObjId,
__in DWORD cExtensions, _In_ DWORD cExtensions,
__in_ecount(cExtensions) CERT_EXTENSION rgExtensions[] _In_reads_(cExtensions) CERT_EXTENSION rgExtensions[]
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find the first attribute identified by its Object Identifier. // Find the first attribute identified by its Object Identifier.
// //
// If found, returns pointer to the attribute. Otherwise, returns NULL. // If found, returns pointer to the attribute. Otherwise, returns NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCRYPT_ATTRIBUTE PCRYPT_ATTRIBUTE
WINAPI WINAPI
CertFindAttribute( CertFindAttribute(
__in LPCSTR pszObjId, _In_ LPCSTR pszObjId,
__in DWORD cAttr, _In_ DWORD cAttr,
__in_ecount(cAttr) CRYPT_ATTRIBUTE rgAttr[] _In_reads_(cAttr) CRYPT_ATTRIBUTE rgAttr[]
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find the first CERT_RDN attribute identified by its Object Identifier in // Find the first CERT_RDN attribute identified by its Object Identifier in
// the name's list of Relative Distinguished Names. // the name's list of Relative Distinguished Names.
// //
// If found, returns pointer to the attribute. Otherwise, returns NULL. // If found, returns pointer to the attribute. Otherwise, returns NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCERT_RDN_ATTR PCERT_RDN_ATTR
WINAPI WINAPI
CertFindRDNAttr( CertFindRDNAttr(
__in LPCSTR pszObjId, _In_ LPCSTR pszObjId,
__in PCERT_NAME_INFO pName _In_ PCERT_NAME_INFO pName
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the intended key usage bytes from the certificate. // Get the intended key usage bytes from the certificate.
// //
// If the certificate doesn't have any intended key usage bytes, returns FALSE // If the certificate doesn't have any intended key usage bytes, returns FALSE
// and *pbKeyUsage is zeroed. Otherwise, returns TRUE and up through // and *pbKeyUsage is zeroed. Otherwise, returns TRUE and up through
// cbKeyUsage bytes are copied into *pbKeyUsage. Any remaining uncopied // cbKeyUsage bytes are copied into *pbKeyUsage. Any remaining uncopied
// bytes are zeroed. // bytes are zeroed.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertGetIntendedKeyUsage( CertGetIntendedKeyUsage(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_INFO pCertInfo, _In_ PCERT_INFO pCertInfo,
__out_bcount_full(cbKeyUsage) BYTE *pbKeyUsage, _Out_writes_bytes_all_(cbKeyUsage) BYTE *pbKeyUsage,
__in DWORD cbKeyUsage _In_ DWORD cbKeyUsage
); );
typedef void *HCRYPTDEFAULTCONTEXT; typedef void *HCRYPTDEFAULTCONTEXT;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Install a previously CryptAcquiredContext'ed HCRYPTPROV to be used as // Install a previously CryptAcquiredContext'ed HCRYPTPROV to be used as
// a default context. // a default context.
// //
// dwDefaultType and pvDefaultPara specify where the default context is used. // dwDefaultType and pvDefaultPara specify where the default context is used.
// For example, install the HCRYPTPROV to be used to verify certificate's // For example, install the HCRYPTPROV to be used to verify certificate's
skipping to change at line 13860 skipping to change at line 14571
// //
// If CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG is set, then, the HCRYPTPROV // If CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG is set, then, the HCRYPTPROV
// is CryptReleaseContext'ed at thread or process exit. However, // is CryptReleaseContext'ed at thread or process exit. However,
// not CryptReleaseContext'ed if CryptUninstallDefaultContext is // not CryptReleaseContext'ed if CryptUninstallDefaultContext is
// called. // called.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptInstallDefaultContext( CryptInstallDefaultContext(
__in HCRYPTPROV hCryptProv, _In_ HCRYPTPROV hCryptProv,
__in DWORD dwDefaultType, _In_ DWORD dwDefaultType,
__in_opt const void *pvDefaultPara, _In_opt_ const void *pvDefaultPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out HCRYPTDEFAULTCONTEXT *phDefaultContext _Out_ HCRYPTDEFAULTCONTEXT *phDefaultContext
); );
// dwFlags // dwFlags
#define CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG 0x00000001 #define CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG 0x00000001
#define CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG 0x00000002 #define CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG 0x00000002
// List of dwDefaultType's // List of dwDefaultType's
#define CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID 1 #define CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID 1
#define CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID 2 #define CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID 2
skipping to change at line 13913 skipping to change at line 14624
// CryptInstallDefaultContext. // CryptInstallDefaultContext.
// //
// For a default context installed with CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG // For a default context installed with CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG
// set, if any other threads are currently using this context, // set, if any other threads are currently using this context,
// this function will block until they finish. // this function will block until they finish.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUninstallDefaultContext( CryptUninstallDefaultContext(
__in_opt HCRYPTDEFAULTCONTEXT hDefaultContext, _In_opt_ HCRYPTDEFAULTCONTEXT hDefaultContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Export the public key info associated with the provider's corresponding // Export the public key info associated with the provider's corresponding
// private key. // private key.
// //
// Calls CryptExportPublicKeyInfoEx with pszPublicKeyObjId = NULL, // Calls CryptExportPublicKeyInfoEx with pszPublicKeyObjId = NULL,
// dwFlags = 0 and pvAuxInfo = NULL. // dwFlags = 0 and pvAuxInfo = NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptExportPublicKeyInfo( CryptExportPublicKeyInfo(
__in HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, _In_ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
__in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE _In_opt_ DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo, _Out_writes_bytes_to_opt_(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
__inout DWORD *pcbInfo _Inout_ DWORD *pcbInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Export the public key info associated with the provider's corresponding // Export the public key info associated with the provider's corresponding
// private key. // private key.
// //
// Uses the dwCertEncodingType and pszPublicKeyObjId to call the // Uses the dwCertEncodingType and pszPublicKeyObjId to call the
// installable CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC. The called function // installable CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC. The called function
// has the same signature as CryptExportPublicKeyInfoEx. // has the same signature as CryptExportPublicKeyInfoEx.
// //
skipping to change at line 13959 skipping to change at line 14670
// dwFlags can be set with the following 2 flags passed directly to // dwFlags can be set with the following 2 flags passed directly to
// CryptFindOIDInfo: // CryptFindOIDInfo:
// CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG // CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG
// CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG // CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptExportPublicKeyInfoEx( CryptExportPublicKeyInfoEx(
__in HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, _In_ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
__in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE _In_opt_ DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_opt LPSTR pszPublicKeyObjId, _In_opt_ LPSTR pszPublicKeyObjId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo, _Out_writes_bytes_to_opt_(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
__inout DWORD *pcbInfo _Inout_ DWORD *pcbInfo
); );
// Legacy define used for exporting CAPI1 HCRYPTPROV public keys. // Legacy define used for exporting CAPI1 HCRYPTPROV public keys.
#define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx" #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Export CNG PublicKeyInfo OID installable function. Note, not called // Export CNG PublicKeyInfo OID installable function. Note, not called
// for a HCRYPTPROV choice. // for a HCRYPTPROV choice.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC \ #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC \
"CryptDllExportPublicKeyInfoEx2" "CryptDllExportPublicKeyInfoEx2"
typedef BOOL (WINAPI *PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC) ( typedef BOOL (WINAPI *PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC) (
__in NCRYPT_KEY_HANDLE hNCryptKey, _In_ NCRYPT_KEY_HANDLE hNCryptKey,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPSTR pszPublicKeyObjId, _In_ LPSTR pszPublicKeyObjId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo, _Out_writes_bytes_to_opt_(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
__inout DWORD *pcbInfo _Inout_ DWORD *pcbInfo
); );
#if (NTDDI_VERSION >= NTDDI_WIN7) #if (NTDDI_VERSION >= NTDDI_WIN7)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Export the public key info associated with the provider's corresponding // Export the public key info associated with the provider's corresponding
// private key. // private key.
// //
// Uses the dwCertEncodingType and pszPublicKeyObjId to call the // Uses the dwCertEncodingType and pszPublicKeyObjId to call the
// installable CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC. The // installable CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC. The
skipping to change at line 14014 skipping to change at line 14725
// In addition dwFlags can be set with the following 2 flags passed directly // In addition dwFlags can be set with the following 2 flags passed directly
// to CryptFindOIDInfo: // to CryptFindOIDInfo:
// CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG // CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG
// CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG // CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptExportPublicKeyInfoFromBCryptKeyHandle( CryptExportPublicKeyInfoFromBCryptKeyHandle(
__in BCRYPT_KEY_HANDLE hBCryptKey, _In_ BCRYPT_KEY_HANDLE hBCryptKey,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_opt LPSTR pszPublicKeyObjId, _In_opt_ LPSTR pszPublicKeyObjId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo, _Out_writes_bytes_to_opt_(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
__inout DWORD *pcbInfo _Inout_ DWORD *pcbInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Export CNG PublicKeyInfo OID installable function. Note, not called // Export CNG PublicKeyInfo OID installable function. Note, not called
// for a HCRYPTPROV or NCRYPT_KEY_HANDLE choice. // for a HCRYPTPROV or NCRYPT_KEY_HANDLE choice.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC \ #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC \
"CryptDllExportPublicKeyInfoFromBCryptKeyHandle" "CryptDllExportPublicKeyInfoFromBCryptKeyHandle"
typedef BOOL (WINAPI *PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC) ( typedef BOOL (WINAPI *PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC) (
__in BCRYPT_KEY_HANDLE hBCryptKey, _In_ BCRYPT_KEY_HANDLE hBCryptKey,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPSTR pszPublicKeyObjId, _In_ LPSTR pszPublicKeyObjId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo, _Out_writes_bytes_to_opt_(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
__inout DWORD *pcbInfo _Inout_ DWORD *pcbInfo
); );
#endif // (NTDDI_VERSION >= NTDDI_WIN7) #endif // (NTDDI_VERSION >= NTDDI_WIN7)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert and import the public key info into the provider and return a // Convert and import the public key info into the provider and return a
// handle to the public key. // handle to the public key.
// //
// Calls CryptImportPublicKeyInfoEx with aiKeyAlg = 0, dwFlags = 0 and // Calls CryptImportPublicKeyInfoEx with aiKeyAlg = 0, dwFlags = 0 and
// pvAuxInfo = NULL. // pvAuxInfo = NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptImportPublicKeyInfo( CryptImportPublicKeyInfo(
__in HCRYPTPROV hCryptProv, _In_ HCRYPTPROV hCryptProv,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo, _In_ PCERT_PUBLIC_KEY_INFO pInfo,
__out HCRYPTKEY *phKey _Out_ HCRYPTKEY *phKey
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert and import the public key info into the provider and return a // Convert and import the public key info into the provider and return a
// handle to the public key. // handle to the public key.
// //
// Uses the dwCertEncodingType and pInfo->Algorithm.pszObjId to call the // Uses the dwCertEncodingType and pInfo->Algorithm.pszObjId to call the
// installable CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC. The called function // installable CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC. The called function
// has the same signature as CryptImportPublicKeyInfoEx. // has the same signature as CryptImportPublicKeyInfoEx.
// //
skipping to change at line 14078 skipping to change at line 14789
// //
// For szOID_RSA_RSA: aiKeyAlg may be set to CALG_RSA_SIGN or CALG_RSA_KEYX. // For szOID_RSA_RSA: aiKeyAlg may be set to CALG_RSA_SIGN or CALG_RSA_KEYX.
// Defaults to CALG_RSA_KEYX. The dwFlags and pvAuxInfo aren't used. // Defaults to CALG_RSA_KEYX. The dwFlags and pvAuxInfo aren't used.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC "CryptDllImportPublicKeyInfoEx" #define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC "CryptDllImportPublicKeyInfoEx"
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptImportPublicKeyInfoEx( CryptImportPublicKeyInfoEx(
__in HCRYPTPROV hCryptProv, _In_ HCRYPTPROV hCryptProv,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo, _In_ PCERT_PUBLIC_KEY_INFO pInfo,
__in ALG_ID aiKeyAlg, _In_ ALG_ID aiKeyAlg,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out HCRYPTKEY *phKey _Out_ HCRYPTKEY *phKey
); );
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert and import the public key info into the CNG asymmetric or // Convert and import the public key info into the CNG asymmetric or
// signature algorithm provider and return a BCRYPT_KEY_HANDLE to it. // signature algorithm provider and return a BCRYPT_KEY_HANDLE to it.
// //
// Uses the dwCertEncodingType and pInfo->Algorithm.pszObjId to call the // Uses the dwCertEncodingType and pInfo->Algorithm.pszObjId to call the
// installable CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC. The called function // installable CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC. The called function
// has the same signature as CryptImportPublicKeyInfoEx2. // has the same signature as CryptImportPublicKeyInfoEx2.
// //
// dwFlags can be set with the following 2 flags passed directly to // dwFlags can be set with the following 2 flags passed directly to
// CryptFindOIDInfo: // CryptFindOIDInfo:
// CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG // CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG
// CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG // CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG
// dwFlags can also have BCRYPT_NO_KEY_VALIDATION OR'd in. This flag is // dwFlags can also have BCRYPT_NO_KEY_VALIDATION OR'd in. This flag is
// passed to BCryptImportKeyPair. // passed to BCryptImportKeyPair.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptImportPublicKeyInfoEx2( CryptImportPublicKeyInfoEx2(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo, _In_ PCERT_PUBLIC_KEY_INFO pInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out BCRYPT_KEY_HANDLE *phKey _Out_ BCRYPT_KEY_HANDLE *phKey
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Import CNG PublicKeyInfo OID installable function // Import CNG PublicKeyInfo OID installable function
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC \ #define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC \
"CryptDllImportPublicKeyInfoEx2" "CryptDllImportPublicKeyInfoEx2"
typedef BOOL (WINAPI *PFN_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC) ( typedef BOOL (WINAPI *PFN_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC) (
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo, _In_ PCERT_PUBLIC_KEY_INFO pInfo,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvAuxInfo, _In_opt_ void *pvAuxInfo,
__out BCRYPT_KEY_HANDLE *phKey _Out_ BCRYPT_KEY_HANDLE *phKey
); );
#endif // (NTDDI_VERSION >= NTDDI_WINLH) #endif // (NTDDI_VERSION >= NTDDI_VISTA)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Acquire a HCRYPTPROV and dwKeySpec or NCRYPT_KEY_HANDLE for the // Acquire a HCRYPTPROV and dwKeySpec or NCRYPT_KEY_HANDLE for the
// specified certificate context. Uses the certificate's // specified certificate context. Uses the certificate's
// CERT_KEY_PROV_INFO_PROP_ID property. // CERT_KEY_PROV_INFO_PROP_ID property.
// The returned HCRYPTPROV or NCRYPT_KEY_HANDLE handle may optionally be // The returned HCRYPTPROV or NCRYPT_KEY_HANDLE handle may optionally be
// cached using the certificate's CERT_KEY_CONTEXT_PROP_ID property. // cached using the certificate's CERT_KEY_CONTEXT_PROP_ID property.
// //
// If CRYPT_ACQUIRE_CACHE_FLAG is set, then, if an already acquired and // If CRYPT_ACQUIRE_CACHE_FLAG is set, then, if an already acquired and
// cached HCRYPTPROV or NCRYPT_KEY_HANDLE exists for the certificate, its // cached HCRYPTPROV or NCRYPT_KEY_HANDLE exists for the certificate, its
skipping to change at line 14163 skipping to change at line 14874
// a cached HCRYPTPROV or NCRYPT_KEY_HANDLE is returned, the comparison isn't // a cached HCRYPTPROV or NCRYPT_KEY_HANDLE is returned, the comparison isn't
// done. We assume the comparison was done on the initial acquire. // done. We assume the comparison was done on the initial acquire.
// //
// The CRYPT_ACQUIRE_NO_HEALING flags prohibits this function from // The CRYPT_ACQUIRE_NO_HEALING flags prohibits this function from
// attempting to recreate the CERT_KEY_PROV_INFO_PROP_ID in the certificate // attempting to recreate the CERT_KEY_PROV_INFO_PROP_ID in the certificate
// context if it fails to retrieve this property. // context if it fails to retrieve this property.
// //
// The CRYPT_ACQUIRE_SILENT_FLAG can be set to suppress any UI by the CSP. // The CRYPT_ACQUIRE_SILENT_FLAG can be set to suppress any UI by the CSP.
// See CryptAcquireContext's CRYPT_SILENT flag for more details. // See CryptAcquireContext's CRYPT_SILENT flag for more details.
// //
// The CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG can be set when a pointer to a window h
andle (HWND*)
// is passed in as the pvParameters. The window handle will be used
// by calling CryptSetProvParam with a NULL HCRYPTPROV and dwParam
// is PP_CLIENT_HWND before the call to CryptAcquireContext.
// This will set the window handle for all CAPI calls in this process.
// The caller should make sure the window handle is valid or clear it out by
// calling CryptSetProvParam with PP_CLIENT_HWND with a NULL hWnd.
// Or for cng, the hwnd will be used by calling NCryptSetProperty on the storag
e provider
// handle provider with property NCRYPT_WINDOW_HANDLE_PROPERTY and
// by calling NCryptSetPRoperty on the key handle with property NCRYPT_WINDOW_H
ANDLE_PROPERTY.
// If both calls to NCryptSetProperty fail then the function will return the fa
ilure of
// setting the NCRYPT_WINDOW_HANDLE_PROPERTY on the key handle.
// Do not use this flag with CRYPT_ACQUIRE_SILENT_FLAG.
//
// The following flags can be set to optionally open and return a CNG // The following flags can be set to optionally open and return a CNG
// NCRYPT_KEY_HANDLE instead of a HCRYPTPROV. *pdwKeySpec is set to // NCRYPT_KEY_HANDLE instead of a HCRYPTPROV. *pdwKeySpec is set to
// CERT_NCRYPT_KEY_SPEC when a NCRYPT_KEY_HANDLE is returned. // CERT_NCRYPT_KEY_SPEC when a NCRYPT_KEY_HANDLE is returned.
// CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG - if the CryptAcquireContext // CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG - if the CryptAcquireContext
// fails, then, an NCryptOpenKey is attempted. // fails, then, an NCryptOpenKey is attempted.
// //
// CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG - the NCryptOpenKey is // CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG - the NCryptOpenKey is
// first attempted and its handle returned for success. // first attempted and its handle returned for success.
// //
// CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG - only the NCryptOpenKey is // CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG - only the NCryptOpenKey is
skipping to change at line 14197 skipping to change at line 14922
// HCRYPTPROV must be released by the caller by calling CryptReleaseContext. // HCRYPTPROV must be released by the caller by calling CryptReleaseContext.
// A returned NCRYPT_KEY_HANDLE is freed by calling NCryptFreeObject. // A returned NCRYPT_KEY_HANDLE is freed by calling NCryptFreeObject.
// *pdwKeySpec MUST be checked when CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG // *pdwKeySpec MUST be checked when CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG
// or CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG is set. // or CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG is set.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptAcquireCertificatePrivateKey( CryptAcquireCertificatePrivateKey(
__in PCCERT_CONTEXT pCert, _In_ PCCERT_CONTEXT pCert,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _In_opt_ void *pvParameters,
__out HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProvOrNCryptKey, _Out_ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProvOrNCryptKey,
__out_opt DWORD *pdwKeySpec, _Out_opt_ DWORD *pdwKeySpec,
__out_opt BOOL *pfCallerFreeProvOrNCryptKey _Out_opt_ BOOL *pfCallerFreeProvOrNCryptKey
); );
#define CRYPT_ACQUIRE_CACHE_FLAG 0x00000001 #define CRYPT_ACQUIRE_CACHE_FLAG 0x00000001
#define CRYPT_ACQUIRE_USE_PROV_INFO_FLAG 0x00000002 #define CRYPT_ACQUIRE_USE_PROV_INFO_FLAG 0x00000002
#define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004 #define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
#define CRYPT_ACQUIRE_NO_HEALING 0x00000008 #define CRYPT_ACQUIRE_NO_HEALING 0x00000008
#define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040 #define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040
#define CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG 0x00000080
#define CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK 0x00070000 #define CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK 0x00070000
#define CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG 0x00010000 #define CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG 0x00010000
#define CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG 0x00020000 #define CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG 0x00020000
#define CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG 0x00040000 #define CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG 0x00040000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerates the cryptographic providers and their containers to find the // Enumerates the cryptographic providers and their containers to find the
// private key corresponding to the certificate's public key. For a match, // private key corresponding to the certificate's public key. For a match,
// the certificate's CERT_KEY_PROV_INFO_PROP_ID property is updated. // the certificate's CERT_KEY_PROV_INFO_PROP_ID property is updated.
skipping to change at line 14243 skipping to change at line 14969
// If a container isn't found, returns FALSE with LastError set to // If a container isn't found, returns FALSE with LastError set to
// NTE_NO_KEY. // NTE_NO_KEY.
// //
// The above CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS can also be set. The default // The above CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS can also be set. The default
// is CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG. // is CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptFindCertificateKeyProvInfo( CryptFindCertificateKeyProvInfo(
__in PCCERT_CONTEXT pCert, _In_ PCCERT_CONTEXT pCert,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
#define CRYPT_FIND_USER_KEYSET_FLAG 0x00000001 #define CRYPT_FIND_USER_KEYSET_FLAG 0x00000001
#define CRYPT_FIND_MACHINE_KEYSET_FLAG 0x00000002 #define CRYPT_FIND_MACHINE_KEYSET_FLAG 0x00000002
#define CRYPT_FIND_SILENT_KEYSET_FLAG 0x00000040 #define CRYPT_FIND_SILENT_KEYSET_FLAG 0x00000040
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// This is the prototype for the installable function which is called to // This is the prototype for the installable function which is called to
// actually import a key into a CSP. an installable of this type is called // actually import a key into a CSP. an installable of this type is called
// from CryptImportPKCS8. the algorithm OID of the private key is used // from CryptImportPKCS8. the algorithm OID of the private key is used
skipping to change at line 14267 skipping to change at line 14993
// //
// hCryptProv - the provider to import the key to // hCryptProv - the provider to import the key to
// pPrivateKeyInfo - describes the key to be imported // pPrivateKeyInfo - describes the key to be imported
// dwFlags - The available flags are: // dwFlags - The available flags are:
// CRYPT_EXPORTABLE // CRYPT_EXPORTABLE
// this flag is used when importing private keys, for a full // this flag is used when importing private keys, for a full
// explanation please see the documentation for CryptImportKey. // explanation please see the documentation for CryptImportKey.
// pvAuxInfo - reserved for future, must be NULL // pvAuxInfo - reserved for future, must be NULL
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_IMPORT_PRIV_KEY_FUNC) ( typedef BOOL (WINAPI *PFN_IMPORT_PRIV_KEY_FUNC) (
__in HCRYPTPROV hCryptProv, // in _In_ HCRYPTPROV hCryptProv, // in
__in CRYPT_PRIVATE_KEY_INFO* pPrivateKeyInfo, // in _In_ CRYPT_PRIVATE_KEY_INFO* pPrivateKeyInfo, // in
__in DWORD dwFlags, // in _In_ DWORD dwFlags, // in
__in_opt void* pvAuxInfo // in, optional _In_opt_ void* pvAuxInfo // in, optional
); );
#define CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC "CryptDllImportPrivateKeyInfoEx " #define CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC "CryptDllImportPrivateKeyInfoEx "
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert (from PKCS8 format) and import the private key into a provider // Convert (from PKCS8 format) and import the private key into a provider
// and return a handle to the provider as well as the KeySpec used to import to. // and return a handle to the provider as well as the KeySpec used to import to.
// //
// This function will call the PRESOLVE_HCRYPTPROV_FUNC in the // This function will call the PRESOLVE_HCRYPTPROV_FUNC in the
// privateKeyAndParams to obtain a handle of provider to import the key to. // privateKeyAndParams to obtain a handle of provider to import the key to.
skipping to change at line 14297 skipping to change at line 15023
// explanation please see the documentation for CryptImportKey. // explanation please see the documentation for CryptImportKey.
// phCryptProv - filled in with the handle of the provider the key was // phCryptProv - filled in with the handle of the provider the key was
// imported to, the caller is responsible for freeing it // imported to, the caller is responsible for freeing it
// pvAuxInfo - This parameter is reserved for future use and should be set // pvAuxInfo - This parameter is reserved for future use and should be set
// to NULL in the interim. // to NULL in the interim.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptImportPKCS8( CryptImportPKCS8(
__in CRYPT_PKCS8_IMPORT_PARAMS sPrivateKeyAndParams, // in _In_ CRYPT_PKCS8_IMPORT_PARAMS sPrivateKeyAndParams, // in
__in DWORD dwFlags, // in _In_ DWORD dwFlags, // in
__out_opt HCRYPTPROV *phCryptProv, // out, optional _Out_opt_ HCRYPTPROV *phCryptProv, // out, optional
__in_opt void* pvAuxInfo // in, optional _In_opt_ void* pvAuxInfo // in, optional
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// this is the prototype for installable functions for exporting the private key // this is the prototype for installable functions for exporting the private key
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_EXPORT_PRIV_KEY_FUNC) ( typedef BOOL (WINAPI *PFN_EXPORT_PRIV_KEY_FUNC) (
__in HCRYPTPROV hCryptProv, // in _In_ HCRYPTPROV hCryptProv, // in
__in DWORD dwKeySpec, // in _In_ DWORD dwKeySpec, // in
__in LPSTR pszPrivateKeyObjId, // in _In_ LPSTR pszPrivateKeyObjId, // in
__in DWORD dwFlags, // in _In_ DWORD dwFlags, // in
__in_opt void* pvAuxInfo, // in _In_opt_ void* pvAuxInfo, // in
__out_bcount_opt (*pcbPrivateKeyInfo) CRYPT_PRIVATE_KEY_INFO* pPrivateKeyInf _Out_writes_bytes_opt_ (*pcbPrivateKeyInfo) CRYPT_PRIVATE_KEY_INFO* pPrivate
o, // out KeyInfo, // out
__inout DWORD* pcbPrivateKeyInfo // in, out _Inout_ DWORD* pcbPrivateKeyInfo // in, out
); );
#define CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC "CryptDllExportPrivateKeyInfoEx " #define CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC "CryptDllExportPrivateKeyInfoEx "
#define CRYPT_DELETE_KEYSET CRYPT_DELETEKEYSET #define CRYPT_DELETE_KEYSET CRYPT_DELETEKEYSET
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CryptExportPKCS8 -- superseded by CryptExportPKCS8Ex // CryptExportPKCS8 -- superseded by CryptExportPKCS8Ex
// //
// Export the private key in PKCS8 format // Export the private key in PKCS8 format
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptExportPKCS8( CryptExportPKCS8(
__in HCRYPTPROV hCryptProv, // in _In_ HCRYPTPROV hCryptProv, // in
__in DWORD dwKeySpec, // in _In_ DWORD dwKeySpec, // in
__in LPSTR pszPrivateKeyObjId, // in _In_ LPSTR pszPrivateKeyObjId, // in
__in DWORD dwFlags, // in _In_ DWORD dwFlags, // in
__in_opt void* pvAuxInfo, // in _In_opt_ void* pvAuxInfo, // in
__out_bcount_opt (*pcbPrivateKeyBlob) BYTE* pbPrivateKeyBlob, // out _Out_writes_bytes_opt_ (*pcbPrivateKeyBlob) BYTE* pbPrivateKeyBlob, // out
__inout DWORD *pcbPrivateKeyBlob // in, out _Inout_ DWORD *pcbPrivateKeyBlob // in, out
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CryptExportPKCS8Ex // CryptExportPKCS8Ex
// //
// Export the private key in PKCS8 format // Export the private key in PKCS8 format
// //
// //
// Uses the pszPrivateKeyObjId to call the // Uses the pszPrivateKeyObjId to call the
// installable CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC. The called function // installable CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC. The called function
skipping to change at line 14363 skipping to change at line 15089
// NULL in the interim. // NULL in the interim.
// pbPrivateKeyBlob - A pointer to the private key blob. It will be encoded // pbPrivateKeyBlob - A pointer to the private key blob. It will be encoded
// as a PKCS8 PrivateKeyInfo. // as a PKCS8 PrivateKeyInfo.
// pcbPrivateKeyBlob - A pointer to a DWORD that contains the size, in bytes, // pcbPrivateKeyBlob - A pointer to a DWORD that contains the size, in bytes,
// of the private key blob being exporte d. // of the private key blob being exporte d.
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptExportPKCS8Ex( CryptExportPKCS8Ex(
__in CRYPT_PKCS8_EXPORT_PARAMS* psExportParams, // in _In_ CRYPT_PKCS8_EXPORT_PARAMS* psExportParams, // in
__in DWORD dwFlags, // in _In_ DWORD dwFlags, // in
__in_opt void* pvAuxInfo, // in _In_opt_ void* pvAuxInfo, // in
__out_bcount_opt (*pcbPrivateKeyBlob) BYTE* pbPrivateKeyBlob, // out _Out_writes_bytes_opt_ (*pcbPrivateKeyBlob) BYTE* pbPrivateKeyBlob, // out
__inout DWORD* pcbPrivateKeyBlob // in, out _Inout_ DWORD* pcbPrivateKeyBlob // in, out
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Compute the hash of the encoded public key info. // Compute the hash of the encoded public key info.
// //
// The public key info is encoded and then hashed. // The public key info is encoded and then hashed.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptHashPublicKeyInfo( CryptHashPublicKeyInfo(
__in_opt HCRYPTPROV_LEGACY hCryptProv, _In_opt_ HCRYPTPROV_LEGACY hCryptProv,
__in ALG_ID Algid, _In_ ALG_ID Algid,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo, _In_ PCERT_PUBLIC_KEY_INFO pInfo,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
sh, edHash,
__inout DWORD *pcbComputedHash _Inout_ DWORD *pcbComputedHash
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert a Name Value to a null terminated char string // Convert a Name Value to a null terminated char string
// //
// Returns the number of characters converted including the terminating null // Returns the number of characters converted including the terminating null
// character. If psz is NULL or csz is 0, returns the required size of the // character. If psz is NULL or csz is 0, returns the required size of the
// destination string (including the terminating null char). // destination string (including the terminating null char).
// //
// If psz != NULL && csz != 0, returned psz is always NULL terminated. // If psz != NULL && csz != 0, returned psz is always NULL terminated.
// //
// Note: csz includes the NULL char. // Note: csz includes the NULL char.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertRDNValueToStrA( CertRDNValueToStrA(
__in DWORD dwValueType, _In_ DWORD dwValueType,
__in PCERT_RDN_VALUE_BLOB pValue, _In_ PCERT_RDN_VALUE_BLOB pValue,
__out_ecount_part_opt(csz, return) LPSTR psz, _Out_writes_to_opt_(csz, return) LPSTR psz,
__in DWORD csz _In_ DWORD csz
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert a Name Value to a null terminated char string // Convert a Name Value to a null terminated char string
// //
// Returns the number of characters converted including the terminating null // Returns the number of characters converted including the terminating null
// character. If psz is NULL or csz is 0, returns the required size of the // character. If psz is NULL or csz is 0, returns the required size of the
// destination string (including the terminating null char). // destination string (including the terminating null char).
// //
// If psz != NULL && csz != 0, returned psz is always NULL terminated. // If psz != NULL && csz != 0, returned psz is always NULL terminated.
// //
// Note: csz includes the NULL char. // Note: csz includes the NULL char.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertRDNValueToStrW( CertRDNValueToStrW(
__in DWORD dwValueType, _In_ DWORD dwValueType,
__in PCERT_RDN_VALUE_BLOB pValue, _In_ PCERT_RDN_VALUE_BLOB pValue,
__out_ecount_part_opt(csz, return) LPWSTR psz, _Out_writes_to_opt_(csz, return) LPWSTR psz,
__in DWORD csz _In_ DWORD csz
); );
#ifdef UNICODE #ifdef UNICODE
#define CertRDNValueToStr CertRDNValueToStrW #define CertRDNValueToStr CertRDNValueToStrW
#else #else
#define CertRDNValueToStr CertRDNValueToStrA #define CertRDNValueToStr CertRDNValueToStrA
#endif // !UNICODE #endif // !UNICODE
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert the certificate name blob to a null terminated char string. // Convert the certificate name blob to a null terminated char string.
// //
skipping to change at line 14534 skipping to change at line 15260
// //
// Note: csz includes the NULL char. // Note: csz includes the NULL char.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertNameToStrA( CertNameToStrA(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_NAME_BLOB pName, _In_ PCERT_NAME_BLOB pName,
__in DWORD dwStrType, _In_ DWORD dwStrType,
__out_ecount_part_opt(csz, return) LPSTR psz, _Out_writes_to_opt_(csz, return) LPSTR psz,
__in DWORD csz _In_ DWORD csz
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertNameToStrW( CertNameToStrW(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_NAME_BLOB pName, _In_ PCERT_NAME_BLOB pName,
__in DWORD dwStrType, _In_ DWORD dwStrType,
__out_ecount_part_opt(csz, return) LPWSTR psz, _Out_writes_to_opt_(csz, return) LPWSTR psz,
__in DWORD csz _In_ DWORD csz
); );
#ifdef UNICODE #ifdef UNICODE
#define CertNameToStr CertNameToStrW #define CertNameToStr CertNameToStrW
#else #else
#define CertNameToStr CertNameToStrA #define CertNameToStr CertNameToStrA
#endif // !UNICODE #endif // !UNICODE
// certenrolld_begin -- CERT_NAME_STR_*_FLAG // certenrolld_begin -- CERT_NAME_STR_*_FLAG
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate name string types // Certificate name string types
skipping to change at line 14700 skipping to change at line 15426
// ppszError can be set to NULL if not interested in getting a pointer // ppszError can be set to NULL if not interested in getting a pointer
// to the invalid character sequence. // to the invalid character sequence.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertStrToNameA( CertStrToNameA(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCSTR pszX500, _In_ LPCSTR pszX500,
__in DWORD dwStrType, _In_ DWORD dwStrType,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded, _Out_writes_bytes_to_opt_(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
__inout DWORD *pcbEncoded, _Inout_ DWORD *pcbEncoded,
__deref_opt_out_opt LPCSTR *ppszError _Outptr_opt_result_maybenull_ LPCSTR *ppszError
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertStrToNameW( CertStrToNameW(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in LPCWSTR pszX500, _In_ LPCWSTR pszX500,
__in DWORD dwStrType, _In_ DWORD dwStrType,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded, _Out_writes_bytes_to_opt_(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
__inout DWORD *pcbEncoded, _Inout_ DWORD *pcbEncoded,
__deref_opt_out_opt LPCWSTR *ppszError _Outptr_opt_result_maybenull_ LPCWSTR *ppszError
); );
#ifdef UNICODE #ifdef UNICODE
#define CertStrToName CertStrToNameW #define CertStrToName CertStrToNameW
#else #else
#define CertStrToName CertStrToNameA #define CertStrToName CertStrToNameA
#endif // !UNICODE #endif // !UNICODE
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the subject or issuer name from the certificate and // Get the subject or issuer name from the certificate and
// according to the specified format type, convert to a null terminated // according to the specified format type, convert to a null terminated
skipping to change at line 14824 skipping to change at line 15550
// //
// Note: cchNameString includes the NULL char. // Note: cchNameString includes the NULL char.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertGetNameStringA( CertGetNameStringA(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwType, _In_ DWORD dwType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvTypePara, _In_opt_ void *pvTypePara,
__out_ecount_part_opt(cchNameString, return) LPSTR pszNameString, _Out_writes_to_opt_(cchNameString, return) LPSTR pszNameString,
__in DWORD cchNameString _In_ DWORD cchNameString
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
DWORD DWORD
WINAPI WINAPI
CertGetNameStringW( CertGetNameStringW(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in DWORD dwType, _In_ DWORD dwType,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt void *pvTypePara, _In_opt_ void *pvTypePara,
__out_ecount_part_opt(cchNameString, return) LPWSTR pszNameString, _Out_writes_to_opt_(cchNameString, return) LPWSTR pszNameString,
__in DWORD cchNameString _In_ DWORD cchNameString
); );
#ifdef UNICODE #ifdef UNICODE
#define CertGetNameString CertGetNameStringW #define CertGetNameString CertGetNameStringW
#else #else
#define CertGetNameString CertGetNameStringA #define CertGetNameString CertGetNameStringA
#endif // !UNICODE #endif // !UNICODE
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate name types // Certificate name types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 14868 skipping to change at line 15594
#define CERT_NAME_DNS_TYPE 6 #define CERT_NAME_DNS_TYPE 6
#define CERT_NAME_URL_TYPE 7 #define CERT_NAME_URL_TYPE 7
#define CERT_NAME_UPN_TYPE 8 #define CERT_NAME_UPN_TYPE 8
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate name flags // Certificate name flags
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_NAME_ISSUER_FLAG 0x1 #define CERT_NAME_ISSUER_FLAG 0x1
#define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000 #define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000
// Following is only applicable to CERT_NAME_DNS_TYPE. When set returns
// all names not just the first one. Returns a multi-string. Each string
// will be null terminated. The last string will be double null terminated.
#define CERT_NAME_SEARCH_ALL_NAMES_FLAG 0x2
//+========================================================================= //+=========================================================================
// Simplified Cryptographic Message Data Structures and APIs // Simplified Cryptographic Message Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Conventions for the *pb and *pcb output parameters: // Conventions for the *pb and *pcb output parameters:
// //
// Upon entry to the function: // Upon entry to the function:
// if pcb is OPTIONAL && pcb == NULL, then, // if pcb is OPTIONAL && pcb == NULL, then,
// No output is returned // No output is returned
skipping to change at line 14920 skipping to change at line 15651
// //
// Note, if the KEYID choice was selected for a CMS SignerId, then, the // Note, if the KEYID choice was selected for a CMS SignerId, then, the
// SerialNumber is 0 and the Issuer is encoded containing a single RDN with a // SerialNumber is 0 and the Issuer is encoded containing a single RDN with a
// single Attribute whose OID is szOID_KEYID_RDN, value type is // single Attribute whose OID is szOID_KEYID_RDN, value type is
// CERT_RDN_OCTET_STRING and value is the KEYID. When the // CERT_RDN_OCTET_STRING and value is the KEYID. When the
// CertGetSubjectCertificateFromStore and // CertGetSubjectCertificateFromStore and
// CertFindCertificateInStore(CERT_FIND_SUBJECT_CERT) APIs see this // CertFindCertificateInStore(CERT_FIND_SUBJECT_CERT) APIs see this
// special KEYID Issuer and SerialNumber, they do a KEYID match. // special KEYID Issuer and SerialNumber, they do a KEYID match.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef PCCERT_CONTEXT (WINAPI *PFN_CRYPT_GET_SIGNER_CERTIFICATE)( typedef PCCERT_CONTEXT (WINAPI *PFN_CRYPT_GET_SIGNER_CERTIFICATE)(
__inout_opt void *pvGetArg, _Inout_opt_ void *pvGetArg,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in PCERT_INFO pSignerId, // Only the Issuer and SerialNumber _In_ PCERT_INFO pSignerId, // Only the Issuer and SerialNumber
// fields have been updated // fields have been updated
__in HCERTSTORE hMsgCertStore _In_ HCERTSTORE hMsgCertStore
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// The CRYPT_SIGN_MESSAGE_PARA are used for signing messages using the // The CRYPT_SIGN_MESSAGE_PARA are used for signing messages using the
// specified signing certificate context. // specified signing certificate context.
// //
// Either the CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_PROV_INFO_PROP_ID must // Either the CERT_KEY_PROV_HANDLE_PROP_ID or CERT_KEY_PROV_INFO_PROP_ID must
// be set for each rgpSigningCert[]. Either one specifies the private // be set for each rgpSigningCert[]. Either one specifies the private
// signature key to use. // signature key to use.
// //
skipping to change at line 15036 skipping to change at line 15767
// //
// cbSize must be set to the sizeof(CRYPT_VERIFY_MESSAGE_PARA) or else // cbSize must be set to the sizeof(CRYPT_VERIFY_MESSAGE_PARA) or else
// LastError will be updated with E_INVALIDARG. // LastError will be updated with E_INVALIDARG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_VERIFY_MESSAGE_PARA { typedef struct _CRYPT_VERIFY_MESSAGE_PARA {
DWORD cbSize; DWORD cbSize;
DWORD dwMsgAndCertEncodingType; DWORD dwMsgAndCertEncodingType;
HCRYPTPROV_LEGACY hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate; PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate;
void *pvGetArg; void *pvGetArg;
#ifdef CRYPT_VERIFY_MESSAGE_PARA_HAS_EXTRA_FIELDS
// Note, if you #define CRYPT_VERIFY_MESSAGE_PARA_HAS_EXTRA_FIELDS,
// then, you must zero all unused fields in this data structure.
// More fields could be added in a future release.
//
// The following is set to check for Strong and Restricted Signatures
//
PCCERT_STRONG_SIGN_PARA pStrongSignPara;
#endif
} CRYPT_VERIFY_MESSAGE_PARA, *PCRYPT_VERIFY_MESSAGE_PARA; } CRYPT_VERIFY_MESSAGE_PARA, *PCRYPT_VERIFY_MESSAGE_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// The CRYPT_ENCRYPT_MESSAGE_PARA are used for encrypting messages. // The CRYPT_ENCRYPT_MESSAGE_PARA are used for encrypting messages.
// //
// hCryptProv is used to do content encryption, recipient key // hCryptProv is used to do content encryption, recipient key
// encryption, and recipient key export. Its private key // encryption, and recipient key export. Its private key
// isn't used. // isn't used.
// //
// Currently, pvEncryptionAuxInfo is only defined for RC2 or RC4 encryption // Currently, pvEncryptionAuxInfo is only defined for RC2 or RC4 encryption
skipping to change at line 15203 skipping to change at line 15947
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sign the message. // Sign the message.
// //
// If fDetachedSignature is TRUE, the "to be signed" content isn't included // If fDetachedSignature is TRUE, the "to be signed" content isn't included
// in the encoded signed blob. // in the encoded signed blob.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSignMessage( CryptSignMessage(
__in PCRYPT_SIGN_MESSAGE_PARA pSignPara, _In_ PCRYPT_SIGN_MESSAGE_PARA pSignPara,
__in BOOL fDetachedSignature, _In_ BOOL fDetachedSignature,
__in DWORD cToBeSigned, _In_ DWORD cToBeSigned,
__in_ecount_opt(cToBeSigned) const BYTE *rgpbToBeSigned[], _In_reads_opt_(cToBeSigned) const BYTE *rgpbToBeSigned[],
__in_ecount(cToBeSigned) DWORD rgcbToBeSigned[], _In_reads_(cToBeSigned) DWORD rgcbToBeSigned[],
__out_bcount_part_opt(*pcbSignedBlob, *pcbSignedBlob) BYTE *pbSignedBlob, _Out_writes_bytes_to_opt_(*pcbSignedBlob, *pcbSignedBlob) BYTE *pbSignedBlob
__inout DWORD *pcbSignedBlob ,
_Inout_ DWORD *pcbSignedBlob
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify a signed message. // Verify a signed message.
// //
// If pbDecoded == NULL, then, *pcbDecoded is implicitly set to 0 on input. // If pbDecoded == NULL, then, *pcbDecoded is implicitly set to 0 on input.
// For *pcbDecoded == 0 && ppSignerCert == NULL on input, the signer isn't // For *pcbDecoded == 0 && ppSignerCert == NULL on input, the signer isn't
// verified. // verified.
// //
// A message might have more than one signer. Set dwSignerIndex to iterate // A message might have more than one signer. Set dwSignerIndex to iterate
skipping to change at line 15252 skipping to change at line 15996
// CRYPT_E_NO_SIGNER. Also, for CRYPT_E_NO_SIGNER, pfnGetSignerCertificate // CRYPT_E_NO_SIGNER. Also, for CRYPT_E_NO_SIGNER, pfnGetSignerCertificate
// is still called with pSignerId set to NULL. // is still called with pSignerId set to NULL.
// //
// Note, an alternative way to get the certificates and CRLs from a // Note, an alternative way to get the certificates and CRLs from a
// signed message is to call CryptGetMessageCertificates. // signed message is to call CryptGetMessageCertificates.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptVerifyMessageSignature( CryptVerifyMessageSignature(
__in PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, _In_ PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
__in DWORD dwSignerIndex, _In_ DWORD dwSignerIndex,
__in_bcount(cbSignedBlob) const BYTE *pbSignedBlob, _In_reads_bytes_(cbSignedBlob) const BYTE *pbSignedBlob,
__in DWORD cbSignedBlob, _In_ DWORD cbSignedBlob,
__out_bcount_part_opt(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded, _Out_writes_bytes_to_opt_(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded,
__inout_opt DWORD *pcbDecoded, _Inout_opt_ DWORD *pcbDecoded,
__deref_opt_out_opt PCCERT_CONTEXT *ppSignerCert _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppSignerCert
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Returns the count of signers in the signed message. For no signers, returns // Returns the count of signers in the signed message. For no signers, returns
// 0. For an error returns -1 with LastError updated accordingly. // 0. For an error returns -1 with LastError updated accordingly.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
LONG LONG
WINAPI WINAPI
CryptGetMessageSignerCount( CryptGetMessageSignerCount(
__in DWORD dwMsgEncodingType, _In_ DWORD dwMsgEncodingType,
__in_bcount(cbSignedBlob) const BYTE *pbSignedBlob, _In_reads_bytes_(cbSignedBlob) const BYTE *pbSignedBlob,
__in DWORD cbSignedBlob _In_ DWORD cbSignedBlob
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Returns the cert store containing the message's certs and CRLs. // Returns the cert store containing the message's certs and CRLs.
// For an error, returns NULL with LastError updated. // For an error, returns NULL with LastError updated.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CryptGetMessageCertificates( CryptGetMessageCertificates(
__in DWORD dwMsgAndCertEncodingType, _In_ DWORD dwMsgAndCertEncodingType,
__in_opt HCRYPTPROV_LEGACY hCryptProv, // passed to CertOpenStore _In_opt_ HCRYPTPROV_LEGACY hCryptProv, // passed to CertOpenStore
__in DWORD dwFlags, // passed to CertOpenStore _In_ DWORD dwFlags, // passed to CertOpenStore
__in_bcount(cbSignedBlob) const BYTE *pbSignedBlob, _In_reads_bytes_(cbSignedBlob) const BYTE *pbSignedBlob,
__in DWORD cbSignedBlob _In_ DWORD cbSignedBlob
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify a signed message containing detached signature(s). // Verify a signed message containing detached signature(s).
// The "to be signed" content is passed in separately. No // The "to be signed" content is passed in separately. No
// decoded output. Otherwise, identical to CryptVerifyMessageSignature. // decoded output. Otherwise, identical to CryptVerifyMessageSignature.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptVerifyDetachedMessageSignature( CryptVerifyDetachedMessageSignature(
__in PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, _In_ PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
__in DWORD dwSignerIndex, _In_ DWORD dwSignerIndex,
__in_bcount(cbDetachedSignBlob) const BYTE *pbDetachedSignBlob, _In_reads_bytes_(cbDetachedSignBlob) const BYTE *pbDetachedSignBlob,
__in DWORD cbDetachedSignBlob, _In_ DWORD cbDetachedSignBlob,
__in DWORD cToBeSigned, _In_ DWORD cToBeSigned,
__in_ecount(cToBeSigned) const BYTE *rgpbToBeSigned[], _In_reads_(cToBeSigned) const BYTE *rgpbToBeSigned[],
__in_ecount(cToBeSigned) DWORD rgcbToBeSigned[], _In_reads_(cToBeSigned) DWORD rgcbToBeSigned[],
__deref_opt_out_opt PCCERT_CONTEXT *ppSignerCert _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppSignerCert
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Encrypts the message for the recipient(s). // Encrypts the message for the recipient(s).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptEncryptMessage( CryptEncryptMessage(
__in PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara, _In_ PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara,
__in DWORD cRecipientCert, _In_ DWORD cRecipientCert,
__in_ecount(cRecipientCert) PCCERT_CONTEXT rgpRecipientCert[], _In_reads_(cRecipientCert) PCCERT_CONTEXT rgpRecipientCert[],
__in_bcount_opt(cbToBeEncrypted) const BYTE *pbToBeEncrypted, _In_reads_bytes_opt_(cbToBeEncrypted) const BYTE *pbToBeEncrypted,
__in DWORD cbToBeEncrypted, _In_ DWORD cbToBeEncrypted,
__out_bcount_part_opt(*pcbEncryptedBlob, *pcbEncryptedBlob) BYTE *pbEncrypte _Out_writes_bytes_to_opt_(*pcbEncryptedBlob, *pcbEncryptedBlob) BYTE *pbEncr
dBlob, yptedBlob,
__inout DWORD *pcbEncryptedBlob _Inout_ DWORD *pcbEncryptedBlob
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Decrypts the message. // Decrypts the message.
// //
// If pbDecrypted == NULL, then, *pcbDecrypted is implicitly set to 0 on input. // If pbDecrypted == NULL, then, *pcbDecrypted is implicitly set to 0 on input.
// For *pcbDecrypted == 0 && ppXchgCert == NULL on input, the message isn't // For *pcbDecrypted == 0 && ppXchgCert == NULL on input, the message isn't
// decrypted. // decrypted.
// //
// For a successfully decrypted message, *ppXchgCert is updated // For a successfully decrypted message, *ppXchgCert is updated
// with the CertContext used to decrypt. It must be freed by calling // with the CertContext used to decrypt. It must be freed by calling
// CertStoreFreeCert. Otherwise, *ppXchgCert is set to NULL. // CertStoreFreeCert. Otherwise, *ppXchgCert is set to NULL.
// //
// ppXchgCert can be NULL, indicating the caller isn't interested // ppXchgCert can be NULL, indicating the caller isn't interested
// in getting the CertContext used to decrypt. // in getting the CertContext used to decrypt.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptDecryptMessage( CryptDecryptMessage(
__in PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara, _In_ PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
__in_bcount(cbEncryptedBlob) const BYTE *pbEncryptedBlob, _In_reads_bytes_(cbEncryptedBlob) const BYTE *pbEncryptedBlob,
__in DWORD cbEncryptedBlob, _In_ DWORD cbEncryptedBlob,
__out_bcount_part_opt(*pcbDecrypted, *pcbDecrypted) BYTE *pbDecrypted, _Out_writes_bytes_to_opt_(*pcbDecrypted, *pcbDecrypted) BYTE *pbDecrypted,
__inout_opt DWORD *pcbDecrypted, _Inout_opt_ DWORD *pcbDecrypted,
__deref_opt_out_opt PCCERT_CONTEXT *ppXchgCert _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppXchgCert
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sign the message and encrypt for the recipient(s). Does a CryptSignMessage // Sign the message and encrypt for the recipient(s). Does a CryptSignMessage
// followed with a CryptEncryptMessage. // followed with a CryptEncryptMessage.
// //
// Note: this isn't the CMSG_SIGNED_AND_ENVELOPED. Its a CMSG_SIGNED // Note: this isn't the CMSG_SIGNED_AND_ENVELOPED. Its a CMSG_SIGNED
// inside of an CMSG_ENVELOPED. // inside of an CMSG_ENVELOPED.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSignAndEncryptMessage( CryptSignAndEncryptMessage(
__in PCRYPT_SIGN_MESSAGE_PARA pSignPara, _In_ PCRYPT_SIGN_MESSAGE_PARA pSignPara,
__in PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara, _In_ PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara,
__in DWORD cRecipientCert, _In_ DWORD cRecipientCert,
__in_ecount(cRecipientCert) PCCERT_CONTEXT rgpRecipientCert[], _In_reads_(cRecipientCert) PCCERT_CONTEXT rgpRecipientCert[],
__in_bcount(cbToBeSignedAndEncrypted) const BYTE *pbToBeSignedAndEncrypted, _In_reads_bytes_(cbToBeSignedAndEncrypted) const BYTE *pbToBeSignedAndEncryp
__in DWORD cbToBeSignedAndEncrypted, ted,
__out_bcount_part_opt(*pcbSignedAndEncryptedBlob, *pcbSignedAndEncryptedBlob _In_ DWORD cbToBeSignedAndEncrypted,
) BYTE *pbSignedAndEncryptedBlob, _Out_writes_bytes_to_opt_(*pcbSignedAndEncryptedBlob, *pcbSignedAndEncrypted
__inout DWORD *pcbSignedAndEncryptedBlob Blob) BYTE *pbSignedAndEncryptedBlob,
_Inout_ DWORD *pcbSignedAndEncryptedBlob
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Decrypts the message and verifies the signer. Does a CryptDecryptMessage // Decrypts the message and verifies the signer. Does a CryptDecryptMessage
// followed with a CryptVerifyMessageSignature. // followed with a CryptVerifyMessageSignature.
// //
// If pbDecrypted == NULL, then, *pcbDecrypted is implicitly set to 0 on input. // If pbDecrypted == NULL, then, *pcbDecrypted is implicitly set to 0 on input.
// For *pcbDecrypted == 0 && ppSignerCert == NULL on input, the signer isn't // For *pcbDecrypted == 0 && ppSignerCert == NULL on input, the signer isn't
// verified. // verified.
// //
skipping to change at line 15402 skipping to change at line 16146
// Note: this isn't the CMSG_SIGNED_AND_ENVELOPED. Its a CMSG_SIGNED // Note: this isn't the CMSG_SIGNED_AND_ENVELOPED. Its a CMSG_SIGNED
// inside of an CMSG_ENVELOPED. // inside of an CMSG_ENVELOPED.
// //
// The message always needs to be decrypted to allow access to the // The message always needs to be decrypted to allow access to the
// signed message. Therefore, if ppXchgCert != NULL, its always updated. // signed message. Therefore, if ppXchgCert != NULL, its always updated.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptDecryptAndVerifyMessageSignature( CryptDecryptAndVerifyMessageSignature(
__in PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara, _In_ PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
__in PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, _In_ PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
__in DWORD dwSignerIndex, _In_ DWORD dwSignerIndex,
__in_bcount(cbEncryptedBlob) const BYTE *pbEncryptedBlob, _In_reads_bytes_(cbEncryptedBlob) const BYTE *pbEncryptedBlob,
__in DWORD cbEncryptedBlob, _In_ DWORD cbEncryptedBlob,
__out_bcount_part_opt(*pcbDecrypted, *pcbDecrypted) BYTE *pbDecrypted, _Out_writes_bytes_to_opt_(*pcbDecrypted, *pcbDecrypted) BYTE *pbDecrypted,
__inout_opt DWORD *pcbDecrypted, _Inout_opt_ DWORD *pcbDecrypted,
__deref_opt_out_opt PCCERT_CONTEXT *ppXchgCert, _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppXchgCert,
__deref_opt_out_opt PCCERT_CONTEXT *ppSignerCert _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppSignerCert
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Decodes a cryptographic message which may be one of the following types: // Decodes a cryptographic message which may be one of the following types:
// CMSG_DATA // CMSG_DATA
// CMSG_SIGNED // CMSG_SIGNED
// CMSG_ENVELOPED // CMSG_ENVELOPED
// CMSG_SIGNED_AND_ENVELOPED // CMSG_SIGNED_AND_ENVELOPED
// CMSG_HASHED // CMSG_HASHED
// //
skipping to change at line 15449 skipping to change at line 16193
// For CMSG_SIGNED: same as CryptVerifyMessageSignature. // For CMSG_SIGNED: same as CryptVerifyMessageSignature.
// For CMSG_ENVELOPED: same as CryptDecryptMessage. // For CMSG_ENVELOPED: same as CryptDecryptMessage.
// For CMSG_SIGNED_AND_ENVELOPED: same as CryptDecryptMessage plus // For CMSG_SIGNED_AND_ENVELOPED: same as CryptDecryptMessage plus
// CryptVerifyMessageSignature. // CryptVerifyMessageSignature.
// For CMSG_HASHED: verifies the hash and returns decoded content. // For CMSG_HASHED: verifies the hash and returns decoded content.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptDecodeMessage( CryptDecodeMessage(
__in DWORD dwMsgTypeFlags, _In_ DWORD dwMsgTypeFlags,
__in_opt PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara, _In_opt_ PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
__in_opt PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, _In_opt_ PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
__in DWORD dwSignerIndex, _In_ DWORD dwSignerIndex,
__in_bcount(cbEncodedBlob) const BYTE *pbEncodedBlob, _In_reads_bytes_(cbEncodedBlob) const BYTE *pbEncodedBlob,
__in DWORD cbEncodedBlob, _In_ DWORD cbEncodedBlob,
__in DWORD dwPrevInnerContentType, _In_ DWORD dwPrevInnerContentType,
__out_opt DWORD *pdwMsgType, _Out_opt_ DWORD *pdwMsgType,
__out_opt DWORD *pdwInnerContentType, _Out_opt_ DWORD *pdwInnerContentType,
__out_bcount_part_opt(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded, _Out_writes_bytes_to_opt_(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded,
__inout_opt DWORD *pcbDecoded, _Inout_opt_ DWORD *pcbDecoded,
__deref_opt_out_opt PCCERT_CONTEXT *ppXchgCert, _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppXchgCert,
__deref_opt_out_opt PCCERT_CONTEXT *ppSignerCert _Outptr_opt_result_maybenull_ PCCERT_CONTEXT *ppSignerCert
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Hash the message. // Hash the message.
// //
// If fDetachedHash is TRUE, only the ComputedHash is encoded in the // If fDetachedHash is TRUE, only the ComputedHash is encoded in the
// pbHashedBlob. Otherwise, both the ToBeHashed and ComputedHash // pbHashedBlob. Otherwise, both the ToBeHashed and ComputedHash
// are encoded. // are encoded.
// //
// pcbHashedBlob or pcbComputedHash can be NULL, indicating the caller // pcbHashedBlob or pcbComputedHash can be NULL, indicating the caller
// isn't interested in getting the output. // isn't interested in getting the output.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptHashMessage( CryptHashMessage(
__in PCRYPT_HASH_MESSAGE_PARA pHashPara, _In_ PCRYPT_HASH_MESSAGE_PARA pHashPara,
__in BOOL fDetachedHash, _In_ BOOL fDetachedHash,
__in DWORD cToBeHashed, _In_ DWORD cToBeHashed,
__in_ecount(cToBeHashed) const BYTE *rgpbToBeHashed[], _In_reads_(cToBeHashed) const BYTE *rgpbToBeHashed[],
__in_ecount(cToBeHashed) DWORD rgcbToBeHashed[], _In_reads_(cToBeHashed) DWORD rgcbToBeHashed[],
__out_bcount_part_opt(*pcbHashedBlob, *pcbHashedBlob) BYTE *pbHashedBlob, _Out_writes_bytes_to_opt_(*pcbHashedBlob, *pcbHashedBlob) BYTE *pbHashedBlob
__inout_opt DWORD *pcbHashedBlob, ,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Inout_opt_ DWORD *pcbHashedBlob,
sh, _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
__inout_opt DWORD *pcbComputedHash edHash,
_Inout_opt_ DWORD *pcbComputedHash
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify a hashed message. // Verify a hashed message.
// //
// pcbToBeHashed or pcbComputedHash can be NULL, // pcbToBeHashed or pcbComputedHash can be NULL,
// indicating the caller isn't interested in getting the output. // indicating the caller isn't interested in getting the output.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptVerifyMessageHash( CryptVerifyMessageHash(
__in PCRYPT_HASH_MESSAGE_PARA pHashPara, _In_ PCRYPT_HASH_MESSAGE_PARA pHashPara,
__in_bcount(cbHashedBlob) BYTE *pbHashedBlob, _In_reads_bytes_(cbHashedBlob) BYTE *pbHashedBlob,
__in DWORD cbHashedBlob, _In_ DWORD cbHashedBlob,
__out_bcount_part_opt(*pcbToBeHashed, *pcbToBeHashed) BYTE *pbToBeHashed, _Out_writes_bytes_to_opt_(*pcbToBeHashed, *pcbToBeHashed) BYTE *pbToBeHashed
__inout_opt DWORD *pcbToBeHashed, ,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Inout_opt_ DWORD *pcbToBeHashed,
sh, _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
__inout_opt DWORD *pcbComputedHash edHash,
_Inout_opt_ DWORD *pcbComputedHash
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify a hashed message containing a detached hash. // Verify a hashed message containing a detached hash.
// The "to be hashed" content is passed in separately. No // The "to be hashed" content is passed in separately. No
// decoded output. Otherwise, identical to CryptVerifyMessageHash. // decoded output. Otherwise, identical to CryptVerifyMessageHash.
// //
// pcbComputedHash can be NULL, indicating the caller isn't interested // pcbComputedHash can be NULL, indicating the caller isn't interested
// in getting the output. // in getting the output.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptVerifyDetachedMessageHash( CryptVerifyDetachedMessageHash(
__in PCRYPT_HASH_MESSAGE_PARA pHashPara, _In_ PCRYPT_HASH_MESSAGE_PARA pHashPara,
__in_bcount(cbDetachedHashBlob) BYTE *pbDetachedHashBlob, _In_reads_bytes_(cbDetachedHashBlob) BYTE *pbDetachedHashBlob,
__in DWORD cbDetachedHashBlob, _In_ DWORD cbDetachedHashBlob,
__in DWORD cToBeHashed, _In_ DWORD cToBeHashed,
__in_ecount(cToBeHashed) const BYTE *rgpbToBeHashed[], _In_reads_(cToBeHashed) const BYTE *rgpbToBeHashed[],
__in_ecount(cToBeHashed) DWORD rgcbToBeHashed[], _In_reads_(cToBeHashed) DWORD rgcbToBeHashed[],
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa _Out_writes_bytes_to_opt_(*pcbComputedHash, *pcbComputedHash) BYTE *pbComput
sh, edHash,
__inout_opt DWORD *pcbComputedHash _Inout_opt_ DWORD *pcbComputedHash
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sign the message using the provider's private key specified in the // Sign the message using the provider's private key specified in the
// parameters. A dummy SignerId is created and stored in the message. // parameters. A dummy SignerId is created and stored in the message.
// //
// Normally used until a certificate has been created for the key. // Normally used until a certificate has been created for the key.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSignMessageWithKey( CryptSignMessageWithKey(
__in PCRYPT_KEY_SIGN_MESSAGE_PARA pSignPara, _In_ PCRYPT_KEY_SIGN_MESSAGE_PARA pSignPara,
__in_bcount(cbToBeSigned) const BYTE *pbToBeSigned, _In_reads_bytes_(cbToBeSigned) const BYTE *pbToBeSigned,
__in DWORD cbToBeSigned, _In_ DWORD cbToBeSigned,
__out_bcount_part_opt(*pcbSignedBlob, *pcbSignedBlob) BYTE *pbSignedBlob, _Out_writes_bytes_to_opt_(*pcbSignedBlob, *pcbSignedBlob) BYTE *pbSignedBlob
__inout DWORD *pcbSignedBlob ,
_Inout_ DWORD *pcbSignedBlob
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify a signed message using the specified public key info. // Verify a signed message using the specified public key info.
// //
// Normally called by a CA until it has created a certificate for the // Normally called by a CA until it has created a certificate for the
// key. // key.
// //
// pPublicKeyInfo contains the public key to use to verify the signed // pPublicKeyInfo contains the public key to use to verify the signed
// message. If NULL, the signature isn't verified (for instance, the decoded // message. If NULL, the signature isn't verified (for instance, the decoded
// content may contain the PublicKeyInfo). // content may contain the PublicKeyInfo).
// //
// pcbDecoded can be NULL, indicating the caller isn't interested // pcbDecoded can be NULL, indicating the caller isn't interested
// in getting the decoded content. // in getting the decoded content.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptVerifyMessageSignatureWithKey( CryptVerifyMessageSignatureWithKey(
__in PCRYPT_KEY_VERIFY_MESSAGE_PARA pVerifyPara, _In_ PCRYPT_KEY_VERIFY_MESSAGE_PARA pVerifyPara,
__in_opt PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, _In_opt_ PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
__in_bcount(cbSignedBlob) const BYTE *pbSignedBlob, _In_reads_bytes_(cbSignedBlob) const BYTE *pbSignedBlob,
__in DWORD cbSignedBlob, _In_ DWORD cbSignedBlob,
__out_bcount_part_opt(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded, _Out_writes_bytes_to_opt_(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded,
__inout_opt DWORD *pcbDecoded _Inout_opt_ DWORD *pcbDecoded
); );
//+========================================================================= //+=========================================================================
// System Certificate Store Data Structures and APIs // System Certificate Store Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get a system certificate store based on a subsystem protocol. // Get a system certificate store based on a subsystem protocol.
// //
// Current examples of subsystems protocols are: // Current examples of subsystems protocols are:
skipping to change at line 15600 skipping to change at line 16344
// The returned Cert Store can be searched for an appropriate Cert // The returned Cert Store can be searched for an appropriate Cert
// using the Cert Store API's (see certstor.h) // using the Cert Store API's (see certstor.h)
// //
// When done, the cert store should be closed using CertStoreClose // When done, the cert store should be closed using CertStoreClose
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CertOpenSystemStoreA( CertOpenSystemStoreA(
__in_opt HCRYPTPROV_LEGACY hProv, _In_opt_ HCRYPTPROV_LEGACY hProv,
__in LPCSTR szSubsystemProtocol _In_ LPCSTR szSubsystemProtocol
); );
WINCRYPT32API WINCRYPT32API
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CertOpenSystemStoreW( CertOpenSystemStoreW(
__in_opt HCRYPTPROV_LEGACY hProv, _In_opt_ HCRYPTPROV_LEGACY hProv,
__in LPCWSTR szSubsystemProtocol _In_ LPCWSTR szSubsystemProtocol
); );
#ifdef UNICODE #ifdef UNICODE
#define CertOpenSystemStore CertOpenSystemStoreW #define CertOpenSystemStore CertOpenSystemStoreW
#else #else
#define CertOpenSystemStore CertOpenSystemStoreA #define CertOpenSystemStore CertOpenSystemStoreA
#endif // !UNICODE #endif // !UNICODE
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCertificateToSystemStoreA( CertAddEncodedCertificateToSystemStoreA(
__in LPCSTR szCertStoreName, _In_ LPCSTR szCertStoreName,
__in_bcount(cbCertEncoded) const BYTE * pbCertEncoded, _In_reads_bytes_(cbCertEncoded) const BYTE * pbCertEncoded,
__in DWORD cbCertEncoded _In_ DWORD cbCertEncoded
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCertificateToSystemStoreW( CertAddEncodedCertificateToSystemStoreW(
__in LPCWSTR szCertStoreName, _In_ LPCWSTR szCertStoreName,
__in_bcount(cbCertEncoded) const BYTE * pbCertEncoded, _In_reads_bytes_(cbCertEncoded) const BYTE * pbCertEncoded,
__in DWORD cbCertEncoded _In_ DWORD cbCertEncoded
); );
#ifdef UNICODE #ifdef UNICODE
#define CertAddEncodedCertificateToSystemStore CertAddEncodedCertificateToSyste mStoreW #define CertAddEncodedCertificateToSystemStore CertAddEncodedCertificateToSyste mStoreW
#else #else
#define CertAddEncodedCertificateToSystemStore CertAddEncodedCertificateToSyste mStoreA #define CertAddEncodedCertificateToSystemStore CertAddEncodedCertificateToSyste mStoreA
#endif // !UNICODE #endif // !UNICODE
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Find all certificate chains tying the given issuer name to any certificate // Find all certificate chains tying the given issuer name to any certificate
// that the current user has a private key for. // that the current user has a private key for.
skipping to change at line 15660 skipping to change at line 16404
DWORD cCerts; // number of certs in chain DWORD cCerts; // number of certs in chain
PCERT_BLOB certs; // pointer to array of cert chain blobs PCERT_BLOB certs; // pointer to array of cert chain blobs
// representing the certs // representing the certs
CRYPT_KEY_PROV_INFO keyLocatorInfo; // key locator for cert CRYPT_KEY_PROV_INFO keyLocatorInfo; // key locator for cert
} CERT_CHAIN, *PCERT_CHAIN; } CERT_CHAIN, *PCERT_CHAIN;
// WINCRYPT32API This is not exported by crypt32, it is exported by softpub // WINCRYPT32API This is not exported by crypt32, it is exported by softpub
HRESULT HRESULT
WINAPI WINAPI
FindCertsByIssuer( FindCertsByIssuer(
__out_bcount_part_opt(*pcbCertChains, *pcbCertChains) PCERT_CHAIN pCertChain _Out_writes_bytes_to_opt_(*pcbCertChains, *pcbCertChains) PCERT_CHAIN pCertC
s, hains,
__inout DWORD *pcbCertChains, _Inout_ DWORD *pcbCertChains,
__out DWORD *pcCertChains, // count of certificates chains returned _Out_ DWORD *pcCertChains, // count of certificates chains returned
__in_bcount_opt(cbEncodedIssuerName) BYTE* pbEncodedIssuerName, // DER enc _In_reads_bytes_opt_(cbEncodedIssuerName) BYTE* pbEncodedIssuerName, // DE
oded issuer name R encoded issuer name
__in DWORD cbEncodedIssuerName, // count in bytes of encoded issuer name _In_ DWORD cbEncodedIssuerName, // count in bytes of encoded issuer name
__in_opt LPCWSTR pwszPurpose, // "ClientAuth" or "CodeSigning" _In_opt_ LPCWSTR pwszPurpose, // "ClientAuth" or "CodeSigning"
__in DWORD dwKeySpec // only return signers supporting this _In_ DWORD dwKeySpec // only return signers supporting this
// keyspec // keyspec
); );
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// //
// CryptQueryObject takes a CERT_BLOB or a file name and returns the // CryptQueryObject takes a CERT_BLOB or a file name and returns the
// information about the content in the blob or in the file. // information about the content in the blob or in the file.
// //
// Parameters: // Parameters:
// INPUT dwObjectType: // INPUT dwObjectType:
skipping to change at line 15804 skipping to change at line 16548
// CERT_QUERY_CONTENT_SERIALIZED_CTL, it is a PCCTL_CONTEXT ; // CERT_QUERY_CONTENT_SERIALIZED_CTL, it is a PCCTL_CONTEXT ;
// Caller should free the pContext via CertFreeCTLContext. // Caller should free the pContext via CertFreeCTLContext.
// //
// If the *pbObject is of type CERT_QUERY_CONTENT_PKCS10 or CERT_QUERY_CONTENT_ PFX, CryptQueryObject // If the *pbObject is of type CERT_QUERY_CONTENT_PKCS10 or CERT_QUERY_CONTENT_ PFX, CryptQueryObject
// will not return anything in *phCertstore, *phMsg, or *ppvContext. // will not return anything in *phCertstore, *phMsg, or *ppvContext.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptQueryObject( CryptQueryObject(
__in DWORD dwObjectType, _In_ DWORD dwObjectType,
__in const void *pvObject, _In_ const void *pvObject,
__in DWORD dwExpectedContentTypeFlags, _In_ DWORD dwExpectedContentTypeFlags,
__in DWORD dwExpectedFormatTypeFlags, _In_ DWORD dwExpectedFormatTypeFlags,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_opt DWORD *pdwMsgAndCertEncodingType, _Out_opt_ DWORD *pdwMsgAndCertEncodingType,
__out_opt DWORD *pdwContentType, _Out_opt_ DWORD *pdwContentType,
__out_opt DWORD *pdwFormatType, _Out_opt_ DWORD *pdwFormatType,
__out_opt HCERTSTORE *phCertStore, _Out_opt_ HCERTSTORE *phCertStore,
__out_opt HCRYPTMSG *phMsg, _Out_opt_ HCRYPTMSG *phMsg,
__deref_opt_out_opt const void **ppvContext _Outptr_opt_result_maybenull_ const void **ppvContext
); );
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//dwObjectType for CryptQueryObject //dwObjectType for CryptQueryObject
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#define CERT_QUERY_OBJECT_FILE 0x00000001 #define CERT_QUERY_OBJECT_FILE 0x00000001
#define CERT_QUERY_OBJECT_BLOB 0x00000002 #define CERT_QUERY_OBJECT_BLOB 0x00000002
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//dwContentType for CryptQueryObject //dwContentType for CryptQueryObject
skipping to change at line 15932 skipping to change at line 16676
CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \ CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \
CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | \ CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | \
CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | \ CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | \
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \ CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \
CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | \ CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | \
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | \ CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | \
CERT_QUERY_CONTENT_FLAG_PKCS10 | \ CERT_QUERY_CONTENT_FLAG_PKCS10 | \
CERT_QUERY_CONTENT_FLAG_PFX | \ CERT_QUERY_CONTENT_FLAG_PFX | \
CERT_QUERY_CONTENT_FLAG_CERT_PAIR ) CERT_QUERY_CONTENT_FLAG_CERT_PAIR )
//content types allowed for Issuer certificates
#define CERT_QUERY_CONTENT_FLAG_ALL_ISSUER_CERT \
( CERT_QUERY_CONTENT_FLAG_CERT | \
CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \
CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \
CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED )
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//dwFormatType for CryptQueryObject //dwFormatType for CryptQueryObject
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//the content is in binary format //the content is in binary format
#define CERT_QUERY_FORMAT_BINARY 1 #define CERT_QUERY_FORMAT_BINARY 1
//the content is base64 encoded //the content is base64 encoded
#define CERT_QUERY_FORMAT_BASE64_ENCODED 2 #define CERT_QUERY_FORMAT_BASE64_ENCODED 2
//the content is ascii hex encoded with "{ASN}" prefix //the content is ascii hex encoded with "{ASN}" prefix
skipping to change at line 15974 skipping to change at line 16726
// //
// Crypt32 Memory Management Routines. All Crypt32 API which return allocated // Crypt32 Memory Management Routines. All Crypt32 API which return allocated
// buffers will do so via CryptMemAlloc, CryptMemRealloc. Clients can free // buffers will do so via CryptMemAlloc, CryptMemRealloc. Clients can free
// those buffers using CryptMemFree. Also included is CryptMemSize // those buffers using CryptMemFree. Also included is CryptMemSize
// //
WINCRYPT32API WINCRYPT32API
LPVOID LPVOID
WINAPI WINAPI
CryptMemAlloc ( CryptMemAlloc (
__in ULONG cbSize _In_ ULONG cbSize
); );
WINCRYPT32API WINCRYPT32API
LPVOID LPVOID
WINAPI WINAPI
CryptMemRealloc ( CryptMemRealloc (
__in_opt LPVOID pv, _In_opt_ LPVOID pv,
__in ULONG cbSize _In_ ULONG cbSize
); );
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CryptMemFree ( CryptMemFree (
__in_opt LPVOID pv _In_opt_ LPVOID pv
); );
// //
// Crypt32 Asynchronous Parameter Management Routines. All Crypt32 API which // Crypt32 Asynchronous Parameter Management Routines. All Crypt32 API which
// expose asynchronous mode operation use a Crypt32 Async Handle to pass // expose asynchronous mode operation use a Crypt32 Async Handle to pass
// around information about the operation e.g. callback routines. The // around information about the operation e.g. callback routines. The
// following API are used for manipulation of the async handle // following API are used for manipulation of the async handle
// //
// Following functions were never used. If called, will fail with LastError // Following functions were never used. If called, will fail with LastError
// set to ERROR_CALL_NOT_IMPLEMENTED. // set to ERROR_CALL_NOT_IMPLEMENTED.
typedef HANDLE HCRYPTASYNC, *PHCRYPTASYNC; typedef HANDLE HCRYPTASYNC, *PHCRYPTASYNC;
typedef VOID (WINAPI *PFN_CRYPT_ASYNC_PARAM_FREE_FUNC) ( typedef VOID (WINAPI *PFN_CRYPT_ASYNC_PARAM_FREE_FUNC) (
__in LPSTR pszParamOid, _In_ LPSTR pszParamOid,
__in LPVOID pvParam _In_ LPVOID pvParam
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptCreateAsyncHandle ( CryptCreateAsyncHandle (
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out PHCRYPTASYNC phAsync _Out_ PHCRYPTASYNC phAsync
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSetAsyncParam ( CryptSetAsyncParam (
__in HCRYPTASYNC hAsync, _In_ HCRYPTASYNC hAsync,
__in LPSTR pszParamOid, _In_ LPSTR pszParamOid,
__in_opt LPVOID pvParam, _In_opt_ LPVOID pvParam,
__callback PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree __callback PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptGetAsyncParam ( CryptGetAsyncParam (
__in HCRYPTASYNC hAsync, _In_ HCRYPTASYNC hAsync,
__in LPSTR pszParamOid, _In_ LPSTR pszParamOid,
__deref_opt_out_opt LPVOID* ppvParam, _Outptr_opt_result_maybenull_ LPVOID* ppvParam,
__deref_opt_out_opt __callback PFN_CRYPT_ASYNC_PARAM_FREE_FUNC* ppfnFree _Outptr_opt_result_maybenull_ __callback PFN_CRYPT_ASYNC_PARAM_FREE_FUNC* p
pfnFree
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptCloseAsyncHandle ( CryptCloseAsyncHandle (
__in_opt HCRYPTASYNC hAsync _In_opt_ HCRYPTASYNC hAsync
); );
// //
// Crypt32 Remote Object Retrieval Routines. This API allows retrieval of // Crypt32 Remote Object Retrieval Routines. This API allows retrieval of
// remote PKI objects where the location is given by an URL. The remote // remote PKI objects where the location is given by an URL. The remote
// object retrieval manager exposes two provider models. One is the "Scheme // object retrieval manager exposes two provider models. One is the "Scheme
// Provider" model which allows for installable protocol providers as defined // Provider" model which allows for installable protocol providers as defined
// by the URL scheme e.g. ldap, http, ftp. The scheme provider entry point is // by the URL scheme e.g. ldap, http, ftp. The scheme provider entry point is
// the same as the CryptRetrieveObjectByUrl however the *ppvObject returned // the same as the CryptRetrieveObjectByUrl however the *ppvObject returned
// is ALWAYS a counted array of encoded bits (one per object retrieved). The // is ALWAYS a counted array of encoded bits (one per object retrieved). The
skipping to change at line 16108 skipping to change at line 16860
// //
// The following is obsolete and has been replaced with the following // The following is obsolete and has been replaced with the following
// definition // definition
#define SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC "SchemeDllRetrieveEncodedObject" #define SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC "SchemeDllRetrieveEncodedObject"
// 2-8-02 Server 2003 changed to use UNICODE Url strings instead of multibyte // 2-8-02 Server 2003 changed to use UNICODE Url strings instead of multibyte
#define SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC "SchemeDllRetrieveEncodedObject W" #define SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC "SchemeDllRetrieveEncodedObject W"
typedef VOID (WINAPI *PFN_FREE_ENCODED_OBJECT_FUNC) ( typedef VOID (WINAPI *PFN_FREE_ENCODED_OBJECT_FUNC) (
__in_opt LPCSTR pszObjectOid, _In_opt_ LPCSTR pszObjectOid,
__inout PCRYPT_BLOB_ARRAY pObject, _Inout_ PCRYPT_BLOB_ARRAY pObject,
__inout_opt LPVOID pvFreeContext _Inout_opt_ LPVOID pvFreeContext
); );
// //
// SchemeDllRetrieveEncodedObject was replaced in Server 2003 with // SchemeDllRetrieveEncodedObject was replaced in Server 2003 with
// the following. (Changed to use UNICODE Url Strings.) // the following. (Changed to use UNICODE Url Strings.)
// //
// //
// SchemeDllRetrieveEncodedObjectW has the following signature: // SchemeDllRetrieveEncodedObjectW has the following signature:
// //
// __success(return == TRUE) // _Success_(return != FALSE)
// BOOL WINAPI SchemeDllRetrieveEncodedObjectW ( // BOOL WINAPI SchemeDllRetrieveEncodedObjectW (
// __in LPCWSTR pwszUrl, // _In_ LPCWSTR pwszUrl,
// __in_opt LPCSTR pszObjectOid, // _In_opt_ LPCSTR pszObjectOid,
// __in DWORD dwRetrievalFlags, // _In_ DWORD dwRetrievalFlags,
// __in DWORD dwTimeout, // milliseconds // _In_ DWORD dwTimeout, // milliseconds
// __out PCRYPT_BLOB_ARRAY pObject, // _Out_ PCRYPT_BLOB_ARRAY pObject,
// __deref_out __callback PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFr // _Outptr_ __callback PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFreeO
eeObject, bject,
// __deref_out_opt LPVOID* ppvFreeContext, // _Outptr_result_maybenull_ LPVOID* ppvFreeContext,
// __in_opt HCRYPTASYNC hAsyncRetrieve, // _In_opt_ HCRYPTASYNC hAsyncRetrieve,
// __in_opt PCRYPT_CREDENTIALS pCredentials, // _In_opt_ PCRYPT_CREDENTIALS pCredentials,
// __inout_opt PCRYPT_RETRIEVE_AUX_INFO pAuxInfo // _Inout_opt_ PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
// ) // )
// //
// //
// Context Provider Signatures // Context Provider Signatures
// //
#define CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC "ContextDllCreateObjectContext" #define CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC "ContextDllCreateObjectContext"
#define CONTEXT_OID_CERTIFICATE ((LPCSTR)1) #define CONTEXT_OID_CERTIFICATE ((LPCSTR)1)
#define CONTEXT_OID_CRL ((LPCSTR)2) #define CONTEXT_OID_CRL ((LPCSTR)2)
#define CONTEXT_OID_CTL ((LPCSTR)3) #define CONTEXT_OID_CTL ((LPCSTR)3)
#define CONTEXT_OID_PKCS7 ((LPCSTR)4) #define CONTEXT_OID_PKCS7 ((LPCSTR)4)
#define CONTEXT_OID_CAPI2_ANY ((LPCSTR)5) #define CONTEXT_OID_CAPI2_ANY ((LPCSTR)5)
#define CONTEXT_OID_OCSP_RESP ((LPCSTR)6) #define CONTEXT_OID_OCSP_RESP ((LPCSTR)6)
// //
// ContextDllCreateObjectContext has the following signature: // ContextDllCreateObjectContext has the following signature:
// //
// __success(return == TRUE) // _Success_(return != FALSE)
// BOOL WINAPI ContextDllCreateObjectContext ( // BOOL WINAPI ContextDllCreateObjectContext (
// __in_opt LPCSTR pszObjectOid, // _In_opt_ LPCSTR pszObjectOid,
// __in DWORD dwRetrievalFlags, // _In_ DWORD dwRetrievalFlags,
// __in PCRYPT_BLOB_ARRAY pObject, // _In_ PCRYPT_BLOB_ARRAY pObject,
// __deref_out LPVOID* ppvContext // _Outptr_ LPVOID* ppvContext
// ) // )
// //
// //
// Remote Object Retrieval API // Remote Object Retrieval API
// //
// //
// Retrieval flags // Retrieval flags
// //
skipping to change at line 16242 skipping to change at line 16994
// set in pAuxInfo. Only applicable to http URL retrievals. // set in pAuxInfo. Only applicable to http URL retrievals.
#define CRYPT_PROXY_CACHE_RETRIEVAL 0x00200000 #define CRYPT_PROXY_CACHE_RETRIEVAL 0x00200000
// When this flag is set, for a conditional retrieval returning not modified, // When this flag is set, for a conditional retrieval returning not modified,
// TRUE is returned and *ppvObject is set to NULL. For a nonNULL pAuxInfo, // TRUE is returned and *ppvObject is set to NULL. For a nonNULL pAuxInfo,
// dwHttpStatusCode is set to winhttp.h's HTTP_STATUS_NOT_MODIFIED. Otherwise, // dwHttpStatusCode is set to winhttp.h's HTTP_STATUS_NOT_MODIFIED. Otherwise,
// *ppvObject is updated for a successful retrieval. Only applicable to // *ppvObject is updated for a successful retrieval. Only applicable to
// http URL retrievals. // http URL retrievals.
#define CRYPT_NOT_MODIFIED_RETRIEVAL 0x00400000 #define CRYPT_NOT_MODIFIED_RETRIEVAL 0x00400000
// When this flag is set, revocation checking is enabled for https URLs.
// If the server's certificate is revoked, then, LastError is set to
// CRYPT_E_REVOKED. For no other errors, LastError is set to
// CRYPT_E_REVOCATION_OFFLINE for any offline revocation error.
//
// To ignore offline revocation errors, this API can be called again without
// setting this flag.
#define CRYPT_ENABLE_SSL_REVOCATION_RETRIEVAL 0x00800000
// Set this flag to append a random query string to the URL passed to
// WinHttpOpenRequest. This should only be set on URL's accessing Windows
// Update content. The random query string ensures that cached proxy content
// isn't used and the HTTP request will always reach the Content Delivery
// Network (CDN) used by Windows Update which removes a query string
// before doing a cache lookup.
#define CRYPT_RANDOM_QUERY_STRING_RETRIEVAL 0x04000000
// File scheme retrieval's are disabled by default. This flag can be set to
// allow file retrievals.
#define CRYPT_ENABLE_FILE_RETRIEVAL 0x08000000
// //
// Data verification retrieval flags // Data verification retrieval flags
// //
// CRYPT_VERIFY_CONTEXT_SIGNATURE is used to get signature verification // CRYPT_VERIFY_CONTEXT_SIGNATURE is used to get signature verification
// on the context created. In this case pszObjectOid must be non-NULL and // on the context created. In this case pszObjectOid must be non-NULL and
// pvVerify points to the signer certificate context // pvVerify points to the signer certificate context
// //
// CRYPT_VERIFY_DATA_HASH is used to get verification of the blob data // CRYPT_VERIFY_DATA_HASH is used to get verification of the blob data
// retrieved by the protocol. The pvVerify points to an URL_DATA_HASH // retrieved by the protocol. The pvVerify points to an URL_DATA_HASH
// structure (TBD) // structure (TBD)
// //
#define CRYPT_VERIFY_CONTEXT_SIGNATURE 0x00000020 #define CRYPT_VERIFY_CONTEXT_SIGNATURE 0x00000020
#define CRYPT_VERIFY_DATA_HASH 0x00000040 #define CRYPT_VERIFY_DATA_HASH 0x00000040
// //
// Time Valid Object flags // Time Valid Object flags
// //
#define CRYPT_KEEP_TIME_VALID 0x00000080 #define CRYPT_KEEP_TIME_VALID 0x00000080
#define CRYPT_DONT_VERIFY_SIGNATURE 0x00000100 #define CRYPT_DONT_VERIFY_SIGNATURE 0x00000100
#define CRYPT_DONT_CHECK_TIME_VALIDITY 0x00000200 #define CRYPT_DONT_CHECK_TIME_VALIDITY 0x00000200
// The default checks if ftNextUpdate >= ftValidFor. Set this flag to // The default checks if ftNextUpdate >= ftValidFor. Set this flag to
// check if ftThisUpdate >= ftValidFor. // check if ftThisUpdate >= ftValidFor.
#define CRYPT_CHECK_FRESHNESS_TIME_VALIDITY 0x00000400 #define CRYPT_CHECK_FRESHNESS_TIME_VALIDITY 0x00000400
#define CRYPT_ACCUMULATIVE_TIMEOUT 0x00000800 #define CRYPT_ACCUMULATIVE_TIMEOUT 0x00000800
// Set this flag to only use OCSP AIA URLs. // Set this flag to only use OCSP AIA URLs.
#define CRYPT_OCSP_ONLY_RETRIEVAL 0x01000000 #define CRYPT_OCSP_ONLY_RETRIEVAL 0x01000000
// Set this flag to only use the OCSP AIA URL if present. If the subject
// doesn't have an OCSP AIA URL, then, the CDP URLs are used.
#define CRYPT_NO_OCSP_FAILOVER_TO_CRL_RETRIEVAL 0x02000000
// //
// Cryptnet URL Cache Pre-Fetch Info // Cryptnet URL Cache Pre-Fetch Info
// //
typedef struct _CRYPTNET_URL_CACHE_PRE_FETCH_INFO { typedef struct _CRYPTNET_URL_CACHE_PRE_FETCH_INFO {
DWORD cbSize; DWORD cbSize;
DWORD dwObjectType; DWORD dwObjectType;
// Possible errors: // Possible errors:
// S_OK - Pending // S_OK - Pending
skipping to change at line 16296 skipping to change at line 17073
// Other errors - Unable to retrieve pre-fetch content // Other errors - Unable to retrieve pre-fetch content
DWORD dwError; DWORD dwError;
DWORD dwReserved; DWORD dwReserved;
FILETIME ThisUpdateTime; FILETIME ThisUpdateTime;
FILETIME NextUpdateTime; FILETIME NextUpdateTime;
FILETIME PublishTime; // May be zero FILETIME PublishTime; // May be zero
} CRYPTNET_URL_CACHE_PRE_FETCH_INFO, *PCRYPTNET_URL_CACHE_PRE_FETCH_INFO; } CRYPTNET_URL_CACHE_PRE_FETCH_INFO, *PCRYPTNET_URL_CACHE_PRE_FETCH_INFO;
// Pre-fetch ObjectTypes // Pre-fetch ObjectTypes
#define CRYPTNET_URL_CACHE_PRE_FETCH_NONE 0 #define CRYPTNET_URL_CACHE_PRE_FETCH_NONE 0
#define CRYPTNET_URL_CACHE_PRE_FETCH_BLOB 1 #define CRYPTNET_URL_CACHE_PRE_FETCH_BLOB 1
#define CRYPTNET_URL_CACHE_PRE_FETCH_CRL 2 #define CRYPTNET_URL_CACHE_PRE_FETCH_CRL 2
#define CRYPTNET_URL_CACHE_PRE_FETCH_OCSP 3 #define CRYPTNET_URL_CACHE_PRE_FETCH_OCSP 3
#define CRYPTNET_URL_CACHE_PRE_FETCH_AUTOROOT_CAB 5 #define CRYPTNET_URL_CACHE_PRE_FETCH_AUTOROOT_CAB 5
#define CRYPTNET_URL_CACHE_PRE_FETCH_DISALLOWED_CERT_CAB 6
// //
// Cryptnet URL Cache Flush Info // Cryptnet URL Cache Flush Info
// //
typedef struct _CRYPTNET_URL_CACHE_FLUSH_INFO { typedef struct _CRYPTNET_URL_CACHE_FLUSH_INFO {
DWORD cbSize; DWORD cbSize;
// If pre-fetching is enabled, following is ignored // If pre-fetching is enabled, following is ignored
// //
// 0 - use default flush exempt seconds (2 weeks) // 0 - use default flush exempt seconds (2 weeks)
// 0xFFFFFFFF - disable flushing // 0xFFFFFFFF - disable flushing
skipping to change at line 16404 skipping to change at line 17182
// cleared. This value will only be updated for http or https URL // cleared. This value will only be updated for http or https URL
// retrievals. // retrievals.
// //
// If CRYPT_NOT_MODIFIED_RETRIEVAL was set in dwFlags, set to winhttp.h's // If CRYPT_NOT_MODIFIED_RETRIEVAL was set in dwFlags, set to winhttp.h's
// HTTP_STATUS_NOT_MODIFIED if the retrieval returned not modified. In // HTTP_STATUS_NOT_MODIFIED if the retrieval returned not modified. In
// this case TRUE is returned with *ppvObject set to NULL. // this case TRUE is returned with *ppvObject set to NULL.
DWORD dwHttpStatusCode; DWORD dwHttpStatusCode;
} CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO; } CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO;
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptRetrieveObjectByUrlA ( CryptRetrieveObjectByUrlA (
__in LPCSTR pszUrl, _In_ LPCSTR pszUrl,
__in_opt LPCSTR pszObjectOid, _In_opt_ LPCSTR pszObjectOid,
__in DWORD dwRetrievalFlags, _In_ DWORD dwRetrievalFlags,
__in DWORD dwTimeout, // milliseconds _In_ DWORD dwTimeout, // milliseconds
__deref_out LPVOID* ppvObject, _Outptr_ LPVOID* ppvObject,
__in_opt HCRYPTASYNC hAsyncRetrieve, _In_opt_ HCRYPTASYNC hAsyncRetrieve,
__in_opt PCRYPT_CREDENTIALS pCredentials, _In_opt_ PCRYPT_CREDENTIALS pCredentials,
__in_opt LPVOID pvVerify, _In_opt_ LPVOID pvVerify,
__inout_opt PCRYPT_RETRIEVE_AUX_INFO pAuxInfo _Inout_opt_ PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptRetrieveObjectByUrlW ( CryptRetrieveObjectByUrlW (
__in LPCWSTR pszUrl, _In_ LPCWSTR pszUrl,
__in_opt LPCSTR pszObjectOid, _In_opt_ LPCSTR pszObjectOid,
__in DWORD dwRetrievalFlags, _In_ DWORD dwRetrievalFlags,
__in DWORD dwTimeout, // milliseconds _In_ DWORD dwTimeout, // milliseconds
__deref_out LPVOID* ppvObject, _Outptr_ LPVOID* ppvObject,
__in_opt HCRYPTASYNC hAsyncRetrieve, _In_opt_ HCRYPTASYNC hAsyncRetrieve,
__in_opt PCRYPT_CREDENTIALS pCredentials, _In_opt_ PCRYPT_CREDENTIALS pCredentials,
__in_opt LPVOID pvVerify, _In_opt_ LPVOID pvVerify,
__inout_opt PCRYPT_RETRIEVE_AUX_INFO pAuxInfo _Inout_opt_ PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptRetrieveObjectByUrl CryptRetrieveObjectByUrlW #define CryptRetrieveObjectByUrl CryptRetrieveObjectByUrlW
#else #else
#define CryptRetrieveObjectByUrl CryptRetrieveObjectByUrlA #define CryptRetrieveObjectByUrl CryptRetrieveObjectByUrlA
#endif // !UNICODE #endif // !UNICODE
// //
// Call back function to cancel object retrieval // Call back function to cancel object retrieval
// //
// The function can be installed on a per thread basis. // The function can be installed on a per thread basis.
// If CryptInstallCancelRetrieval is called for multiple times, only the most re cent // If CryptInstallCancelRetrieval is called for multiple times, only the most re cent
// installation will be kept. // installation will be kept.
// //
// This is only effective for http, https, gopher, and ftp protocol. // This is only effective for http, https, gopher, and ftp protocol.
// It is ignored by the rest of the protocols. // It is ignored by the rest of the protocols.
typedef BOOL (WINAPI *PFN_CRYPT_CANCEL_RETRIEVAL)( typedef BOOL (WINAPI *PFN_CRYPT_CANCEL_RETRIEVAL)(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_opt void *pvArg _Inout_opt_ void *pvArg
); );
// //
// PFN_CRYPT_CANCEL_RETRIEVAL // PFN_CRYPT_CANCEL_RETRIEVAL
// //
// This function should return FALSE when the object retrieval should be continu ed // This function should return FALSE when the object retrieval should be continu ed
// and return TRUE when the object retrieval should be cancelled. // and return TRUE when the object retrieval should be cancelled.
// //
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptInstallCancelRetrieval( CryptInstallCancelRetrieval(
__callback PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel, __callback PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel,
__in_opt const void *pvArg, _In_opt_ const void *pvArg,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUninstallCancelRetrieval( CryptUninstallCancelRetrieval(
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved _Reserved_ void *pvReserved
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptCancelAsyncRetrieval ( CryptCancelAsyncRetrieval (
__in_opt HCRYPTASYNC hAsyncRetrieval _In_opt_ HCRYPTASYNC hAsyncRetrieval
); );
// //
// Remote Object Async Retrieval parameters // Remote Object Async Retrieval parameters
// //
// //
// A client that wants to be notified of asynchronous object retrieval // A client that wants to be notified of asynchronous object retrieval
// completion sets this parameter on the async handle // completion sets this parameter on the async handle
// //
#define CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION ((LPCSTR)1) #define CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION ((LPCSTR)1)
typedef VOID (WINAPI *PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC) ( typedef VOID (WINAPI *PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC) (
__inout_opt LPVOID pvCompletion, _Inout_opt_ LPVOID pvCompletion,
__in DWORD dwCompletionCode, _In_ DWORD dwCompletionCode,
__in LPCSTR pszUrl, _In_ LPCSTR pszUrl,
__in_opt LPSTR pszObjectOid, _In_opt_ LPSTR pszObjectOid,
__in LPVOID pvObject _In_ LPVOID pvObject
); );
typedef struct _CRYPT_ASYNC_RETRIEVAL_COMPLETION { typedef struct _CRYPT_ASYNC_RETRIEVAL_COMPLETION {
__callback PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC pfnCompletion; __callback PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC pfnCompletion;
__inout_opt LPVOID pvCompletion; _Inout_opt_ LPVOID pvCompletion;
} CRYPT_ASYNC_RETRIEVAL_COMPLETION, *PCRYPT_ASYNC_RETRIEVAL_COMPLETION; } CRYPT_ASYNC_RETRIEVAL_COMPLETION, *PCRYPT_ASYNC_RETRIEVAL_COMPLETION;
// //
// This function is set on the async handle by a scheme provider that // This function is set on the async handle by a scheme provider that
// supports asynchronous retrieval // supports asynchronous retrieval
// //
#define CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL ((LPCSTR)2) #define CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL ((LPCSTR)2)
typedef BOOL (WINAPI *PFN_CANCEL_ASYNC_RETRIEVAL_FUNC) ( typedef BOOL (WINAPI *PFN_CANCEL_ASYNC_RETRIEVAL_FUNC) (
__in_opt HCRYPTASYNC hAsyncRetrieve _In_opt_ HCRYPTASYNC hAsyncRetrieve
); );
// //
// Get the locator for a CAPI object // Get the locator for a CAPI object
// //
#define CRYPT_GET_URL_FROM_PROPERTY 0x00000001 #define CRYPT_GET_URL_FROM_PROPERTY 0x00000001
#define CRYPT_GET_URL_FROM_EXTENSION 0x00000002 #define CRYPT_GET_URL_FROM_EXTENSION 0x00000002
#define CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE 0x00000004 #define CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE 0x00000004
#define CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE 0x00000008 #define CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE 0x00000008
skipping to change at line 16552 skipping to change at line 17330
// distribution points. Each distribution point may have multiple // distribution points. Each distribution point may have multiple
// URLs, (LDAP and HTTP scheme). // URLs, (LDAP and HTTP scheme).
DWORD cGroup; DWORD cGroup;
DWORD *rgcGroupEntry; DWORD *rgcGroupEntry;
} CRYPT_URL_INFO, *PCRYPT_URL_INFO; } CRYPT_URL_INFO, *PCRYPT_URL_INFO;
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptGetObjectUrl ( CryptGetObjectUrl (
__in LPCSTR pszUrlOid, _In_ LPCSTR pszUrlOid,
__in LPVOID pvPara, _In_ LPVOID pvPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbUrlArray, *pcbUrlArray) PCRYPT_URL_ARRAY pUrlArray _Out_writes_bytes_to_opt_(*pcbUrlArray, *pcbUrlArray) PCRYPT_URL_ARRAY pUrlA
, rray,
__inout DWORD* pcbUrlArray, _Inout_ DWORD* pcbUrlArray,
__out_bcount_part_opt(*pcbUrlInfo, *pcbUrlInfo) PCRYPT_URL_INFO pUrlInfo, _Out_writes_bytes_to_opt_(*pcbUrlInfo, *pcbUrlInfo) PCRYPT_URL_INFO pUrlInfo
__inout_opt DWORD* pcbUrlInfo, ,
__reserved LPVOID pvReserved _Inout_opt_ DWORD* pcbUrlInfo,
_Reserved_ LPVOID pvReserved
); );
#define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl" #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
// //
// UrlDllGetObjectUrl has the same signature as CryptGetObjectUrl // UrlDllGetObjectUrl has the same signature as CryptGetObjectUrl
// //
// //
// URL_OID_CERTIFICATE_ISSUER // URL_OID_CERTIFICATE_ISSUER
skipping to change at line 16732 skipping to change at line 17510
PCERT_REVOCATION_CHAIN_PARA pChainPara; PCERT_REVOCATION_CHAIN_PARA pChainPara;
// Should be used if the DeltaCrlIndicator value is more than 4 bytes // Should be used if the DeltaCrlIndicator value is more than 4 bytes
// If nonNull and iDeltaCrlIndicator == MAXLONG, check that the CRL's number is >= // If nonNull and iDeltaCrlIndicator == MAXLONG, check that the CRL's number is >=
PCRYPT_INTEGER_BLOB pDeltaCrlIndicator; PCRYPT_INTEGER_BLOB pDeltaCrlIndicator;
} CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO, } CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO,
*PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO; *PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO;
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptGetTimeValidObject ( CryptGetTimeValidObject (
__in LPCSTR pszTimeValidOid, _In_ LPCSTR pszTimeValidOid,
__in LPVOID pvPara, _In_ LPVOID pvPara,
__in PCCERT_CONTEXT pIssuer, _In_ PCCERT_CONTEXT pIssuer,
__in_opt LPFILETIME pftValidFor, _In_opt_ LPFILETIME pftValidFor,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in DWORD dwTimeout, // milliseconds _In_ DWORD dwTimeout, // milliseconds
__deref_opt_out LPVOID* ppvObject, _Outptr_opt_ LPVOID* ppvObject,
__in_opt PCRYPT_CREDENTIALS pCredentials, _In_opt_ PCRYPT_CREDENTIALS pCredentials,
__inout_opt PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO pExtraInfo _Inout_opt_ PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO pExtraInfo
); );
#define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject" #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
// //
// TimeValidDllGetObject has the same signature as CryptGetTimeValidObject // TimeValidDllGetObject has the same signature as CryptGetTimeValidObject
// //
// //
// TIME_VALID_OID_GET_CTL // TIME_VALID_OID_GET_CTL
skipping to change at line 16786 skipping to change at line 17564
#define TIME_VALID_OID_GET_CRL ((LPCSTR)2) #define TIME_VALID_OID_GET_CRL ((LPCSTR)2)
#define TIME_VALID_OID_GET_CRL_FROM_CERT ((LPCSTR)3) #define TIME_VALID_OID_GET_CRL_FROM_CERT ((LPCSTR)3)
#define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT ((LPCSTR)4) #define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT ((LPCSTR)4)
#define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL ((LPCSTR)5) #define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL ((LPCSTR)5)
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptFlushTimeValidObject ( CryptFlushTimeValidObject (
__in LPCSTR pszFlushTimeValidOid, _In_ LPCSTR pszFlushTimeValidOid,
__in LPVOID pvPara, _In_ LPVOID pvPara,
__in PCCERT_CONTEXT pIssuer, _In_ PCCERT_CONTEXT pIssuer,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved LPVOID pvReserved _Reserved_ LPVOID pvReserved
); );
#define TIME_VALID_OID_FLUSH_OBJECT_FUNC "TimeValidDllFlushObject" #define TIME_VALID_OID_FLUSH_OBJECT_FUNC "TimeValidDllFlushObject"
// //
// TimeValidDllFlushObject has the same signature as CryptFlushTimeValidObject // TimeValidDllFlushObject has the same signature as CryptFlushTimeValidObject
// //
// //
// TIME_VALID_OID_FLUSH_CTL // TIME_VALID_OID_FLUSH_CTL
skipping to change at line 16829 skipping to change at line 17607
// freshest CRL to flush // freshest CRL to flush
// //
#define TIME_VALID_OID_FLUSH_CTL ((LPCSTR)1) #define TIME_VALID_OID_FLUSH_CTL ((LPCSTR)1)
#define TIME_VALID_OID_FLUSH_CRL ((LPCSTR)2) #define TIME_VALID_OID_FLUSH_CRL ((LPCSTR)2)
#define TIME_VALID_OID_FLUSH_CRL_FROM_CERT ((LPCSTR)3) #define TIME_VALID_OID_FLUSH_CRL_FROM_CERT ((LPCSTR)3)
#define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT ((LPCSTR)4) #define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT ((LPCSTR)4)
#define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL ((LPCSTR)5) #define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL ((LPCSTR)5)
//-------------------------------------------------------------------------
// Data Protection APIs
//-------------------------------------------------------------------------
//
// Data protection APIs enable applications to easily secure data.
//
// The base provider provides protection based on the users' logon
// credentials. The data secured with these APIs follow the same
// roaming characteristics as HKCU -- if HKCU roams, the data
// protected by the base provider may roam as well. This makes
// the API ideal for the munging of data stored in the registry.
//
//
// Prompt struct -- what to tell users about the access
//
typedef struct _CRYPTPROTECT_PROMPTSTRUCT
{
DWORD cbSize;
DWORD dwPromptFlags;
HWND hwndApp;
LPCWSTR szPrompt;
} CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT;
//
// base provider action
//
#define CRYPTPROTECT_DEFAULT_PROVIDER { 0xdf9d8cd0, 0x1501, 0x11d1, {0x8c, 0x7
a, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb} }
//
// CryptProtect PromptStruct dwPromtFlags
//
//
// prompt on unprotect
#define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x1 // 1<<0
//
// prompt on protect
#define CRYPTPROTECT_PROMPT_ON_PROTECT 0x2 // 1<<1
#define CRYPTPROTECT_PROMPT_RESERVED 0x04 // reserved, do not use.
//
// default to strong variant UI protection (user supplied password currently).
#define CRYPTPROTECT_PROMPT_STRONG 0x08 // 1<<3
//
// require strong variant UI protection (user supplied password currently).
#define CRYPTPROTECT_PROMPT_REQUIRE_STRONG 0x10 // 1<<4
//
// CryptProtectData and CryptUnprotectData dwFlags
//
// for remote-access situations where ui is not an option
// if UI was specified on protect or unprotect operation, the call
// will fail and GetLastError() will indicate ERROR_PASSWORD_RESTRICTION
#define CRYPTPROTECT_UI_FORBIDDEN 0x1
//
// per machine protected data -- any user on machine where CryptProtectData
// took place may CryptUnprotectData
#define CRYPTPROTECT_LOCAL_MACHINE 0x4
//
// force credential synchronize during CryptProtectData()
// Synchronize is only operation that occurs during this operation
#define CRYPTPROTECT_CRED_SYNC 0x8
//
// Generate an Audit on protect and unprotect operations
//
#define CRYPTPROTECT_AUDIT 0x10
//
// Protect data with a non-recoverable key
//
#define CRYPTPROTECT_NO_RECOVERY 0x20
//
// Verify the protection of a protected blob
//
#define CRYPTPROTECT_VERIFY_PROTECTION 0x40
//
// Regenerate the local machine protection
//
#define CRYPTPROTECT_CRED_REGENERATE 0x80
// flags reserved for system use
#define CRYPTPROTECT_FIRST_RESERVED_FLAGVAL 0x0FFFFFFF
#define CRYPTPROTECT_LAST_RESERVED_FLAGVAL 0xFFFFFFFF
//
// flags specific to base provider
//
WINCRYPT32API
BOOL
WINAPI
CryptProtectData(
__in DATA_BLOB* pDataIn,
__in_opt LPCWSTR szDataDescr,
__in_opt DATA_BLOB* pOptionalEntropy,
__reserved PVOID pvReserved,
__in_opt CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct,
__in DWORD dwFlags,
__out DATA_BLOB* pDataOut // out encr blob
);
WINCRYPT32API
BOOL
WINAPI
CryptUnprotectData(
__in DATA_BLOB* pDataIn, // in encr blob
__deref_opt_out_opt LPWSTR* ppszDataDescr, // out
__in_opt DATA_BLOB* pOptionalEntropy,
__reserved PVOID pvReserved,
__in_opt CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct,
__in DWORD dwFlags,
__out DATA_BLOB* pDataOut
);
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINCRYPT32API
BOOL
WINAPI
CryptUpdateProtectedState(
__in_opt PSID pOldSid,
__in_opt LPCWSTR pwszOldPassword,
__in DWORD dwFlags,
__out_opt DWORD *pdwSuccessCount,
__out_opt DWORD *pdwFailureCount);
#endif // (NTDDI_VERSION >= NTDDI_WINLH)
//
// The buffer length passed into CryptProtectMemory and CryptUnprotectMemory
// must be a multiple of this length (or zero).
//
#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16
//
// CryptProtectMemory/CryptUnprotectMemory dwFlags
//
//
// Encrypt/Decrypt within current process context.
//
#define CRYPTPROTECTMEMORY_SAME_PROCESS 0x00
//
// Encrypt/Decrypt across process boundaries.
// eg: encrypted buffer passed across LPC to another process which calls CryptUn
protectMemory.
//
#define CRYPTPROTECTMEMORY_CROSS_PROCESS 0x01
//
// Encrypt/Decrypt across callers with same LogonId.
// eg: encrypted buffer passed across LPC to another process which calls CryptUn
protectMemory whilst impersonating.
//
#define CRYPTPROTECTMEMORY_SAME_LOGON 0x02
WINCRYPT32API
BOOL
WINAPI
CryptProtectMemory(
__inout LPVOID pDataIn, // in out data to encry
pt
__in DWORD cbDataIn, // multiple of CRYPTPRO
TECTMEMORY_BLOCK_SIZE
__in DWORD dwFlags
);
WINCRYPT32API
BOOL
WINAPI
CryptUnprotectMemory(
__inout LPVOID pDataIn, // in out data to decry
pt
__in DWORD cbDataIn, // multiple of CRYPTPRO
TECTMEMORY_BLOCK_SIZE
__in DWORD dwFlags
);
//+========================================================================= //+=========================================================================
// Helper functions to build certificates // Helper functions to build certificates
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// //
// Builds a self-signed certificate and returns a PCCERT_CONTEXT representing // Builds a self-signed certificate and returns a PCCERT_CONTEXT representing
// the certificate. A hProv may be specified to build the cert context. // the certificate. A hProv may be specified to build the cert context.
// //
// pSubjectIssuerBlob is the DN for the certifcate. If an alternate subject // pSubjectIssuerBlob is the DN for the certifcate. If an alternate subject
skipping to change at line 17051 skipping to change at line 17645
// //
// If the cert being built is only a dummy placeholder cert for speed it may not // If the cert being built is only a dummy placeholder cert for speed it may not
// need to be signed. Signing of the cert is skipped if CERT_CREATE_SELFSIGN_NO_ SIGN // need to be signed. Signing of the cert is skipped if CERT_CREATE_SELFSIGN_NO_ SIGN
// is specified in dwFlags. // is specified in dwFlags.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertCreateSelfSignCertificate( CertCreateSelfSignCertificate(
__in_opt HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, _In_opt_ HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
__in PCERT_NAME_BLOB pSubjectIssuerBlob, _In_ PCERT_NAME_BLOB pSubjectIssuerBlob,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCRYPT_KEY_PROV_INFO pKeyProvInfo, _In_opt_ PCRYPT_KEY_PROV_INFO pKeyProvInfo,
__in_opt PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, _In_opt_ PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt PSYSTEMTIME pStartTime, _In_opt_ PSYSTEMTIME pStartTime,
__in_opt PSYSTEMTIME pEndTime, _In_opt_ PSYSTEMTIME pEndTime,
__in_opt PCERT_EXTENSIONS pExtensions _In_opt_ PCERT_EXTENSIONS pExtensions
); );
#define CERT_CREATE_SELFSIGN_NO_SIGN 1 #define CERT_CREATE_SELFSIGN_NO_SIGN 1
#define CERT_CREATE_SELFSIGN_NO_KEY_INFO 2 #define CERT_CREATE_SELFSIGN_NO_KEY_INFO 2
//+========================================================================= //+=========================================================================
// Key Identifier Property Data Structures and APIs // Key Identifier Property Data Structures and APIs
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 17097 skipping to change at line 17691
// By default, searches the CurrentUser's list of Key Identifiers. // By default, searches the CurrentUser's list of Key Identifiers.
// CRYPT_KEYID_MACHINE_FLAG can be set to search the LocalMachine's list // CRYPT_KEYID_MACHINE_FLAG can be set to search the LocalMachine's list
// of Key Identifiers. When CRYPT_KEYID_MACHINE_FLAG is set, pwszComputerName // of Key Identifiers. When CRYPT_KEYID_MACHINE_FLAG is set, pwszComputerName
// can also be set to specify the name of a remote computer to be searched // can also be set to specify the name of a remote computer to be searched
// instead of the local machine. // instead of the local machine.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptGetKeyIdentifierProperty( CryptGetKeyIdentifierProperty(
__in const CRYPT_HASH_BLOB *pKeyIdentifier, _In_ const CRYPT_HASH_BLOB *pKeyIdentifier,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt LPCWSTR pwszComputerName, _In_opt_ LPCWSTR pwszComputerName,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out_bcount_part_opt(*pcbData, *pcbData) void *pvData, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) void *pvData,
__inout DWORD *pcbData _Inout_ DWORD *pcbData
); );
// When the following flag is set, searches the LocalMachine instead of the // When the following flag is set, searches the LocalMachine instead of the
// CurrentUser. This flag is applicable to all the KeyIdentifierProperty APIs. // CurrentUser. This flag is applicable to all the KeyIdentifierProperty APIs.
#define CRYPT_KEYID_MACHINE_FLAG 0x00000020 #define CRYPT_KEYID_MACHINE_FLAG 0x00000020
// When the following flag is set, *pvData is updated with a pointer to // When the following flag is set, *pvData is updated with a pointer to
// allocated memory. LocalFree() must be called to free the allocated memory. // allocated memory. LocalFree() must be called to free the allocated memory.
#define CRYPT_KEYID_ALLOC_FLAG 0x00008000 #define CRYPT_KEYID_ALLOC_FLAG 0x00008000
skipping to change at line 17137 skipping to change at line 17731
// properties is deleted. // properties is deleted.
// //
// If CRYPT_KEYID_SET_NEW_FLAG is set, the set fails if the property already // If CRYPT_KEYID_SET_NEW_FLAG is set, the set fails if the property already
// exists. For an existing property, FALSE is returned with LastError set to // exists. For an existing property, FALSE is returned with LastError set to
// CRYPT_E_EXISTS. // CRYPT_E_EXISTS.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSetKeyIdentifierProperty( CryptSetKeyIdentifierProperty(
__in const CRYPT_HASH_BLOB *pKeyIdentifier, _In_ const CRYPT_HASH_BLOB *pKeyIdentifier,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt LPCWSTR pwszComputerName, _In_opt_ LPCWSTR pwszComputerName,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__in_opt const void *pvData _In_opt_ const void *pvData
); );
// When the following flag is set, the Key Identifier and all its properties // When the following flag is set, the Key Identifier and all its properties
// are deleted. // are deleted.
#define CRYPT_KEYID_DELETE_FLAG 0x00000010 #define CRYPT_KEYID_DELETE_FLAG 0x00000010
// When the following flag is set, the set fails if the property already // When the following flag is set, the set fails if the property already
// exists. // exists.
#define CRYPT_KEYID_SET_NEW_FLAG 0x00002000 #define CRYPT_KEYID_SET_NEW_FLAG 0x00002000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// For CERT_KEY_PROV_INFO_PROP_ID, rgppvData[] points to a // For CERT_KEY_PROV_INFO_PROP_ID, rgppvData[] points to a
// CRYPT_KEY_PROV_INFO. // CRYPT_KEY_PROV_INFO.
// //
// Return FALSE to stop the enumeration. // Return FALSE to stop the enumeration.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_CRYPT_ENUM_KEYID_PROP)( typedef BOOL (WINAPI *PFN_CRYPT_ENUM_KEYID_PROP)(
__in const CRYPT_HASH_BLOB *pKeyIdentifier, _In_ const CRYPT_HASH_BLOB *pKeyIdentifier,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__in DWORD cProp, _In_ DWORD cProp,
__in_ecount(cProp) DWORD *rgdwPropId, _In_reads_(cProp) DWORD *rgdwPropId,
__in_ecount(cProp) void **rgpvData, _In_reads_(cProp) void **rgpvData,
__in_ecount(cProp) DWORD *rgcbData _In_reads_(cProp) DWORD *rgcbData
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the Key Identifiers. // Enumerate the Key Identifiers.
// //
// If pKeyIdentifier is NULL, enumerates all Key Identifers. Otherwise, // If pKeyIdentifier is NULL, enumerates all Key Identifers. Otherwise,
// calls the callback for the specified KeyIdentifier. If dwPropId is // calls the callback for the specified KeyIdentifier. If dwPropId is
// 0, calls the callback with all the properties. Otherwise, only calls // 0, calls the callback with all the properties. Otherwise, only calls
// the callback with the specified property (cProp = 1). // the callback with the specified property (cProp = 1).
// Furthermore, when dwPropId is specified, skips KeyIdentifiers not // Furthermore, when dwPropId is specified, skips KeyIdentifiers not
// having the property. // having the property.
// //
// Set CRYPT_KEYID_MACHINE_FLAG to enumerate the LocalMachine // Set CRYPT_KEYID_MACHINE_FLAG to enumerate the LocalMachine
// Key Identifiers. Set pwszComputerName, to enumerate Key Identifiers on // Key Identifiers. Set pwszComputerName, to enumerate Key Identifiers on
// a remote computer. // a remote computer.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptEnumKeyIdentifierProperties( CryptEnumKeyIdentifierProperties(
__in_opt const CRYPT_HASH_BLOB *pKeyIdentifier, _In_opt_ const CRYPT_HASH_BLOB *pKeyIdentifier,
__in DWORD dwPropId, _In_ DWORD dwPropId,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt LPCWSTR pwszComputerName, _In_opt_ LPCWSTR pwszComputerName,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__inout_opt void *pvArg, _Inout_opt_ void *pvArg,
__callback PFN_CRYPT_ENUM_KEYID_PROP pfnEnum __callback PFN_CRYPT_ENUM_KEYID_PROP pfnEnum
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Create a KeyIdentifier from the CSP Public Key Blob. // Create a KeyIdentifier from the CSP Public Key Blob.
// //
// Converts the CSP PUBLICKEYSTRUC into a X.509 CERT_PUBLIC_KEY_INFO and // Converts the CSP PUBLICKEYSTRUC into a X.509 CERT_PUBLIC_KEY_INFO and
// encodes. The encoded CERT_PUBLIC_KEY_INFO is SHA1 hashed to obtain // encodes. The encoded CERT_PUBLIC_KEY_INFO is SHA1 hashed to obtain
// the Key Identifier. // the Key Identifier.
// //
// By default, the pPubKeyStruc->aiKeyAlg is used to find the appropriate // By default, the pPubKeyStruc->aiKeyAlg is used to find the appropriate
// public key Object Identifier. pszPubKeyOID can be set to override // public key Object Identifier. pszPubKeyOID can be set to override
// the default OID obtained from the aiKeyAlg. // the default OID obtained from the aiKeyAlg.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptCreateKeyIdentifierFromCSP( CryptCreateKeyIdentifierFromCSP(
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in_opt LPCSTR pszPubKeyOID, _In_opt_ LPCSTR pszPubKeyOID,
__in_bcount(cbPubKeyStruc) const PUBLICKEYSTRUC *pPubKeyStruc, _In_reads_bytes_(cbPubKeyStruc) const PUBLICKEYSTRUC *pPubKeyStruc,
__in DWORD cbPubKeyStruc, _In_ DWORD cbPubKeyStruc,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__out_bcount_part_opt(*pcbHash, *pcbHash) BYTE *pbHash, _Out_writes_bytes_to_opt_(*pcbHash, *pcbHash) BYTE *pbHash,
__inout DWORD *pcbHash _Inout_ DWORD *pcbHash
); );
//+========================================================================= //+=========================================================================
// Certificate Chaining Infrastructure // Certificate Chaining Infrastructure
//========================================================================== //==========================================================================
#define CERT_CHAIN_CONFIG_REGPATH \ #define CERT_CHAIN_CONFIG_REGPATH \
L"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CertDllCreateCerti ficateChainEngine\\Config" L"Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CertDllCreateCerti ficateChainEngine\\Config"
// max size of the cryptographic object to download, in bytes // max size of the cryptographic object to download, in bytes
skipping to change at line 17288 skipping to change at line 17882
L"MaxAIAUrlRetrievalCertCount" L"MaxAIAUrlRetrievalCertCount"
#define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT 10 #define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT 10
// The following is a REG_DWORD. If the OCSP response NextUpdate is zero, // The following is a REG_DWORD. If the OCSP response NextUpdate is zero,
// this value is added to the ThisUpdate to get a nonzero NextUpdate. // this value is added to the ThisUpdate to get a nonzero NextUpdate.
#define CERT_CHAIN_OCSP_VALIDITY_SECONDS_VALUE_NAME \ #define CERT_CHAIN_OCSP_VALIDITY_SECONDS_VALUE_NAME \
L"OcspValiditySeconds" L"OcspValiditySeconds"
// 12 hours // 12 hours
#define CERT_CHAIN_OCSP_VALIDITY_SECONDS_DEFAULT (12 * 60 * 60) #define CERT_CHAIN_OCSP_VALIDITY_SECONDS_DEFAULT (12 * 60 * 60)
// The following is a REG_DWORD. Flags can be set to enable weak
// signature hash algorithms and/or weak public key lengths that
// are disabled by default. Also, has flags to enable logging of weak
// certificates.
//
#define CERT_CHAIN_ENABLE_WEAK_SIGNATURE_FLAGS_VALUE_NAME \
L"EnableWeakSignatureFlags"
// The following flag is set to enable MD2 or MD4 hashes that are
// disabled by default. If none, code signing, driver signing
// or time stamping requested EKUs are passed to CertGetCertificateChain API,
// then MD2 or MD4 isn't disabled by default.
#define CERT_CHAIN_ENABLE_MD2_MD4_FLAG 0x00000001
// The following flag is set to enable weak RSA public key lengths
// for trusted roots that are disabled by default.
#define CERT_CHAIN_ENABLE_WEAK_RSA_ROOT_FLAG 0x00000002
// The following flag is set to enable the logging of weak certificates
// to the directory identified by CERT_CHAIN_WEAK_SIGNATURE_LOG_DIR_VALUE_NAME.
// Not applicable to MD2 or MD4 certificates.
#define CERT_CHAIN_ENABLE_WEAK_LOGGING_FLAG 0x00000004
// The following flag is set to only log weak certificates. Disables
// weak signature errors from being returned. Not applicable
// to MD2 or MD4 certificates.
#define CERT_CHAIN_ENABLE_ONLY_WEAK_LOGGING_FLAG 0x00000008
// The following is a REG_DWORD that specifies the minimum RSA public
// key length in bits. If not defined or a value of 0, uses the
// default value.
#define CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_VALUE_NAME \
L"MinRsaPubKeyBitLength"
#define CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DEFAULT 1023
// The following value disables checking for weak RSA public key lengths.
#define CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DISABLE \
0xFFFFFFFF
// The following is a REG_BINARY containing the 8 byte FILETIME. The weak
// RSA public key length check is disabled for timestamped files before
// this time. If not defined or a zero FILETIME, uses the default value.
#define CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_VALUE_NAME \
L"WeakRsaPubKeyTime"
// The default time: UTC: Fri Jan 01 00:00:00 2010
#define CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_DEFAULT \
0x01CA8A755C6E0000ui64
// The following is a REG_SZ. When defined, weak certificates are
// written to this directory. This directory should be ACL'ed to allow
// modify access by Authenticated Users and All Application Packages.
#define CERT_CHAIN_WEAK_SIGNATURE_LOG_DIR_VALUE_NAME \
L"WeakSignatureLogDir"
//+=========================================================================
//
// Weak Signature Registry Configuration
//
//==========================================================================
//
// The administrator will continue to place the weak crypto settings under:
// CERT_CHAIN_CONFIG_REGPATH defined above.
//
// The OS and Windows Update will configure the same settings in the
// "Default" subkey under CERT_CHAIN_CONFIG_REGPATH.
//
#define CERT_CHAIN_DEFAULT_CONFIG_SUBDIR L"Default"
//
// The registry values will have the following name syntax:
// "Weak"<CryptoAlg><ConfigType><ValueType>
//
// Where:
// - <CryptoAlg> can be: "Md5", "Sha1", "Rsa", "Dsa" or "Ecdsa"
// - <ConfigType> can be: "ThirdParty" or "All"
// - <ValueType> can be: "Flags", "Hygiene", "MinBitLength", "AfterTime" or
// "Sha256Allow"
// - "Hygiene" is only applicable to hash algorithms
// - "MinBitLengh" is only applicable to key algorithms
// - <CryptoAlg>, <ConfigType> and <ValueType> will be present in all names.
//
//
// For example, all possible registry value names for Md5:
// WeakMd5ThirdPartyFlags
// WeakMd5AllFlags
// WeakMd5ThirdPartyHygiene
// WeakMd5AllHygiene
// WeakMd5ThirdPartyAfterTime
// WeakMd5AllAfterTime
// WeakMd5ThirdPartySha256Allow
// WeakMd5AllSha256Allow
//
// For example, all possible registry value names for Rsa:
// WeakRsaThirdPartyFlags
// WeakRsaAllFlags
// WeakRsaThirdPartyAfterTime
// WeakRsaAllAfterTime
// WeakRsaThirdPartyMinBitLength
// WeakRsaAllMinBitLength
// WeakRsaThirdPartySha256Allow
// WeakRsaAllSha256Allow
//
// The following registry values can be set:
// - "Weak"<CryptoAlg><ConfigType>"Flags"
// - REG_DWORD
// - Flags can be set to disable the hash algorithm or enable a
// minimum key length. See below for a complete list.
// - "Weak"<HashCryptoAlg><ConfigType>"Hygiene"
// - REG_DWORD or REG_QWORD. The REG_DWORD can be used until the number
// of hygiene functions exceeds 32. We will support either registry type
// for this value.
// - This value corresponds to the qwHygieneFlags parameter passed to the
// I_CertGetCertificateHygieneStatus internal API.
// - The hygiene checks are skipped if the hash algorithm has been disabled.
// - "Weak"<KeyCryptoAlg><ConfigType>"MinBitLength"
// - REG_DWORD
// - This value specifies the minimum public key length in bits.
// - "Weak"<CryptoAlg><ConfigType>"AfterTime"
// - REG_BINARY
// - This value contains an 8 byte FILETIME. The weak crypto algorithm
// check is disabled for time stamped files before this time.
// - This configuration value isn't applicable to timestamp chains.
// - This configuration value isn't applicable to hygiene checks.
// - "Weak"<CryptoAlg><ConfigType>"Sha256Allow"
// - REG_SZ or REG_MULTI_SZ
// - This value contains the list of certificate SHA256 thumbprints
// (ASCII_HEX formatted) identifying weak certificates to be explicitly
// allowed. Non ASCII_HEX characters in the string are skipped.
// This allows embedded spaces.
// - The resultant set used for either "Weak"<CryptoAlg>"ThirdParty" or
// "Weak"<CryptoAlg>"All" is the union of:
// - Default and Administrator
// - "ThirdParty" and "All"
//
#define CERT_CHAIN_WEAK_PREFIX_NAME L"Weak"
#define CERT_CHAIN_WEAK_THIRD_PARTY_CONFIG_NAME L"ThirdParty"
#define CERT_CHAIN_WEAK_ALL_CONFIG_NAME L"All"
#define CERT_CHAIN_WEAK_FLAGS_NAME L"Flags"
#define CERT_CHAIN_WEAK_HYGIENE_NAME L"Hygiene"
#define CERT_CHAIN_WEAK_AFTER_TIME_NAME L"AfterTime"
#define CERT_CHAIN_WEAK_MIN_BIT_LENGTH_NAME L"MinBitLength"
#define CERT_CHAIN_WEAK_SHA256_ALLOW_NAME L"Sha256Allow"
// The following value disables checking for weak public key lengths.
#define CERT_CHAIN_MIN_PUB_KEY_BIT_LENGTH_DISABLE \
0xFFFFFFFF
// The following flags can be set in the above
// "Weak"<CryptoAlg><ConfigType>"Flags"
// If the following flag isn't set, then all other flags and registry values
// are ignored for this "Weak"<CryptoAlg><ConfigType>.
//
// If the administrator sets this flag for its "Weak"<CryptoAlg><ConfigType>,
// then, the corresponding Default OS/Windows Update settings are ignored.
//
// If this flag is set in "Weak"<CryptoAlg>"AllFlags":
// - Resultant "Weak"<CryptoAlg>"ThirdPartyFlags" will or with
// "Weak"<CryptoAlg>"AllFlags". However, "Weak"<CryptoAlg>"ThirdPartyFlags"
// logging flags won't be updated.
//
// ThirdPartyFlags |= AllFlags &
// ~(CERT_CHAIN_ENABLE_WEAK_LOGGING_FLAG |
// CERT_CHAIN_ENABLE_ONLY_WEAK_LOGGING_FLAG);
// - Resultant "Weak"<HashCryptoAlg>"ThirdPartyHygine" will or with
// "Weak"<HashCryptoAlg>AllHygiene"
// - Resultant "Weak<CryptoAlg>"ThirdPartyAfterTime" will be earliest
// ("Weak"<CryptoAlg>"AllAfterTime", "Weak"<CryptoAlg>"ThirdPartyAfterTime").
//
// Only applicable if "Weak"<CryptoAlg>"AllAfterTime" is defined and nonzero.
// - Resultant "Weak"<KeyCryptoAlg>"ThirdPartyMinBitLength" will be largest
// ("Weak"<KeyCryptoAlg>"AllMinBitLength",
// "Weak"<KeyCryptoAlg>"ThirdPartyMinBitLength"
#define CERT_CHAIN_ENABLE_WEAK_SETTINGS_FLAG 0x80000000
// The following flag is set to enable the logging of weak certificates to the
// directory identified by CERT_CHAIN_WEAK_SIGNATURE_LOG_DIR_VALUE_NAME.
// #define CERT_CHAIN_ENABLE_WEAK_LOGGING_FLAG 0x00000004
// The following flag is set to only log weak certificates to the directory
// identified by CERT_CHAIN_WEAK_SIGNATURE_LOG_DIR_VALUE_NAME. Weak signature
// errors aren't returned.
// #define CERT_CHAIN_ENABLE_ONLY_WEAK_LOGGING_FLAG 0x00000008
// In addition to setting the above CERT_CHAIN_ENABLE_WEAK_SETTINGS_FLAG flag,
// the following flags corresponding to the EKU must be set to disable weak
// signature or enable weak hash hygiene checks:
// This flag disables for all EKUs.
#define CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG 0x00010000
// This flag enables hygiene for all EKUs not disabling.
#define CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG 0x00020000
// This flag disables for ServerAuth EKUs.
#define CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG 0x00100000
// This flag enables hygiene for ServerAuth EKUs.
#define CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG 0x00200000
// This flag disables for code signing EKUs
#define CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG 0x00400000
// This flag disables for code signing EKUs only when CertGetCertificateChain
// is called with the Mark-Of-The-Web (CERT_CHAIN_HAS_MOTW)
#define CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG 0x00800000
// This flag enables hygiene for code signing EKUs
#define CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG 0x01000000
// This flag enables hygiene for code signing EKUs only when
// CertGetCertificateChain is called with the
// Mark-Of-The-Web (CERT_CHAIN_HAS_MOTW)
#define CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG 0x02000000
// This flag disables for timestamp EKUs.
#define CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG 0x04000000
// This flag disables for timestamp EKUs only when CertGetCertificateChain is
// called with the Mark-Of-The-Web (CERT_CHAIN_HAS_MOTW)
#define CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG 0x08000000
// This flag enables hygiene for timestamp EKUs
#define CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG 0x10000000
// This flag enables hygiene for timestamp EKUs only when
// CertGetCertificateChain is called with the
// Mark-Of-The-Web (CERT_CHAIN_HAS_MOTW)
#define CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG 0x20000000
// This flag ignores the "Weak"<CryptoAlg><ConfigType>"AfterTime" value
// when CertGetCertificateChain is called with the
// Mark-Of-The-Web (CERT_CHAIN_HAS_MOTW)
#define CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG 0x40000000
// If the hash algorithm is disabled, then, the hygiene check will be skipped.
// The hygiene flags are only applicable to hash algorithms.
// If no EKU flags are set, then, weak crypto isn't enforced for the
// "Weak"<CryptoAlg><ConfigType>. This allows the administrator to always
// ignore the Default OS/Windows Update settings.
#define CERT_CHAIN_DISABLE_WEAK_FLAGS ( \
CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG | \
CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG | \
CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG | \
CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG | \
CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG | \
CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG )
#define CERT_CHAIN_ENABLE_HYGIENE_FLAGS ( \
CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG | \
CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG | \
CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG | \
CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG | \
CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG | \
CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG )
#define CERT_CHAIN_MOTW_WEAK_FLAGS ( \
CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG | \
CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG | \
CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG | \
CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG | \
CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG)
// The following are REG_DWORD's. These configuration parameters are // The following are REG_DWORD's. These configuration parameters are
// used by the following APIs to get a non-blocking, time valid OCSP // used by the following APIs to get a non-blocking, time valid OCSP
// response for a server certificate chain: // response for a server certificate chain:
// CertOpenServerOcspResponse // CertOpenServerOcspResponse
// CertAddRefServerOcspResponse // CertAddRefServerOcspResponse
// CertCloseServerOcspResponse // CertCloseServerOcspResponse
// CertGetServerOcspResponseContext // CertGetServerOcspResponseContext
// CertAddRefServerOcspResponseContext // CertAddRefServerOcspResponseContext
// CertFreeServerOcspResponseContext // CertFreeServerOcspResponseContext
skipping to change at line 17386 skipping to change at line 18249
// 1 hour // 1 hour
#define CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_DEFAULT \ #define CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_DEFAULT \
(1 * 60 * 60) (1 * 60 * 60)
#define CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_VALUE_NAME \ #define CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_VALUE_NAME \
L"CryptnetPreFetchMaxMaxAgeSeconds" L"CryptnetPreFetchMaxMaxAgeSeconds"
// 2 Weeks : 14 days * 24 hours * 60 minutes * 60 seconds // 2 Weeks : 14 days * 24 hours * 60 minutes * 60 seconds
#define CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_DEFAULT \ #define CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_DEFAULT \
(14 * 24 * 60 * 60) (14 * 24 * 60 * 60)
// Following parameter is used to set the lower limit on the
// OCSP validity period
#define CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_VALUE_NAME \
L"CryptnetPreFetchMinOcspValidityPeriodSeconds"
// 2 Weeks : 14 days * 24 hours * 60 minutes * 60 seconds
#define CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_DEFAULT \
(14 * 24 * 60 * 60)
// Following 3 parameters are used to calculate the PreFetch start before // Following 3 parameters are used to calculate the PreFetch start before
// the NextUpdate // the NextUpdate
// //
// Where PreFetchStartTime = PublishTime + // Where PreFetchStartTime = PublishTime +
// PublishPeriod / AfterPublishPreFetchDivisor // PublishPeriod / AfterPublishPreFetchDivisor
// PreFetchEndTime = NextUpdate - // PreFetchEndTime = NextUpdate -
// PublishPeriod / BeforeNextUpdatePreFetchDivisor // PublishPeriod / BeforeNextUpdatePreFetchDivisor
// //
// PreFetchPeriod = PreFetchEndTime - PreFetchStartTime // PreFetchPeriod = PreFetchEndTime - PreFetchStartTime
// //
skipping to change at line 17693 skipping to change at line 18564
// (milliseconds) // (milliseconds)
// //
#define CERT_CHAIN_CACHE_END_CERT 0x00000001 #define CERT_CHAIN_CACHE_END_CERT 0x00000001
#define CERT_CHAIN_THREAD_STORE_SYNC 0x00000002 #define CERT_CHAIN_THREAD_STORE_SYNC 0x00000002
#define CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL 0x00000004 #define CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL 0x00000004
#define CERT_CHAIN_USE_LOCAL_MACHINE_STORE 0x00000008 #define CERT_CHAIN_USE_LOCAL_MACHINE_STORE 0x00000008
#define CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE 0x00000010 #define CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE 0x00000010
#define CERT_CHAIN_ENABLE_SHARE_STORE 0x00000020 #define CERT_CHAIN_ENABLE_SHARE_STORE 0x00000020
// Following CertGetCertificateChain dwFlag can also be set on the
// chain engine flags
// #define CERT_CHAIN_DISABLE_AIA 0x00002000
typedef struct _CERT_CHAIN_ENGINE_CONFIG { typedef struct _CERT_CHAIN_ENGINE_CONFIG {
DWORD cbSize; DWORD cbSize;
HCERTSTORE hRestrictedRoot; HCERTSTORE hRestrictedRoot;
HCERTSTORE hRestrictedTrust; HCERTSTORE hRestrictedTrust;
HCERTSTORE hRestrictedOther; HCERTSTORE hRestrictedOther;
DWORD cAdditionalStore; DWORD cAdditionalStore;
HCERTSTORE* rghAdditionalStore; HCERTSTORE* rghAdditionalStore;
DWORD dwFlags; DWORD dwFlags;
DWORD dwUrlRetrievalTimeout; // milliseconds DWORD dwUrlRetrievalTimeout; // milliseconds
DWORD MaximumCachedCertificates; DWORD MaximumCachedCertificates;
DWORD CycleDetectionModulus; DWORD CycleDetectionModulus;
#if (NTDDI_VERSION >= NTDDI_WIN7) #if (NTDDI_VERSION >= NTDDI_WIN7)
HCERTSTORE hExclusiveRoot; HCERTSTORE hExclusiveRoot;
HCERTSTORE hExclusiveTrustedPeople; HCERTSTORE hExclusiveTrustedPeople;
#endif #endif
#if (NTDDI_VERSION >= NTDDI_WIN8)
DWORD dwExclusiveFlags;
#endif
} CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG; } CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
#if (NTDDI_VERSION >= NTDDI_WIN8)
//
// dwExclusiveFlags
//
// CA certificates in hExclusiveRoot are also trusted. Chain building
// can terminate in a trusted CA certificate.
#define CERT_CHAIN_EXCLUSIVE_ENABLE_CA_FLAG 0x00000001
#endif
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertCreateCertificateChainEngine ( CertCreateCertificateChainEngine (
__in PCERT_CHAIN_ENGINE_CONFIG pConfig, _In_ PCERT_CHAIN_ENGINE_CONFIG pConfig,
__out HCERTCHAINENGINE* phChainEngine _Out_ HCERTCHAINENGINE* phChainEngine
); );
// //
// Free a certificate trust engine // Free a certificate trust engine
// //
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertFreeCertificateChainEngine ( CertFreeCertificateChainEngine (
__in_opt HCERTCHAINENGINE hChainEngine _In_opt_ HCERTCHAINENGINE hChainEngine
); );
// //
// Resync the certificate chain engine. This resync's the stores backing // Resync the certificate chain engine. This resync's the stores backing
// the engine and updates the engine caches. // the engine and updates the engine caches.
// //
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertResyncCertificateChainEngine ( CertResyncCertificateChainEngine (
__in_opt HCERTCHAINENGINE hChainEngine _In_opt_ HCERTCHAINENGINE hChainEngine
); );
// //
// When an application requests a certificate chain, the data structure // When an application requests a certificate chain, the data structure
// returned is in the form of a CERT_CHAIN_CONTEXT. This contains // returned is in the form of a CERT_CHAIN_CONTEXT. This contains
// an array of CERT_SIMPLE_CHAIN where each simple chain goes from // an array of CERT_SIMPLE_CHAIN where each simple chain goes from
// an end cert to a self signed cert and the chain context connects simple // an end cert to a self signed cert and the chain context connects simple
// chains via trust lists. Each simple chain contains the chain of // chains via trust lists. Each simple chain contains the chain of
// certificates, summary trust information about the chain and trust information // certificates, summary trust information about the chain and trust information
// about each certificate element in the chain. // about each certificate element in the chain.
skipping to change at line 17798 skipping to change at line 18687
// In LH, this error will never be set. // In LH, this error will never be set.
#define CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT 0x00002000 #define CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT 0x00002000
#define CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT 0x00004000 #define CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT 0x00004000
#define CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT 0x00008000 #define CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT 0x00008000
#define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000 #define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000
#define CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY 0x02000000 #define CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY 0x02000000
#define CERT_TRUST_IS_EXPLICIT_DISTRUST 0x04000000 #define CERT_TRUST_IS_EXPLICIT_DISTRUST 0x04000000
#define CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT 0x08000000 #define CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT 0x08000000
#define CERT_TRUST_HAS_WEAK_SIGNATURE 0x00100000
#define CERT_TRUST_HAS_WEAK_HYGIENE 0x00200000
// These can be applied to chains only // These can be applied to chains only
#define CERT_TRUST_IS_PARTIAL_CHAIN 0x00010000 #define CERT_TRUST_IS_PARTIAL_CHAIN 0x00010000
#define CERT_TRUST_CTL_IS_NOT_TIME_VALID 0x00020000 #define CERT_TRUST_CTL_IS_NOT_TIME_VALID 0x00020000
#define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 0x00040000 #define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 0x00040000
#define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 0x00080000 #define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 0x00080000
// //
// The following are info status bits // The following are info status bits
// //
// These can be applied to certificates only // These can be applied to certificates only
#define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 0x00000001 #define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 0x00000001
#define CERT_TRUST_HAS_KEY_MATCH_ISSUER 0x00000002 #define CERT_TRUST_HAS_KEY_MATCH_ISSUER 0x00000002
#define CERT_TRUST_HAS_NAME_MATCH_ISSUER 0x00000004 #define CERT_TRUST_HAS_NAME_MATCH_ISSUER 0x00000004
#define CERT_TRUST_IS_SELF_SIGNED 0x00000008 #define CERT_TRUST_IS_SELF_SIGNED 0x00000008
#define CERT_TRUST_AUTO_UPDATE_CA_REVOCATION 0x00000010
#define CERT_TRUST_AUTO_UPDATE_END_REVOCATION 0x00000020
#define CERT_TRUST_NO_OCSP_FAILOVER_TO_CRL 0x00000040
// These can be applied to certificates and chains // These can be applied to certificates and chains
#define CERT_TRUST_HAS_PREFERRED_ISSUER 0x00000100 #define CERT_TRUST_HAS_PREFERRED_ISSUER 0x00000100
#define CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY 0x00000200 #define CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY 0x00000200
#define CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS 0x00000400 #define CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS 0x00000400
#define CERT_TRUST_IS_PEER_TRUSTED 0x00000800 #define CERT_TRUST_IS_PEER_TRUSTED 0x00000800
#define CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED 0x00001000 #define CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED 0x00001000
// Indicates that the certificate was found in // Indicates that the certificate was found in
// a store specified by hExclusiveRoot or hExclusiveTrustedPeople // a store specified by hExclusiveRoot or hExclusiveTrustedPeople
#define CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE 0x00002000 #define CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE 0x00002000
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define CERT_TRUST_IS_CA_TRUSTED 0x00004000
#define CERT_TRUST_HAS_AUTO_UPDATE_WEAK_SIGNATURE 0x00008000
#define CERT_TRUST_HAS_ALLOW_WEAK_SIGNATURE 0x00020000
#endif
// These can be applied to chains only // These can be applied to chains only
#define CERT_TRUST_IS_COMPLEX_CHAIN 0x00010000 #define CERT_TRUST_IS_COMPLEX_CHAIN 0x00010000
// //
// Each certificate context in a simple chain has a corresponding chain element // Each certificate context in a simple chain has a corresponding chain element
// in the simple chain context // in the simple chain context
// //
// dwErrorStatus has CERT_TRUST_IS_REVOKED, pRevocationInfo set // dwErrorStatus has CERT_TRUST_IS_REVOKED, pRevocationInfo set
// dwErrorStatus has CERT_TRUST_REVOCATION_STATUS_UNKNOWN, pRevocationInfo set // dwErrorStatus has CERT_TRUST_REVOCATION_STATUS_UNKNOWN, pRevocationInfo set
skipping to change at line 18011 skipping to change at line 18911
CERT_USAGE_MATCH RequestedIssuancePolicy; CERT_USAGE_MATCH RequestedIssuancePolicy;
DWORD dwUrlRetrievalTimeout; // milliseconds DWORD dwUrlRetrievalTimeout; // milliseconds
BOOL fCheckRevocationFreshnessTime; BOOL fCheckRevocationFreshnessTime;
DWORD dwRevocationFreshnessTime; // seconds DWORD dwRevocationFreshnessTime; // seconds
// If nonNULL, any cached information before this time is considered // If nonNULL, any cached information before this time is considered
// time invalid and forces a wire retrieval. When set overrides // time invalid and forces a wire retrieval. When set overrides
// the registry configuration CacheResync time. // the registry configuration CacheResync time.
LPFILETIME pftCacheResync; LPFILETIME pftCacheResync;
//
// The following is set to check for Strong Signatures
//
PCCERT_STRONG_SIGN_PARA pStrongSignPara;
//
// By default the public key in the end certificate is checked.
// CERT_CHAIN_STRONG_SIGN_DISABLE_END_CHECK_FLAG can be
// set in the following flags to not check if the end certificate's public
// key length is strong.
//
DWORD dwStrongSignFlags;
#endif #endif
} CERT_CHAIN_PARA, *PCERT_CHAIN_PARA; } CERT_CHAIN_PARA, *PCERT_CHAIN_PARA;
#define CERT_CHAIN_STRONG_SIGN_DISABLE_END_CHECK_FLAG 0x00000001
// //
// The following API is used for retrieving certificate chains // The following API is used for retrieving certificate chains
// //
// Parameters: // Parameters:
// //
// hChainEngine - the chain engine (namespace and cache) to use, NULL // hChainEngine - the chain engine (namespace and cache) to use, NULL
// mean use the default chain engine // mean use the default chain engine
// //
// pCertContext - the context we are retrieving the chain for, it // pCertContext - the context we are retrieving the chain for, it
// will be the zero index element in the chain // will be the zero index element in the chain
skipping to change at line 18104 skipping to change at line 19019
#define CERT_CHAIN_ENABLE_PEER_TRUST 0x00000400 #define CERT_CHAIN_ENABLE_PEER_TRUST 0x00000400
// When this flag is set, "My" certificates aren't considered for // When this flag is set, "My" certificates aren't considered for
// PEER_TRUST. // PEER_TRUST.
// //
// This flag was added 11/12/04 in LH. // This flag was added 11/12/04 in LH.
// //
// On 8-05-05 changed to never consider "My" certificates for PEER_TRUST. // On 8-05-05 changed to never consider "My" certificates for PEER_TRUST.
#define CERT_CHAIN_DISABLE_MY_PEER_TRUST 0x00000800 #define CERT_CHAIN_DISABLE_MY_PEER_TRUST 0x00000800
// The following flag should be set to explicitly disable MD2 or MD4 for
// any requested EKU. By default, MD2 or MD4 isn't disabled for none,
// code signing, driver signing or time stamping requested EKUs.
#define CERT_CHAIN_DISABLE_MD2_MD4 0x00001000
// The following flag can be set to explicitly disable AIA retrievals.
// If can also be set in the chain engine dwFlags.
#define CERT_CHAIN_DISABLE_AIA 0x00002000
// The following flag should be set when verifying the certificate
// associated with a file having the Mark-Of-The-Web
#define CERT_CHAIN_HAS_MOTW 0x00004000
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertGetCertificateChain ( CertGetCertificateChain (
__in_opt HCERTCHAINENGINE hChainEngine, _In_opt_ HCERTCHAINENGINE hChainEngine,
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in_opt LPFILETIME pTime, _In_opt_ LPFILETIME pTime,
__in_opt HCERTSTORE hAdditionalStore, _In_opt_ HCERTSTORE hAdditionalStore,
__in PCERT_CHAIN_PARA pChainPara, _In_ PCERT_CHAIN_PARA pChainPara,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved LPVOID pvReserved, _Reserved_ LPVOID pvReserved,
__out PCCERT_CHAIN_CONTEXT* ppChainContext _Out_ PCCERT_CHAIN_CONTEXT* ppChainContext
); );
// //
// Free a certificate chain // Free a certificate chain
// //
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertFreeCertificateChain ( CertFreeCertificateChain (
__in PCCERT_CHAIN_CONTEXT pChainContext _In_ PCCERT_CHAIN_CONTEXT pChainContext
); );
// //
// Duplicate (add a reference to) a certificate chain // Duplicate (add a reference to) a certificate chain
// //
WINCRYPT32API WINCRYPT32API
PCCERT_CHAIN_CONTEXT PCCERT_CHAIN_CONTEXT
WINAPI WINAPI
CertDuplicateCertificateChain ( CertDuplicateCertificateChain (
__in PCCERT_CHAIN_CONTEXT pChainContext _In_ PCCERT_CHAIN_CONTEXT pChainContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// This data structure is optionally pointed to by the pChainPara field // This data structure is optionally pointed to by the pChainPara field
// in the CERT_REVOCATION_PARA and CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO // in the CERT_REVOCATION_PARA and CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO
// data structures. CertGetCertificateChain() populates when it calls // data structures. CertGetCertificateChain() populates when it calls
// the CertVerifyRevocation() API. // the CertVerifyRevocation() API.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
struct _CERT_REVOCATION_CHAIN_PARA { struct _CERT_REVOCATION_CHAIN_PARA {
DWORD cbSize; DWORD cbSize;
skipping to change at line 18212 skipping to change at line 19140
// pPrevChainContext is set to the CERT_CHAIN_CONTEXT returned by a previous // pPrevChainContext is set to the CERT_CHAIN_CONTEXT returned by a previous
// call. // call.
// //
// NOTE: a NON-NULL pPrevChainContext is always CertFreeCertificateChain'ed by // NOTE: a NON-NULL pPrevChainContext is always CertFreeCertificateChain'ed by
// this function, even for an error. // this function, even for an error.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CHAIN_CONTEXT PCCERT_CHAIN_CONTEXT
WINAPI WINAPI
CertFindChainInStore( CertFindChainInStore(
__in HCERTSTORE hCertStore, _In_ HCERTSTORE hCertStore,
__in DWORD dwCertEncodingType, _In_ DWORD dwCertEncodingType,
__in DWORD dwFindFlags, _In_ DWORD dwFindFlags,
__in DWORD dwFindType, _In_ DWORD dwFindType,
__in_opt const void *pvFindPara, _In_opt_ const void *pvFindPara,
__in_opt PCCERT_CHAIN_CONTEXT pPrevChainContext _In_opt_ PCCERT_CHAIN_CONTEXT pPrevChainContext
); );
#define CERT_CHAIN_FIND_BY_ISSUER 1 #define CERT_CHAIN_FIND_BY_ISSUER 1
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_CHAIN_FIND_BY_ISSUER // CERT_CHAIN_FIND_BY_ISSUER
// //
// Find a certificate chain having a private key for the end certificate and // Find a certificate chain having a private key for the end certificate and
// matching one of the given issuer names. A matching dwKeySpec and // matching one of the given issuer names. A matching dwKeySpec and
// enhanced key usage can also be specified. Additionally a callback can // enhanced key usage can also be specified. Additionally a callback can
skipping to change at line 18267 skipping to change at line 19195
// cached system stores instead of the Current User's. // cached system stores instead of the Current User's.
// //
// Setting CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG in dwFindFlags // Setting CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG in dwFindFlags
// restricts CertGetCertificateChain to only search the URL cache // restricts CertGetCertificateChain to only search the URL cache
// and not hit the wire. // and not hit the wire.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Returns FALSE to skip this certificate. Otherwise, returns TRUE to // Returns FALSE to skip this certificate. Otherwise, returns TRUE to
// build a chain for this certificate. // build a chain for this certificate.
typedef BOOL (WINAPI *PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK)( typedef BOOL (WINAPI *PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK)(
__in PCCERT_CONTEXT pCert, _In_ PCCERT_CONTEXT pCert,
__inout_opt void *pvFindArg _Inout_opt_ void *pvFindArg
); );
typedef struct _CERT_CHAIN_FIND_BY_ISSUER_PARA { typedef struct _CERT_CHAIN_FIND_BY_ISSUER_PARA {
DWORD cbSize; DWORD cbSize;
// If pszUsageIdentifier == NULL, matches any usage. // If pszUsageIdentifier == NULL, matches any usage.
LPCSTR pszUsageIdentifier; LPCSTR pszUsageIdentifier;
// If dwKeySpec == 0, matches any KeySpec // If dwKeySpec == 0, matches any KeySpec
DWORD dwKeySpec; DWORD dwKeySpec;
skipping to change at line 18435 skipping to change at line 19363
// behaviour. In addition, policy specific parameters can be passed in // behaviour. In addition, policy specific parameters can be passed in
// the pvExtraPolicyPara field of pPolicyPara. // the pvExtraPolicyPara field of pPolicyPara.
// //
// In addition to returning dwError, in pPolicyStatus, policy OID specific // In addition to returning dwError, in pPolicyStatus, policy OID specific
// extra status may be returned via pvExtraPolicyStatus. // extra status may be returned via pvExtraPolicyStatus.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertVerifyCertificateChainPolicy( CertVerifyCertificateChainPolicy(
__in LPCSTR pszPolicyOID, _In_ LPCSTR pszPolicyOID,
__in PCCERT_CHAIN_CONTEXT pChainContext, _In_ PCCERT_CHAIN_CONTEXT pChainContext,
__in PCERT_CHAIN_POLICY_PARA pPolicyPara, _In_ PCERT_CHAIN_POLICY_PARA pPolicyPara,
__inout PCERT_CHAIN_POLICY_STATUS pPolicyStatus _Inout_ PCERT_CHAIN_POLICY_STATUS pPolicyStatus
); );
// Predefined OID Function Names // Predefined OID Function Names
#define CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC \ #define CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC \
"CertDllVerifyCertificateChainPolicy" "CertDllVerifyCertificateChainPolicy"
// CertDllVerifyCertificateChainPolicy has same function signature as // CertDllVerifyCertificateChainPolicy has same function signature as
// CertVerifyCertificateChainPolicy. // CertVerifyCertificateChainPolicy.
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
skipping to change at line 18611 skipping to change at line 19539
// CERT_CHAIN_POLICY_MICROSOFT_ROOT // CERT_CHAIN_POLICY_MICROSOFT_ROOT
// //
// Checks if the last element of the first simple chain contains a // Checks if the last element of the first simple chain contains a
// Microsoft root public key. If it doesn't contain a Microsoft root // Microsoft root public key. If it doesn't contain a Microsoft root
// public key, dwError is set to CERT_E_UNTRUSTEDROOT. // public key, dwError is set to CERT_E_UNTRUSTEDROOT.
// //
// pPolicyPara is optional. However, // pPolicyPara is optional. However,
// MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG can be set in // MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG can be set in
// the dwFlags in pPolicyPara to also check for the Microsoft Test Roots. // the dwFlags in pPolicyPara to also check for the Microsoft Test Roots.
// //
// MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG can be set
// in the dwFlags in pPolicyPara to check for the Microsoft root for
// application signing instead of the Microsoft product root. This flag
// explicitly checks for the application root only and cannot be combined
// with the test root flag.
//
// pvExtraPolicyPara and pvExtraPolicyStatus aren't used and must be set // pvExtraPolicyPara and pvExtraPolicyStatus aren't used and must be set
// to NULL. // to NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000
#define MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG 0x00020000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_CHAIN_POLICY_EV // CERT_CHAIN_POLICY_EV
// //
// Verify the issuance policy in the end certificate of the first simple // Verify the issuance policy in the end certificate of the first simple
// chain matches with the root certificate EV policy. // chain matches with the root certificate EV policy.
// //
// pvExtraPolicyPara may optionally be set to point to the following // pvExtraPolicyPara may optionally be set to point to the following
// EV_EXTRA_CERT_CHAIN_POLICY_PARA. The dwRootProgramQualifierFlags member // EV_EXTRA_CERT_CHAIN_POLICY_PARA. The dwRootProgramQualifierFlags member
// can be set to one or more of the CERT_ROOT_PROGRAM_FLAG_* to define // can be set to one or more of the CERT_ROOT_PROGRAM_FLAG_* to define
skipping to change at line 18657 skipping to change at line 19592
// cchString is obtained via strlen() + 1. // cchString is obtained via strlen() + 1.
// dwFlags defines string format // dwFlags defines string format
// if pbBinary is NULL, *pcbBinary returns the size of required memory // if pbBinary is NULL, *pcbBinary returns the size of required memory
// *pdwSkip returns the character count of skipped strings, optional // *pdwSkip returns the character count of skipped strings, optional
// *pdwFlags returns the actual format used in the conversion, optional // *pdwFlags returns the actual format used in the conversion, optional
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32STRINGAPI WINCRYPT32STRINGAPI
BOOL BOOL
WINAPI WINAPI
CryptStringToBinaryA( CryptStringToBinaryA(
__in_ecount(cchString) LPCSTR pszString, _In_reads_(cchString) LPCSTR pszString,
__in DWORD cchString, _In_ DWORD cchString,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbBinary, *pcbBinary) BYTE *pbBinary, _Out_writes_bytes_to_opt_(*pcbBinary, *pcbBinary) BYTE *pbBinary,
__inout DWORD *pcbBinary, _Inout_ DWORD *pcbBinary,
__out_opt DWORD *pdwSkip, _Out_opt_ DWORD *pdwSkip,
__out_opt DWORD *pdwFlags _Out_opt_ DWORD *pdwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// convert formatted string to binary // convert formatted string to binary
// If cchString is 0, then pszString is NULL terminated and // If cchString is 0, then pszString is NULL terminated and
// cchString is obtained via strlen() + 1. // cchString is obtained via strlen() + 1.
// dwFlags defines string format // dwFlags defines string format
// if pbBinary is NULL, *pcbBinary returns the size of required memory // if pbBinary is NULL, *pcbBinary returns the size of required memory
// *pdwSkip returns the character count of skipped strings, optional // *pdwSkip returns the character count of skipped strings, optional
// *pdwFlags returns the actual format used in the conversion, optional // *pdwFlags returns the actual format used in the conversion, optional
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32STRINGAPI WINCRYPT32STRINGAPI
BOOL BOOL
WINAPI WINAPI
CryptStringToBinaryW( CryptStringToBinaryW(
__in_ecount(cchString) LPCWSTR pszString, _In_reads_(cchString) LPCWSTR pszString,
__in DWORD cchString, _In_ DWORD cchString,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_bcount_part_opt(*pcbBinary, *pcbBinary) BYTE *pbBinary, _Out_writes_bytes_to_opt_(*pcbBinary, *pcbBinary) BYTE *pbBinary,
__inout DWORD *pcbBinary, _Inout_ DWORD *pcbBinary,
__out_opt DWORD *pdwSkip, _Out_opt_ DWORD *pdwSkip,
__out_opt DWORD *pdwFlags _Out_opt_ DWORD *pdwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptStringToBinary CryptStringToBinaryW #define CryptStringToBinary CryptStringToBinaryW
#else #else
#define CryptStringToBinary CryptStringToBinaryA #define CryptStringToBinary CryptStringToBinaryA
#endif // !UNICODE #endif // !UNICODE
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// convert binary to formatted string // convert binary to formatted string
// dwFlags defines string format // dwFlags defines string format
// if pszString is NULL, *pcchString returns size in characters // if pszString is NULL, *pcchString returns size in characters
// including null-terminator // including null-terminator
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
_Success_(return)
WINCRYPT32STRINGAPI WINCRYPT32STRINGAPI
BOOL BOOL
WINAPI WINAPI
CryptBinaryToStringA( CryptBinaryToStringA(
__in_bcount(cbBinary) CONST BYTE *pbBinary, _In_reads_bytes_(cbBinary) CONST BYTE *pbBinary,
__in DWORD cbBinary, _In_ DWORD cbBinary,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_ecount_part_opt(*pcchString, *pcchString) LPSTR pszString, _Out_writes_to_opt_(*pcchString, *pcchString) LPSTR pszString,
__inout DWORD *pcchString _Inout_ DWORD *pcchString
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// convert binary to formatted string // convert binary to formatted string
// dwFlags defines string format // dwFlags defines string format
// if pszString is NULL, *pcchString returns size in characters // if pszString is NULL, *pcchString returns size in characters
// including null-terminator // including null-terminator
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
_Success_(return)
WINCRYPT32STRINGAPI WINCRYPT32STRINGAPI
BOOL BOOL
WINAPI WINAPI
CryptBinaryToStringW( CryptBinaryToStringW(
__in_bcount(cbBinary) CONST BYTE *pbBinary, _In_reads_bytes_(cbBinary) CONST BYTE *pbBinary,
__in DWORD cbBinary, _In_ DWORD cbBinary,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__out_ecount_part_opt(*pcchString, *pcchString) LPWSTR pszString, _Out_writes_to_opt_(*pcchString, *pcchString) LPWSTR pszString,
__inout DWORD *pcchString _Inout_ DWORD *pcchString
); );
#ifdef UNICODE #ifdef UNICODE
#define CryptBinaryToString CryptBinaryToStringW #define CryptBinaryToString CryptBinaryToStringW
#else #else
#define CryptBinaryToString CryptBinaryToStringA #define CryptBinaryToString CryptBinaryToStringA
#endif // !UNICODE #endif // !UNICODE
// dwFlags has the following defines // dwFlags has the following defines
// certenrolld_begin -- CRYPT_STRING_* // certenrolld_begin -- CRYPT_STRING_*
#define CRYPT_STRING_BASE64HEADER 0x00000000 #define CRYPT_STRING_BASE64HEADER 0x00000000
skipping to change at line 18823 skipping to change at line 19760
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PFXImportCertStore // PFXImportCertStore
// //
// Import the PFX blob and return a store containing certificates // Import the PFX blob and return a store containing certificates
// //
// If the password parameter is incorrect or any other problems decoding // If the password parameter is incorrect or any other problems decoding
// the PFX blob are encountered, the function will return NULL and the // the PFX blob are encountered, the function will return NULL and the
// error code can be found from GetLastError(). // error code can be found from GetLastError().
// //
// The dwFlags parameter may be set to the following: // The dwFlags parameter may be set to the following:
// PKCS12_IMPORT_SILENT - only allow importing key in silent mode. If the
// csp or ksp requires ui then this call will fail
// with the error from the csp or ksp.
// CRYPT_EXPORTABLE - specify that any imported keys should be marked as // CRYPT_EXPORTABLE - specify that any imported keys should be marked as
// exportable (see documentation on CryptImportKey) // exportable (see documentation on CryptImportKey)
// CRYPT_USER_PROTECTED - (see documentation on CryptImportKey) // CRYPT_USER_PROTECTED - (see documentation on CryptImportKey)
// CRYPT_MACHINE_KEYSET - used to force the private key to be stored in the // CRYPT_MACHINE_KEYSET - used to force the private key to be stored in the
// the local machine and not the current user. // the local machine and not the current user.
// CRYPT_USER_KEYSET - used to force the private key to be stored in the // CRYPT_USER_KEYSET - used to force the private key to be stored in the
// the current user and not the local machine, even if // the current user and not the local machine, even if
// the pfx blob specifies that it should go into local // the pfx blob specifies that it should go into local
// machine. // machine.
// PKCS12_INCLUDE_EXTENDED_PROPERTIES - used to import all extended // PKCS12_INCLUDE_EXTENDED_PROPERTIES - used to import all extended
// properties that were saved with CertExportCertStore() // properties that were saved with CertExportCertStore()
// using the same flag. // using the same flag.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCERTSTORE HCERTSTORE
WINAPI WINAPI
PFXImportCertStore( PFXImportCertStore(
__in CRYPT_DATA_BLOB* pPFX, _In_ CRYPT_DATA_BLOB* pPFX,
__in LPCWSTR szPassword, _In_ LPCWSTR szPassword,
__in DWORD dwFlags); _In_ DWORD dwFlags);
// dwFlags definitions for PFXImportCertStore // dwFlags definitions for PFXImportCertStore
//#define CRYPT_EXPORTABLE 0x00000001 // CryptImportKey dwFlags //#define CRYPT_EXPORTABLE 0x00000001 // CryptImportKey dwFlags
//#define CRYPT_USER_PROTECTED 0x00000002 // CryptImportKey dwFlags //#define CRYPT_USER_PROTECTED 0x00000002 // CryptImportKey dwFlags
//#define CRYPT_MACHINE_KEYSET 0x00000020 // CryptAcquireContext dwFlags //#define CRYPT_MACHINE_KEYSET 0x00000020 // CryptAcquireContext dwFlags
//#define PKCS12_INCLUDE_EXTENDED_PROPERTIES 0x10 //#define PKCS12_INCLUDE_EXTENDED_PROPERTIES 0x10
#define PKCS12_IMPORT_SILENT 0x00000040
#define CRYPT_USER_KEYSET 0x00001000 #define CRYPT_USER_KEYSET 0x00001000
#define PKCS12_PREFER_CNG_KSP 0x00000100 // prefer using CNG KSP #define PKCS12_PREFER_CNG_KSP 0x00000100 // prefer using CNG KSP
#define PKCS12_ALWAYS_CNG_KSP 0x00000200 // always use CNG KSP #define PKCS12_ALWAYS_CNG_KSP 0x00000200 // always use CNG KSP
#define PKCS12_ALLOW_OVERWRITE_KEY 0x00004000 // allow overwrite existing key #define PKCS12_ALLOW_OVERWRITE_KEY 0x00004000 // allow overwrite existing key
#define PKCS12_NO_PERSIST_KEY 0x00008000 // key will not be persisted #define PKCS12_NO_PERSIST_KEY 0x00008000 // key will not be persisted
#define PKCS12_IMPORT_RESERVED_MASK 0xffff0000 #define PKCS12_IMPORT_RESERVED_MASK 0xffff0000
#define PKCS12_OBJECT_LOCATOR_ALL_IMPORT_FLAGS \
( PKCS12_ALWAYS_CNG_KSP | \
PKCS12_NO_PERSIST_KEY | \
PKCS12_IMPORT_SILENT | \
PKCS12_INCLUDE_EXTENDED_PROPERTIES )
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PFXIsPFXBlob // PFXIsPFXBlob
// //
// This function will try to decode the outer layer of the blob as a pfx // This function will try to decode the outer layer of the blob as a pfx
// blob, and if that works it will return TRUE, it will return FALSE otherwise // blob, and if that works it will return TRUE, it will return FALSE otherwise
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
PFXIsPFXBlob( PFXIsPFXBlob(
__in CRYPT_DATA_BLOB* pPFX); _In_ CRYPT_DATA_BLOB* pPFX);
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PFXVerifyPassword // PFXVerifyPassword
// //
// This function will attempt to decode the outer layer of the blob as a pfx // This function will attempt to decode the outer layer of the blob as a pfx
// blob and decrypt with the given password. No data from the blob will be // blob and decrypt with the given password. No data from the blob will be
// imported. // imported.
// //
// Return value is TRUE if password appears correct, FALSE otherwise. // Return value is TRUE if password appears correct, FALSE otherwise.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
PFXVerifyPassword( PFXVerifyPassword(
__in CRYPT_DATA_BLOB* pPFX, _In_ CRYPT_DATA_BLOB* pPFX,
__in LPCWSTR szPassword, _In_ LPCWSTR szPassword,
__in DWORD dwFlags); _In_ DWORD dwFlags);
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PFXExportCertStoreEx // PFXExportCertStoreEx
// //
// Export the certificates and private keys referenced in the passed-in store // Export the certificates and private keys referenced in the passed-in store
// //
// This API encodes the blob under a stronger algorithm. The resulting // This API encodes the blob under a stronger algorithm. The resulting
// PKCS12 blobs are incompatible with the earlier PFXExportCertStore API. // PKCS12 blobs are incompatible with the earlier PFXExportCertStore API.
// //
// The value passed in the password parameter will be used to encrypt and // The value passed in the password parameter will be used to encrypt and
// verify the integrity of the PFX packet. If any problems encoding the store // verify the integrity of the PFX packet. If any problems encoding the store
// are encountered, the function will return FALSE and the error code can // are encountered, the function will return FALSE and the error code can
// be found from GetLastError(). // be found from GetLastError().
// //
// The PKCS12_PROTECT_TO_DOMAIN_SIDS flag together with an
// NCRYPT_DESCRIPTOR_HANDLE* for pvPara means the password will be stored
// in the pfx protected to the NCRYPT_DESCRIPTOR_HANDLE. On import, any
// principal that is listed in NCRYPT_DESCRIPTOR_HANDLE can decrypt the
// password within the pfx and use it to descrypt the entire pfx.
//
// If the password parameter is NULL or L"" and the
// PKCS12_PROTECT_TO_DOMAIN_SIDS flag is set together with an
// NCRYPT_DESCRIPTOR_HANDLE* for pvPara then a random password of length
// 40 characters is chosen to protect the pfx. This password will be
// protected inside the pfx.
//
// The dwFlags parameter may be set to any combination of // The dwFlags parameter may be set to any combination of
// EXPORT_PRIVATE_KEYS // EXPORT_PRIVATE_KEYS
// REPORT_NO_PRIVATE_KEY // REPORT_NO_PRIVATE_KEY
// REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY // REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY
// PKCS12_EXPORT_SILENT
// PKCS12_INCLUDE_EXTENDED_PROPERTIES // PKCS12_INCLUDE_EXTENDED_PROPERTIES
// PKCS12_PROTECT_TO_DOMAIN_SIDS
// //
// The encoded PFX blob is returned in *pPFX. If pPFX->pbData is NULL upon // The encoded PFX blob is returned in *pPFX. If pPFX->pbData is NULL upon
// input, this is a length only calculation, whereby, pPFX->cbData is updated // input, this is a length only calculation, whereby, pPFX->cbData is updated
// with the number of bytes required for the encoded blob. Otherwise, // with the number of bytes required for the encoded blob. Otherwise,
// the memory pointed to by pPFX->pbData is updated with the encoded bytes // the memory pointed to by pPFX->pbData is updated with the encoded bytes
// and pPFX->cbData is updated with the encoded byte length. // and pPFX->cbData is updated with the encoded byte length.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
PFXExportCertStoreEx( PFXExportCertStoreEx(
__in HCERTSTORE hStore, _In_ HCERTSTORE hStore,
__inout CRYPT_DATA_BLOB* pPFX, _Inout_ CRYPT_DATA_BLOB* pPFX,
__in LPCWSTR szPassword, _In_ LPCWSTR szPassword,
__reserved void* pvReserved, _In_ void* pvPara,
__in DWORD dwFlags); _In_ DWORD dwFlags);
// dwFlags definitions for PFXExportCertStoreEx // dwFlags definitions for PFXExportCertStoreEx
#define REPORT_NO_PRIVATE_KEY 0x0001 #define REPORT_NO_PRIVATE_KEY 0x0001
#define REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY 0x0002 #define REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY 0x0002
#define EXPORT_PRIVATE_KEYS 0x0004 #define EXPORT_PRIVATE_KEYS 0x0004
#define PKCS12_INCLUDE_EXTENDED_PROPERTIES 0x0010 #define PKCS12_INCLUDE_EXTENDED_PROPERTIES 0x0010
#define PKCS12_PROTECT_TO_DOMAIN_SIDS 0x0020
#define PKCS12_EXPORT_SILENT 0x0040
#define PKCS12_EXPORT_RESERVED_MASK 0xffff0000 #define PKCS12_EXPORT_RESERVED_MASK 0xffff0000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PFXExportCertStore // PFXExportCertStore
// //
// Export the certificates and private keys referenced in the passed-in store // Export the certificates and private keys referenced in the passed-in store
// //
// This is an old API kept for compatibility with IE4 clients. New applications // This is an old API kept for compatibility with IE4 clients. New applications
// should call the above PfxExportCertStoreEx for enhanced security. // should call the above PfxExportCertStoreEx for enhanced security.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
PFXExportCertStore( PFXExportCertStore(
__in HCERTSTORE hStore, _In_ HCERTSTORE hStore,
__inout CRYPT_DATA_BLOB* pPFX, _Inout_ CRYPT_DATA_BLOB* pPFX,
__in LPCWSTR szPassword, _In_ LPCWSTR szPassword,
__in DWORD dwFlags); _In_ DWORD dwFlags);
//+========================================================================= //+=========================================================================
// APIs to get a non-blocking, time valid OCSP response for // APIs to get a non-blocking, time valid OCSP response for
// a server certificate chain. // a server certificate chain.
// //
// Normally, this OCSP response will be included along with the server // Normally, this OCSP response will be included along with the server
// certificate in a message returned to the client. As a result only the // certificate in a message returned to the client. As a result only the
// server should need to contact the OCSP responser for its certificate. // server should need to contact the OCSP responser for its certificate.
//========================================================================== //==========================================================================
#if (NTDDI_VERSION >= NTDDI_WINLH) #if (NTDDI_VERSION >= NTDDI_VISTA)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Server OCSP response handle. // Server OCSP response handle.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef VOID *HCERT_SERVER_OCSP_RESPONSE; typedef VOID *HCERT_SERVER_OCSP_RESPONSE;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Open a handle to an OCSP response associated with a server certificate // Open a handle to an OCSP response associated with a server certificate
// chain. If the end certificate doesn't have an OCSP AIA URL, NULL is // chain. If the end certificate doesn't have an OCSP AIA URL, NULL is
// returned with LastError set to CRYPT_E_NOT_IN_REVOCATION_DATABASE. NULL // returned with LastError set to CRYPT_E_NOT_IN_REVOCATION_DATABASE. NULL
// will also be returned if unable to allocate memory or create system // will also be returned if unable to allocate memory or create system
// objects. // objects.
// //
// This API will try to retrieve an initial OCSP response before returning. // This API will try to retrieve an initial OCSP response before returning.
// This API will block during the retrieval. If unable to successfully // This API will block during the retrieval. If unable to successfully
// retrieve the first OCSP response, a non-NULL handle will still be returned // retrieve the first OCSP response, a non-NULL handle will still be returned
// if not one of the error cases mentioned above. // if not one of the error cases mentioned above.
// //
// The CERT_SERVER_OCSP_RESPONSE_ASYNC_FLAG flag can be set to
// return immediately without making the initial synchronous retrieval.
//
// A background thread is created that will pre-fetch time valid // A background thread is created that will pre-fetch time valid
// OCSP responses. // OCSP responses.
// //
// The input chain context will be AddRef'ed and not freed until // The input chain context will be AddRef'ed and not freed until
// the returned handle is closed. // the returned handle is closed.
// //
// CertCloseServerOcspResponse() must be called to close the returned // CertCloseServerOcspResponse() must be called to close the returned
// handle. // handle.
// //
// dwFlags and pvReserved aren't currently used and must be set to 0 // pvReserved isn't currently used and must be set to NULL.
// and NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
HCERT_SERVER_OCSP_RESPONSE HCERT_SERVER_OCSP_RESPONSE
WINAPI WINAPI
CertOpenServerOcspResponse( CertOpenServerOcspResponse(
__in PCCERT_CHAIN_CONTEXT pChainContext, _In_ PCCERT_CHAIN_CONTEXT pChainContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved LPVOID pvReserved _Reserved_ LPVOID pvReserved
); );
// Set this flag to return immediately without making the initial
// synchronous retrieval
#define CERT_SERVER_OCSP_RESPONSE_ASYNC_FLAG 0x00000001
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// AddRef a HCERT_SERVER_OCSP_RESPONSE returned by // AddRef a HCERT_SERVER_OCSP_RESPONSE returned by
// CertOpenServerOcspResponse(). Each Open and AddRef requires a // CertOpenServerOcspResponse(). Each Open and AddRef requires a
// corresponding CertCloseServerOcspResponse(). // corresponding CertCloseServerOcspResponse().
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertAddRefServerOcspResponse( CertAddRefServerOcspResponse(
__in_opt HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse _In_opt_ HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Close the handle returned by CertOpenServerOcspResponse() or AddRef'ed // Close the handle returned by CertOpenServerOcspResponse() or AddRef'ed
// by CertAddRefServerOcspResponse(). // by CertAddRefServerOcspResponse().
// //
// dwFlags isn't currently used and must be set to 0. // dwFlags isn't currently used and must be set to 0.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertCloseServerOcspResponse( CertCloseServerOcspResponse(
__in_opt HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse, _In_opt_ HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Server OCSP response context. // Server OCSP response context.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_SERVER_OCSP_RESPONSE_CONTEXT typedef struct _CERT_SERVER_OCSP_RESPONSE_CONTEXT
CERT_SERVER_OCSP_RESPONSE_CONTEXT, CERT_SERVER_OCSP_RESPONSE_CONTEXT,
*PCERT_SERVER_OCSP_RESPONSE_CONTEXT; *PCERT_SERVER_OCSP_RESPONSE_CONTEXT;
typedef const CERT_SERVER_OCSP_RESPONSE_CONTEXT typedef const CERT_SERVER_OCSP_RESPONSE_CONTEXT
*PCCERT_SERVER_OCSP_RESPONSE_CONTEXT; *PCCERT_SERVER_OCSP_RESPONSE_CONTEXT;
skipping to change at line 19051 skipping to change at line 20020
// isn't available, NULL will be returned with LAST_ERROR set to // isn't available, NULL will be returned with LAST_ERROR set to
// CRYPT_E_REVOCATION_OFFLINE. // CRYPT_E_REVOCATION_OFFLINE.
// //
// CertFreeServerOcspResponseContext() must be called to free the // CertFreeServerOcspResponseContext() must be called to free the
// returned OCSP response context. // returned OCSP response context.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_SERVER_OCSP_RESPONSE_CONTEXT PCCERT_SERVER_OCSP_RESPONSE_CONTEXT
WINAPI WINAPI
CertGetServerOcspResponseContext( CertGetServerOcspResponseContext(
__in HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse, _In_ HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved LPVOID pvReserved _Reserved_ LPVOID pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// AddRef a PCCERT_SERVER_OCSP_RESPONSE_CONTEXT returned by // AddRef a PCCERT_SERVER_OCSP_RESPONSE_CONTEXT returned by
// CertGetServerOcspResponseContext(). Each Get and AddRef requires a // CertGetServerOcspResponseContext(). Each Get and AddRef requires a
// corresponding CertFreeServerOcspResponseContext(). // corresponding CertFreeServerOcspResponseContext().
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertAddRefServerOcspResponseContext( CertAddRefServerOcspResponseContext(
__in_opt PCCERT_SERVER_OCSP_RESPONSE_CONTEXT pServerOcspResponseContext _In_opt_ PCCERT_SERVER_OCSP_RESPONSE_CONTEXT pServerOcspResponseContext
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Free the OCSP response context returned by // Free the OCSP response context returned by
// CertGetServerOcspResponseContext(). // CertGetServerOcspResponseContext().
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertFreeServerOcspResponseContext( CertFreeServerOcspResponseContext(
__in_opt PCCERT_SERVER_OCSP_RESPONSE_CONTEXT pServerOcspResponseContext _In_opt_ PCCERT_SERVER_OCSP_RESPONSE_CONTEXT pServerOcspResponseContext
); );
#endif // (NTDDI_VERSION >= NTDDI_WINLH) #endif // (NTDDI_VERSION >= NTDDI_VISTA)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Helper function to do URL retrieval of logo or biometric information // Helper function to do URL retrieval of logo or biometric information
// specified in either the szOID_LOGOTYPE_EXT or szOID_BIOMETRIC_EXT // specified in either the szOID_LOGOTYPE_EXT or szOID_BIOMETRIC_EXT
// certificate extension. // certificate extension.
// //
// Only the first hashed URL matching lpszLogoOrBiometricType is used // Only the first hashed URL matching lpszLogoOrBiometricType is used
// to do the URL retrieval. Only direct logotypes are supported. // to do the URL retrieval. Only direct logotypes are supported.
// The bytes at the first URL are retrieved via // The bytes at the first URL are retrieved via
// CryptRetrieveObjectByUrlW and hashed. The computed hash is compared // CryptRetrieveObjectByUrlW and hashed. The computed hash is compared
skipping to change at line 19129 skipping to change at line 20098
// dwRetrievalFlags - see CryptRetrieveObjectByUrlW // dwRetrievalFlags - see CryptRetrieveObjectByUrlW
// dwTimeout - see CryptRetrieveObjectByUrlW // dwTimeout - see CryptRetrieveObjectByUrlW
// //
// dwFlags - reserved, must be set to 0 // dwFlags - reserved, must be set to 0
// pvReserved - reserved, must be set to NULL // pvReserved - reserved, must be set to NULL
// //
// *ppwszMimeType is always NULL for the biometric types. For success, // *ppwszMimeType is always NULL for the biometric types. For success,
// the caller must always check if non-NULL before dereferencing. // the caller must always check if non-NULL before dereferencing.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
__success(return == TRUE) _Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertRetrieveLogoOrBiometricInfo( CertRetrieveLogoOrBiometricInfo(
__in PCCERT_CONTEXT pCertContext, _In_ PCCERT_CONTEXT pCertContext,
__in LPCSTR lpszLogoOrBiometricType, _In_ LPCSTR lpszLogoOrBiometricType,
__in DWORD dwRetrievalFlags, _In_ DWORD dwRetrievalFlags,
__in DWORD dwTimeout, // milliseconds _In_ DWORD dwTimeout, // milliseconds
__in DWORD dwFlags, _In_ DWORD dwFlags,
__reserved void *pvReserved, _Reserved_ void *pvReserved,
__deref_out_bcount_opt(*pcbData) BYTE **ppbData, // CryptMemFree() _Outptr_result_bytebuffer_(*pcbData) BYTE **ppbData, // CryptMemFree()
__out DWORD *pcbData, _Out_ DWORD *pcbData,
__deref_opt_out_opt LPWSTR *ppwszMimeType // CryptMemFree() _Outptr_opt_result_maybenull_ LPWSTR *ppwszMimeType // CryptMemFree(
)
); );
// Predefined Logotypes // Predefined Logotypes
#define CERT_RETRIEVE_ISSUER_LOGO ((LPCSTR) 1) #define CERT_RETRIEVE_ISSUER_LOGO ((LPCSTR) 1)
#define CERT_RETRIEVE_SUBJECT_LOGO ((LPCSTR) 2) #define CERT_RETRIEVE_SUBJECT_LOGO ((LPCSTR) 2)
#define CERT_RETRIEVE_COMMUNITY_LOGO ((LPCSTR) 3) #define CERT_RETRIEVE_COMMUNITY_LOGO ((LPCSTR) 3)
// Predefined Biometric types // Predefined Biometric types
#define CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE ((LPCSTR) 1000) #define CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE ((LPCSTR) 1000)
skipping to change at line 19180 skipping to change at line 20149
} }
CERT_SELECT_CHAIN_PARA, *PCERT_SELECT_CHAIN_PARA; CERT_SELECT_CHAIN_PARA, *PCERT_SELECT_CHAIN_PARA;
typedef const CERT_SELECT_CHAIN_PARA* PCCERT_SELECT_CHAIN_PARA; typedef const CERT_SELECT_CHAIN_PARA* PCCERT_SELECT_CHAIN_PARA;
#define CERT_SELECT_MAX_PARA 500 #define CERT_SELECT_MAX_PARA 500
typedef struct _CERT_SELECT_CRITERIA typedef struct _CERT_SELECT_CRITERIA
{ {
DWORD dwType; DWORD dwType;
DWORD cPara; DWORD cPara;
__field_ecount(cPara) void** ppPara; _Field_size_(cPara) void** ppPara;
} }
CERT_SELECT_CRITERIA, *PCERT_SELECT_CRITERIA; CERT_SELECT_CRITERIA, *PCERT_SELECT_CRITERIA;
typedef const CERT_SELECT_CRITERIA* PCCERT_SELECT_CRITERIA; typedef const CERT_SELECT_CRITERIA* PCCERT_SELECT_CRITERIA;
// Selection Criteria // Selection Criteria
#define CERT_SELECT_BY_ENHKEY_USAGE 1 #define CERT_SELECT_BY_ENHKEY_USAGE 1
#define CERT_SELECT_BY_KEY_USAGE 2 #define CERT_SELECT_BY_KEY_USAGE 2
#define CERT_SELECT_BY_POLICY_OID 3 #define CERT_SELECT_BY_POLICY_OID 3
#define CERT_SELECT_BY_PROV_NAME 4 #define CERT_SELECT_BY_PROV_NAME 4
#define CERT_SELECT_BY_EXTENSION 5 #define CERT_SELECT_BY_EXTENSION 5
#define CERT_SELECT_BY_SUBJECT_HOST_NAME 6 #define CERT_SELECT_BY_SUBJECT_HOST_NAME 6
#define CERT_SELECT_BY_ISSUER_ATTR 7 #define CERT_SELECT_BY_ISSUER_ATTR 7
#define CERT_SELECT_BY_SUBJECT_ATTR 8 #define CERT_SELECT_BY_SUBJECT_ATTR 8
#define CERT_SELECT_BY_ISSUER_NAME 9 #define CERT_SELECT_BY_ISSUER_NAME 9
#define CERT_SELECT_BY_PUBLIC_KEY 10 #define CERT_SELECT_BY_PUBLIC_KEY 10
#define CERT_SELECT_BY_TLS_SIGNATURES 11 #define CERT_SELECT_BY_TLS_SIGNATURES 11
//add for WinRT
#define CERT_SELECT_BY_ISSUER_DISPLAYNAME 12
#define CERT_SELECT_BY_FRIENDLYNAME 13
#define CERT_SELECT_BY_THUMBPRINT 14
#define CERT_SELECT_LAST CERT_SELECT_BY_TLS_SIGNATURES #define CERT_SELECT_LAST CERT_SELECT_BY_TLS_SIGNATURES
#define CERT_SELECT_MAX (CERT_SELECT_LAST * 3) #define CERT_SELECT_MAX (CERT_SELECT_LAST * 3)
// Selection Flags // Selection Flags
#define CERT_SELECT_ALLOW_EXPIRED 0x00000001 #define CERT_SELECT_ALLOW_EXPIRED 0x00000001
#define CERT_SELECT_TRUSTED_ROOT 0x00000002 #define CERT_SELECT_TRUSTED_ROOT 0x00000002
#define CERT_SELECT_DISALLOW_SELFSIGNED 0x00000004 #define CERT_SELECT_DISALLOW_SELFSIGNED 0x00000004
#define CERT_SELECT_HAS_PRIVATE_KEY 0x00000008 #define CERT_SELECT_HAS_PRIVATE_KEY 0x00000008
#define CERT_SELECT_HAS_KEY_FOR_SIGNATURE 0x00000010 #define CERT_SELECT_HAS_KEY_FOR_SIGNATURE 0x00000010
#define CERT_SELECT_HAS_KEY_FOR_KEY_EXCHANGE 0x00000020 #define CERT_SELECT_HAS_KEY_FOR_KEY_EXCHANGE 0x00000020
#define CERT_SELECT_HARDWARE_ONLY 0x00000040 #define CERT_SELECT_HARDWARE_ONLY 0x00000040
#define CERT_SELECT_ALLOW_DUPLICATES 0x00000080 #define CERT_SELECT_ALLOW_DUPLICATES 0x00000080
#define CERT_SELECT_IGNORE_AUTOSELECT 0x00000100
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Build certificate chains from the certificates in the store and select // Build certificate chains from the certificates in the store and select
// the matching ones based on the flags and selection criteria. // the matching ones based on the flags and selection criteria.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
_Success_(return != FALSE)
BOOL BOOL
WINAPI WINAPI
CertSelectCertificateChains( CertSelectCertificateChains(
__in_opt LPCGUID pSelectionContext, _In_opt_ LPCGUID pSelectionContext,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__in_opt PCCERT_SELECT_CHAIN_PARA pChainParameters, _In_opt_ PCCERT_SELECT_CHAIN_PARA pChainParameters,
__in DWORD cCriteria, _In_ DWORD cCriteria,
__in_ecount_opt(cCriteria) PCCERT_SELECT_CRITERIA rgpCriteria, _In_reads_opt_(cCriteria) PCCERT_SELECT_CRITERIA rgpCriteria,
__in HCERTSTORE hStore, _In_ HCERTSTORE hStore,
__out PDWORD pcSelection, _Out_ PDWORD pcSelection,
__out_ecount(*pcSelection) PCCERT_CHAIN_CONTEXT** pprgpSelection _Outptr_result_buffer_(*pcSelection) PCCERT_CHAIN_CONTEXT** pprgpSelection
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Free the array of pointers to chain contexts. // Free the array of pointers to chain contexts.
// CertFreeCertificateChain is NOT called for each entry. // CertFreeCertificateChain is NOT called for each entry.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CertFreeCertificateChainList( CertFreeCertificateChainList(
__in PCCERT_CHAIN_CONTEXT* prgpSelection _In_ PCCERT_CHAIN_CONTEXT* prgpSelection
); );
#endif // (NTDDI_VERSION >= NTDDI_WIN7) #endif // (NTDDI_VERSION >= NTDDI_WIN7)
// //
// Time stamp API // Time stamp API
// //
#if (NTDDI_VERSION >= NTDDI_WIN7) #if (NTDDI_VERSION >= NTDDI_WIN7)
skipping to change at line 19267 skipping to change at line 20243
typedef struct _CRYPT_TIMESTAMP_REQUEST typedef struct _CRYPT_TIMESTAMP_REQUEST
{ {
DWORD dwVersion; // v1 DWORD dwVersion; // v1
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
CRYPT_DER_BLOB HashedMessage; CRYPT_DER_BLOB HashedMessage;
LPSTR pszTSAPolicyId; // OPTIONAL LPSTR pszTSAPolicyId; // OPTIONAL
CRYPT_INTEGER_BLOB Nonce; // OPTIONAL CRYPT_INTEGER_BLOB Nonce; // OPTIONAL
BOOL fCertReq; // DEFAULT FALSE BOOL fCertReq; // DEFAULT FALSE
DWORD cExtension; DWORD cExtension;
__field_ecount(cExtension) _Field_size_(cExtension)
PCERT_EXTENSION rgExtension; // OPTIONAL PCERT_EXTENSION rgExtension; // OPTIONAL
} CRYPT_TIMESTAMP_REQUEST, *PCRYPT_TIMESTAMP_REQUEST; } CRYPT_TIMESTAMP_REQUEST, *PCRYPT_TIMESTAMP_REQUEST;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRYPT_TIMESTAMP_RESPONSE // CRYPT_TIMESTAMP_RESPONSE
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_TIMESTAMP_RESPONSE typedef struct _CRYPT_TIMESTAMP_RESPONSE
{ {
DWORD dwStatus; DWORD dwStatus;
DWORD cFreeText; // OPTIONAL DWORD cFreeText; // OPTIONAL
__field_ecount(cFreeText) _Field_size_(cFreeText)
LPWSTR* rgFreeText; LPWSTR* rgFreeText;
CRYPT_BIT_BLOB FailureInfo; // OPTIONAL CRYPT_BIT_BLOB FailureInfo; // OPTIONAL
CRYPT_DER_BLOB ContentInfo; // OPTIONAL CRYPT_DER_BLOB ContentInfo; // OPTIONAL
} CRYPT_TIMESTAMP_RESPONSE, *PCRYPT_TIMESTAMP_RESPONSE; } CRYPT_TIMESTAMP_RESPONSE, *PCRYPT_TIMESTAMP_RESPONSE;
#define TIMESTAMP_STATUS_GRANTED 0 #define TIMESTAMP_STATUS_GRANTED 0
#define TIMESTAMP_STATUS_GRANTED_WITH_MODS 1 #define TIMESTAMP_STATUS_GRANTED_WITH_MODS 1
#define TIMESTAMP_STATUS_REJECTED 2 #define TIMESTAMP_STATUS_REJECTED 2
#define TIMESTAMP_STATUS_WAITING 3 #define TIMESTAMP_STATUS_WAITING 3
#define TIMESTAMP_STATUS_REVOCATION_WARNING 4 #define TIMESTAMP_STATUS_REVOCATION_WARNING 4
skipping to change at line 19329 skipping to change at line 20305
LPSTR pszTSAPolicyId; LPSTR pszTSAPolicyId;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
CRYPT_DER_BLOB HashedMessage; CRYPT_DER_BLOB HashedMessage;
CRYPT_INTEGER_BLOB SerialNumber; CRYPT_INTEGER_BLOB SerialNumber;
FILETIME ftTime; FILETIME ftTime;
PCRYPT_TIMESTAMP_ACCURACY pvAccuracy; // OPTIONAL PCRYPT_TIMESTAMP_ACCURACY pvAccuracy; // OPTIONAL
BOOL fOrdering; // OPTIONAL BOOL fOrdering; // OPTIONAL
CRYPT_DER_BLOB Nonce; // OPTIONAL CRYPT_DER_BLOB Nonce; // OPTIONAL
CRYPT_DER_BLOB Tsa; // OPTIONAL CRYPT_DER_BLOB Tsa; // OPTIONAL
DWORD cExtension; DWORD cExtension;
__field_ecount(cExtension) _Field_size_(cExtension)
PCERT_EXTENSION rgExtension; // OPTIONAL PCERT_EXTENSION rgExtension; // OPTIONAL
} CRYPT_TIMESTAMP_INFO, *PCRYPT_TIMESTAMP_INFO; } CRYPT_TIMESTAMP_INFO, *PCRYPT_TIMESTAMP_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRYPT_TIMESTAMP_CONTEXT // CRYPT_TIMESTAMP_CONTEXT
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_TIMESTAMP_CONTEXT typedef struct _CRYPT_TIMESTAMP_CONTEXT
{ {
DWORD cbEncoded; DWORD cbEncoded;
__field_bcount(cbEncoded) _Field_size_bytes_(cbEncoded)
BYTE *pbEncoded; BYTE *pbEncoded;
PCRYPT_TIMESTAMP_INFO pTimeStamp; PCRYPT_TIMESTAMP_INFO pTimeStamp;
} CRYPT_TIMESTAMP_CONTEXT, *PCRYPT_TIMESTAMP_CONTEXT; } CRYPT_TIMESTAMP_CONTEXT, *PCRYPT_TIMESTAMP_CONTEXT;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRYPT_TIMESTAMP_PARA // CRYPT_TIMESTAMP_PARA
// //
// pszTSAPolicyId // pszTSAPolicyId
// [optional] Specifies the TSA policy under which the time stamp token // [optional] Specifies the TSA policy under which the time stamp token
// should be provided. // should be provided.
skipping to change at line 19370 skipping to change at line 20346
// rgExtension // rgExtension
// [optional] Specifies Extensions to be included in request. // [optional] Specifies Extensions to be included in request.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_TIMESTAMP_PARA typedef struct _CRYPT_TIMESTAMP_PARA
{ {
LPCSTR pszTSAPolicyId; // OPTIONAL LPCSTR pszTSAPolicyId; // OPTIONAL
BOOL fRequestCerts; // Default is TRUE BOOL fRequestCerts; // Default is TRUE
CRYPT_INTEGER_BLOB Nonce; // OPTIONAL CRYPT_INTEGER_BLOB Nonce; // OPTIONAL
DWORD cExtension; DWORD cExtension;
__field_ecount(cExtension) _Field_size_(cExtension)
PCERT_EXTENSION rgExtension; // OPTIONAL PCERT_EXTENSION rgExtension; // OPTIONAL
} CRYPT_TIMESTAMP_PARA, *PCRYPT_TIMESTAMP_PARA; } CRYPT_TIMESTAMP_PARA, *PCRYPT_TIMESTAMP_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CryptRetrieveTimeStamp // CryptRetrieveTimeStamp
// //
// wszUrl // wszUrl
// [in] Specifies TSA where to send request to. // [in] Specifies TSA where to send request to.
// //
// dwRetrievalFlags // dwRetrievalFlags
skipping to change at line 19421 skipping to change at line 20397
// //
// Remarks: // Remarks:
// //
// The TIMESTAMP_VERIFY_CONTEXT_SIGNATURE flag can be only used, // The TIMESTAMP_VERIFY_CONTEXT_SIGNATURE flag can be only used,
// if fRequestCerts value is TRUE. // if fRequestCerts value is TRUE.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
BOOL BOOL
WINAPI WINAPI
CryptRetrieveTimeStamp( CryptRetrieveTimeStamp(
__in LPCWSTR wszUrl, _In_ LPCWSTR wszUrl,
DWORD dwRetrievalFlags, DWORD dwRetrievalFlags,
DWORD dwTimeout, DWORD dwTimeout,
__in LPCSTR pszHashId, _In_ LPCSTR pszHashId,
__in_opt const CRYPT_TIMESTAMP_PARA *pPara, _In_opt_ const CRYPT_TIMESTAMP_PARA *pPara,
__in_bcount(cbData) _In_reads_bytes_(cbData)
const BYTE *pbData, const BYTE *pbData,
DWORD cbData, DWORD cbData,
__deref_out PCRYPT_TIMESTAMP_CONTEXT *ppTsContext, _Outptr_ PCRYPT_TIMESTAMP_CONTEXT *ppTsContext,
__deref_out_opt PCCERT_CONTEXT *ppTsSigner, _Outptr_result_maybenull_ PCCERT_CONTEXT *ppTsSigner,
__out_opt HCERTSTORE *phStore _Out_opt_ HCERTSTORE *phStore
); );
// Set this flag to inhibit hash calculation on pbData // Set this flag to inhibit hash calculation on pbData
#define TIMESTAMP_DONT_HASH_DATA 0x00000001 #define TIMESTAMP_DONT_HASH_DATA 0x00000001
// Set this flag to enforce signature validation on retrieved time stamp. // Set this flag to enforce signature validation on retrieved time stamp.
#define TIMESTAMP_VERIFY_CONTEXT_SIGNATURE 0x00000020 // CRYPT_VERIFY_CON TEXT_SIGNATURE #define TIMESTAMP_VERIFY_CONTEXT_SIGNATURE 0x00000020 // CRYPT_VERIFY_CON TEXT_SIGNATURE
// Set this flag to inhibit automatic authentication handling. See the // Set this flag to inhibit automatic authentication handling. See the
// wininet flag, INTERNET_FLAG_NO_AUTH, for more details. // wininet flag, INTERNET_FLAG_NO_AUTH, for more details.
skipping to change at line 19480 skipping to change at line 20456
// receives the certificate of the signer. // receives the certificate of the signer.
// When you have finished using this structure, free it by passing this // When you have finished using this structure, free it by passing this
// pointer to the CertFreeCertificateContext function. // pointer to the CertFreeCertificateContext function.
// This parameter can be NULL if the TSA signer's certificate is not needed. // This parameter can be NULL if the TSA signer's certificate is not needed.
// //
// NOTE: // NOTE:
// The caller should validate pszTSAPolicyId, if any was specified in the req uest, // The caller should validate pszTSAPolicyId, if any was specified in the req uest,
// and ftTime. // and ftTime.
// The caller should also build a chain for ppTsSigner and validate the trust . // The caller should also build a chain for ppTsSigner and validate the trust .
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
__success(return == TRUE) _Success_(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptVerifyTimeStampSignature ( CryptVerifyTimeStampSignature (
__in_bcount( cbTSContentInfo ) _In_reads_bytes_( cbTSContentInfo )
const BYTE *pbTSContentInfo, const BYTE *pbTSContentInfo,
DWORD cbTSContentInfo, DWORD cbTSContentInfo,
__in_bcount_opt(cbData) _In_reads_bytes_opt_(cbData)
const BYTE *pbData, const BYTE *pbData,
DWORD cbData, DWORD cbData,
__in_opt HCERTSTORE hAdditionalStore, _In_opt_ HCERTSTORE hAdditionalStore,
__deref_out PCRYPT_TIMESTAMP_CONTEXT *ppTsContext, _Outptr_ PCRYPT_TIMESTAMP_CONTEXT *ppTsContext,
__deref_out_opt PCCERT_CONTEXT *ppTsSigner, _Outptr_result_maybenull_ PCCERT_CONTEXT *ppTsSigner,
__out_opt HCERTSTORE *phStore _Out_opt_ HCERTSTORE *phStore
); );
#endif // (NTDDI_VERSION >= NTDDI_WIN7) #endif // (NTDDI_VERSION >= NTDDI_WIN7)
//
// Object Locator Provider API
//
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define CRYPT_OBJECT_LOCATOR_SPN_NAME_TYPE 1 //ex. "HTTP/www
.contoso.com"
#define CRYPT_OBJECT_LOCATOR_LAST_RESERVED_NAME_TYPE 32
#define CRYPT_OBJECT_LOCATOR_FIRST_RESERVED_USER_NAME_TYPE 33
#define CRYPT_OBJECT_LOCATOR_LAST_RESERVED_USER_NAME_TYPE 0x0000FFFF
#define SSL_OBJECT_LOCATOR_PFX_FUNC "SslObjectLocatorInitia
lizePfx"
#define SSL_OBJECT_LOCATOR_ISSUER_LIST_FUNC "SslObjectLocatorInitia
lizeIssuerList"
#define SSL_OBJECT_LOCATOR_CERT_VALIDATION_CONFIG_FUNC "SslObjectLocatorInitia
lizeCertValidationConfig"
//--------------------------------------------------------------------------
// Releasing the locator can be done with the following reasons
// On system shutdown and process exit, the provider is not expected to
// release all memory. However, on service stop and dll unload the provider
// should clean itself up.
//--------------------------------------------------------------------------
#define CRYPT_OBJECT_LOCATOR_RELEASE_SYSTEM_SHUTDOWN 1
#define CRYPT_OBJECT_LOCATOR_RELEASE_SERVICE_STOP 2
#define CRYPT_OBJECT_LOCATOR_RELEASE_PROCESS_EXIT 3
#define CRYPT_OBJECT_LOCATOR_RELEASE_DLL_UNLOAD 4
//--------------------------------------------------------------------------
// The object locator provider receives this function when it is initialized.
// The object locator provider is expected to call this function when an
// object has changed. This indicates to the application that its copy of the
// object is stale and it should get an updated object.
//
// pContext
// This is the context pararameter passed into the object locator providers
// initialize function. The object locator provider must hold onto this conte
xt
// and pass it back into this flush function.
//
// rgIdentifierOrNameList
// An array of name/identifier blobs for objects that are stale. If an object
// has an identifier then pass in the identifier name. If an object does not
have
// an identifier then pass in the name. You can pass in NULL which indicates
all
// objects are stale but this is not recommended for performance reasons.
//
// dwIdentifierOrNameListCount
// Number of names/identifiers in the array. 0 implies that rgIdentifierOrNam
eList
// is NULL which means all objects are stale.
//
//--------------------------------------------------------------------------
_Success_(return != 0)
typedef BOOL (WINAPI *PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FLUSH)(
_In_ LPVOID pContext,
_In_reads_(dwIdentifierOrNameListCount) PCERT_NAME_BLOB *rgIdentifierOrNameL
ist,
_In_ DWORD dwIdentifierOrNameListCount);
//--------------------------------------------------------------------------
// An application will call on the object provider with the GET function when
// the application needs an object. The name blob uniquely identifies the conten
t
// to return. This function can return an identifier data blob. Subsequent calls
// to this function for the same object will pass in the identifier that was pre
viously
// returned. The identifier does not need to uniquely identify a particular obje
ct.
//
// pPluginContext
// This is the context that is returned by the object locator provider when
// it is initialized.
//
// pIdentifier
// This is the identifier that was returned on a previous GET call for this o
bject.
// On the first call for a particular object it is always NULL.
//
// dwNameType, pNameBlob
// The name the application is using for the object. The name will uniquely i
dentify
// an object.
//
// ppContent, pcbContent
// The returned object.
//
// ppwszPassword
// If the returned object is a pfx then this is the password for the pfx.
//
// ppIdentifier
// The identifier for the object.
//--------------------------------------------------------------------------
_Success_(return != 0)
typedef BOOL (WINAPI *PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET)(
_In_opt_ LPVOID pPluginContext,
_In_opt_ PCRYPT_DATA_BLOB pIdentifier,
_In_ DWORD dwNameType,
_In_ PCERT_NAME_BLOB pNameBlob,
_Outptr_result_bytebuffer_(*pcbContent) PBYTE *ppbContent,
_Out_ DWORD *pcbContent,
_Outptr_result_maybenull_ PCWSTR *ppwszPassword,
_Outptr_result_maybenull_ PCRYPT_DATA_BLOB *ppIdentifier);
//--------------------------------------------------------------------------
// The application has indicated it no longer needs to locate objects by
// calling this release function.
//
// dwReason
// Can be one of:
// CRYPT_OBJECT_LOCATOR_RELEASE_SYSTEM_SHUTDOWN
// CRYPT_OBJECT_LOCATOR_RELEASE_SERVICE_STOP
// CRYPT_OBJECT_LOCATOR_RELEASE_PROCESS_EXIT
// CRYPT_OBJECT_LOCATOR_RELEASE_DLL_UNLOAD
//
// pPluginContext
// This is the context that is returned by the object locator provider when
// it is initialized.
//--------------------------------------------------------------------------
typedef void (WINAPI * PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_RELEASE)(
_In_ DWORD dwReason,
_In_opt_ LPVOID pPluginContext);
//--------------------------------------------------------------------------
// If the PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET function returns a password
// that is non-NULL then this function will be called to release the memory.
// Best practice is to zero the memory before releasing it.
//
// pPluginContext
// This is the context that is returned by the object locator provider when
// it is initialized.
//
// pwszPassword
// Password obtained from PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET
//--------------------------------------------------------------------------
typedef void (WINAPI *PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_PASSWORD)(
_In_opt_ LPVOID pPluginContext,
_In_ PCWSTR pwszPassword
);
//--------------------------------------------------------------------------
// The content returned by the PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET function
// is released using this function.
//
// pPluginContext
// This is the context that is returned by the object locator provider when
// it is initialized.
//
// pbData
// Content returned by the GET function.
//--------------------------------------------------------------------------
typedef void (WINAPI *PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE)(
_In_opt_ LPVOID pPluginContext,
_In_ PBYTE pbData
);
//--------------------------------------------------------------------------
//
// The identifier returned by the PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET function
// is released with this function. This will be called only if the identifier is
// non-NULL.
// The identifier will be released when the application no longer needs the
// object that was returned by the GET call.
//
// pPluginContext
// This is the context that is returned by the object locator provider when
// it is initialized.
//
// pIdentifier
// Identifier returned by the GET function.
//--------------------------------------------------------------------------
typedef void (WINAPI *PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_IDENTIFIER)(
_In_opt_ LPVOID pPluginContext,
_In_ PCRYPT_DATA_BLOB pIdentifier);
typedef struct _CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE
{
_Field_range_(sizeof(CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE), sizeof(CRYPT_OBJE
CT_LOCATOR_PROVIDER_TABLE)) DWORD cbSize;
PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET pfnGet;
PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_RELEASE pfnRelease;
PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_PASSWORD pfnFreePassword;
PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE pfnFree;
PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_IDENTIFIER pfnFreeIdentifier;
} CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE, *PCRYPT_OBJECT_LOCATOR_PROVIDER_TABLE;
//--------------------------------------------------------------------------
//
// This is the initialization function of the object locator provider.
//
// pfnFlush
// This is the function which the provider must call when it detects that
// an object has changed and the calling application should know about it
// to prevent stale copies of the object from being used.
//
// pContext
// This context is passed to the intialization function. The provider
// is expected to hold onto this context and pass it back with the call
// call to the flush function
//
// pdwExpectedObjectCount
// The number of objects that the provider expects it will need to locate.
// This number will determine the size of a hash table used internally.
//
// pFuncTable
// A structure that describes a set of callback functions which can be used
// to get objects and free objects.
//
// ppPluginContext
// Extra information that the provider can return in its initialize call whic
h
// will be passed back to each of the subsequent callback functions.
//--------------------------------------------------------------------------
_Success_(return != 0)
typedef BOOL (WINAPI *PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_INITIALIZE)(
_In_ PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FLUSH pfnFlush,
_In_ LPVOID pContext,
_Out_ DWORD *pdwExpectedObjectCount,
_Outptr_ PCRYPT_OBJECT_LOCATOR_PROVIDER_TABLE *ppFuncTable,
_Outptr_result_maybenull_ void **ppPluginContext);
#endif // (NTDDI_VERSION >= NTDDI_WIN8)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif //!defined(_DDK_DRIVER_) #endif //!defined(_DDK_DRIVER_)
#ifdef __cplusplus #ifdef __cplusplus
} // Balance extern "C" above } // Balance extern "C" above
#endif #endif
#if defined (_MSC_VER) #if defined (_MSC_VER)
#if ( _MSC_VER >= 800 ) #if ( _MSC_VER >= 800 )
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(pop) #pragma warning(pop)
#else #else
#pragma warning(default:4201) #pragma warning(default:4201)
#endif #endif
#endif #endif
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
//
// The following headers are refactored out of WinCrypt.h,
// reflecting the separate binaries.
// Applications which do not depend on all functionality of CRYPT32 etc.,
// can link directly to smaller binaries using smaller headers also.
//
#ifndef _WINCRYPT_NO_DPAPI
#include <dpapi.h>
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif // __WINCRYPT_H__ #endif // __WINCRYPT_H__
 End of changes. 574 change blocks. 
1869 lines changed or deleted 3119 lines changed or added


 winefs.h (6.1.7601.23418-Windows_7.0)   winefs.h (6.3.9600.17415-Windows_8.1) 
#include <winapifamily.h>
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// Microsoft Windows // Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992-1999. // Copyright (C) Microsoft Corporation, 1992-1999.
// //
// File: winefs.h // File: winefs.h
// //
// Contents: EFS Data and prototypes. // Contents: EFS Data and prototypes.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
skipping to change at line 26 skipping to change at line 27
#if (NTDDI_VERSION >= NTDDI_WIN2K) #if (NTDDI_VERSION >= NTDDI_WIN2K)
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define WINEFS_SETUSERKEY_SET_CAPABILITIES 0x00000001 #define WINEFS_SETUSERKEY_SET_CAPABILITIES 0x00000001
//+----------------------------------------------------------------------------- ----/ //+----------------------------------------------------------------------------- ----/
// / // /
// / // /
// Data Structures / // Data Structures /
// / // /
// / // /
//------------------------------------------------------------------------------ ----/ //------------------------------------------------------------------------------ ----/
skipping to change at line 157 skipping to change at line 161
#if (NTDDI_VERSION >= NTDDI_WIN7) #if (NTDDI_VERSION >= NTDDI_WIN7)
typedef struct _EFS_COMPATIBILITY_INFO { typedef struct _EFS_COMPATIBILITY_INFO {
DWORD EfsVersion; DWORD EfsVersion;
} EFS_COMPATIBILITY_INFO, *PEFS_COMPATIBILITY_INFO; } EFS_COMPATIBILITY_INFO, *PEFS_COMPATIBILITY_INFO;
#endif // #if (NTDDI_VERSION >= NTDDI_WIN7) #endif // #if (NTDDI_VERSION >= NTDDI_WIN7)
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define EFS_COMPATIBILITY_VERSION_NCRYPT_PROTECTOR 5
#endif // #if (NTDDI_VERSION >= NTDDI_WINBLUE)
// EFS_(EN/DE)CRYPTION_STATUS_INFO was not available pre-LH // EFS_(EN/DE)CRYPTION_STATUS_INFO was not available pre-LH
#if (NTDDI_VERSION >= NTDDI_VISTA) #if (NTDDI_VERSION >= NTDDI_VISTA)
typedef struct _EFS_DECRYPTION_STATUS_INFO { typedef struct _EFS_DECRYPTION_STATUS_INFO {
DWORD dwDecryptionError; DWORD dwDecryptionError;
DWORD dwHashOffset; DWORD dwHashOffset;
DWORD cbHash; DWORD cbHash;
} EFS_DECRYPTION_STATUS_INFO, *PEFS_DECRYPTION_STATUS_INFO; } EFS_DECRYPTION_STATUS_INFO, *PEFS_DECRYPTION_STATUS_INFO;
skipping to change at line 242 skipping to change at line 252
DWORD dwEfsAcce ssType; DWORD dwEfsAcce ssType;
PENCRYPTION_CERTIFICATE_HASH_LIST pCertificatesAdded; PENCRYPTION_CERTIFICATE_HASH_LIST pCertificatesAdded;
PENCRYPTION_CERTIFICATE pEncryptionCertificate; PENCRYPTION_CERTIFICATE pEncryptionCertificate;
PEFS_RPC_BLOB pEfsStreamSignatu re; PEFS_RPC_BLOB pEfsStreamSignatu re;
} ENCRYPTED_FILE_METADATA_SIGNATURE, *PENCRYPTED_FILE_METADATA_SIGNATURE; } ENCRYPTED_FILE_METADATA_SIGNATURE, *PENCRYPTED_FILE_METADATA_SIGNATURE;
#endif // #if (NTDDI_VERSION >= NTDDI_VISTA) #endif // #if (NTDDI_VERSION >= NTDDI_VISTA)
//
// TODO Update this to NTDDI_WINBLUE when available.
//
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef struct _ENCRYPTION_PROTECTOR{
DWORD cbTotalLength;
SID * pUserSid;
#ifdef MIDL_PASS
[string]
#endif // MIDL_PASS
LPWSTR lpProtectorDescriptor;
} ENCRYPTION_PROTECTOR, *PENCRYPTION_PROTECTOR;
typedef struct _ENCRYPTION_PROTECTOR_LIST {
DWORD nProtectors;
#ifdef MIDL_PASS
[size_is(nProtectors)]
#endif // MIDL_PASS
PENCRYPTION_PROTECTOR *pProtectors;
} ENCRYPTION_PROTECTOR_LIST, *PENCRYPTION_PROTECTOR_LIST;
#endif
//+----------------------------------------------------------------------------- ----/ //+----------------------------------------------------------------------------- ----/
// / // /
// / // /
// Prototypes / // Prototypes /
// / // /
// / // /
//------------------------------------------------------------------------------ ----/ //------------------------------------------------------------------------------ ----/
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
QueryUsersOnEncryptedFile( QueryUsersOnEncryptedFile(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__deref_out PENCRYPTION_CERTIFICATE_HASH_LIST *pUsers _Outptr_ PENCRYPTION_CERTIFICATE_HASH_LIST *pUsers
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
QueryRecoveryAgentsOnEncryptedFile( QueryRecoveryAgentsOnEncryptedFile(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__deref_out PENCRYPTION_CERTIFICATE_HASH_LIST *pRecoveryAgents _Outptr_ PENCRYPTION_CERTIFICATE_HASH_LIST *pRecoveryAgents
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
RemoveUsersFromEncryptedFile( RemoveUsersFromEncryptedFile(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in PENCRYPTION_CERTIFICATE_HASH_LIST pHashes _In_ PENCRYPTION_CERTIFICATE_HASH_LIST pHashes
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
AddUsersToEncryptedFile( AddUsersToEncryptedFile(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in PENCRYPTION_CERTIFICATE_LIST pEncryptionCertificates _In_ PENCRYPTION_CERTIFICATE_LIST pEncryptionCertificates
); );
// //
// SetUserFileEncryptionKey signature change in Vista to allow NULL certificate // SetUserFileEncryptionKey signature change in Vista to allow NULL certificate
// //
#if (NTDDI_VERSION >= NTDDI_VISTA) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetUserFileEncryptionKey( SetUserFileEncryptionKey(
__in_opt PENCRYPTION_CERTIFICATE pEncryptionCertificate _In_opt_ PENCRYPTION_CERTIFICATE pEncryptionCertificate
); );
#else #else
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetUserFileEncryptionKey( SetUserFileEncryptionKey(
__in PENCRYPTION_CERTIFICATE pEncryptionCertificate _In_ PENCRYPTION_CERTIFICATE pEncryptionCertificate
); );
#endif #endif
// SetUserFileEncryptionKeyEx was not available pre-LH // SetUserFileEncryptionKeyEx was not available pre-LH
#if (NTDDI_VERSION >= NTDDI_VISTA) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetUserFileEncryptionKeyEx( SetUserFileEncryptionKeyEx(
__in_opt PENCRYPTION_CERTIFICATE pEncryptionCertificate, _In_opt_ PENCRYPTION_CERTIFICATE pEncryptionCertificate,
DWORD dwCapabilities, DWORD dwCapabilities,
DWORD dwFlags, DWORD dwFlags,
__reserved LPVOID pvReserved _Reserved_ LPVOID pvReserved
); );
#endif // #if (NTDDI_VERSION >= NTDDI_VISTA) #endif // #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
FreeEncryptionCertificateHashList( FreeEncryptionCertificateHashList(
__in PENCRYPTION_CERTIFICATE_HASH_LIST pUsers _In_ PENCRYPTION_CERTIFICATE_HASH_LIST pUsers
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EncryptionDisable( EncryptionDisable(
__in LPCWSTR DirPath, _In_ LPCWSTR DirPath,
BOOL Disable BOOL Disable
); );
// DuplicateEncryptionInfoFile signature changed // DuplicateEncryptionInfoFile signature changed
// in WS03 to use a CONST SECURITY_ATTRIBUTES structure // in WS03 to use a CONST SECURITY_ATTRIBUTES structure
#if (NTDDI_VERSION >= NTDDI_WS03) #if (NTDDI_VERSION >= NTDDI_WS03)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
DuplicateEncryptionInfoFile( DuplicateEncryptionInfoFile(
__in LPCWSTR SrcFileName, _In_ LPCWSTR SrcFileName,
__in LPCWSTR DstFileName, _In_ LPCWSTR DstFileName,
DWORD dwCreationDistribution, DWORD dwCreationDistribution,
DWORD dwAttributes, DWORD dwAttributes,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
// DuplicateEncryptionInfoFile didn't exist pre-WXP // DuplicateEncryptionInfoFile didn't exist pre-WXP
#elif (NTDDI_VERSION >= NTDDI_WINXP) #elif (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
DuplicateEncryptionInfoFile( DuplicateEncryptionInfoFile(
__in LPCWSTR SrcFileName, _In_ LPCWSTR SrcFileName,
__in LPCWSTR DstFileName, _In_ LPCWSTR DstFileName,
DWORD dwCreationDistribution, DWORD dwCreationDistribution,
DWORD dwAttributes, DWORD dwAttributes,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
#endif #endif
// *EncryptedFileMetadata routines were not available pre-LH // *EncryptedFileMetadata routines were not available pre-LH
#if (NTDDI_VERSION >= NTDDI_VISTA) #if (NTDDI_VERSION >= NTDDI_VISTA)
__declspec(deprecated) __declspec(deprecated)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetEncryptedFileMetadata( GetEncryptedFileMetadata(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__out PDWORD pcbMetadata, _Out_ PDWORD pcbMetadata,
__deref_out_bcount(*pcbMetadata) PBYTE *ppbMetadata _Outptr_result_bytebuffer_(*pcbMetadata) PBYTE *ppbMetadata
); );
__declspec(deprecated) __declspec(deprecated)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetEncryptedFileMetadata( SetEncryptedFileMetadata(
__in LPCWSTR lpFileName, _In_ LPCWSTR lpFileName,
__in_opt PBYTE pbOldMetadata, _In_opt_ PBYTE pbOldMetadata,
__in PBYTE pbNewMetadata, _In_ PBYTE pbNewMetadata,
__in PENCRYPTION_CERTIFICATE_HASH pOwnerHash, _In_ PENCRYPTION_CERTIFICATE_HASH pOwnerHash,
DWORD dwOperation, DWORD dwOperation,
__in_opt PENCRYPTION_CERTIFICATE_HASH_LIST pCertificatesAdded _In_opt_ PENCRYPTION_CERTIFICATE_HASH_LIST pCertificatesAdded
); );
__declspec(deprecated) __declspec(deprecated)
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
FreeEncryptedFileMetadata( FreeEncryptedFileMetadata(
__in PBYTE pbMetadata _In_ PBYTE pbMetadata
); );
#endif // #if (NTDDI_VERSION >= NTDDI_VISTA) #endif // #if (NTDDI_VERSION >= NTDDI_VISTA)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#ifdef __cplusplus #ifdef __cplusplus
} // Balance extern "C" above } // Balance extern "C" above
#endif #endif
#endif // #if (NTDDI_VERSION >= NTDDI_WIN2K) #endif // #if (NTDDI_VERSION >= NTDDI_WIN2K)
#endif // __WINEFS_H__ #endif // __WINEFS_H__
 End of changes. 23 change blocks. 
29 lines changed or deleted 67 lines changed or added


 winreg.h (6.1.7601.23418-Windows_7.0)   winreg.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 19 skipping to change at line 20
Abstract: Abstract:
This module contains the function prototypes and constant, type and This module contains the function prototypes and constant, type and
structure definitions for the Windows 32-Bit Registry API. structure definitions for the Windows 32-Bit Registry API.
--*/ --*/
#ifndef _WINREG_ #ifndef _WINREG_
#define _WINREG_ #define _WINREG_
#include <winapifamily.h>
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
/* APISET_NAME: api-ms-win-core-registry-l1 */
#ifndef _APISET_REGISTRY_VER
#ifdef _APISET_MINWIN_VERSION
#if _APISET_MINWIN_VERSION >= 0x0100
#define _APISET_REGISTRY_VER 0x0100
#endif
#endif
#endif
#ifdef _MAC #ifdef _MAC
#include <macwin32.h> #include <macwin32.h>
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifndef WINVER #ifndef WINVER
#define WINVER 0x0500 // version 5.0 #define WINVER 0x0500 // version 5.0
#endif /* !WINVER */ #endif /* !WINVER */
// //
// RRF - Registry Routine Flags (for RegGetValue) // RRF - Registry Routine Flags (for RegGetValue)
// //
#define RRF_RT_REG_NONE 0x00000001 // restrict type to REG_NONE (ot her data types will not return ERROR_SUCCESS) #define RRF_RT_REG_NONE 0x00000001 // restrict type to REG_NONE (ot her data types will not return ERROR_SUCCESS)
#define RRF_RT_REG_SZ 0x00000002 // restrict type to REG_SZ (ot her data types will not return ERROR_SUCCESS) (automatically converts REG_EXPAND _SZ to REG_SZ unless RRF_NOEXPAND is specified) #define RRF_RT_REG_SZ 0x00000002 // restrict type to REG_SZ (ot her data types will not return ERROR_SUCCESS) (automatically converts REG_EXPAND _SZ to REG_SZ unless RRF_NOEXPAND is specified)
skipping to change at line 77 skipping to change at line 99
// Reserved Key Handles. // Reserved Key Handles.
// //
#define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x800000 00) ) #define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x800000 00) )
#define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x800000 01) ) #define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x800000 01) )
#define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x800000 02) ) #define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x800000 02) )
#define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x800000 03) ) #define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x800000 03) )
#define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x800000 04) ) #define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x800000 04) )
#define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x800000 50) ) #define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x800000 50) )
#define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x800000 60) ) #define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x800000 60) )
#if(WINVER >= 0x0400)
#if (WINVER >= 0x0400)
#define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x800000 05) ) #define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x800000 05) )
#define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x800000 06) ) #define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x800000 06) )
#define HKEY_CURRENT_USER_LOCAL_SETTINGS (( HKEY ) (ULONG_PTR)((LONG)0x800000 07) ) #define HKEY_CURRENT_USER_LOCAL_SETTINGS (( HKEY ) (ULONG_PTR)((LONG)0x800000 07) )
// //
// RegConnectRegistryEx supported flags // RegConnectRegistryEx supported flags
// //
#define REG_SECURE_CONNECTION 1 #define REG_SECURE_CONNECTION 1
/*NOINC*/ /*NOINC*/
skipping to change at line 174 skipping to change at line 197
// Default values for parameters that do not exist in the Win 3.1 // Default values for parameters that do not exist in the Win 3.1
// compatible APIs. // compatible APIs.
// //
#define WIN31_CLASS NULL #define WIN31_CLASS NULL
// //
// API Prototypes. // API Prototypes.
// //
typedef __success(return==ERROR_SUCCESS) LONG LSTATUS; typedef _Return_type_success_(return==ERROR_SUCCESS) LONG LSTATUS;
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCloseKey ( RegCloseKey(
__in HKEY hKey _In_ HKEY hKey
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOverridePredefKey ( RegOverridePredefKey (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt HKEY hNewHKey _In_opt_ HKEY hNewHKey
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenUserClassesRoot( RegOpenUserClassesRoot(
__in HANDLE hToken, _In_ HANDLE hToken,
__reserved DWORD dwOptions, _Reserved_ DWORD dwOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenCurrentUser( RegOpenCurrentUser(
__in REGSAM samDesired, _In_ REGSAM samDesired,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDisablePredefinedCache( RegDisablePredefinedCache(
VOID VOID
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDisablePredefinedCacheEx( RegDisablePredefinedCacheEx(
VOID VOID
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegConnectRegistryA ( RegConnectRegistryA (
__in_opt LPCSTR lpMachineName, _In_opt_ LPCSTR lpMachineName,
__in HKEY hKey, _In_ HKEY hKey,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegConnectRegistryW ( RegConnectRegistryW (
__in_opt LPCWSTR lpMachineName, _In_opt_ LPCWSTR lpMachineName,
__in HKEY hKey, _In_ HKEY hKey,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
#ifdef UNICODE #ifdef UNICODE
#define RegConnectRegistry RegConnectRegistryW #define RegConnectRegistry RegConnectRegistryW
#else #else
#define RegConnectRegistry RegConnectRegistryA #define RegConnectRegistry RegConnectRegistryA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegConnectRegistryExA ( RegConnectRegistryExA (
__in_opt LPCSTR lpMachineName, _In_opt_ LPCSTR lpMachineName,
__in HKEY hKey, _In_ HKEY hKey,
__in ULONG Flags, _In_ ULONG Flags,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegConnectRegistryExW ( RegConnectRegistryExW (
__in_opt LPCWSTR lpMachineName, _In_opt_ LPCWSTR lpMachineName,
__in HKEY hKey, _In_ HKEY hKey,
__in ULONG Flags, _In_ ULONG Flags,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
#ifdef UNICODE #ifdef UNICODE
#define RegConnectRegistryEx RegConnectRegistryExW #define RegConnectRegistryEx RegConnectRegistryExW
#else #else
#define RegConnectRegistryEx RegConnectRegistryExA #define RegConnectRegistryEx RegConnectRegistryExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyA ( RegCreateKeyA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyW ( RegCreateKeyW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
#ifdef UNICODE #ifdef UNICODE
#define RegCreateKey RegCreateKeyW #define RegCreateKey RegCreateKeyW
#else #else
#define RegCreateKey RegCreateKeyA #define RegCreateKey RegCreateKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyExA ( RegCreateKeyExA(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpSubKey, _In_ LPCSTR lpSubKey,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in_opt LPSTR lpClass, _In_opt_ LPSTR lpClass,
__in DWORD dwOptions, _In_ DWORD dwOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition _Out_opt_ LPDWORD lpdwDisposition
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyExW ( RegCreateKeyExW(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpSubKey, _In_ LPCWSTR lpSubKey,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in_opt LPWSTR lpClass, _In_opt_ LPWSTR lpClass,
__in DWORD dwOptions, _In_ DWORD dwOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition _Out_opt_ LPDWORD lpdwDisposition
); );
#ifdef UNICODE #ifdef UNICODE
#define RegCreateKeyEx RegCreateKeyExW #define RegCreateKeyEx RegCreateKeyExW
#else #else
#define RegCreateKeyEx RegCreateKeyExA #define RegCreateKeyEx RegCreateKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyTransactedA ( RegCreateKeyTransactedA (
skipping to change at line 329 skipping to change at line 354
#ifdef UNICODE #ifdef UNICODE
#define RegCreateKeyEx RegCreateKeyExW #define RegCreateKeyEx RegCreateKeyExW
#else #else
#define RegCreateKeyEx RegCreateKeyExA #define RegCreateKeyEx RegCreateKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyTransactedA ( RegCreateKeyTransactedA (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpSubKey, _In_ LPCSTR lpSubKey,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in_opt LPSTR lpClass, _In_opt_ LPSTR lpClass,
__in DWORD dwOptions, _In_ DWORD dwOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition, _Out_opt_ LPDWORD lpdwDisposition,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__reserved PVOID pExtendedParemeter _Reserved_ PVOID pExtendedParemeter
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCreateKeyTransactedW ( RegCreateKeyTransactedW (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpSubKey, _In_ LPCWSTR lpSubKey,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in_opt LPWSTR lpClass, _In_opt_ LPWSTR lpClass,
__in DWORD dwOptions, _In_ DWORD dwOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition, _Out_opt_ LPDWORD lpdwDisposition,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__reserved PVOID pExtendedParemeter _Reserved_ PVOID pExtendedParemeter
); );
#ifdef UNICODE #ifdef UNICODE
#define RegCreateKeyTransacted RegCreateKeyTransactedW #define RegCreateKeyTransacted RegCreateKeyTransactedW
#else #else
#define RegCreateKeyTransacted RegCreateKeyTransactedA #define RegCreateKeyTransacted RegCreateKeyTransactedA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyA ( RegDeleteKeyA (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpSubKey _In_ LPCSTR lpSubKey
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyW ( RegDeleteKeyW (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpSubKey _In_ LPCWSTR lpSubKey
); );
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteKey RegDeleteKeyW #define RegDeleteKey RegDeleteKeyW
#else #else
#define RegDeleteKey RegDeleteKeyA #define RegDeleteKey RegDeleteKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyExA ( RegDeleteKeyExA(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpSubKey, _In_ LPCSTR lpSubKey,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__reserved DWORD Reserved _Reserved_ DWORD Reserved
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyExW ( RegDeleteKeyExW(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpSubKey, _In_ LPCWSTR lpSubKey,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__reserved DWORD Reserved _Reserved_ DWORD Reserved
); );
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteKeyEx RegDeleteKeyExW #define RegDeleteKeyEx RegDeleteKeyExW
#else #else
#define RegDeleteKeyEx RegDeleteKeyExA #define RegDeleteKeyEx RegDeleteKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyTransactedA ( RegDeleteKeyTransactedA (
skipping to change at line 411 skipping to change at line 438
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteKeyEx RegDeleteKeyExW #define RegDeleteKeyEx RegDeleteKeyExW
#else #else
#define RegDeleteKeyEx RegDeleteKeyExA #define RegDeleteKeyEx RegDeleteKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyTransactedA ( RegDeleteKeyTransactedA (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpSubKey, _In_ LPCSTR lpSubKey,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__reserved PVOID pExtendedParameter _Reserved_ PVOID pExtendedParameter
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyTransactedW ( RegDeleteKeyTransactedW (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpSubKey, _In_ LPCWSTR lpSubKey,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__reserved PVOID pExtendedParameter _Reserved_ PVOID pExtendedParameter
); );
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteKeyTransacted RegDeleteKeyTransactedW #define RegDeleteKeyTransacted RegDeleteKeyTransactedW
#else #else
#define RegDeleteKeyTransacted RegDeleteKeyTransactedA #define RegDeleteKeyTransacted RegDeleteKeyTransactedA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LONG LONG
APIENTRY APIENTRY
RegDisableReflectionKey ( RegDisableReflectionKey (
__in HKEY hBase _In_ HKEY hBase
); );
WINADVAPI WINADVAPI
LONG LONG
APIENTRY APIENTRY
RegEnableReflectionKey ( RegEnableReflectionKey (
__in HKEY hBase _In_ HKEY hBase
); );
WINADVAPI WINADVAPI
LONG LONG
APIENTRY APIENTRY
RegQueryReflectionKey ( RegQueryReflectionKey (
__in HKEY hBase, _In_ HKEY hBase,
__out BOOL *bIsReflectionDisabled _Out_ BOOL *bIsReflectionDisabled
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteValueA ( RegDeleteValueA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpValueName _In_opt_ LPCSTR lpValueName
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteValueW ( RegDeleteValueW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpValueName _In_opt_ LPCWSTR lpValueName
); );
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteValue RegDeleteValueW #define RegDeleteValue RegDeleteValueW
#else #else
#define RegDeleteValue RegDeleteValueA #define RegDeleteValue RegDeleteValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumKeyA ( RegEnumKeyA (
skipping to change at line 481 skipping to change at line 510
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteValue RegDeleteValueW #define RegDeleteValue RegDeleteValueW
#else #else
#define RegDeleteValue RegDeleteValueA #define RegDeleteValue RegDeleteValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumKeyA ( RegEnumKeyA (
__in HKEY hKey, _In_ HKEY hKey,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_ecount_part_opt(cchName,cchName + 1) LPSTR lpName, _Out_writes_opt_(cchName) LPSTR lpName,
__in DWORD cchName _In_ DWORD cchName
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumKeyW ( RegEnumKeyW (
__in HKEY hKey, _In_ HKEY hKey,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_ecount_part_opt(cchName,cchName + 1) LPWSTR lpName, _Out_writes_opt_(cchName) LPWSTR lpName,
__in DWORD cchName _In_ DWORD cchName
); );
#ifdef UNICODE #ifdef UNICODE
#define RegEnumKey RegEnumKeyW #define RegEnumKey RegEnumKeyW
#else #else
#define RegEnumKey RegEnumKeyA #define RegEnumKey RegEnumKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumKeyExA ( RegEnumKeyExA(
__in HKEY hKey, _In_ HKEY hKey,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_ecount_part_opt(*lpcchName, *lpcchName + 1) LPSTR lpName, _Out_writes_to_opt_(*lpcchName, *lpcchName + 1) LPSTR lpName,
__inout LPDWORD lpcchName, _Inout_ LPDWORD lpcchName,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_ecount_part_opt(*lpcchClass,*lpcchClass + 1) LPSTR lpClass, _Out_writes_to_opt_(*lpcchClass,*lpcchClass + 1) LPSTR lpClass,
__inout_opt LPDWORD lpcchClass, _Inout_opt_ LPDWORD lpcchClass,
__out_opt PFILETIME lpftLastWriteTime _Out_opt_ PFILETIME lpftLastWriteTime
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumKeyExW ( RegEnumKeyExW(
__in HKEY hKey, _In_ HKEY hKey,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_ecount_part_opt(*lpcchName, *lpcchName + 1) LPWSTR lpName, _Out_writes_to_opt_(*lpcchName, *lpcchName + 1) LPWSTR lpName,
__inout LPDWORD lpcchName, _Inout_ LPDWORD lpcchName,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_ecount_part_opt(*lpcchClass,*lpcchClass + 1) LPWSTR lpClass, _Out_writes_to_opt_(*lpcchClass,*lpcchClass + 1) LPWSTR lpClass,
__inout_opt LPDWORD lpcchClass, _Inout_opt_ LPDWORD lpcchClass,
__out_opt PFILETIME lpftLastWriteTime _Out_opt_ PFILETIME lpftLastWriteTime
); );
#ifdef UNICODE #ifdef UNICODE
#define RegEnumKeyEx RegEnumKeyExW #define RegEnumKeyEx RegEnumKeyExW
#else #else
#define RegEnumKeyEx RegEnumKeyExA #define RegEnumKeyEx RegEnumKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumValueA ( RegEnumValueA(
__in HKEY hKey, _In_ HKEY hKey,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_ecount_part_opt(*lpcchValueName, *lpcchValueName + 1) LPSTR lpValueNam _Out_writes_to_opt_(*lpcchValueName, *lpcchValueName + 1) LPSTR lpValueName,
e, _Inout_ LPDWORD lpcchValueName,
__inout LPDWORD lpcchValueName, _Reserved_ LPDWORD lpReserved,
__reserved LPDWORD lpReserved, _Out_opt_ LPDWORD lpType,
__out_opt LPDWORD lpType, _Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY)
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY LPBYTE lpData,
TE lpData, _Inout_opt_ LPDWORD lpcbData
__inout_opt LPDWORD lpcbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegEnumValueW ( RegEnumValueW(
__in HKEY hKey, _In_ HKEY hKey,
__in DWORD dwIndex, _In_ DWORD dwIndex,
__out_ecount_part_opt(*lpcchValueName, *lpcchValueName + 1) LPWSTR lpValueNa _Out_writes_to_opt_(*lpcchValueName, *lpcchValueName + 1) LPWSTR lpValueName
me, ,
__inout LPDWORD lpcchValueName, _Inout_ LPDWORD lpcchValueName,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_opt LPDWORD lpType, _Out_opt_ LPDWORD lpType,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY _Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY)
TE lpData, LPBYTE lpData,
__inout_opt LPDWORD lpcbData _Inout_opt_ LPDWORD lpcbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegEnumValue RegEnumValueW #define RegEnumValue RegEnumValueW
#else #else
#define RegEnumValue RegEnumValueA #define RegEnumValue RegEnumValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegFlushKey ( RegFlushKey(
__in HKEY hKey _In_ HKEY hKey
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegGetKeySecurity ( RegGetKeySecurity(
__in HKEY hKey, _In_ HKEY hKey,
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__out_bcount_opt(*lpcbSecurityDescriptor) PSECURITY_DESCRIPTOR pSecurityDesc _Out_writes_bytes_opt_(*lpcbSecurityDescriptor) PSECURITY_DESCRIPTOR pSecuri
riptor, tyDescriptor,
__inout LPDWORD lpcbSecurityDescriptor _Inout_ LPDWORD lpcbSecurityDescriptor
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegLoadKeyA ( RegLoadKeyA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in LPCSTR lpFile _In_ LPCSTR lpFile
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegLoadKeyW ( RegLoadKeyW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in LPCWSTR lpFile _In_ LPCWSTR lpFile
); );
#ifdef UNICODE #ifdef UNICODE
#define RegLoadKey RegLoadKeyW #define RegLoadKey RegLoadKeyW
#else #else
#define RegLoadKey RegLoadKeyA #define RegLoadKey RegLoadKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegNotifyChangeKeyValue ( RegNotifyChangeKeyValue(
__in HKEY hKey, _In_ HKEY hKey,
__in BOOL bWatchSubtree, _In_ BOOL bWatchSubtree,
__in DWORD dwNotifyFilter, _In_ DWORD dwNotifyFilter,
__in_opt HANDLE hEvent, _In_opt_ HANDLE hEvent,
__in BOOL fAsynchronous _In_ BOOL fAsynchronous
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyA ( RegOpenKeyA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyW ( RegOpenKeyW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
#ifdef UNICODE #ifdef UNICODE
#define RegOpenKey RegOpenKeyW #define RegOpenKey RegOpenKeyW
#else #else
#define RegOpenKey RegOpenKeyA #define RegOpenKey RegOpenKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyExA ( RegOpenKeyExA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in_opt DWORD ulOptions, _In_opt_ DWORD ulOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyExW ( RegOpenKeyExW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in_opt DWORD ulOptions, _In_opt_ DWORD ulOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__out PHKEY phkResult _Out_ PHKEY phkResult
); );
#ifdef UNICODE #ifdef UNICODE
#define RegOpenKeyEx RegOpenKeyExW #define RegOpenKeyEx RegOpenKeyExW
#else #else
#define RegOpenKeyEx RegOpenKeyExA #define RegOpenKeyEx RegOpenKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyTransactedA ( RegOpenKeyTransactedA (
skipping to change at line 667 skipping to change at line 704
#ifdef UNICODE #ifdef UNICODE
#define RegOpenKeyEx RegOpenKeyExW #define RegOpenKeyEx RegOpenKeyExW
#else #else
#define RegOpenKeyEx RegOpenKeyExA #define RegOpenKeyEx RegOpenKeyExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyTransactedA ( RegOpenKeyTransactedA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in_opt DWORD ulOptions, _In_opt_ DWORD ulOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__reserved PVOID pExtendedParemeter _Reserved_ PVOID pExtendedParemeter
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegOpenKeyTransactedW ( RegOpenKeyTransactedW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in_opt DWORD ulOptions, _In_opt_ DWORD ulOptions,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__in HANDLE hTransaction, _In_ HANDLE hTransaction,
__reserved PVOID pExtendedParemeter _Reserved_ PVOID pExtendedParemeter
); );
#ifdef UNICODE #ifdef UNICODE
#define RegOpenKeyTransacted RegOpenKeyTransactedW #define RegOpenKeyTransacted RegOpenKeyTransactedW
#else #else
#define RegOpenKeyTransacted RegOpenKeyTransactedA #define RegOpenKeyTransacted RegOpenKeyTransactedA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryInfoKeyA ( RegQueryInfoKeyA(
__in HKEY hKey, _In_ HKEY hKey,
__out_ecount_part_opt(*lpcchClass, *lpcchClass + 1) LPSTR lpClass, _Out_writes_to_opt_(*lpcchClass, *lpcchClass + 1) LPSTR lpClass,
__inout_opt LPDWORD lpcchClass, _Inout_opt_ LPDWORD lpcchClass,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_opt LPDWORD lpcSubKeys, _Out_opt_ LPDWORD lpcSubKeys,
__out_opt LPDWORD lpcbMaxSubKeyLen, _Out_opt_ LPDWORD lpcbMaxSubKeyLen,
__out_opt LPDWORD lpcbMaxClassLen, _Out_opt_ LPDWORD lpcbMaxClassLen,
__out_opt LPDWORD lpcValues, _Out_opt_ LPDWORD lpcValues,
__out_opt LPDWORD lpcbMaxValueNameLen, _Out_opt_ LPDWORD lpcbMaxValueNameLen,
__out_opt LPDWORD lpcbMaxValueLen, _Out_opt_ LPDWORD lpcbMaxValueLen,
__out_opt LPDWORD lpcbSecurityDescriptor, _Out_opt_ LPDWORD lpcbSecurityDescriptor,
__out_opt PFILETIME lpftLastWriteTime _Out_opt_ PFILETIME lpftLastWriteTime
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryInfoKeyW ( RegQueryInfoKeyW(
__in HKEY hKey, _In_ HKEY hKey,
__out_ecount_part_opt(*lpcchClass, *lpcchClass + 1) LPWSTR lpClass, _Out_writes_to_opt_(*lpcchClass, *lpcchClass + 1) LPWSTR lpClass,
__inout_opt LPDWORD lpcchClass, _Inout_opt_ LPDWORD lpcchClass,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_opt LPDWORD lpcSubKeys, _Out_opt_ LPDWORD lpcSubKeys,
__out_opt LPDWORD lpcbMaxSubKeyLen, _Out_opt_ LPDWORD lpcbMaxSubKeyLen,
__out_opt LPDWORD lpcbMaxClassLen, _Out_opt_ LPDWORD lpcbMaxClassLen,
__out_opt LPDWORD lpcValues, _Out_opt_ LPDWORD lpcValues,
__out_opt LPDWORD lpcbMaxValueNameLen, _Out_opt_ LPDWORD lpcbMaxValueNameLen,
__out_opt LPDWORD lpcbMaxValueLen, _Out_opt_ LPDWORD lpcbMaxValueLen,
__out_opt LPDWORD lpcbSecurityDescriptor, _Out_opt_ LPDWORD lpcbSecurityDescriptor,
__out_opt PFILETIME lpftLastWriteTime _Out_opt_ PFILETIME lpftLastWriteTime
); );
#ifdef UNICODE #ifdef UNICODE
#define RegQueryInfoKey RegQueryInfoKeyW #define RegQueryInfoKey RegQueryInfoKeyW
#else #else
#define RegQueryInfoKey RegQueryInfoKeyA #define RegQueryInfoKey RegQueryInfoKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryValueA ( RegQueryValueA (
skipping to change at line 737 skipping to change at line 776
#ifdef UNICODE #ifdef UNICODE
#define RegQueryInfoKey RegQueryInfoKeyW #define RegQueryInfoKey RegQueryInfoKeyW
#else #else
#define RegQueryInfoKey RegQueryInfoKeyA #define RegQueryInfoKey RegQueryInfoKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryValueA ( RegQueryValueA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPST _Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY)
R lpData, LPSTR lpData,
__inout_opt PLONG lpcbData _Inout_opt_ PLONG lpcbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryValueW ( RegQueryValueW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPWS _Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY)
TR lpData, LPWSTR lpData,
__inout_opt PLONG lpcbData _Inout_opt_ PLONG lpcbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegQueryValue RegQueryValueW #define RegQueryValue RegQueryValueW
#else #else
#define RegQueryValue RegQueryValueA #define RegQueryValue RegQueryValueA
#endif // !UNICODE #endif // !UNICODE
#if(WINVER >= 0x0400) #if (WINVER >= 0x0400)
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryMultipleValuesA ( RegQueryMultipleValuesA (
__in HKEY hKey, _In_ HKEY hKey,
__out_ecount(num_vals) PVALENTA val_list, _Out_writes_(num_vals) PVALENTA val_list,
__in DWORD num_vals, _In_ DWORD num_vals,
__out_bcount_part_opt(*ldwTotsize, *ldwTotsize) __out_data_source(REGISTRY) _Out_writes_bytes_to_opt_(*ldwTotsize, *ldwTotsize) __out_data_source(REGIST
LPSTR lpValueBuf, RY) LPSTR lpValueBuf,
__inout_opt LPDWORD ldwTotsize _Inout_opt_ LPDWORD ldwTotsize
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryMultipleValuesW ( RegQueryMultipleValuesW (
__in HKEY hKey, _In_ HKEY hKey,
__out_ecount(num_vals) PVALENTW val_list, _Out_writes_(num_vals) PVALENTW val_list,
__in DWORD num_vals, _In_ DWORD num_vals,
__out_bcount_part_opt(*ldwTotsize, *ldwTotsize) __out_data_source(REGISTRY) _Out_writes_bytes_to_opt_(*ldwTotsize, *ldwTotsize) __out_data_source(REGIST
LPWSTR lpValueBuf, RY) LPWSTR lpValueBuf,
__inout_opt LPDWORD ldwTotsize _Inout_opt_ LPDWORD ldwTotsize
); );
#ifdef UNICODE #ifdef UNICODE
#define RegQueryMultipleValues RegQueryMultipleValuesW #define RegQueryMultipleValues RegQueryMultipleValuesW
#else #else
#define RegQueryMultipleValues RegQueryMultipleValuesA #define RegQueryMultipleValues RegQueryMultipleValuesA
#endif // !UNICODE #endif // !UNICODE
#endif /* WINVER >= 0x0400 */ #endif /* WINVER >= 0x0400 */
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryValueExA ( RegQueryValueExA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpValueName, _In_opt_ LPCSTR lpValueName,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_opt LPDWORD lpType, _Out_opt_ LPDWORD lpType,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY _Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY)
TE lpData, LPBYTE lpData,
__inout_opt LPDWORD lpcbData _When_(lpData == NULL, _Out_opt_)
_When_(lpData != NULL, _Inout_opt_) LPDWORD lpcbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegQueryValueExW ( RegQueryValueExW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpValueName, _In_opt_ LPCWSTR lpValueName,
__reserved LPDWORD lpReserved, _Reserved_ LPDWORD lpReserved,
__out_opt LPDWORD lpType, _Out_opt_ LPDWORD lpType,
__out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY _Out_writes_bytes_to_opt_(*lpcbData, *lpcbData) __out_data_source(REGISTRY)
TE lpData, LPBYTE lpData,
__inout_opt LPDWORD lpcbData _When_(lpData == NULL, _Out_opt_)
_When_(lpData != NULL, _Inout_opt_) LPDWORD lpcbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegQueryValueEx RegQueryValueExW #define RegQueryValueEx RegQueryValueExW
#else #else
#define RegQueryValueEx RegQueryValueExA #define RegQueryValueEx RegQueryValueExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegReplaceKeyA ( RegReplaceKeyA (
skipping to change at line 818 skipping to change at line 861
#ifdef UNICODE #ifdef UNICODE
#define RegQueryValueEx RegQueryValueExW #define RegQueryValueEx RegQueryValueExW
#else #else
#define RegQueryValueEx RegQueryValueExA #define RegQueryValueEx RegQueryValueExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegReplaceKeyA ( RegReplaceKeyA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in LPCSTR lpNewFile, _In_ LPCSTR lpNewFile,
__in LPCSTR lpOldFile _In_ LPCSTR lpOldFile
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegReplaceKeyW ( RegReplaceKeyW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in LPCWSTR lpNewFile, _In_ LPCWSTR lpNewFile,
__in LPCWSTR lpOldFile _In_ LPCWSTR lpOldFile
); );
#ifdef UNICODE #ifdef UNICODE
#define RegReplaceKey RegReplaceKeyW #define RegReplaceKey RegReplaceKeyW
#else #else
#define RegReplaceKey RegReplaceKeyA #define RegReplaceKey RegReplaceKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegRestoreKeyA ( RegRestoreKeyA(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpFile, _In_ LPCSTR lpFile,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegRestoreKeyW ( RegRestoreKeyW(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpFile, _In_ LPCWSTR lpFile,
__in DWORD dwFlags _In_ DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define RegRestoreKey RegRestoreKeyW #define RegRestoreKey RegRestoreKeyW
#else #else
#define RegRestoreKey RegRestoreKeyA #define RegRestoreKey RegRestoreKeyA
#endif // !UNICODE #endif // !UNICODE
#if(WINVER >= 0x0600) #if (WINVER >= 0x0600)
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegRenameKey( RegRenameKey(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKeyName, _In_opt_ LPCWSTR lpSubKeyName,
__in LPCWSTR lpNewKeyName _In_ LPCWSTR lpNewKeyName
); );
#endif /* WINVER >= 0x0600 */ #endif /* WINVER >= 0x0600 */
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSaveKeyA ( RegSaveKeyA (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpFile, _In_ LPCSTR lpFile,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSaveKeyW ( RegSaveKeyW (
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpFile, _In_ LPCWSTR lpFile,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
#ifdef UNICODE #ifdef UNICODE
#define RegSaveKey RegSaveKeyW #define RegSaveKey RegSaveKeyW
#else #else
#define RegSaveKey RegSaveKeyA #define RegSaveKey RegSaveKeyA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetKeySecurity ( RegSetKeySecurity(
__in HKEY hKey, _In_ HKEY hKey,
__in SECURITY_INFORMATION SecurityInformation, _In_ SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor _In_ PSECURITY_DESCRIPTOR pSecurityDescriptor
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetValueA ( RegSetValueA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in DWORD dwType, _In_ DWORD dwType,
__in_bcount_opt(cbData) LPCSTR lpData, _In_reads_bytes_opt_(cbData) LPCSTR lpData,
__in DWORD cbData _In_ DWORD cbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetValueW ( RegSetValueW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in DWORD dwType, _In_ DWORD dwType,
__in_bcount_opt(cbData) LPCWSTR lpData, _In_reads_bytes_opt_(cbData) LPCWSTR lpData,
__in DWORD cbData _In_ DWORD cbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegSetValue RegSetValueW #define RegSetValue RegSetValueW
#else #else
#define RegSetValue RegSetValueA #define RegSetValue RegSetValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetValueExA ( RegSetValueExA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpValueName, _In_opt_ LPCSTR lpValueName,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in DWORD dwType, _In_ DWORD dwType,
__in_bcount_opt(cbData) CONST BYTE* lpData, _In_reads_bytes_opt_(cbData) CONST BYTE * lpData,
__in DWORD cbData _In_ DWORD cbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetValueExW ( RegSetValueExW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpValueName, _In_opt_ LPCWSTR lpValueName,
__reserved DWORD Reserved, _Reserved_ DWORD Reserved,
__in DWORD dwType, _In_ DWORD dwType,
__in_bcount_opt(cbData) CONST BYTE* lpData, _In_reads_bytes_opt_(cbData) CONST BYTE * lpData,
__in DWORD cbData _In_ DWORD cbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegSetValueEx RegSetValueExW #define RegSetValueEx RegSetValueExW
#else #else
#define RegSetValueEx RegSetValueExA #define RegSetValueEx RegSetValueExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegUnLoadKeyA ( RegUnLoadKeyA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey _In_opt_ LPCSTR lpSubKey
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegUnLoadKeyW ( RegUnLoadKeyW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey _In_opt_ LPCWSTR lpSubKey
); );
#ifdef UNICODE #ifdef UNICODE
#define RegUnLoadKey RegUnLoadKeyW #define RegUnLoadKey RegUnLoadKeyW
#else #else
#define RegUnLoadKey RegUnLoadKeyA #define RegUnLoadKey RegUnLoadKeyA
#endif // !UNICODE #endif // !UNICODE
// //
// Utils wrappers // Utils wrappers
// //
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyValueA ( RegDeleteKeyValueA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in_opt LPCSTR lpValueName _In_opt_ LPCSTR lpValueName
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteKeyValueW ( RegDeleteKeyValueW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in_opt LPCWSTR lpValueName _In_opt_ LPCWSTR lpValueName
); );
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteKeyValue RegDeleteKeyValueW #define RegDeleteKeyValue RegDeleteKeyValueW
#else #else
#define RegDeleteKeyValue RegDeleteKeyValueA #define RegDeleteKeyValue RegDeleteKeyValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetKeyValueA ( RegSetKeyValueA (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in_opt LPCSTR lpValueName, _In_opt_ LPCSTR lpValueName,
__in DWORD dwType, _In_ DWORD dwType,
__in_bcount_opt(cbData) LPCVOID lpData, _In_reads_bytes_opt_(cbData) LPCVOID lpData,
__in DWORD cbData _In_ DWORD cbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSetKeyValueW ( RegSetKeyValueW (
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in_opt LPCWSTR lpValueName, _In_opt_ LPCWSTR lpValueName,
__in DWORD dwType, _In_ DWORD dwType,
__in_bcount_opt(cbData) LPCVOID lpData, _In_reads_bytes_opt_(cbData) LPCVOID lpData,
__in DWORD cbData _In_ DWORD cbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegSetKeyValue RegSetKeyValueW #define RegSetKeyValue RegSetKeyValueW
#else #else
#define RegSetKeyValue RegSetKeyValueA #define RegSetKeyValue RegSetKeyValueA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteTreeA ( RegDeleteTreeA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCSTR lpSubKey _In_opt_ LPCSTR lpSubKey
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegDeleteTreeW ( RegDeleteTreeW(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR lpSubKey _In_opt_ LPCWSTR lpSubKey
); );
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteTree RegDeleteTreeW #define RegDeleteTree RegDeleteTreeW
#else #else
#define RegDeleteTree RegDeleteTreeA #define RegDeleteTree RegDeleteTreeA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCopyTreeA ( RegCopyTreeA (
skipping to change at line 1057 skipping to change at line 1109
#ifdef UNICODE #ifdef UNICODE
#define RegDeleteTree RegDeleteTreeW #define RegDeleteTree RegDeleteTreeW
#else #else
#define RegDeleteTree RegDeleteTreeA #define RegDeleteTree RegDeleteTreeA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegCopyTreeA ( RegCopyTreeA (
__in HKEY hKeySrc, _In_ HKEY hKeySrc,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in HKEY hKeyDest _In_ HKEY hKeyDest
);
WINADVAPI
LSTATUS
APIENTRY
RegCopyTreeW (
__in HKEY hKeySrc,
__in_opt LPCWSTR lpSubKey,
__in HKEY hKeyDest
); );
#ifdef UNICODE #ifndef UNICODE
#define RegCopyTree RegCopyTreeW
#else
#define RegCopyTree RegCopyTreeA #define RegCopyTree RegCopyTreeA
#endif // !UNICODE #endif // !UNICODE
#if ((_WIN32_WINNT >= 0x0502) && !defined(_CONTRACT_GEN)) || (_APISET_MINWIN_VER
SION > 0x0100)
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegGetValueA ( RegGetValueA(
__in HKEY hkey, _In_ HKEY hkey,
__in_opt LPCSTR lpSubKey, _In_opt_ LPCSTR lpSubKey,
__in_opt LPCSTR lpValue, _In_opt_ LPCSTR lpValue,
__in_opt DWORD dwFlags, _In_ DWORD dwFlags,
__out_opt LPDWORD pdwType, _Out_opt_ LPDWORD pdwType,
__out_bcount_part_opt(*pcbData,*pcbData) PVOID pvData, _When_((dwFlags & 0x7F) == RRF_RT_REG_SZ ||
__inout_opt LPDWORD pcbData (dwFlags & 0x7F) == RRF_RT_REG_EXPAND_SZ ||
(dwFlags & 0x7F) == (RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ) ||
*pdwType == REG_SZ ||
*pdwType == REG_EXPAND_SZ, _Post_z_)
_When_((dwFlags & 0x7F) == RRF_RT_REG_MULTI_SZ ||
*pdwType == REG_MULTI_SZ, _Post_ _NullNull_terminated_)
_Out_writes_bytes_to_opt_(*pcbData,*pcbData) PVOID pvData,
_Inout_opt_ LPDWORD pcbData
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegGetValueW ( RegGetValueW(
__in HKEY hkey, _In_ HKEY hkey,
__in_opt LPCWSTR lpSubKey, _In_opt_ LPCWSTR lpSubKey,
__in_opt LPCWSTR lpValue, _In_opt_ LPCWSTR lpValue,
__in_opt DWORD dwFlags, _In_ DWORD dwFlags,
__out_opt LPDWORD pdwType, _Out_opt_ LPDWORD pdwType,
__out_bcount_part_opt(*pcbData,*pcbData) PVOID pvData, _When_((dwFlags & 0x7F) == RRF_RT_REG_SZ ||
__inout_opt LPDWORD pcbData (dwFlags & 0x7F) == RRF_RT_REG_EXPAND_SZ ||
(dwFlags & 0x7F) == (RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ) ||
*pdwType == REG_SZ ||
*pdwType == REG_EXPAND_SZ, _Post_z_)
_When_((dwFlags & 0x7F) == RRF_RT_REG_MULTI_SZ ||
*pdwType == REG_MULTI_SZ, _Post_ _NullNull_terminated_)
_Out_writes_bytes_to_opt_(*pcbData,*pcbData) PVOID pvData,
_Inout_opt_ LPDWORD pcbData
); );
#ifdef UNICODE #ifdef UNICODE
#define RegGetValue RegGetValueW #define RegGetValue RegGetValueW
#else #else
#define RegGetValue RegGetValueA #define RegGetValue RegGetValueA
#endif // !UNICODE #endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0502)
#if ((_WIN32_WINNT >= 0x0600) && !defined(_CONTRACT_GEN)) || (_APISET_MINWIN_VER
SION > 0x0100)
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegLoadMUIStringA ( RegCopyTreeW(
__in HKEY hKey, _In_ HKEY hKeySrc,
__in_opt LPCSTR pszValue, _In_opt_ LPCWSTR lpSubKey,
__out_bcount_opt(cbOutBuf) LPSTR pszOutBuf, _In_ HKEY hKeyDest
__in DWORD cbOutBuf, );
__out_opt LPDWORD pcbData,
__in DWORD Flags, #ifdef UNICODE
__in_opt LPCSTR pszDirectory #define RegCopyTree RegCopyTreeW
); #endif
#endif
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegLoadMUIStringW ( RegLoadMUIStringA(
__in HKEY hKey, _In_ HKEY hKey,
__in_opt LPCWSTR pszValue, _In_opt_ LPCSTR pszValue,
__out_bcount_opt(cbOutBuf) LPWSTR pszOutBuf, _Out_writes_bytes_opt_(cbOutBuf) LPSTR pszOutBuf,
__in DWORD cbOutBuf, _In_ DWORD cbOutBuf,
__out_opt LPDWORD pcbData, _Out_opt_ LPDWORD pcbData,
__in DWORD Flags, _In_ DWORD Flags,
__in_opt LPCWSTR pszDirectory _In_opt_ LPCSTR pszDirectory
); );
WINADVAPI
LSTATUS
APIENTRY
RegLoadMUIStringW(
_In_ HKEY hKey,
_In_opt_ LPCWSTR pszValue,
_Out_writes_bytes_opt_(cbOutBuf) LPWSTR pszOutBuf,
_In_ DWORD cbOutBuf,
_Out_opt_ LPDWORD pcbData,
_In_ DWORD Flags,
_In_opt_ LPCWSTR pszDirectory
);
#ifdef UNICODE #ifdef UNICODE
#define RegLoadMUIString RegLoadMUIStringW #define RegLoadMUIString RegLoadMUIStringW
#else #else
#define RegLoadMUIString RegLoadMUIStringA #define RegLoadMUIString RegLoadMUIStringA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegLoadAppKeyA ( RegLoadAppKeyA(
__in LPCSTR lpFile, _In_ LPCSTR lpFile,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__in DWORD dwOptions, _In_ DWORD dwOptions,
__reserved DWORD Reserved _Reserved_ DWORD Reserved
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegLoadAppKeyW ( RegLoadAppKeyW(
__in LPCWSTR lpFile, _In_ LPCWSTR lpFile,
__out PHKEY phkResult, _Out_ PHKEY phkResult,
__in REGSAM samDesired, _In_ REGSAM samDesired,
__in DWORD dwOptions, _In_ DWORD dwOptions,
__reserved DWORD Reserved _Reserved_ DWORD Reserved
); );
#ifdef UNICODE #ifdef UNICODE
#define RegLoadAppKey RegLoadAppKeyW #define RegLoadAppKey RegLoadAppKeyW
#else #else
#define RegLoadAppKey RegLoadAppKeyA #define RegLoadAppKey RegLoadAppKeyA
#endif // !UNICODE #endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600 #endif // _WIN32_WINNT >= 0x0600
// //
// Remoteable System Shutdown APIs // Remoteable System Shutdown APIs
skipping to change at line 1172 skipping to change at line 1254
// //
// Remoteable System Shutdown APIs // Remoteable System Shutdown APIs
// //
__drv_preferredFunction("InitiateSystemShutdownEx", "Legacy API. Rearchitect to avoid Reboot") __drv_preferredFunction("InitiateSystemShutdownEx", "Legacy API. Rearchitect to avoid Reboot")
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
InitiateSystemShutdownA( InitiateSystemShutdownA(
__in_opt LPSTR lpMachineName, _In_opt_ LPSTR lpMachineName,
__in_opt LPSTR lpMessage, _In_opt_ LPSTR lpMessage,
__in DWORD dwTimeout, _In_ DWORD dwTimeout,
__in BOOL bForceAppsClosed, _In_ BOOL bForceAppsClosed,
__in BOOL bRebootAfterShutdown _In_ BOOL bRebootAfterShutdown
); );
__drv_preferredFunction("InitiateSystemShutdownEx", "Legacy API. Rearchitect to avoid Reboot") __drv_preferredFunction("InitiateSystemShutdownEx", "Legacy API. Rearchitect to avoid Reboot")
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
InitiateSystemShutdownW( InitiateSystemShutdownW(
__in_opt LPWSTR lpMachineName, _In_opt_ LPWSTR lpMachineName,
__in_opt LPWSTR lpMessage, _In_opt_ LPWSTR lpMessage,
__in DWORD dwTimeout, _In_ DWORD dwTimeout,
__in BOOL bForceAppsClosed, _In_ BOOL bForceAppsClosed,
__in BOOL bRebootAfterShutdown _In_ BOOL bRebootAfterShutdown
); );
#ifdef UNICODE #ifdef UNICODE
#define InitiateSystemShutdown InitiateSystemShutdownW #define InitiateSystemShutdown InitiateSystemShutdownW
#else #else
#define InitiateSystemShutdown InitiateSystemShutdownA #define InitiateSystemShutdown InitiateSystemShutdownA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
AbortSystemShutdownA( AbortSystemShutdownA(
__in_opt LPSTR lpMachineName _In_opt_ LPSTR lpMachineName
); );
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
AbortSystemShutdownW( AbortSystemShutdownW(
__in_opt LPWSTR lpMachineName _In_opt_ LPWSTR lpMachineName
); );
#ifdef UNICODE #ifdef UNICODE
#define AbortSystemShutdown AbortSystemShutdownW #define AbortSystemShutdown AbortSystemShutdownW
#else #else
#define AbortSystemShutdown AbortSystemShutdownA #define AbortSystemShutdown AbortSystemShutdownA
#endif // !UNICODE #endif // !UNICODE
// //
// defines for InitiateSystemShutdownEx reason codes // defines for InitiateSystemShutdownEx reason codes
// //
skipping to change at line 1237 skipping to change at line 1319
#define REASON_UNKNOWN SHTDN_REASON_UNKNOWN #define REASON_UNKNOWN SHTDN_REASON_UNKNOWN
#define REASON_LEGACY_API SHTDN_REASON_LEGACY_API #define REASON_LEGACY_API SHTDN_REASON_LEGACY_API
#define REASON_PLANNED_FLAG SHTDN_REASON_FLAG_PLANNED #define REASON_PLANNED_FLAG SHTDN_REASON_FLAG_PLANNED
// //
// MAX Shutdown TimeOut == 10 Years in seconds // MAX Shutdown TimeOut == 10 Years in seconds
// //
#define MAX_SHUTDOWN_TIMEOUT (10*365*24*60*60) #define MAX_SHUTDOWN_TIMEOUT (10*365*24*60*60)
__drv_preferredFunction("a design alternative", "Rearchitect to avoid Reboot") __drv_preferredFunction("a design alternative", "Rearchitect to avoid Reboot")
__drv_when(((dwReason==0 && lpMessage==0)) || dwReason>=0xd0000000, _When_(((dwReason==0 && lpMessage==0)) || dwReason>=0xd0000000,
__drv_reportError("Requires a valid dwReason or lpMessage")) __drv_reportError("Requires a valid dwReason or lpMessage"))
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
InitiateSystemShutdownExA( InitiateSystemShutdownExA(
__in_opt LPSTR lpMachineName, _In_opt_ LPSTR lpMachineName,
__in_opt LPSTR lpMessage, _In_opt_ LPSTR lpMessage,
__in DWORD dwTimeout, _In_ DWORD dwTimeout,
__in BOOL bForceAppsClosed, _In_ BOOL bForceAppsClosed,
__in BOOL bRebootAfterShutdown, _In_ BOOL bRebootAfterShutdown,
__in DWORD dwReason _In_ DWORD dwReason
); );
__drv_preferredFunction("a design alternative", "Rearchitect to avoid Reboot") __drv_preferredFunction("a design alternative", "Rearchitect to avoid Reboot")
__drv_when(((dwReason==0 && lpMessage==0)) || dwReason>=0xd0000000, _When_(((dwReason==0 && lpMessage==0)) || dwReason>=0xd0000000,
__drv_reportError("Requires a valid dwReason or lpMessage")) __drv_reportError("Requires a valid dwReason or lpMessage"))
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
InitiateSystemShutdownExW( InitiateSystemShutdownExW(
__in_opt LPWSTR lpMachineName, _In_opt_ LPWSTR lpMachineName,
__in_opt LPWSTR lpMessage, _In_opt_ LPWSTR lpMessage,
__in DWORD dwTimeout, _In_ DWORD dwTimeout,
__in BOOL bForceAppsClosed, _In_ BOOL bForceAppsClosed,
__in BOOL bRebootAfterShutdown, _In_ BOOL bRebootAfterShutdown,
__in DWORD dwReason _In_ DWORD dwReason
); );
#ifdef UNICODE #ifdef UNICODE
#define InitiateSystemShutdownEx InitiateSystemShutdownExW #define InitiateSystemShutdownEx InitiateSystemShutdownExW
#else #else
#define InitiateSystemShutdownEx InitiateSystemShutdownExA #define InitiateSystemShutdownEx InitiateSystemShutdownExA
#endif // !UNICODE #endif // !UNICODE
// //
// Shutdown flags // Shutdown flags
// //
#define SHUTDOWN_FORCE_OTHERS 0x00000001 #define SHUTDOWN_FORCE_OTHERS 0x00000001
#define SHUTDOWN_FORCE_SELF 0x00000002 #define SHUTDOWN_FORCE_SELF 0x00000002
#define SHUTDOWN_RESTART 0x00000004 #define SHUTDOWN_RESTART 0x00000004
#define SHUTDOWN_POWEROFF 0x00000008 #define SHUTDOWN_POWEROFF 0x00000008
#define SHUTDOWN_NOREBOOT 0x00000010 #define SHUTDOWN_NOREBOOT 0x00000010
#define SHUTDOWN_GRACE_OVERRIDE 0x00000020 #define SHUTDOWN_GRACE_OVERRIDE 0x00000020
#define SHUTDOWN_INSTALL_UPDATES 0x00000040 #define SHUTDOWN_INSTALL_UPDATES 0x00000040
#define SHUTDOWN_RESTARTAPPS 0x00000080 #define SHUTDOWN_RESTARTAPPS 0x00000080
#define SHUTDOWN_SKIP_SVC_PRESHUTDOWN 0x00000100 #define SHUTDOWN_SKIP_SVC_PRESHUTDOWN 0x00000100
#define SHUTDOWN_HYBRID 0x00000200
#define SHUTDOWN_RESTART_BOOTOPTIONS 0x00000400
WINADVAPI WINADVAPI
DWORD DWORD
APIENTRY APIENTRY
InitiateShutdownA( InitiateShutdownA(
__in_opt LPSTR lpMachineName, _In_opt_ LPSTR lpMachineName,
__in_opt LPSTR lpMessage, _In_opt_ LPSTR lpMessage,
__in DWORD dwGracePeriod, _In_ DWORD dwGracePeriod,
__in DWORD dwShutdownFlags, _In_ DWORD dwShutdownFlags,
__in DWORD dwReason _In_ DWORD dwReason
); );
WINADVAPI WINADVAPI
DWORD DWORD
APIENTRY APIENTRY
InitiateShutdownW( InitiateShutdownW(
__in_opt LPWSTR lpMachineName, _In_opt_ LPWSTR lpMachineName,
__in_opt LPWSTR lpMessage, _In_opt_ LPWSTR lpMessage,
__in DWORD dwGracePeriod, _In_ DWORD dwGracePeriod,
__in DWORD dwShutdownFlags, _In_ DWORD dwShutdownFlags,
__in DWORD dwReason _In_ DWORD dwReason
); );
#ifdef UNICODE #ifdef UNICODE
#define InitiateShutdown InitiateShutdownW #define InitiateShutdown InitiateShutdownW
#else #else
#define InitiateShutdown InitiateShutdownA #define InitiateShutdown InitiateShutdownA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD
APIENTRY
CheckForHiberboot(
_Inout_ PBOOLEAN pHiberboot,
_In_ BOOLEAN bClearFlag
);
WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSaveKeyExA ( RegSaveKeyExA(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCSTR lpFile, _In_ LPCSTR lpFile,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD Flags _In_ DWORD Flags
); );
WINADVAPI WINADVAPI
LSTATUS LSTATUS
APIENTRY APIENTRY
RegSaveKeyExW ( RegSaveKeyExW(
__in HKEY hKey, _In_ HKEY hKey,
__in LPCWSTR lpFile, _In_ LPCWSTR lpFile,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, _In_opt_ CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD Flags _In_ DWORD Flags
); );
#ifdef UNICODE #ifdef UNICODE
#define RegSaveKeyEx RegSaveKeyExW #define RegSaveKeyEx RegSaveKeyExW
#else #else
#define RegSaveKeyEx RegSaveKeyExA #define RegSaveKeyEx RegSaveKeyExA
#endif // !UNICODE #endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#pragma endregion
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // _WINREG_ #endif // _WINREG_
 End of changes. 134 change blocks. 
467 lines changed or deleted 564 lines changed or added


 winsafer.h (6.1.7601.23418-Windows_7.0)   winsafer.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 20 skipping to change at line 20
This file implements the publicly exported functions, data types, This file implements the publicly exported functions, data types,
data structures, and definitions usable by programs that directly data structures, and definitions usable by programs that directly
interact with the Windows SAFER APIs. interact with the Windows SAFER APIs.
--*/ --*/
#ifndef _WINSAFER_H #ifndef _WINSAFER_H
#define _WINSAFER_H #define _WINSAFER_H
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <guiddef.h> #include <guiddef.h>
#include <wincrypt.h> #include <wincrypt.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// //
// Opaque datatype for representing handles to Safer objects. // Opaque datatype for representing handles to Safer objects.
// //
skipping to change at line 83 skipping to change at line 88
// //
// Flags for specifying what criteria within SAFER_CODE_PROPERTIES to evaluate // Flags for specifying what criteria within SAFER_CODE_PROPERTIES to evaluate
// when finding code identity with SaferIdentifyLevel. // when finding code identity with SaferIdentifyLevel.
// //
#define SAFER_CRITERIA_IMAGEPATH 0x00001 #define SAFER_CRITERIA_IMAGEPATH 0x00001
#define SAFER_CRITERIA_NOSIGNEDHASH 0x00002 #define SAFER_CRITERIA_NOSIGNEDHASH 0x00002
#define SAFER_CRITERIA_IMAGEHASH 0x00004 #define SAFER_CRITERIA_IMAGEHASH 0x00004
#define SAFER_CRITERIA_AUTHENTICODE 0x00008 #define SAFER_CRITERIA_AUTHENTICODE 0x00008
#define SAFER_CRITERIA_URLZONE 0x00010 #define SAFER_CRITERIA_URLZONE 0x00010
#define SAFER_CRITERIA_APPX_PACKAGE 0x00020
#define SAFER_CRITERIA_IMAGEPATH_NT 0x01000 #define SAFER_CRITERIA_IMAGEPATH_NT 0x01000
// //
// Code image information structure passed to SaferIdentifyLevel. // Code image information structure passed to SaferIdentifyLevel.
// //
#include <pshpack8.h> #include <pshpack8.h>
typedef struct _SAFER_CODE_PROPERTIES typedef struct _SAFER_CODE_PROPERTIES_V1
{ {
// //
// Must be initialized to be the size of this structure, // Must be initialized to be the size of this structure,
// for the purposes of future/backwards compatibility. // for the purposes of future/backwards compatibility.
// //
DWORD cbSize; DWORD cbSize;
// //
skipping to change at line 177 skipping to change at line 183
// //
// Optionally gives the arguments used for Authenticode signer // Optionally gives the arguments used for Authenticode signer
// certificate verification. These arguments are supplied to the // certificate verification. These arguments are supplied to the
// WinVerifyTrust() API and control the user-interface prompting // WinVerifyTrust() API and control the user-interface prompting
// to accept untrusted certificates. // to accept untrusted certificates.
// //
HWND hWndParent; HWND hWndParent;
DWORD dwWVTUIChoice; DWORD dwWVTUIChoice;
} SAFER_CODE_PROPERTIES, *PSAFER_CODE_PROPERTIES; } SAFER_CODE_PROPERTIES_V1, *PSAFER_CODE_PROPERTIES_V1;
typedef struct _SAFER_CODE_PROPERTIES_V2
{
//
// Begin SAFER_CODE_PROPERTIES_V1
// These must be present for backwards compatability
//
//
// Must be initialized to be the size of this structure,
// for the purposes of future/backwards compatibility.
//
DWORD cbSize;
//
// Must be initialized to the types of criteria that should
// be considered when evaluating this structure. This can be
// a combination of the SAFER_CRITERIA_xxxx flags. If not enough
// of the structure elements needed to evaluate the criteria
// types indicated were supplied, then some of those criteria
// flags may be silently ignored. Specifying 0 for this value
// will cause the entire structure's contents to be ignored.
//
DWORD dwCheckFlags;
//
// Optionally specifies the fully-qualified path and filename
// to be used for discrimination checks based on the path.
// The ImagePath will additionally be used to open and read the
// file to identify any other discrimination criteria that was
// unsupplied in this structure.
//
LPCWSTR ImagePath;
//
// Optionally specifies a file handle that has been opened to
// code image with at least GENERIC_READ access. The handle will
// be used instead of explicitly opening the file again to compute
// other discrimination criteria that was unsupplied in this structure.
//
HANDLE hImageFileHandle;
//
// Optionally specifies the pre-determined Internet Explorer
// security zone. These enums are defined within urlmon.h
// For example: URLZONE_LOCAL_MACHINE, URLZONE_INTRANET,
// URLZONE_TRUSTED, URLZONE_INTERNET, or URLZONE_UNTRUSTED.
//
DWORD UrlZoneId;
//
// Optionally specifies the pre-computed hash of the image.
// The supplied hash is interpreted as being valid if ImageSize
// is non-zero and dwImageHashSize is non-zero and HashAlgorithm
// represents a valid hashing algorithm from wincrypt.h
//
// If the supplied hash fails to meet the conditions above, then
// the hash will be automatically computed against:
// 1) by using ImageSize and pByteBlock if both are non-zero.
// 2) by using hImageFileHandle if it is non-null.
// 3) by attempting to open ImagePath if it is non-null.
//
BYTE ImageHash[SAFER_MAX_HASH_SIZE];
DWORD dwImageHashSize;
LARGE_INTEGER ImageSize;
ALG_ID HashAlgorithm;
//
// Optionally specifies a memory block of memory representing
// the image for which the trust is being requested for. When
// this member is specified, ImageSize must also be supplied.
//
LPBYTE pByteBlock;
//
// Optionally gives the arguments used for Authenticode signer
// certificate verification. These arguments are supplied to the
// WinVerifyTrust() API and control the user-interface prompting
// to accept untrusted certificates.
//
HWND hWndParent;
DWORD dwWVTUIChoice;
//
// End SAFER_CODE_PROPERTIES_V1
//
//
// Package properties for Modern applications
//
LPCWSTR PackageMoniker;
LPCWSTR PackagePublisher;
LPCWSTR PackageName;
ULONG64 PackageVersion;
BOOL PackageIsFramework;
} SAFER_CODE_PROPERTIES_V2, *PSAFER_CODE_PROPERTIES_V2;
typedef SAFER_CODE_PROPERTIES_V2 SAFER_CODE_PROPERTIES, *PSAFER_CODE_PROPERTIES;
#include <poppack.h> #include <poppack.h>
// //
// Masks for the per-identity WinSafer flags // Masks for the per-identity WinSafer flags
// //
#define SAFER_POLICY_JOBID_MASK 0xFF000000 #define SAFER_POLICY_JOBID_MASK 0xFF000000
#define SAFER_POLICY_JOBID_CONSTRAINED 0x04000000 #define SAFER_POLICY_JOBID_CONSTRAINED 0x04000000
#define SAFER_POLICY_JOBID_UNTRUSTED 0x03000000 #define SAFER_POLICY_JOBID_UNTRUSTED 0x03000000
skipping to change at line 502 skipping to change at line 617
// //
// Functions related to querying and setting the global policy // Functions related to querying and setting the global policy
// controls to disable transparent enforcement, and perform level // controls to disable transparent enforcement, and perform level
// enumeration operations. // enumeration operations.
// //
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferGetPolicyInformation( SaferGetPolicyInformation(
__in DWORD dwScopeId, _In_ DWORD dwScopeId,
__in SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass, _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
__in DWORD InfoBufferSize, _In_ DWORD InfoBufferSize,
__out_bcount(InfoBufferSize) PVOID InfoBuffer, _Out_writes_bytes_(InfoBufferSize) PVOID InfoBuffer,
__out PDWORD InfoBufferRetSize, _Out_ PDWORD InfoBufferRetSize,
__reserved LPVOID lpReserved _Reserved_ LPVOID lpReserved
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferSetPolicyInformation( SaferSetPolicyInformation(
__in DWORD dwScopeId, _In_ DWORD dwScopeId,
__in SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass, _In_ SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
__in DWORD InfoBufferSize, _In_ DWORD InfoBufferSize,
__in_bcount(InfoBufferSize) PVOID InfoBuffer, _In_reads_bytes_(InfoBufferSize) PVOID InfoBuffer,
__reserved LPVOID lpReserved _Reserved_ LPVOID lpReserved
); );
// //
// Functions to open or close a handle to a Safer Level. // Functions to open or close a handle to a Safer Level.
// //
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferCreateLevel( SaferCreateLevel(
__in DWORD dwScopeId, _In_ DWORD dwScopeId,
__in DWORD dwLevelId, _In_ DWORD dwLevelId,
__in DWORD OpenFlags, _In_ DWORD OpenFlags,
__deref_out SAFER_LEVEL_HANDLE * pLevelHandle, _Outptr_ SAFER_LEVEL_HANDLE * pLevelHandle,
__reserved LPVOID lpReserved _Reserved_ LPVOID lpReserved
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferCloseLevel( SaferCloseLevel(
__in SAFER_LEVEL_HANDLE hLevelHandle _In_ SAFER_LEVEL_HANDLE hLevelHandle
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferIdentifyLevel( SaferIdentifyLevel(
__in DWORD dwNumProperties, _In_ DWORD dwNumProperties,
__in_ecount_opt(dwNumProperties) PSAFER_CODE_PROPERTIES pCodeProperties, _In_reads_opt_(dwNumProperties) PSAFER_CODE_PROPERTIES pCodeProperties,
__deref_out SAFER_LEVEL_HANDLE * pLevelHandle, _Outptr_ SAFER_LEVEL_HANDLE * pLevelHandle,
__in_opt LPVOID lpReserved _In_opt_ LPVOID lpReserved
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferComputeTokenFromLevel( SaferComputeTokenFromLevel(
__in SAFER_LEVEL_HANDLE LevelHandle, _In_ SAFER_LEVEL_HANDLE LevelHandle,
__in_opt HANDLE InAccessToken, _In_opt_ HANDLE InAccessToken,
__out PHANDLE OutAccessToken, _Out_ PHANDLE OutAccessToken,
__in DWORD dwFlags, _In_ DWORD dwFlags,
__inout_opt LPVOID lpReserved _Inout_opt_ LPVOID lpReserved
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferGetLevelInformation( SaferGetLevelInformation(
__in SAFER_LEVEL_HANDLE LevelHandle, _In_ SAFER_LEVEL_HANDLE LevelHandle,
__in SAFER_OBJECT_INFO_CLASS dwInfoType, _In_ SAFER_OBJECT_INFO_CLASS dwInfoType,
__out_bcount_opt(dwInBufferSize) LPVOID lpQueryBuffer, _Out_writes_bytes_opt_(dwInBufferSize) LPVOID lpQueryBuffer,
__in DWORD dwInBufferSize, _In_ DWORD dwInBufferSize,
__out LPDWORD lpdwOutBufferSize _Out_ LPDWORD lpdwOutBufferSize
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferSetLevelInformation( SaferSetLevelInformation(
__in SAFER_LEVEL_HANDLE LevelHandle, _In_ SAFER_LEVEL_HANDLE LevelHandle,
__in SAFER_OBJECT_INFO_CLASS dwInfoType, _In_ SAFER_OBJECT_INFO_CLASS dwInfoType,
__in_bcount(dwInBufferSize) LPVOID lpQueryBuffer, _In_reads_bytes_(dwInBufferSize) LPVOID lpQueryBuffer,
__in DWORD dwInBufferSize _In_ DWORD dwInBufferSize
); );
// //
// This function performs logging of messages to the Application // This function performs logging of messages to the Application
// event log. This is called by the hooks within CreateProcess, // event log. This is called by the hooks within CreateProcess,
// ShellExecute and cmd when a lower trust evaluation result occurs. // ShellExecute and cmd when a lower trust evaluation result occurs.
// //
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferRecordEventLogEntry( SaferRecordEventLogEntry(
__in SAFER_LEVEL_HANDLE hLevel, _In_ SAFER_LEVEL_HANDLE hLevel,
__in LPCWSTR szTargetPath, _In_ LPCWSTR szTargetPath,
__reserved LPVOID lpReserved _Reserved_ LPVOID lpReserved
); );
WINADVAPI WINADVAPI
BOOL WINAPI BOOL WINAPI
SaferiIsExecutableFileType( SaferiIsExecutableFileType(
__in LPCWSTR szFullPathname, _In_ LPCWSTR szFullPathname,
__in BOOLEAN bFromShellExecute _In_ BOOLEAN bFromShellExecute
); );
#define SRP_POLICY_EXE L"EXE" #define SRP_POLICY_EXE L"EXE"
#define SRP_POLICY_DLL L"DLL" #define SRP_POLICY_DLL L"DLL"
#define SRP_POLICY_MSI L"MSI" #define SRP_POLICY_MSI L"MSI"
#define SRP_POLICY_SCRIPT L"SCRIPT" #define SRP_POLICY_SCRIPT L"SCRIPT"
#define SRP_POLICY_SHELL L"SHELL" #define SRP_POLICY_SHELL L"SHELL"
#define SRP_POLICY_NOV2 L"IGNORESRPV2" #define SRP_POLICY_NOV2 L"IGNORESRPV2"
#define SRP_POLICY_APPX L"APPX"
#define SRP_POLICY_WLDPMSI L"WLDPMSI"
#define SRP_POLICY_WLDPSCRIPT L"WLDPSCRIPT"
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif #endif
 End of changes. 16 change blocks. 
48 lines changed or deleted 170 lines changed or added


 winsvc.h (6.1.7601.23418-Windows_7.0)   winsvc.h (6.3.9600.17415-Windows_8.1) 
skipping to change at line 21 skipping to change at line 21
Header file for the Service Control Manager Header file for the Service Control Manager
Environment: Environment:
User Mode - Win32 User Mode - Win32
--*/ --*/
#ifndef _WINSVC_ #ifndef _WINSVC_
#define _WINSVC_ #define _WINSVC_
#include <winapifamily.h>
// //
// Define API decoration for direct importing of DLL references. // Define API decoration for direct importing of DLL references.
// //
#if !defined(WINADVAPI) #if !defined(WINADVAPI)
#if !defined(_ADVAPI32_) #if !defined(_ADVAPI32_)
#define WINADVAPI DECLSPEC_IMPORT #define WINADVAPI DECLSPEC_IMPORT
#else #else
#define WINADVAPI #define WINADVAPI
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// //
// Constants // Constants
// //
// //
// Service database names // Service database names
// //
#define SERVICES_ACTIVE_DATABASEW L"ServicesActive" #define SERVICES_ACTIVE_DATABASEW L"ServicesActive"
#define SERVICES_FAILED_DATABASEW L"ServicesFailed" #define SERVICES_FAILED_DATABASEW L"ServicesFailed"
skipping to change at line 192 skipping to change at line 197
// //
#define SERVICE_CONFIG_DESCRIPTION 1 #define SERVICE_CONFIG_DESCRIPTION 1
#define SERVICE_CONFIG_FAILURE_ACTIONS 2 #define SERVICE_CONFIG_FAILURE_ACTIONS 2
#define SERVICE_CONFIG_DELAYED_AUTO_START_INFO 3 #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO 3
#define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG 4 #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG 4
#define SERVICE_CONFIG_SERVICE_SID_INFO 5 #define SERVICE_CONFIG_SERVICE_SID_INFO 5
#define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6 #define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6
#define SERVICE_CONFIG_PRESHUTDOWN_INFO 7 #define SERVICE_CONFIG_PRESHUTDOWN_INFO 7
#define SERVICE_CONFIG_TRIGGER_INFO 8 #define SERVICE_CONFIG_TRIGGER_INFO 8
#define SERVICE_CONFIG_PREFERRED_NODE 9 #define SERVICE_CONFIG_PREFERRED_NODE 9
// reserved 10
// reserved 11
#define SERVICE_CONFIG_LAUNCH_PROTECTED 12
// //
// Info levels for NotifyServiceStatusChange // Info levels for NotifyServiceStatusChange
// //
#define SERVICE_NOTIFY_STATUS_CHANGE_1 1 #define SERVICE_NOTIFY_STATUS_CHANGE_1 1
#define SERVICE_NOTIFY_STATUS_CHANGE_2 2 #define SERVICE_NOTIFY_STATUS_CHANGE_2 2
#define SERVICE_NOTIFY_STATUS_CHANGE SERVICE_NOTIFY_STATUS_CHANGE_2 #define SERVICE_NOTIFY_STATUS_CHANGE SERVICE_NOTIFY_STATUS_CHANGE_2
// //
skipping to change at line 296 skipping to change at line 304
#define SERVICE_SID_TYPE_RESTRICTED ( 0x00000002 | S ERVICE_SID_TYPE_UNRESTRICTED ) #define SERVICE_SID_TYPE_RESTRICTED ( 0x00000002 | S ERVICE_SID_TYPE_UNRESTRICTED )
// //
// Service trigger types // Service trigger types
// //
#define SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL 1 #define SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL 1
#define SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY 2 #define SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY 2
#define SERVICE_TRIGGER_TYPE_DOMAIN_JOIN 3 #define SERVICE_TRIGGER_TYPE_DOMAIN_JOIN 3
#define SERVICE_TRIGGER_TYPE_FIREWALL_PORT_EVENT 4 #define SERVICE_TRIGGER_TYPE_FIREWALL_PORT_EVENT 4
#define SERVICE_TRIGGER_TYPE_GROUP_POLICY 5 #define SERVICE_TRIGGER_TYPE_GROUP_POLICY 5
#define SERVICE_TRIGGER_TYPE_NETWORK_ENDPOINT 6
#define SERVICE_TRIGGER_TYPE_CUSTOM_SYSTEM_STATE_CHANGE 7
#define SERVICE_TRIGGER_TYPE_CUSTOM 20 #define SERVICE_TRIGGER_TYPE_CUSTOM 20
// //
// Service trigger data types // Service trigger data types
// //
#define SERVICE_TRIGGER_DATA_TYPE_BINARY 1 #define SERVICE_TRIGGER_DATA_TYPE_BINARY 1
#define SERVICE_TRIGGER_DATA_TYPE_STRING 2 #define SERVICE_TRIGGER_DATA_TYPE_STRING 2
#define SERVICE_TRIGGER_DATA_TYPE_LEVEL 3
#define SERVICE_TRIGGER_DATA_TYPE_KEYWORD_ANY 4
#define SERVICE_TRIGGER_DATA_TYPE_KEYWORD_ALL 5
//
// Service start reason
//
#define SERVICE_START_REASON_DEMAND 0x00000001
#define SERVICE_START_REASON_AUTO 0x00000002
#define SERVICE_START_REASON_TRIGGER 0x00000004
#define SERVICE_START_REASON_RESTART_ON_FAILURE 0x00000008
#define SERVICE_START_REASON_DELAYEDAUTO 0x00000010
//
// Service dynamic information levels
//
#define SERVICE_DYNAMIC_INFORMATION_LEVEL_START_REASON 1
//
// Service LaunchProtected types supported
//
#define SERVICE_LAUNCH_PROTECTED_NONE 0
#define SERVICE_LAUNCH_PROTECTED_WINDOWS 1
#define SERVICE_LAUNCH_PROTECTED_WINDOWS_LIGHT 2
#define SERVICE_LAUNCH_PROTECTED_ANTIMALWARE_LIGHT 3
// //
// NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID & NETWORK_MANAGER_LAST_IP_ADDR ESS_REMOVAL_GUID are used with // NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID & NETWORK_MANAGER_LAST_IP_ADDR ESS_REMOVAL_GUID are used with
// SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY trigger. // SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY trigger.
// //
DEFINE_GUID ( /* 4f27f2de-14e2-430b-a549-7cd48cbc8245 */ DEFINE_GUID ( /* 4f27f2de-14e2-430b-a549-7cd48cbc8245 */
NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID, NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID,
0x4f27f2de, 0x4f27f2de,
0x14e2, 0x14e2,
0x430b, 0x430b,
skipping to change at line 384 skipping to change at line 419
DEFINE_GUID ( /* 54FB46C8-F089-464C-B1FD-59D1B62C3B50 */ DEFINE_GUID ( /* 54FB46C8-F089-464C-B1FD-59D1B62C3B50 */
USER_POLICY_PRESENT_GUID, USER_POLICY_PRESENT_GUID,
0x54FB46C8, 0x54FB46C8,
0xF089, 0xF089,
0x464C, 0x464C,
0xB1, 0xFD, 0x59, 0xD1, 0xB6, 0x2C, 0x3B, 0x50 0xB1, 0xFD, 0x59, 0xD1, 0xB6, 0x2C, 0x3B, 0x50
); );
// //
// RPC_INTERFACE_EVENT_GUID, NAMED_PIPE_EVENT_GUID & TCP_PORT_EVENT_GUID are
// used with SERVICE_TRIGGER_TYPE_NETWORK_ENDPOINT trigger.
DEFINE_GUID ( /* bc90d167-9470-4139-a9ba-be0bbbf5b74d */
RPC_INTERFACE_EVENT_GUID,
0xbc90d167,
0x9470,
0x4139,
0xa9, 0xba, 0xbe, 0x0b, 0xbb, 0xf5, 0xb7, 0x4d
);
DEFINE_GUID ( /* 1f81d131-3fac-4537-9e0c-7e7b0c2f4b55 */
NAMED_PIPE_EVENT_GUID,
0x1f81d131,
0x3fac,
0x4537,
0x9e, 0x0c, 0x7e, 0x7b, 0x0c, 0x2f, 0x4b, 0x55
);
//
// CUSTOM_SYSTEM_STATE_CHANGE_EVENT_GUID is used with SERVICE_TRIGGER_TYPE_CUSTO
M_SYSTEM_STATE_CHANGE
//
DEFINE_GUID ( /* 2d7a2816-0c5e-45fc-9ce7-570e5ecde9c9 */
CUSTOM_SYSTEM_STATE_CHANGE_EVENT_GUID,
0x2d7a2816,
0x0c5e,
0x45fc,
0x9c, 0xe7, 0x57, 0x0e, 0x5e, 0xcd, 0xe9, 0xc9
);
//
// Service notification trigger identifier
//
typedef struct
{
DWORD Data[2];
} SERVICE_TRIGGER_CUSTOM_STATE_ID;
typedef struct _SERVICE_CUSTOM_SYSTEM_STATE_CHANGE_DATA_ITEM {
union {
SERVICE_TRIGGER_CUSTOM_STATE_ID CustomStateId;
struct {
DWORD DataOffset;
BYTE Data[1];
} s;
} u;
} SERVICE_CUSTOM_SYSTEM_STATE_CHANGE_DATA_ITEM, *LPSERVICE_CUSTOM_SYSTEM_STATE_C
HANGE_DATA_ITEM;
//
// Service trigger actions // Service trigger actions
// //
#define SERVICE_TRIGGER_ACTION_SERVICE_START 1 #define SERVICE_TRIGGER_ACTION_SERVICE_START 1
#define SERVICE_TRIGGER_ACTION_SERVICE_STOP 2 #define SERVICE_TRIGGER_ACTION_SERVICE_STOP 2
// //
// argv[1] passed into ServiceMain of trigger started services // argv[1] passed into ServiceMain of trigger started services
// //
#define SERVICE_TRIGGER_STARTED_ARGUMENT L"TriggerStarted" #define SERVICE_TRIGGER_STARTED_ARGUMENT L"TriggerStarted"
skipping to change at line 579 skipping to change at line 663
// //
// Time change information // Time change information
// //
typedef struct _SERVICE_TIMECHANGE_INFO { typedef struct _SERVICE_TIMECHANGE_INFO {
LARGE_INTEGER liNewTime; // New time LARGE_INTEGER liNewTime; // New time
LARGE_INTEGER liOldTime; // Old time LARGE_INTEGER liOldTime; // Old time
} SERVICE_TIMECHANGE_INFO, *PSERVICE_TIMECHANGE_INFO; } SERVICE_TIMECHANGE_INFO, *PSERVICE_TIMECHANGE_INFO;
// //
// Service launch protected setting
//
typedef struct _SERVICE_LAUNCH_PROTECTED_INFO {
DWORD dwLaunchProtected; // Service launch protected
} SERVICE_LAUNCH_PROTECTED_INFO, *PSERVICE_LAUNCH_PROTECTED_INFO;
//
// Handle Types // Handle Types
// //
DECLARE_HANDLE(SC_HANDLE); DECLARE_HANDLE(SC_HANDLE);
typedef SC_HANDLE *LPSC_HANDLE; typedef SC_HANDLE *LPSC_HANDLE;
DECLARE_HANDLE(SERVICE_STATUS_HANDLE); DECLARE_HANDLE(SERVICE_STATUS_HANDLE);
// //
// Info levels for QueryServiceStatusEx // Info levels for QueryServiceStatusEx
skipping to change at line 730 skipping to change at line 821
typedef LPQUERY_SERVICE_CONFIGW LPQUERY_SERVICE_CONFIG; typedef LPQUERY_SERVICE_CONFIGW LPQUERY_SERVICE_CONFIG;
#else #else
typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG; typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG;
typedef LPQUERY_SERVICE_CONFIGA LPQUERY_SERVICE_CONFIG; typedef LPQUERY_SERVICE_CONFIGA LPQUERY_SERVICE_CONFIG;
#endif // UNICODE #endif // UNICODE
// //
// Function Prototype for the Service Main Function // Function Prototype for the Service Main Function
// //
typedef VOID WINAPI SERVICE_MAIN_FUNCTIONW (
DWORD dwNumServicesArgs,
LPWSTR *lpServiceArgVectors
);
typedef VOID WINAPI SERVICE_MAIN_FUNCTIONA (
DWORD dwNumServicesArgs,
LPTSTR *lpServiceArgVectors
);
#ifdef UNICODE
#define SERVICE_MAIN_FUNCTION SERVICE_MAIN_FUNCTIONW
#else
#define SERVICE_MAIN_FUNCTION SERVICE_MAIN_FUNCTIONA
#endif //UNICODE
typedef VOID (WINAPI *LPSERVICE_MAIN_FUNCTIONW)( typedef VOID (WINAPI *LPSERVICE_MAIN_FUNCTIONW)(
DWORD dwNumServicesArgs, DWORD dwNumServicesArgs,
LPWSTR *lpServiceArgVectors LPWSTR *lpServiceArgVectors
); );
typedef VOID (WINAPI *LPSERVICE_MAIN_FUNCTIONA)( typedef VOID (WINAPI *LPSERVICE_MAIN_FUNCTIONA)(
DWORD dwNumServicesArgs, DWORD dwNumServicesArgs,
LPSTR *lpServiceArgVectors LPSTR *lpServiceArgVectors
); );
skipping to change at line 770 skipping to change at line 877
typedef LPSERVICE_TABLE_ENTRYW LPSERVICE_TABLE_ENTRY; typedef LPSERVICE_TABLE_ENTRYW LPSERVICE_TABLE_ENTRY;
#else #else
typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY; typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY;
typedef LPSERVICE_TABLE_ENTRYA LPSERVICE_TABLE_ENTRY; typedef LPSERVICE_TABLE_ENTRYA LPSERVICE_TABLE_ENTRY;
#endif // UNICODE #endif // UNICODE
// //
// Prototype for the Service Control Handler Function // Prototype for the Service Control Handler Function
// //
typedef VOID WINAPI HANDLER_FUNCTION (
DWORD dwControl
);
typedef DWORD WINAPI HANDLER_FUNCTION_EX (
DWORD dwControl,
DWORD dwEventType,
LPVOID lpEventData,
LPVOID lpContext
);
typedef VOID (WINAPI *LPHANDLER_FUNCTION)( typedef VOID (WINAPI *LPHANDLER_FUNCTION)(
DWORD dwControl DWORD dwControl
); );
typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)( typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)(
DWORD dwControl, DWORD dwControl,
DWORD dwEventType, DWORD dwEventType,
LPVOID lpEventData, LPVOID lpEventData,
LPVOID lpContext LPVOID lpContext
); );
// //
// Service notification parameters // Service notification parameters
// //
typedef typedef
VOID VOID
( CALLBACK * PFN_SC_NOTIFY_CALLBACK ) ( ( CALLBACK * PFN_SC_NOTIFY_CALLBACK ) (
__in PVOID pParameter _In_ PVOID pParameter
); );
// //
// Each new notify structure is a superset of the older version // Each new notify structure is a superset of the older version
// //
typedef struct _SERVICE_NOTIFY_1 { typedef struct _SERVICE_NOTIFY_1 {
DWORD dwVersion; DWORD dwVersion;
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback; PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback;
PVOID pContext; PVOID pContext;
DWORD dwNotificationStatus; DWORD dwNotificationStatus;
skipping to change at line 861 skipping to change at line 979
SERVICE_STATUS_PROCESS ServiceStatus; SERVICE_STATUS_PROCESS ServiceStatus;
} SERVICE_CONTROL_STATUS_REASON_PARAMSW, *PSERVICE_CONTROL_STATUS_REASON_PARAMSW ; } SERVICE_CONTROL_STATUS_REASON_PARAMSW, *PSERVICE_CONTROL_STATUS_REASON_PARAMSW ;
#ifdef UNICODE #ifdef UNICODE
typedef SERVICE_CONTROL_STATUS_REASON_PARAMSW SERVICE_CONTROL_STATUS_REASON_PARA MS; typedef SERVICE_CONTROL_STATUS_REASON_PARAMSW SERVICE_CONTROL_STATUS_REASON_PARA MS;
typedef PSERVICE_CONTROL_STATUS_REASON_PARAMSW PSERVICE_CONTROL_STATUS_REASON_PA RAMS; typedef PSERVICE_CONTROL_STATUS_REASON_PARAMSW PSERVICE_CONTROL_STATUS_REASON_PA RAMS;
#else #else
typedef SERVICE_CONTROL_STATUS_REASON_PARAMSA SERVICE_CONTROL_STATUS_REASON_PARA MS; typedef SERVICE_CONTROL_STATUS_REASON_PARAMSA SERVICE_CONTROL_STATUS_REASON_PARA MS;
typedef PSERVICE_CONTROL_STATUS_REASON_PARAMSA PSERVICE_CONTROL_STATUS_REASON_PA RAMS; typedef PSERVICE_CONTROL_STATUS_REASON_PARAMSA PSERVICE_CONTROL_STATUS_REASON_PA RAMS;
#endif // UNICODE #endif // UNICODE
//
// Service start reason
//
typedef struct _SERVICE_START_REASON {
DWORD dwReason;
} SERVICE_START_REASON, *PSERVICE_START_REASON;
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// API Function Prototypes // API Function Prototypes
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ChangeServiceConfigA( ChangeServiceConfigA(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwStartType, _In_ DWORD dwStartType,
__in DWORD dwErrorControl, _In_ DWORD dwErrorControl,
__in_opt LPCSTR lpBinaryPathName, _In_opt_ LPCSTR lpBinaryPathName,
__in_opt LPCSTR lpLoadOrderGroup, _In_opt_ LPCSTR lpLoadOrderGroup,
__out_opt LPDWORD lpdwTagId, _Out_opt_ LPDWORD lpdwTagId,
__in_opt LPCSTR lpDependencies, _In_opt_ LPCSTR lpDependencies,
__in_opt LPCSTR lpServiceStartName, _In_opt_ LPCSTR lpServiceStartName,
__in_opt LPCSTR lpPassword, _In_opt_ LPCSTR lpPassword,
__in_opt LPCSTR lpDisplayName _In_opt_ LPCSTR lpDisplayName
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ChangeServiceConfigW( ChangeServiceConfigW(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwStartType, _In_ DWORD dwStartType,
__in DWORD dwErrorControl, _In_ DWORD dwErrorControl,
__in_opt LPCWSTR lpBinaryPathName, _In_opt_ LPCWSTR lpBinaryPathName,
__in_opt LPCWSTR lpLoadOrderGroup, _In_opt_ LPCWSTR lpLoadOrderGroup,
__out_opt LPDWORD lpdwTagId, _Out_opt_ LPDWORD lpdwTagId,
__in_opt LPCWSTR lpDependencies, _In_opt_ LPCWSTR lpDependencies,
__in_opt LPCWSTR lpServiceStartName, _In_opt_ LPCWSTR lpServiceStartName,
__in_opt LPCWSTR lpPassword, _In_opt_ LPCWSTR lpPassword,
__in_opt LPCWSTR lpDisplayName _In_opt_ LPCWSTR lpDisplayName
); );
#ifdef UNICODE #ifdef UNICODE
#define ChangeServiceConfig ChangeServiceConfigW #define ChangeServiceConfig ChangeServiceConfigW
#else #else
#define ChangeServiceConfig ChangeServiceConfigA #define ChangeServiceConfig ChangeServiceConfigA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ChangeServiceConfig2A( ChangeServiceConfig2A(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__in_opt LPVOID lpInfo _In_opt_ LPVOID lpInfo
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ChangeServiceConfig2W( ChangeServiceConfig2W(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__in_opt LPVOID lpInfo _In_opt_ LPVOID lpInfo
); );
#ifdef UNICODE #ifdef UNICODE
#define ChangeServiceConfig2 ChangeServiceConfig2W #define ChangeServiceConfig2 ChangeServiceConfig2W
#else #else
#define ChangeServiceConfig2 ChangeServiceConfig2A #define ChangeServiceConfig2 ChangeServiceConfig2A
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CloseServiceHandle( CloseServiceHandle(
__in SC_HANDLE hSCObject _In_ SC_HANDLE hSCObject
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ControlService( ControlService(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwControl, _In_ DWORD dwControl,
__out LPSERVICE_STATUS lpServiceStatus _Out_ LPSERVICE_STATUS lpServiceStatus
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SC_HANDLE SC_HANDLE
WINAPI WINAPI
CreateServiceA( CreateServiceA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCSTR lpServiceName, _In_ LPCSTR lpServiceName,
__in_opt LPCSTR lpDisplayName, _In_opt_ LPCSTR lpDisplayName,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwStartType, _In_ DWORD dwStartType,
__in DWORD dwErrorControl, _In_ DWORD dwErrorControl,
__in_opt LPCSTR lpBinaryPathName, _In_opt_ LPCSTR lpBinaryPathName,
__in_opt LPCSTR lpLoadOrderGroup, _In_opt_ LPCSTR lpLoadOrderGroup,
__out_opt LPDWORD lpdwTagId, _Out_opt_ LPDWORD lpdwTagId,
__in_opt LPCSTR lpDependencies, _In_opt_ LPCSTR lpDependencies,
__in_opt LPCSTR lpServiceStartName, _In_opt_ LPCSTR lpServiceStartName,
__in_opt LPCSTR lpPassword _In_opt_ LPCSTR lpPassword
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SC_HANDLE SC_HANDLE
WINAPI WINAPI
CreateServiceW( CreateServiceW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCWSTR lpServiceName, _In_ LPCWSTR lpServiceName,
__in_opt LPCWSTR lpDisplayName, _In_opt_ LPCWSTR lpDisplayName,
__in DWORD dwDesiredAccess, _In_ DWORD dwDesiredAccess,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwStartType, _In_ DWORD dwStartType,
__in DWORD dwErrorControl, _In_ DWORD dwErrorControl,
__in_opt LPCWSTR lpBinaryPathName, _In_opt_ LPCWSTR lpBinaryPathName,
__in_opt LPCWSTR lpLoadOrderGroup, _In_opt_ LPCWSTR lpLoadOrderGroup,
__out_opt LPDWORD lpdwTagId, _Out_opt_ LPDWORD lpdwTagId,
__in_opt LPCWSTR lpDependencies, _In_opt_ LPCWSTR lpDependencies,
__in_opt LPCWSTR lpServiceStartName, _In_opt_ LPCWSTR lpServiceStartName,
__in_opt LPCWSTR lpPassword _In_opt_ LPCWSTR lpPassword
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateService CreateServiceW #define CreateService CreateServiceW
#else #else
#define CreateService CreateServiceA #define CreateService CreateServiceA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
DeleteService( DeleteService(
__in SC_HANDLE hService _In_ SC_HANDLE hService
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EnumDependentServicesA( EnumDependentServicesA(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwServiceState, _In_ DWORD dwServiceState,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPENUM_SERVICE_STATUSA lpServices, LPENUM_SERVICE_STATUSA lpServices,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded, _Out_ LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned _Out_ LPDWORD lpServicesReturned
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EnumDependentServicesW( EnumDependentServicesW(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwServiceState, _In_ DWORD dwServiceState,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPENUM_SERVICE_STATUSW lpServices, LPENUM_SERVICE_STATUSW lpServices,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded, _Out_ LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned _Out_ LPDWORD lpServicesReturned
); );
#ifdef UNICODE #ifdef UNICODE
#define EnumDependentServices EnumDependentServicesW #define EnumDependentServices EnumDependentServicesW
#else #else
#define EnumDependentServices EnumDependentServicesA #define EnumDependentServices EnumDependentServicesA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EnumServicesStatusA( EnumServicesStatusA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwServiceState, _In_ DWORD dwServiceState,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPENUM_SERVICE_STATUSA lpServices, LPENUM_SERVICE_STATUSA lpServices,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded, _Out_ LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned, _Out_ LPDWORD lpServicesReturned,
__inout_opt LPDWORD lpResumeHandle _Inout_opt_ LPDWORD lpResumeHandle
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EnumServicesStatusW( EnumServicesStatusW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwServiceState, _In_ DWORD dwServiceState,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPENUM_SERVICE_STATUSW lpServices, LPENUM_SERVICE_STATUSW lpServices,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded, _Out_ LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned, _Out_ LPDWORD lpServicesReturned,
__inout_opt LPDWORD lpResumeHandle _Inout_opt_ LPDWORD lpResumeHandle
); );
#ifdef UNICODE #ifdef UNICODE
#define EnumServicesStatus EnumServicesStatusW #define EnumServicesStatus EnumServicesStatusW
#else #else
#define EnumServicesStatus EnumServicesStatusA #define EnumServicesStatus EnumServicesStatusA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EnumServicesStatusExA( EnumServicesStatusExA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in SC_ENUM_TYPE InfoLevel, _In_ SC_ENUM_TYPE InfoLevel,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwServiceState, _In_ DWORD dwServiceState,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPBYTE lpServices, LPBYTE lpServices,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded, _Out_ LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned, _Out_ LPDWORD lpServicesReturned,
__inout_opt LPDWORD lpResumeHandle, _Inout_opt_ LPDWORD lpResumeHandle,
__in_opt LPCSTR pszGroupName _In_opt_ LPCSTR pszGroupName
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EnumServicesStatusExW( EnumServicesStatusExW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in SC_ENUM_TYPE InfoLevel, _In_ SC_ENUM_TYPE InfoLevel,
__in DWORD dwServiceType, _In_ DWORD dwServiceType,
__in DWORD dwServiceState, _In_ DWORD dwServiceState,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPBYTE lpServices, LPBYTE lpServices,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded, _Out_ LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned, _Out_ LPDWORD lpServicesReturned,
__inout_opt LPDWORD lpResumeHandle, _Inout_opt_ LPDWORD lpResumeHandle,
__in_opt LPCWSTR pszGroupName _In_opt_ LPCWSTR pszGroupName
); );
#ifdef UNICODE #ifdef UNICODE
#define EnumServicesStatusEx EnumServicesStatusExW #define EnumServicesStatusEx EnumServicesStatusExW
#else #else
#define EnumServicesStatusEx EnumServicesStatusExA #define EnumServicesStatusEx EnumServicesStatusExA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetServiceKeyNameA( GetServiceKeyNameA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCSTR lpDisplayName, _In_ LPCSTR lpDisplayName,
__out_ecount_opt(*lpcchBuffer) _Out_writes_opt_(*lpcchBuffer)
LPSTR lpServiceName, LPSTR lpServiceName,
__inout LPDWORD lpcchBuffer _Inout_ LPDWORD lpcchBuffer
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetServiceKeyNameW( GetServiceKeyNameW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCWSTR lpDisplayName, _In_ LPCWSTR lpDisplayName,
__out_ecount_opt(*lpcchBuffer) _Out_writes_opt_(*lpcchBuffer)
LPWSTR lpServiceName, LPWSTR lpServiceName,
__inout LPDWORD lpcchBuffer _Inout_ LPDWORD lpcchBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define GetServiceKeyName GetServiceKeyNameW #define GetServiceKeyName GetServiceKeyNameW
#else #else
#define GetServiceKeyName GetServiceKeyNameA #define GetServiceKeyName GetServiceKeyNameA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetServiceDisplayNameA( GetServiceDisplayNameA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCSTR lpServiceName, _In_ LPCSTR lpServiceName,
__out_ecount_opt(*lpcchBuffer) _Out_writes_opt_(*lpcchBuffer)
LPSTR lpDisplayName, LPSTR lpDisplayName,
__inout LPDWORD lpcchBuffer _Inout_ LPDWORD lpcchBuffer
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetServiceDisplayNameW( GetServiceDisplayNameW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCWSTR lpServiceName, _In_ LPCWSTR lpServiceName,
__out_ecount_opt(*lpcchBuffer) _Out_writes_opt_(*lpcchBuffer)
LPWSTR lpDisplayName, LPWSTR lpDisplayName,
__inout LPDWORD lpcchBuffer _Inout_ LPDWORD lpcchBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define GetServiceDisplayName GetServiceDisplayNameW #define GetServiceDisplayName GetServiceDisplayNameW
#else #else
#define GetServiceDisplayName GetServiceDisplayNameA #define GetServiceDisplayName GetServiceDisplayNameA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
SC_LOCK SC_LOCK
WINAPI WINAPI
LockServiceDatabase( LockServiceDatabase(
__in SC_HANDLE hSCManager _In_ SC_HANDLE hSCManager
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
NotifyBootConfigStatus( NotifyBootConfigStatus(
__in BOOL BootAcceptable _In_ BOOL BootAcceptable
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SC_HANDLE SC_HANDLE
WINAPI WINAPI
OpenSCManagerA( OpenSCManagerA(
__in_opt LPCSTR lpMachineName, _In_opt_ LPCSTR lpMachineName,
__in_opt LPCSTR lpDatabaseName, _In_opt_ LPCSTR lpDatabaseName,
__in DWORD dwDesiredAccess _In_ DWORD dwDesiredAccess
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SC_HANDLE SC_HANDLE
WINAPI WINAPI
OpenSCManagerW( OpenSCManagerW(
__in_opt LPCWSTR lpMachineName, _In_opt_ LPCWSTR lpMachineName,
__in_opt LPCWSTR lpDatabaseName, _In_opt_ LPCWSTR lpDatabaseName,
__in DWORD dwDesiredAccess _In_ DWORD dwDesiredAccess
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenSCManager OpenSCManagerW #define OpenSCManager OpenSCManagerW
#else #else
#define OpenSCManager OpenSCManagerA #define OpenSCManager OpenSCManagerA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SC_HANDLE SC_HANDLE
WINAPI WINAPI
OpenServiceA( OpenServiceA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCSTR lpServiceName, _In_ LPCSTR lpServiceName,
__in DWORD dwDesiredAccess _In_ DWORD dwDesiredAccess
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SC_HANDLE SC_HANDLE
WINAPI WINAPI
OpenServiceW( OpenServiceW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__in LPCWSTR lpServiceName, _In_ LPCWSTR lpServiceName,
__in DWORD dwDesiredAccess _In_ DWORD dwDesiredAccess
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenService OpenServiceW #define OpenService OpenServiceW
#else #else
#define OpenService OpenServiceA #define OpenService OpenServiceA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceConfigA( QueryServiceConfigA(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPQUERY_SERVICE_CONFIGA lpServiceConfig, LPQUERY_SERVICE_CONFIGA lpServiceConfig,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceConfigW( QueryServiceConfigW(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPQUERY_SERVICE_CONFIGW lpServiceConfig, LPQUERY_SERVICE_CONFIGW lpServiceConfig,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
#ifdef UNICODE #ifdef UNICODE
#define QueryServiceConfig QueryServiceConfigW #define QueryServiceConfig QueryServiceConfigW
#else #else
#define QueryServiceConfig QueryServiceConfigA #define QueryServiceConfig QueryServiceConfigA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _When_(dwInfoLevel == SERVICE_CONFIG_DESCRIPTION,
_At_(cbBufSize, _In_range_(>=, sizeof(LPSERVICE_DESCRIPTIONA))))
_When_(dwInfoLevel == SERVICE_CONFIG_FAILURE_ACTIONS,
_At_(cbBufSize, _In_range_(>=, sizeof(LPSERVICE_FAILURE_ACTIONSA))))
_When_(dwInfoLevel == SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO,
_At_(cbBufSize, _In_range_(>=,
sizeof(LPSERVICE_REQUIRED_PRIVILEGES_INFOA))))
_Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceConfig2A( QueryServiceConfig2A(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPBYTE lpBuffer, LPBYTE lpBuffer,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
__checkReturn _When_(dwInfoLevel == SERVICE_CONFIG_DESCRIPTION,
_At_(cbBufSize, _In_range_(>=, sizeof(LPSERVICE_DESCRIPTIONW))))
_When_(dwInfoLevel == SERVICE_CONFIG_FAILURE_ACTIONS,
_At_(cbBufSize, _In_range_(>=, sizeof(LPSERVICE_FAILURE_ACTIONSW))))
_When_(dwInfoLevel == SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO,
_At_(cbBufSize, _In_range_(>=,
sizeof(LPSERVICE_REQUIRED_PRIVILEGES_INFOW))))
_Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceConfig2W( QueryServiceConfig2W(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPBYTE lpBuffer, LPBYTE lpBuffer,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
#ifdef UNICODE #ifdef UNICODE
#define QueryServiceConfig2 QueryServiceConfig2W #define QueryServiceConfig2 QueryServiceConfig2W
#else #else
#define QueryServiceConfig2 QueryServiceConfig2A #define QueryServiceConfig2 QueryServiceConfig2A
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceLockStatusA( QueryServiceLockStatusA(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus, LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceLockStatusW( QueryServiceLockStatusW(
__in SC_HANDLE hSCManager, _In_ SC_HANDLE hSCManager,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus, LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
#ifdef UNICODE #ifdef UNICODE
#define QueryServiceLockStatus QueryServiceLockStatusW #define QueryServiceLockStatus QueryServiceLockStatusW
#else #else
#define QueryServiceLockStatus QueryServiceLockStatusA #define QueryServiceLockStatus QueryServiceLockStatusA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceObjectSecurity( QueryServiceObjectSecurity(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in SECURITY_INFORMATION dwSecurityInformation, _In_ SECURITY_INFORMATION dwSecurityInformation,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
PSECURITY_DESCRIPTOR lpSecurityDescriptor, PSECURITY_DESCRIPTOR lpSecurityDescriptor,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceStatus( QueryServiceStatus(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__out LPSERVICE_STATUS lpServiceStatus _Out_ LPSERVICE_STATUS lpServiceStatus
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
QueryServiceStatusEx( QueryServiceStatusEx(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in SC_STATUS_TYPE InfoLevel, _In_ SC_STATUS_TYPE InfoLevel,
__out_bcount_opt(cbBufSize) _Out_writes_bytes_opt_(cbBufSize)
LPBYTE lpBuffer, LPBYTE lpBuffer,
__in DWORD cbBufSize, _In_ DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded _Out_ LPDWORD pcbBytesNeeded
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SERVICE_STATUS_HANDLE SERVICE_STATUS_HANDLE
WINAPI WINAPI
RegisterServiceCtrlHandlerA( RegisterServiceCtrlHandlerA(
__in LPCSTR lpServiceName, _In_ LPCSTR lpServiceName,
__in __callback _In_ __callback
LPHANDLER_FUNCTION lpHandlerProc LPHANDLER_FUNCTION lpHandlerProc
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SERVICE_STATUS_HANDLE SERVICE_STATUS_HANDLE
WINAPI WINAPI
RegisterServiceCtrlHandlerW( RegisterServiceCtrlHandlerW(
__in LPCWSTR lpServiceName, _In_ LPCWSTR lpServiceName,
__in __callback _In_ __callback
LPHANDLER_FUNCTION lpHandlerProc LPHANDLER_FUNCTION lpHandlerProc
); );
#ifdef UNICODE #ifdef UNICODE
#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW
#else #else
#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA
#endif // !UNICODE #endif // !UNICODE
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SERVICE_STATUS_HANDLE SERVICE_STATUS_HANDLE
WINAPI WINAPI
RegisterServiceCtrlHandlerExA( RegisterServiceCtrlHandlerExA(
__in LPCSTR lpServiceName, _In_ LPCSTR lpServiceName,
__in __callback _In_ __callback
LPHANDLER_FUNCTION_EX lpHandlerProc, LPHANDLER_FUNCTION_EX lpHandlerProc,
__in_opt LPVOID lpContext _In_opt_ LPVOID lpContext
); );
__checkReturn _Must_inspect_result_
WINADVAPI WINADVAPI
SERVICE_STATUS_HANDLE SERVICE_STATUS_HANDLE
WINAPI WINAPI
RegisterServiceCtrlHandlerExW( RegisterServiceCtrlHandlerExW(
__in LPCWSTR lpServiceName, _In_ LPCWSTR lpServiceName,
__in __callback _In_ __callback
LPHANDLER_FUNCTION_EX lpHandlerProc, LPHANDLER_FUNCTION_EX lpHandlerProc,
__in_opt LPVOID lpContext _In_opt_ LPVOID lpContext
); );
#ifdef UNICODE #ifdef UNICODE
#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW #define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW
#else #else
#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA #define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
SetServiceObjectSecurity( SetServiceObjectSecurity(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in SECURITY_INFORMATION dwSecurityInformation, _In_ SECURITY_INFORMATION dwSecurityInformation,
__in PSECURITY_DESCRIPTOR lpSecurityDescriptor _In_ PSECURITY_DESCRIPTOR lpSecurityDescriptor
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
SetServiceStatus( SetServiceStatus(
__in SERVICE_STATUS_HANDLE hServiceStatus, _In_ SERVICE_STATUS_HANDLE hServiceStatus,
__in LPSERVICE_STATUS lpServiceStatus _In_ LPSERVICE_STATUS lpServiceStatus
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
StartServiceCtrlDispatcherA( StartServiceCtrlDispatcherA(
__in CONST SERVICE_TABLE_ENTRYA *lpServiceStartTable _In_ CONST SERVICE_TABLE_ENTRYA *lpServiceStartTable
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
StartServiceCtrlDispatcherW( StartServiceCtrlDispatcherW(
__in CONST SERVICE_TABLE_ENTRYW *lpServiceStartTable _In_ CONST SERVICE_TABLE_ENTRYW *lpServiceStartTable
); );
#ifdef UNICODE #ifdef UNICODE
#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW
#else #else
#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
StartServiceA( StartServiceA(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwNumServiceArgs, _In_ DWORD dwNumServiceArgs,
__in_ecount_opt(dwNumServiceArgs) _In_reads_opt_(dwNumServiceArgs)
LPCSTR *lpServiceArgVectors LPCSTR *lpServiceArgVectors
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
StartServiceW( StartServiceW(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwNumServiceArgs, _In_ DWORD dwNumServiceArgs,
__in_ecount_opt(dwNumServiceArgs) _In_reads_opt_(dwNumServiceArgs)
LPCWSTR *lpServiceArgVectors LPCWSTR *lpServiceArgVectors
); );
#ifdef UNICODE #ifdef UNICODE
#define StartService StartServiceW #define StartService StartServiceW
#else #else
#define StartService StartServiceA #define StartService StartServiceA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
UnlockServiceDatabase( UnlockServiceDatabase(
__in SC_LOCK ScLock _In_ SC_LOCK ScLock
); );
#if (NTDDI_VERSION >= NTDDI_VISTA) #if (NTDDI_VERSION >= NTDDI_VISTA)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
NotifyServiceStatusChangeA ( NotifyServiceStatusChangeA (
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwNotifyMask, _In_ DWORD dwNotifyMask,
__in PSERVICE_NOTIFYA pNotifyBuffer _In_ PSERVICE_NOTIFYA pNotifyBuffer
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
NotifyServiceStatusChangeW ( NotifyServiceStatusChangeW (
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwNotifyMask, _In_ DWORD dwNotifyMask,
__in PSERVICE_NOTIFYW pNotifyBuffer _In_ PSERVICE_NOTIFYW pNotifyBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define NotifyServiceStatusChange NotifyServiceStatusChangeW #define NotifyServiceStatusChange NotifyServiceStatusChangeW
#else #else
#define NotifyServiceStatusChange NotifyServiceStatusChangeA #define NotifyServiceStatusChange NotifyServiceStatusChangeA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ControlServiceExA( ControlServiceExA(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwControl, _In_ DWORD dwControl,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__inout PVOID pControlParams _Inout_ PVOID pControlParams
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ControlServiceExW( ControlServiceExW(
__in SC_HANDLE hService, _In_ SC_HANDLE hService,
__in DWORD dwControl, _In_ DWORD dwControl,
__in DWORD dwInfoLevel, _In_ DWORD dwInfoLevel,
__inout PVOID pControlParams _Inout_ PVOID pControlParams
); );
#ifdef UNICODE #ifdef UNICODE
#define ControlServiceEx ControlServiceExW #define ControlServiceEx ControlServiceExW
#else #else
#define ControlServiceEx ControlServiceExA #define ControlServiceEx ControlServiceExA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI
BOOL
WINAPI
QueryServiceDynamicInformation (
_In_ SERVICE_STATUS_HANDLE hServiceStatus,
_In_ DWORD dwInfoLevel,
_Outptr_ PVOID * ppDynamicInfo
);
#endif // NTDDI_VERSION >= NTDDI_VISTA #endif // NTDDI_VERSION >= NTDDI_VISTA
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // _WINSVC_ #endif // _WINSVC_
 End of changes. 111 change blocks. 
243 lines changed or deleted 396 lines changed or added

This html diff was produced by rfcdiff 1.41.