Headers diff for advapi32.dll between 5.2.3790.3959-Windows 5.0 and 6.0.6002.18005-Windows 6.0 versions



 aclapi.h (5.2.3790.3959-Windows 5.0)   aclapi.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 77 skipping to change at line 77
#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,
__out_ecount(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_A * pListOfExplici tEntries __deref_out_ecount(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_A * pListOfE xplicitEntries
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetExplicitEntriesFromAclW( GetExplicitEntriesFromAclW(
__in PACL pacl, __in PACL pacl,
__out PULONG pcCountOfExplicitEntries, __out PULONG pcCountOfExplicitEntries,
__out_ecount(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_W * pListOfExplici tEntries __deref_out_ecount(*pcCountOfExplicitEntries) PEXPLICIT_ACCESS_W * pListOfE xplicitEntries
); );
#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
skipping to change at line 146 skipping to change at line 146
#define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclA #define GetAuditedPermissionsFromAcl GetAuditedPermissionsFromAclA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetNamedSecurityInfoA( GetNamedSecurityInfoA(
__in LPSTR pObjectName, __in LPSTR pObjectName,
__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 PSECURITY_DESCRIPTOR * ppSecurityDescriptor __out_opt PSECURITY_DESCRIPTOR * ppSecurityDescriptor
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetNamedSecurityInfoW( GetNamedSecurityInfoW(
__in LPWSTR pObjectName, __in LPWSTR pObjectName,
__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 PSECURITY_DESCRIPTOR * ppSecurityDescriptor __out_opt 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,
__deref_out_opt PSID * ppsidOwner, __out_opt PSID * ppsidOwner,
__deref_out_opt PSID * ppsidGroup, __out_opt PSID * ppsidGroup,
__deref_out_opt PACL * ppDacl, __out_opt PACL * ppDacl,
__deref_out_opt PACL * ppSacl, __out_opt PACL * ppSacl,
__deref_out 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,
skipping to change at line 219 skipping to change at line 219
#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 PSID psidOwner, __in_opt PSID psidOwner,
__in PSID psidGroup, __in_opt PSID psidGroup,
__in PACL pDacl, __in_opt PACL pDacl,
__in 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,
skipping to change at line 277 skipping to change at line 277
FreeInheritedFromArray( FreeInheritedFromArray(
__in_ecount(AceCnt) PINHERITED_FROMW pInheritArray, __in_ecount(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
WINADVAPI
DWORD
WINAPI
TreeSetNamedSecurityInfoA(
__in LPSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo,
__in_opt PSID pOwner,
__in_opt PSID pGroup,
__in_opt PACL pDacl,
__in_opt PACL pSacl,
__in DWORD dwAction,
__in_opt FN_PROGRESS fnProgress,
__in PROG_INVOKE_SETTING ProgressInvokeSetting,
__in_opt PVOID Args
);
WINADVAPI
DWORD
WINAPI
TreeSetNamedSecurityInfoW(
__in LPWSTR pObjectName,
__in SE_OBJECT_TYPE ObjectType,
__in SECURITY_INFORMATION SecurityInfo,
__in_opt PSID pOwner,
__in_opt PSID pGroup,
__in_opt PACL pDacl,
__in_opt PACL pSacl,
__in DWORD dwAction,
__in_opt FN_PROGRESS fnProgress,
__in PROG_INVOKE_SETTING ProgressInvokeSetting,
__in_opt PVOID Args
);
#ifdef UNICODE
#define TreeSetNamedSecurityInfo TreeSetNamedSecurityInfoW
#else
#define TreeSetNamedSecurityInfo TreeSetNamedSecurityInfoA
#endif // !UNICODE
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// 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,
 End of changes. 9 change blocks. 
46 lines changed or deleted 84 lines changed or added


 appmgmt.h (5.2.3790.3959-Windows 5.0)   appmgmt.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 147 skipping to change at line 147
#endif #endif
WCHAR * ProductCode, WCHAR * ProductCode,
#if !defined(__midl) #if !defined(__midl)
__in __in
#endif #endif
DWORD dwStatus DWORD dwStatus
); );
DWORD WINAPI DWORD WINAPI
CommandLineFromMsiDescriptor( CommandLineFromMsiDescriptor(
WCHAR * Descriptor, #if !defined(__midl)
__nullterminated
#endif
WCHAR* Descriptor,
#if !defined(__midl)
__out_ecount( *CommandLineLength )
#endif
WCHAR * CommandLine, WCHAR * CommandLine,
DWORD * CommandLineLength DWORD * CommandLineLength
); );
DWORD WINAPI DWORD WINAPI
GetManagedApplications( GetManagedApplications(
#if !defined(__midl) #if !defined(__midl)
__in __in
#endif #endif
GUID * pCategory, GUID * pCategory,
skipping to change at line 199 skipping to change at line 205
PLOCALMANAGEDAPPLICATION* prgLocalApps PLOCALMANAGEDAPPLICATION* prgLocalApps
); );
void WINAPI void WINAPI
GetLocalManagedApplicationData( GetLocalManagedApplicationData(
#if !defined(__midl) #if !defined(__midl)
__in __in
#endif #endif
WCHAR * ProductCode, WCHAR * ProductCode,
#if !defined(__midl) #if !defined(__midl)
__out __deref_out
#endif #endif
LPWSTR * DisplayName, LPWSTR * DisplayName,
#if !defined(__midl) #if !defined(__midl)
__out __deref_out
#endif #endif
LPWSTR * SupportUrl LPWSTR * SupportUrl
); );
DWORD WINAPI DWORD WINAPI
GetManagedApplicationCategories( GetManagedApplicationCategories(
#if !defined(__midl) #if !defined(__midl)
__reserved __reserved
#endif #endif
DWORD dwReserved, DWORD dwReserved,
 End of changes. 3 change blocks. 
3 lines changed or deleted 9 lines changed or added


 evntrace.h (5.2.3790.3959-Windows 5.0)   evntrace.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 19 skipping to change at line 19
Abstract: Abstract:
Public headers for event tracing control applications, Public headers for event tracing control applications,
consumers and providers consumers and providers
--*/ --*/
#ifndef _EVNTRACE_ #ifndef _EVNTRACE_
#define _EVNTRACE_ #define _EVNTRACE_
#pragma once
#if defined(_WINNT_) || defined(WINNT) #if defined(_WINNT_) || defined(WINNT)
#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
skipping to change at line 77 skipping to change at line 79
// DefaultTraceSecurityGuid. Specifies the default event tracing security // DefaultTraceSecurityGuid. Specifies the default event tracing security
// //
DEFINE_GUID ( /* 0811c1af-7a07-4a06-82ed-869455cdf713 */ DEFINE_GUID ( /* 0811c1af-7a07-4a06-82ed-869455cdf713 */
DefaultTraceSecurityGuid, DefaultTraceSecurityGuid,
0x0811c1af, 0x0811c1af,
0x7a07, 0x7a07,
0x4a06, 0x4a06,
0x82, 0xed, 0x86, 0x94, 0x55, 0xcd, 0xf7, 0x13 0x82, 0xed, 0x86, 0x94, 0x55, 0xcd, 0xf7, 0x13
); );
#define KERNEL_LOGGER_NAMEW L"NT Kernel Logger" #define KERNEL_LOGGER_NAMEW L"NT Kernel Logger"
#define GLOBAL_LOGGER_NAMEW L"GlobalLogger" #define GLOBAL_LOGGER_NAMEW L"GlobalLogger"
#define EVENT_LOGGER_NAMEW L"Event Log" #define EVENT_LOGGER_NAMEW L"EventLog"
#define DIAG_LOGGER_NAMEW L"DiagLog"
#define KERNEL_LOGGER_NAMEA "NT Kernel Logger" #define KERNEL_LOGGER_NAMEA "NT Kernel Logger"
#define GLOBAL_LOGGER_NAMEA "GlobalLogger" #define GLOBAL_LOGGER_NAMEA "GlobalLogger"
#define EVENT_LOGGER_NAMEA "Event Log" #define EVENT_LOGGER_NAMEA "EventLog"
#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
typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE; typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
//types for event data going to System Event Logger
#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_DC_START 0x03 // Collection start marker #define EVENT_TRACE_TYPE_DC_START 0x03 // Collection start marker
#define EVENT_TRACE_TYPE_DC_END 0x04 // Collection end marker #define EVENT_TRACE_TYPE_DC_END 0x04 // Collection end marker
#define EVENT_TRACE_TYPE_EXTENSION 0x05 // Extension/continuation #define EVENT_TRACE_TYPE_EXTENSION 0x05 // Extension/continuation
#define EVENT_TRACE_TYPE_REPLY 0x06 // Reply event #define EVENT_TRACE_TYPE_REPLY 0x06 // Reply event
#define EVENT_TRACE_TYPE_DEQUEUE 0x07 // De-queue event #define EVENT_TRACE_TYPE_DEQUEUE 0x07 // De-queue event
#define EVENT_TRACE_TYPE_RESUME 0x07 // Resume event (WinEvent comp atible)
#define EVENT_TRACE_TYPE_CHECKPOINT 0x08 // Generic checkpoint event #define EVENT_TRACE_TYPE_CHECKPOINT 0x08 // Generic checkpoint event
#define EVENT_TRACE_TYPE_RESERVED9 0x09 #define EVENT_TRACE_TYPE_SUSPEND 0x08 // Suspend event (WinEvent com
patible)
#define EVENT_TRACE_TYPE_WINEVT_SEND 0x09 // Send Event (WinEvent compat
ible)
#define EVENT_TRACE_TYPE_WINEVT_RECEIVE 0XF0 // Receive Event (WinEvent com
patible)
// //
// Predefined Event Tracing Levels for Software/Debug Tracing // Predefined Event Tracing Levels for Software/Debug Tracing
// //
// //
// Trace Level is UCHAR and passed in through the EnableLevel parameter // Trace Level is UCHAR and passed in through the EnableLevel parameter
// in EnableTrace API. It is retrieved by the provider using the // in EnableTrace API. It is retrieved by the provider using the
// GetTraceEnableLevel macro.It should be interpreted as an integer value // GetTraceEnableLevel macro.It should be interpreted as an integer value
// to mean everything at or below that level will be traced. // to mean everything at or below that level will be traced.
// //
// Here are the possible Levels. // Here are the possible Levels.
// //
#define TRACE_LEVEL_NONE 0 // Tracing is not on #define TRACE_LEVEL_NONE 0 // Tracing is not on
#define TRACE_LEVEL_FATAL 1 // Abnormal exit or termination #define TRACE_LEVEL_CRITICAL 1 // Abnormal exit or termination
#define TRACE_LEVEL_FATAL 1 // Deprecated name for Abnormal exit or term
ination
#define TRACE_LEVEL_ERROR 2 // Severe errors that need logging #define TRACE_LEVEL_ERROR 2 // Severe errors that need logging
#define TRACE_LEVEL_WARNING 3 // Warnings such as allocation failure #define TRACE_LEVEL_WARNING 3 // Warnings such as allocation failure
#define TRACE_LEVEL_INFORMATION 4 // Includes non-error cases(e.g.,Entry-Exit) #define TRACE_LEVEL_INFORMATION 4 // Includes non-error cases(e.g.,Entry-Exit)
#define TRACE_LEVEL_VERBOSE 5 // Detailed traces from intermediate steps #define TRACE_LEVEL_VERBOSE 5 // Detailed traces from intermediate steps
#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
// //
skipping to change at line 138 skipping to change at line 150
// //
#define EVENT_TRACE_TYPE_LOAD 0x0A // Load image #define EVENT_TRACE_TYPE_LOAD 0x0A // Load image
// //
// 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_WRITE_INIT 0x0D
#define EVENT_TRACE_TYPE_IO_FLUSH 0x0E
#define EVENT_TRACE_TYPE_IO_FLUSH_INIT 0x0F
// //
// 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
#define EVENT_TRACE_TYPE_MM_AV 0x0F // Access violation
// //
// Event types for Network subsystem, all protocols // Event types for Network subsystem, all protocols
// //
#define EVENT_TRACE_TYPE_SEND 0x0A // Send #define EVENT_TRACE_TYPE_SEND 0x0A // Send
#define EVENT_TRACE_TYPE_RECEIVE 0x0B // Receive #define EVENT_TRACE_TYPE_RECEIVE 0x0B // Receive
#define EVENT_TRACE_TYPE_CONNECT 0x0C // Connect #define EVENT_TRACE_TYPE_CONNECT 0x0C // Connect
#define EVENT_TRACE_TYPE_DISCONNECT 0x0D // Disconnect #define EVENT_TRACE_TYPE_DISCONNECT 0x0D // Disconnect
#define EVENT_TRACE_TYPE_RETRANSMIT 0x0E // ReTransmit #define EVENT_TRACE_TYPE_RETRANSMIT 0x0E // ReTransmit
skipping to change at line 177 skipping to change at line 194
// //
// 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
// //
// 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
#define EVENT_TRACE_TYPE_REGDELETEVALUE 0x0F // NtDeleteValueKey #define EVENT_TRACE_TYPE_REGDELETEVALUE 0x0F // NtDeleteValueKey
#define EVENT_TRACE_TYPE_REGQUERYVALUE 0x10 // NtQueryValueKey #define EVENT_TRACE_TYPE_REGQUERYVALUE 0x10 // NtQueryValueKey
#define EVENT_TRACE_TYPE_REGENUMERATEKEY 0x11 // NtEnumerateKey #define EVENT_TRACE_TYPE_REGENUMERATEKEY 0x11 // NtEnumerateKey
#define EVENT_TRACE_TYPE_REGENUMERATEVALUEKEY 0x12 // NtEnumerateValueKey #define EVENT_TRACE_TYPE_REGENUMERATEVALUEKEY 0x12 // NtEnumerateValue
#define EVENT_TRACE_TYPE_REGQUERYMULTIPLEVALUE 0x13 // NtQueryMultipleValue Key
Key #define EVENT_TRACE_TYPE_REGQUERYMULTIPLEVALUE 0x13 // NtQueryMultipleV
#define EVENT_TRACE_TYPE_REGSETINFORMATION 0x14 // NtSetInformationKey alueKey
#define EVENT_TRACE_TYPE_REGFLUSH 0x15 // NtFlushKey #define EVENT_TRACE_TYPE_REGSETINFORMATION 0x14 // NtSetInformation
#define EVENT_TRACE_TYPE_REGKCBDMP 0x16 // KcbDump/create Key
#define EVENT_TRACE_TYPE_REGFLUSH 0x15 // NtFlushKey
#define EVENT_TRACE_TYPE_REGKCBCREATE 0x16 // KcbCreate
#define EVENT_TRACE_TYPE_REGKCBDELETE 0x17 // KcbDelete
#define EVENT_TRACE_TYPE_REGKCBRUNDOWNBEGIN 0x18 // KcbRundownBegin
#define EVENT_TRACE_TYPE_REGKCBRUNDOWNEND 0x19 // KcbRundownEnd
#define EVENT_TRACE_TYPE_REGVIRTUALIZE 0x1A // VirtualizeKey
#define EVENT_TRACE_TYPE_REGCLOSE 0x1B // NtClose (KeyObje
ct)
// //
// 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_IRQ 0x15 // IRQ assigned to devi
ces
#define EVENT_TRACE_TYPE_CONFIG_PNP 0x16 // PnP device info
#define EVENT_TRACE_TYPE_CONFIG_IDECHANNEL 0x17 // Primary/Secondary ID
E channel Configuration
// //
// Enable flags for SystemControlGuid only // 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
#define EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS 0x00001000 // all page faults #define EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS 0x00001000 // all page faults
#define EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS 0x00002000 // hard faults only #define EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS 0x00002000 // hard faults only
#define EVENT_TRACE_FLAG_NETWORK_TCPIP 0x00010000 // tcpip send & receive #define EVENT_TRACE_FLAG_NETWORK_TCPIP 0x00010000 // tcpip send & receive
#define EVENT_TRACE_FLAG_REGISTRY 0x00020000 // registry calls #define EVENT_TRACE_FLAG_REGISTRY 0x00020000 // registry calls
#define EVENT_TRACE_FLAG_DBGPRINT 0x00040000 // DbgPrint(ex) Calls #define EVENT_TRACE_FLAG_DBGPRINT 0x00040000 // DbgPrint(ex) Calls
#define EVENT_TRACE_FLAG_VOLMGR 0x00200000 // volume manager traces //
// Enable flags for Kernel Events on Vista and above
//
#define EVENT_TRACE_FLAG_PROCESS_COUNTERS 0x00000008 // process perf counters
#define EVENT_TRACE_FLAG_CSWITCH 0x00000010 // context switches
#define EVENT_TRACE_FLAG_DPC 0x00000020 // deffered procedure ca
lls
#define EVENT_TRACE_FLAG_INTERRUPT 0x00000040 // interrupts
#define EVENT_TRACE_FLAG_SYSTEMCALL 0x00000080 // system calls
#define EVENT_TRACE_FLAG_DISK_IO_INIT 0x00000400 // physical disk IO init
iation
#define EVENT_TRACE_FLAG_ALPC 0x00100000 // ALPC traces
#define EVENT_TRACE_FLAG_SPLIT_IO 0x00200000 // split io traces (Volu
meManager)
#define EVENT_TRACE_FLAG_DRIVER 0x00800000 // driver delays
#define EVENT_TRACE_FLAG_PROFILE 0x01000000 // sample based profilin
g
#define EVENT_TRACE_FLAG_FILE_IO 0x02000000 // file IO
#define EVENT_TRACE_FLAG_FILE_IO_INIT 0x04000000 // file IO initiation
// //
// 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_SEQUENTIAL 0x00000001 // Log sequentially
#define EVENT_TRACE_FILE_MODE_CIRCULAR 0x00000002 // Log in circular manne
r
#define EVENT_TRACE_FILE_MODE_APPEND 0x00000004 // Append sequential log
#define EVENT_TRACE_FILE_MODE_NONE 0x00000000 // logfile is off #define EVENT_TRACE_REAL_TIME_MODE 0x00000100 // Real time mode on
#define EVENT_TRACE_FILE_MODE_SEQUENTIAL 0x00000001 // log sequentially #define EVENT_TRACE_DELAY_OPEN_FILE_MODE 0x00000200 // Delay opening file
#define EVENT_TRACE_FILE_MODE_CIRCULAR 0x00000002 // log in circular manne #define EVENT_TRACE_BUFFERING_MODE 0x00000400 // Buffering mode only
r
#define EVENT_TRACE_FILE_MODE_APPEND 0x00000004 // append sequential log
#define EVENT_TRACE_FILE_MODE_NEWFILE 0x00000008 // auto-switch log file
#define EVENT_TRACE_FILE_MODE_PREALLOCATE 0x00000020 // pre-allocate mode
#define EVENT_TRACE_REAL_TIME_MODE 0x00000100 // real time mode on
#define EVENT_TRACE_DELAY_OPEN_FILE_MODE 0x00000200 // delay opening file
#define EVENT_TRACE_BUFFERING_MODE 0x00000400 // buffering mode only
#define EVENT_TRACE_PRIVATE_LOGGER_MODE 0x00000800 // Process Private Logge r #define EVENT_TRACE_PRIVATE_LOGGER_MODE 0x00000800 // Process Private Logge r
#define EVENT_TRACE_ADD_HEADER_MODE 0x00001000 // Add a logfile header #define EVENT_TRACE_ADD_HEADER_MODE 0x00001000 // Add a logfile header
#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
// //
// internal control codes used. // Logger Mode flags on XP and above
//
#define EVENT_TRACE_FILE_MODE_NEWFILE 0x00000008 // Auto-switch log file
#define EVENT_TRACE_FILE_MODE_PREALLOCATE 0x00000020 // Pre-allocate mode
//
// Logger Mode flags on Vista and above
//
#define EVENT_TRACE_NONSTOPPABLE_MODE 0x00000040 // Session cannot be sto
pped (Autologger only)
#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_PRIVATE_IN_PROC 0x00020000 // In process private lo
gger
#define EVENT_TRACE_MODE_RESERVED 0x00100000 // Reserved bit, used to
signal Heap/Critsec tracing
//
// 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
//
#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 s #define TRACE_MESSAGE_SEQUENCE 1 // Message should include a seque
equence number nce number
#define TRACE_MESSAGE_GUID 2 // Message includes a #define TRACE_MESSAGE_GUID 2 // Message includes a GUID
GUID #define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Component
#define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Componen ID instead
t ID instead #define TRACE_MESSAGE_TIMESTAMP 8 // Message includes a timestamp
#define TRACE_MESSAGE_TIMESTAMP 8 // Message includes a #define TRACE_MESSAGE_PERFORMANCE_TIMESTAMP 16 // *Obsolete* Clock type is contr
timestamp olled by the logger
#define TRACE_MESSAGE_PERFORMANCE_TIMESTAMP 16 // *Obsolete* Clock type is cont #define TRACE_MESSAGE_SYSTEMINFO 32 // Message includes system inform
rolled by the logger ation TID,PID
#define TRACE_MESSAGE_SYSTEMINFO 32 // Message includes s
ystem information TID,PID //
#define TRACE_MESSAGE_FLAG_MASK 0xFFFF // Only the lower 16 bits of fla // Vista flags set by system to indicate provider pointer size.
gs are placed in the message //
#define TRACE_MESSAGE_POINTER32 0x0040 // Message logged by 32 bit
provider
#define TRACE_MESSAGE_POINTER64 0x0080 // Message logged by 64 bit
provider
#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 // 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 #define TRACE_MESSAGE_MAXIMUM_SIZE 8*1024 // the maximum size allowed for a single trace message
// longer messages will return E RROR_BUFFER_OVERFLOW // 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 valid #define EVENT_TRACE_USE_PROCTIME 0x0001 // ProcessorTime field is valid
#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
// structure while calling into TraceEvent API
//
#define TRACE_HEADER_FLAG_USE_TIMESTAMP 0x00000200
#define TRACE_HEADER_FLAG_TRACED_GUID 0x00020000 // denotes a trace
#define TRACE_HEADER_FLAG_LOG_WNODE 0x00040000 // request to log Wnode
#define TRACE_HEADER_FLAG_USE_GUID_PTR 0x00080000 // Guid is actually a poi
nter
#define TRACE_HEADER_FLAG_USE_MOF_PTR 0x00100000 // MOF data are dereferen
ced
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
#pragma warning(push) #pragma warning(push)
#endif #endif
#pragma warning (disable:4201) #pragma warning (disable:4201)
// //
// Trace header for all (except kernel) events. This is used to overlay // Trace header for all legacy events.
// to bottom part of WNODE_HEADER to conserve space.
// //
typedef struct _EVENT_TRACE_HEADER { // overlays WNODE_HEADER typedef struct _EVENT_TRACE_HEADER { // overlays WNODE_HEADER
USHORT Size; // Size of entire record USHORT Size; // Size of entire record
union { union {
USHORT FieldTypeFlags; // Indicates valid fields USHORT FieldTypeFlags; // Indicates valid fields
struct { struct {
UCHAR HeaderType; // Header type - internal use only UCHAR HeaderType; // Header type - internal use only
UCHAR MarkerFlags; // Marker - internal use only UCHAR MarkerFlags; // Marker - internal use only
}; };
skipping to change at line 323 skipping to change at line 401
}; };
ULONG ThreadId; // Thread Id ULONG ThreadId; // Thread Id
ULONG ProcessId; // Process Id ULONG ProcessId; // Process Id
LARGE_INTEGER TimeStamp; // time when event happens LARGE_INTEGER TimeStamp; // time when event happens
union { union {
GUID Guid; // Guid that identifies event GUID Guid; // Guid that identifies event
ULONGLONG GuidPtr; // use with WNODE_FLAG_USE_GUID_PTR ULONGLONG GuidPtr; // use with WNODE_FLAG_USE_GUID_PTR
}; };
union { union {
struct { struct {
ULONG ClientContext; // Reserved
ULONG Flags; // Flags for header
};
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
}; };
ULONG64 ProcessorTime; // Processor Clock ULONG64 ProcessorTime; // Processor Clock
struct {
ULONG ClientContext; // Reserved
ULONG Flags; // Event Flags
};
}; };
} EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER; } EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER;
// //
// This header is used to trace and track transaction co-relations // This header is used to trace and track transaction co-relations
// //
typedef struct _EVENT_INSTANCE_HEADER { typedef struct _EVENT_INSTANCE_HEADER {
USHORT Size; USHORT Size;
union { union {
USHORT FieldTypeFlags; // Indicates valid fields USHORT FieldTypeFlags; // Indicates valid fields
skipping to change at line 362 skipping to change at line 440
} Class; } Class;
}; };
ULONG ThreadId; ULONG ThreadId;
ULONG ProcessId; ULONG ProcessId;
LARGE_INTEGER TimeStamp; LARGE_INTEGER TimeStamp;
ULONGLONG RegHandle; ULONGLONG RegHandle;
ULONG InstanceId; ULONG InstanceId;
ULONG ParentInstanceId; ULONG ParentInstanceId;
union { union {
struct { struct {
ULONG ClientContext; // Reserved
ULONG Flags; // Flags for header
};
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
}; };
ULONG64 ProcessorTime; // Processor Clock ULONG64 ProcessorTime; // Processor Clock
struct {
ULONG EventId; // Event ID
ULONG Flags; // Trace header Flags
};
}; };
ULONGLONG ParentRegHandle; ULONGLONG ParentRegHandle;
} EVENT_INSTANCE_HEADER, *PEVENT_INSTANCE_HEADER; } EVENT_INSTANCE_HEADER, *PEVENT_INSTANCE_HEADER;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
// //
// Following are structures and macros for use with USE_MOF_PTR // Following are structures and macros for use with USE_MOF_PTR
// //
// Trace data types
#define ETW_NULL_TYPE_VALUE 0
#define ETW_OBJECT_TYPE_VALUE 1
#define ETW_STRING_TYPE_VALUE 2
#define ETW_SBYTE_TYPE_VALUE 3
#define ETW_BYTE_TYPE_VALUE 4
#define ETW_INT16_TYPE_VALUE 5
#define ETW_UINT16_TYPE_VALUE 6
#define ETW_INT32_TYPE_VALUE 7
#define ETW_UINT32_TYPE_VALUE 8
#define ETW_INT64_TYPE_VALUE 9
#define ETW_UINT64_TYPE_VALUE 10
#define ETW_CHAR_TYPE_VALUE 11
#define ETW_SINGLE_TYPE_VALUE 12
#define ETW_DOUBLE_TYPE_VALUE 13
#define ETW_BOOLEAN_TYPE_VALUE 14
#define ETW_DECIMAL_TYPE_VALUE 15
// Extended types
#define ETW_GUID_TYPE_VALUE 101
#define ETW_ASCIICHAR_TYPE_VALUE 102
#define ETW_ASCIISTRING_TYPE_VALUE 103
#define ETW_COUNTED_STRING_TYPE_VALUE 104
#define ETW_POINTER_TYPE_VALUE 105
#define ETW_SIZET_TYPE_VALUE 106
#define ETW_HIDDEN_TYPE_VALUE 107
#define ETW_BOOL_TYPE_VALUE 108
#define ETW_COUNTED_ANSISTRING_TYPE_VALUE 109
#define ETW_REVERSED_COUNTED_STRING_TYPE_VALUE 110
#define ETW_REVERSED_COUNTED_ANSISTRING_TYPE_VALUE 111
#define ETW_NON_NULL_TERMINATED_STRING_TYPE_VALUE 112
#define ETW_REDUCED_ANSISTRING_TYPE_VALUE 113
#define ETW_REDUCED_STRING_TYPE_VALUE 114
#define ETW_SID_TYPE_VALUE 115
#define ETW_VARIANT_TYPE_VALUE 116
#define ETW_PTVECTOR_TYPE_VALUE 117
#define ETW_WMITIME_TYPE_VALUE 118
#define ETW_DATETIME_TYPE_VALUE 119
#define ETW_REFRENCE_TYPE_VALUE 120
#define DEFINE_TRACE_MOF_FIELD(MOF, ptr, length, type) \ #define DEFINE_TRACE_MOF_FIELD(MOF, ptr, length, type) \
(MOF)->DataPtr = (ULONG64) ptr; \ (MOF)->DataPtr = (ULONG64) 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(_NTDDK_) || defined(_NTIFS_)) || defined(_WMIKM_)
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning (disable:4201)
// //
// 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
// //
typedef struct _TRACE_LOGFILE_HEADER { typedef struct _TRACE_LOGFILE_HEADER {
ULONG BufferSize; // Logger buffer size in Kbytes ULONG BufferSize; // Logger buffer size in Kbytes
union { union {
ULONG Version; // Logger version ULONG Version; // Logger version
struct { struct {
skipping to change at line 438 skipping to change at line 565
LPWSTR LogFileName; LPWSTR LogFileName;
TIME_ZONE_INFORMATION TimeZone; TIME_ZONE_INFORMATION TimeZone;
#endif #endif
LARGE_INTEGER BootTime; LARGE_INTEGER BootTime;
LARGE_INTEGER PerfFreq; // Reserved LARGE_INTEGER PerfFreq; // Reserved
LARGE_INTEGER StartTime; // Reserved LARGE_INTEGER StartTime; // Reserved
ULONG ReservedFlags; // Reserved ULONG ReservedFlags; // Reserved
ULONG BuffersLost; ULONG BuffersLost;
} TRACE_LOGFILE_HEADER, *PTRACE_LOGFILE_HEADER; } TRACE_LOGFILE_HEADER, *PTRACE_LOGFILE_HEADER;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif // !_NTDDK_ || _WMIKM_ #endif // !_NTDDK_ || _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;
skipping to change at line 487 skipping to change at line 618
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;
// NOTE: // NOTE:
// If AgeLimit is 0, default is used // If AgeLimit is 0, default is used
// If AgeLimit is < 0, buffer aging is turned off // If AgeLimit is < 0, buffer aging is turned off
//
// Data Provider structures
//
// Used by RegisterTraceGuids()
//
typedef struct _TRACE_GUID_REGISTRATION {
LPCGUID Guid; // Guid of data block being registered or updated.
HANDLE RegHandle; // Guid Registration Handle is returned.
} TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION;
//
// Data consumer structures
//
#endif // !_NTDDK_ || _WMIKM_
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;
typedef struct _ETW_BUFFER_CONTEXT {
UCHAR ProcessorNumber;
UCHAR Alignment;
USHORT LoggerId;
} ETW_BUFFER_CONTEXT, *PETW_BUFFER_CONTEXT;
// //
// Data Provider structures // Provider Information Flags used on Vista and above
// //
// Used by RegisterTraceGuids() #define TRACE_PROVIDER_FLAG_LEGACY (0x00000001)
#define TRACE_PROVIDER_FLAG_PRE_ENABLE (0x00000002)
typedef struct _TRACE_GUID_REGISTRATION { //
LPCGUID Guid; // Guid of data block being registered or updated. // Enable Information for Provider Instance
HANDLE RegHandle; // Guid Registration Handle is returned. // Used on Vista and above
} TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION; //
typedef struct _TRACE_ENABLE_INFO {
ULONG IsEnabled;
UCHAR Level;
UCHAR Reserved1;
USHORT LoggerId;
ULONG EnableProperty;
ULONG Reserved2;
ULONGLONG MatchAnyKeyword;
ULONGLONG MatchAllKeyword;
} TRACE_ENABLE_INFO, *PTRACE_ENABLE_INFO;
// //
// Data consumer structures // Instance Information for Provider
// Used on Vista and above
// //
typedef struct _TRACE_PROVIDER_INSTANCE_INFO {
ULONG NextOffset;
ULONG EnableCount;
ULONG Pid;
ULONG Flags;
} TRACE_PROVIDER_INSTANCE_INFO, *PTRACE_PROVIDER_INSTANCE_INFO;
//
// GUID Information Used on Vista and above
//
typedef struct _TRACE_GUID_INFO {
ULONG InstanceCount;
ULONG Reserved;
} TRACE_GUID_INFO, *PTRACE_GUID_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
#pragma warning(push)
#endif
#pragma warning (disable:4201)
typedef struct _EVENT_TRACE { typedef struct _EVENT_TRACE {
EVENT_TRACE_HEADER Header; // Event trace header EVENT_TRACE_HEADER Header; // Event trace header
ULONG InstanceId; // Instance Id of this event ULONG InstanceId; // Instance Id of this event
ULONG ParentInstanceId; // Parent Instance Id. ULONG ParentInstanceId; // Parent Instance Id.
GUID ParentGuid; // Parent Guid; GUID ParentGuid; // Parent Guid;
PVOID MofData; // Pointer to Variable Data PVOID MofData; // Pointer to Variable Data
ULONG MofLength; // Variable Datablock Length ULONG MofLength; // Variable Datablock Length
ULONG ClientContext; // Reserved union {
ULONG ClientContext;
ETW_BUFFER_CONTEXT BufferContext;
};
} EVENT_TRACE, *PEVENT_TRACE; } EVENT_TRACE, *PEVENT_TRACE;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#if !defined(_WMIKM_) && !defined(_NTDDK_) && !defined(_NTIFS_)
typedef struct _EVENT_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;
typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKW) typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKW)
(PEVENT_TRACE_LOGFILEW Logfile); (PEVENT_TRACE_LOGFILEW Logfile);
typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKA) typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKA)
(PEVENT_TRACE_LOGFILEA Logfile); (PEVENT_TRACE_LOGFILEA Logfile);
typedef VOID (WINAPI *PEVENT_CALLBACK)( PEVENT_TRACE pEvent ); typedef VOID (WINAPI *PEVENT_CALLBACK)( PEVENT_TRACE pEvent );
typedef VOID (WINAPI *PEVENT_RECORD_CALLBACK) (PEVENT_RECORD EventRecord);
// //
// 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,
IN OUT ULONG *BufferSize, IN OUT ULONG *BufferSize,
IN OUT PVOID Buffer IN OUT PVOID Buffer
); );
struct _EVENT_TRACE_LOGFILEW { #if _MSC_VER >= 1200
LPWSTR LogFileName; // Logfile Name #pragma warning(push)
LPWSTR LoggerName; // LoggerName #endif
LONGLONG CurrentTime; // timestamp of last event #pragma warning (disable:4201)
ULONG BuffersRead; // buffers read to date
ULONG LogFileMode; // Mode of the logfile
EVENT_TRACE CurrentEvent; // Current Event from this stream. struct _EVENT_TRACE_LOGFILEW {
TRACE_LOGFILE_HEADER LogfileHeader; // logfile header structure LPWSTR LogFileName; // Logfile Name
PEVENT_TRACE_BUFFER_CALLBACKW // callback before each buffer LPWSTR LoggerName; // LoggerName
BufferCallback; // is read LONGLONG CurrentTime; // timestamp of last event
ULONG BuffersRead; // buffers read to date
union {
// Mode of the logfile
ULONG LogFileMode;
// Processing flags used on Vista and above
ULONG ProcessTraceMode;
};
EVENT_TRACE CurrentEvent; // Current Event from this stream.
TRACE_LOGFILE_HEADER LogfileHeader; // logfile header structure
PEVENT_TRACE_BUFFER_CALLBACKW // callback before each buffer
BufferCallback; // is read
// //
// following variables are filled for BufferCallback. // following variables are filled for BufferCallback.
// //
ULONG BufferSize; ULONG BufferSize;
ULONG Filled; ULONG Filled;
ULONG EventsLost; ULONG EventsLost;
// //
// following needs to be propaged to each buffer // following needs to be propaged to each buffer
// //
union {
// Callback with EVENT_TRACE
PEVENT_CALLBACK EventCallback;
// Callback with EVENT_RECORD on Vista and above
PEVENT_RECORD_CALLBACK EventRecordCallback;
};
PEVENT_CALLBACK EventCallback; // callback for every event ULONG IsKernelTrace; // TRUE for kernel logfile
ULONG IsKernelTrace; // TRUE for kernel logfile
PVOID Context; // reserved for internal use PVOID Context; // reserved for internal use
}; };
struct _EVENT_TRACE_LOGFILEA { struct _EVENT_TRACE_LOGFILEA {
LPSTR LogFileName; // Logfile Name LPSTR LogFileName; // Logfile Name
LPSTR LoggerName; // LoggerName LPSTR LoggerName; // LoggerName
LONGLONG CurrentTime; // timestamp of last event LONGLONG CurrentTime; // timestamp of last event
ULONG BuffersRead; // buffers read to date ULONG BuffersRead; // buffers read to date
ULONG LogFileMode; // LogFile Mode. union {
ULONG LogFileMode; // Mode of the logfile
EVENT_TRACE CurrentEvent; // Current Event from this stream ULONG ProcessTraceMode; // Processing flags
TRACE_LOGFILE_HEADER LogfileHeader; // logfile header structure };
PEVENT_TRACE_BUFFER_CALLBACKA // callback before each buffer EVENT_TRACE CurrentEvent; // Current Event from this stream
BufferCallback; // is read TRACE_LOGFILE_HEADER LogfileHeader; // logfile header structure
PEVENT_TRACE_BUFFER_CALLBACKA // callback before each buffer
BufferCallback; // is read
// //
// following variables are filled for BufferCallback. // following variables are filled for BufferCallback.
// //
ULONG BufferSize; ULONG BufferSize;
ULONG Filled; ULONG Filled;
ULONG EventsLost; ULONG EventsLost;
// //
// following needs to be propaged to each buffer // following needs to be propaged to each buffer
// //
union {
PEVENT_CALLBACK EventCallback; // callback for every event
PEVENT_RECORD_CALLBACK EventRecordCallback;
};
PEVENT_CALLBACK EventCallback; // callback for every event
ULONG IsKernelTrace; // TRUE for kernel logfile ULONG IsKernelTrace; // TRUE for kernel logfile
PVOID Context; // reserved for internal use PVOID Context; // reserved for internal use
}; };
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
// //
// Define generic structures // Define generic structures
// //
#if defined(_UNICODE) || defined(UNICODE) #if defined(_UNICODE) || defined(UNICODE)
#define PEVENT_TRACE_BUFFER_CALLBACK PEVENT_TRACE_BUFFER_CALLBACKW #define PEVENT_TRACE_BUFFER_CALLBACK PEVENT_TRACE_BUFFER_CALLBACKW
#define EVENT_TRACE_LOGFILE EVENT_TRACE_LOGFILEW #define EVENT_TRACE_LOGFILE EVENT_TRACE_LOGFILEW
#define PEVENT_TRACE_LOGFILE PEVENT_TRACE_LOGFILEW #define PEVENT_TRACE_LOGFILE PEVENT_TRACE_LOGFILEW
#define KERNEL_LOGGER_NAME KERNEL_LOGGER_NAMEW #define KERNEL_LOGGER_NAME KERNEL_LOGGER_NAMEW
#define GLOBAL_LOGGER_NAME GLOBAL_LOGGER_NAMEW #define GLOBAL_LOGGER_NAME GLOBAL_LOGGER_NAMEW
#define EVENT_LOGGER_NAME EVENT_LOGGER_NAMEW #define EVENT_LOGGER_NAME EVENT_LOGGER_NAMEW
#else #else
#define PEVENT_TRACE_BUFFER_CALLBACK PEVENT_TRACE_BUFFER_CALLBACKA #define PEVENT_TRACE_BUFFER_CALLBACK PEVENT_TRACE_BUFFER_CALLBACKA
skipping to change at line 633 skipping to change at line 858
#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
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// //
// 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
skipping to change at line 662 skipping to change at line 883
// IN LPTSTR InstanceName, // IN LPTSTR InstanceName,
// IN OUT PEVENT_TRACE_PROPERTIES Properties // IN OUT 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 OUT PEVENT_TRACE_PROPERTIES Properties __inout PEVENT_TRACE_PROPERTIES Properties
); );
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
); );
skipping to change at line 767 skipping to change at line 988
__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.
// //
#if (WINVER >= 0x0501)
// ULONG // ULONG
// FlushTrace( // FlushTrace(
// IN TRACEHANDLE TraceHandle, // IN TRACEHANDLE TraceHandle,
// IN LPTSTR InstanceName, // IN LPTSTR InstanceName,
// IN OUT PEVENT_TRACE_PROPERTIES Properties // IN OUT PEVENT_TRACE_PROPERTIES Properties
// ); // );
#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
#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
// //
// Generic trace control routine // Generic trace control routine
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
ControlTraceW( ControlTraceW(
__in TRACEHANDLE TraceHandle, __in TRACEHANDLE TraceHandle,
skipping to change at line 846 skipping to change at line 1068
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
QueryAllTracesA( QueryAllTracesA(
__out_ecount(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray, __out_ecount(PropertyArrayCount) PEVENT_TRACE_PROPERTIES *PropertyArray,
__in ULONG PropertyArrayCount, __in ULONG PropertyArrayCount,
__out PULONG LoggerCount __out PULONG LoggerCount
); );
// //
// Data Provider APIs // Data Provider Enable APIs
// //
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
CreateTraceInstanceId(
__in HANDLE RegHandle,
__inout PEVENT_INSTANCE_INFO pInstInfo
);
EXTERN_C
ULONG
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
); );
typedef struct _EVENT_FILTER_DESCRIPTOR
EVENT_FILTER_DESCRIPTOR, *PEVENT_FILTER_DESCRIPTOR;
#if (WINVER >= _WIN32_WINNT_LONGHORN)
EXTERN_C
ULONG
WMIAPI
EnableTraceEx(
__in LPCGUID ProviderId,
__in_opt LPCGUID SourceId,
__in TRACEHANDLE TraceHandle,
__in ULONG IsEnabled,
__in UCHAR Level,
__in ULONGLONG MatchAnyKeyword,
__in ULONGLONG MatchAllKeyword,
__in ULONG EnableProperty,
__in_opt PEVENT_FILTER_DESCRIPTOR EnableFilterDesc
);
#endif
typedef enum _TRACE_QUERY_INFO_CLASS {
TraceGuidQueryList,
TraceGuidQueryInfo,
TraceGuidQueryProcess
} TRACE_QUERY_INFO_CLASS;
#if (WINVER >= _WIN32_WINNT_LONGHORN)
EXTERN_C
ULONG
WMIAPI
EnumerateTraceGuidsEx(
__in TRACE_QUERY_INFO_CLASS TraceQueryInfoClass,
__in_bcount_opt(InBufferSize) PVOID InBuffer,
__in ULONG InBufferSize,
__out_bcount_opt(OutBufferSize) PVOID OutBuffer,
__in ULONG OutBufferSize,
__out PULONG ReturnLength
);
#endif
//
// Data Provider APIs
//
EXTERN_C
ULONG
WMIAPI
CreateTraceInstanceId(
__in HANDLE RegHandle,
__inout PEVENT_INSTANCE_INFO pInstInfo
);
// //
// 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,
__inout PEVENT_TRACE_HEADER EventTrace __inout PEVENT_TRACE_HEADER EventTrace
skipping to change at line 917 skipping to change at line 1183
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_ecount_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
); );
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_ecount_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 >= 0x0501) #if (WINVER >= _WIN32_WINNT_WINXP)
EXTERN_C EXTERN_C
ULONG ULONG
WMIAPI WMIAPI
EnumerateTraceGuids( EnumerateTraceGuids(
__inout_ecount(PropertyArrayCount) PTRACE_GUID_PROPERTIES *GuidPropertiesArr ay, __inout_ecount(PropertyArrayCount) PTRACE_GUID_PROPERTIES *GuidPropertiesArr ay,
__in ULONG PropertyArrayCount, __in ULONG PropertyArrayCount,
__out PULONG GuidCount __out PULONG GuidCount
); );
#endif #endif
skipping to change at line 1081 skipping to change at line 1347
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 (WINVER >= 0x0501) #if (NTDDI_VERSION >= NTDDI_WINXP)
#define FlushTrace FlushTraceW #define FlushTrace FlushTraceW
#endif #endif // NTDDI_VERSION >= NTDDI_WINXP
#define QueryAllTraces QueryAllTracesW #define QueryAllTraces QueryAllTracesW
#define OpenTrace OpenTraceW #define OpenTrace OpenTraceW
#else #else
#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 (WINVER >= 0x0501) #if (NTDDI_VERSION >= NTDDI_WINXP)
#define FlushTrace FlushTraceA #define FlushTrace FlushTraceA
#endif #endif // NTDDI_VERSION >= NTDDI_WINXP
#define QueryAllTraces QueryAllTracesA #define QueryAllTraces QueryAllTracesA
#define OpenTrace OpenTraceA #define OpenTrace OpenTraceA
#endif // UNICODE #endif // UNICODE
#endif /* _WMIKM_ && _NTDDK_ */ #endif /* _WMIKM_ && _NTDDK_ */
#endif // WINNT #endif // WINNT
#endif /* _EVNTRACE_ */ #endif /* _EVNTRACE_ */
 End of changes. 71 change blocks. 
118 lines changed or deleted 403 lines changed or added


 lmserver.h (5.2.3790.3959-Windows 5.0)   lmserver.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 48 skipping to change at line 48
#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 LMCSTR servername OPTIONAL, __in_opt IN LMCSTR servername OPTIONAL,
IN DWORD level, __in IN DWORD level,
OUT LPBYTE *bufptr, __out OUT LPBYTE *bufptr,
IN DWORD prefmaxlen, __in IN DWORD prefmaxlen,
OUT LPDWORD entriesread, __out OUT LPDWORD entriesread,
OUT LPDWORD totalentries, __out OUT LPDWORD totalentries,
IN DWORD servertype, __in IN DWORD servertype,
IN LMCSTR domain OPTIONAL, __in_opt IN LMCSTR domain OPTIONAL,
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 LMCSTR ServerName OPTIONAL, __in_opt IN LMCSTR ServerName OPTIONAL,
IN DWORD Level, __in IN DWORD Level,
OUT LPBYTE *Bufptr, __deref_out OUT LPBYTE *Bufptr,
IN DWORD PrefMaxlen, __in IN DWORD PrefMaxlen,
OUT LPDWORD EntriesRead, __out OUT LPDWORD EntriesRead,
OUT LPDWORD totalentries, __out OUT LPDWORD totalentries,
IN DWORD servertype, __in IN DWORD servertype,
IN LMCSTR domain OPTIONAL, __in_opt IN LMCSTR domain OPTIONAL,
IN LMCSTR FirstNameToReturn OPTIONAL __in_opt IN LMCSTR FirstNameToReturn OPTIONAL
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerGetInfo ( NetServerGetInfo (
IN LMSTR servername OPTIONAL, __in_opt IN LMSTR servername OPTIONAL,
IN DWORD level, IN DWORD level,
OUT LPBYTE *bufptr __out OUT LPBYTE *bufptr
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerSetInfo ( NetServerSetInfo (
IN LMSTR servername OPTIONAL, __in_opt IN LMSTR servername OPTIONAL,
IN DWORD level, IN DWORD level,
IN LPBYTE buf, IN LPBYTE buf,
OUT LPDWORD ParmError OPTIONAL __out_opt OUT LPDWORD ParmError OPTIONAL
); );
// //
// Temporary hack function. // Temporary hack function.
// //
NET_API_STATUS NET_API_STATUS
NetServerSetInfoCommandLine ( NetServerSetInfoCommandLine (
IN WORD argc, IN WORD argc,
IN LMSTR argv[] IN LMSTR argv[]
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerDiskEnum ( NetServerDiskEnum (
IN LMSTR servername OPTIONAL, __in_opt IN LMSTR servername OPTIONAL,
IN DWORD level, IN DWORD level,
OUT LPBYTE *bufptr, __out OUT LPBYTE *bufptr,
IN DWORD prefmaxlen, IN DWORD prefmaxlen,
OUT LPDWORD entriesread, __out OUT LPDWORD entriesread,
OUT LPDWORD totalentries, __out OUT LPDWORD totalentries,
IN OUT LPDWORD resume_handle OPTIONAL IN OUT LPDWORD resume_handle OPTIONAL
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerComputerNameAdd( NetServerComputerNameAdd(
IN LMSTR ServerName OPTIONAL, __in_opt IN LMSTR ServerName OPTIONAL,
IN LMSTR EmulatedDomainName OPTIONAL, __in_opt IN LMSTR EmulatedDomainName OPTIONAL,
IN LMSTR EmulatedServerName __in IN LMSTR EmulatedServerName
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerComputerNameDel ( NetServerComputerNameDel (
IN LMSTR ServerName OPTIONAL, __in_opt IN LMSTR ServerName OPTIONAL,
IN LMSTR EmulatedServerName __in IN LMSTR EmulatedServerName
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportAdd ( NetServerTransportAdd (
IN LMSTR servername, __in_opt IN LMSTR servername,
IN DWORD level, IN DWORD level,
IN LPBYTE bufptr __in_bcount(sizeof(SERVER_TRANSPORT_INFO_0)) IN LPBYTE bufptr
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportAddEx ( NetServerTransportAddEx (
IN LMSTR servername OPTIONAL, __in_opt IN LMSTR servername OPTIONAL,
IN DWORD level, IN DWORD level,
IN LPBYTE bufptr __in IN LPBYTE bufptr
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportDel ( NetServerTransportDel (
IN LMSTR servername, __in_opt IN LMSTR servername,
IN DWORD level, IN DWORD level,
IN LPBYTE bufptr __in_bcount(sizeof(SERVER_TRANSPORT_INFO_0)) IN LPBYTE bufptr
); );
NET_API_STATUS NET_API_FUNCTION NET_API_STATUS NET_API_FUNCTION
NetServerTransportEnum ( NetServerTransportEnum (
IN LMSTR servername, __in_opt IN LMSTR servername,
IN DWORD level, IN DWORD level,
OUT LPBYTE *bufptr, __out OUT LPBYTE *bufptr,
IN DWORD prefmaxlen, IN DWORD prefmaxlen,
OUT LPDWORD entriesread, __out OUT LPDWORD entriesread,
OUT LPDWORD totalentries, __out OUT LPDWORD totalentries,
IN OUT LPDWORD resumehandle __inout_opt IN OUT LPDWORD resumehandle
); );
// //
// 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 1357 skipping to change at line 1357
// 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 0x2
#define SVTI2_SCOPED_NAME 0x4
#define SVTI2_VALID_FLAGS (SVTI2_REMAP_PIPE_NAMES|SVTI2_SCOPED_NAME)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // _LMSERVER_ #endif // _LMSERVER_
 End of changes. 21 change blocks. 
42 lines changed or deleted 44 lines changed or added


 ntsecapi.h (5.2.3790.3959-Windows 5.0)   ntsecapi.h (6.0.6002.18005-Windows 6.0) 
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:
--*/ --*/
//
// All the subcategories are named as <Audit_CategoryName_SubCategoryName>
//
#ifdef DEFINE_GUID
/* 0cce9210-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_SecurityStateChange_defined)
DEFINE_GUID(
Audit_System_SecurityStateChange,
0x0cce9210,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_System_SecurityStateChange_defined
#endif
#endif
/* 0cce9211-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_SecuritySubsystemExtension_defin
ed)
DEFINE_GUID(
Audit_System_SecuritySubsystemExtension,
0x0cce9211,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_System_SecuritySubsystemExtension_defined
#endif
#endif
/* 0cce9212-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_Integrity_defined)
DEFINE_GUID(
Audit_System_Integrity,
0x0cce9212,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_System_Integrity_defined
#endif
#endif
/* 0cce9213-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_IPSecDriverEvents_defined)
DEFINE_GUID(
Audit_System_IPSecDriverEvents,
0x0cce9213,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_System_IPSecDriverEvents_defined
#endif
#endif
/* 0cce9214-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_Others_defined)
DEFINE_GUID(
Audit_System_Others,
0x0cce9214,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_System_Others_defined
#endif
#endif
/* 0cce9215-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_Logon_defined)
DEFINE_GUID(
Audit_Logon_Logon,
0x0cce9215,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_Logon_defined
#endif
#endif
/* 0cce9216-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_Logoff_defined)
DEFINE_GUID(
Audit_Logon_Logoff,
0x0cce9216,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_Logoff_defined
#endif
#endif
/* 0cce9217-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_AccountLockout_defined)
DEFINE_GUID(
Audit_Logon_AccountLockout,
0x0cce9217,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_AccountLockout_defined
#endif
#endif
/* 0cce9218-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_IPSecMainMode_defined)
DEFINE_GUID(
Audit_Logon_IPSecMainMode,
0x0cce9218,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_IPSecMainMode_defined
#endif
#endif
/* 0cce9219-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_IPSecQuickMode_defined)
DEFINE_GUID(
Audit_Logon_IPSecQuickMode,
0x0cce9219,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_IPSecQuickMode_defined
#endif
#endif
/* 0cce921a-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_IPSecUserMode_defined)
DEFINE_GUID(
Audit_Logon_IPSecUserMode,
0x0cce921a,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_IPSecUserMode_defined
#endif
#endif
/* 0cce921b-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_SpecialLogon_defined)
DEFINE_GUID(
Audit_Logon_SpecialLogon,
0x0cce921b,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_SpecialLogon_defined
#endif
#endif
/* 0cce921c-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_Others_defined)
DEFINE_GUID(
Audit_Logon_Others,
0x0cce921c,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_Others_defined
#endif
#endif
/* 0cce921d-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_FileSystem_defined)
DEFINE_GUID(
Audit_ObjectAccess_FileSystem,
0x0cce921d,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_FileSystem_defined
#endif
#endif
/* 0cce921e-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_Registry_defined)
DEFINE_GUID(
Audit_ObjectAccess_Registry,
0x0cce921e,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_Registry_defined
#endif
#endif
/* 0cce921f-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_Kernel_defined)
DEFINE_GUID(
Audit_ObjectAccess_Kernel,
0x0cce921f,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_Kernel_defined
#endif
#endif
/* 0cce9220-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_Sam_defined)
DEFINE_GUID(
Audit_ObjectAccess_Sam,
0x0cce9220,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_Sam_defined
#endif
#endif
/* 0cce9221-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_CertificationServices_defi
ned)
DEFINE_GUID(
Audit_ObjectAccess_CertificationServices,
0x0cce9221,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_CertificationServices_defined
#endif
#endif
/* 0cce9222-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_ApplicationGenerated_defin
ed)
DEFINE_GUID(
Audit_ObjectAccess_ApplicationGenerated,
0x0cce9222,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_ApplicationGenerated_defined
#endif
#endif
/*
The Audit_ObjectAccess_Handle sub-category behaves different from the other sub-
categories.
For handle based audits to be generated (Open handle AuditId: 0x1230, Close hand
le AuditId:
0x1232), the corresponding object sub-category AND Audit_ObjectAccess_Handle mus
t be
enabled. For eg, to generate handle based audits for Reg keys, both
Audit_ObjectAccess_Registry and Audit_ObjectAccess_Handle must be enabled
*/
/* 0cce9223-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_Handle_defined)
DEFINE_GUID(
Audit_ObjectAccess_Handle,
0x0cce9223,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_Handle_defined
#endif
#endif
/* 0cce9224-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_Share_defined)
DEFINE_GUID(
Audit_ObjectAccess_Share,
0x0cce9224,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_Share_defined
#endif
#endif
/* 0cce9225-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_FirewallPacketDrops_define
d)
DEFINE_GUID(
Audit_ObjectAccess_FirewallPacketDrops,
0x0cce9225,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_FirewallPacketDrops_defined
#endif
#endif
/* 0cce9226-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_FirewallConnection_defined
)
DEFINE_GUID(
Audit_ObjectAccess_FirewallConnection,
0x0cce9226,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_FirewallConnection_defined
#endif
#endif
/* 0cce9227-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_Other_defined)
DEFINE_GUID(
Audit_ObjectAccess_Other,
0x0cce9227,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_Other_defined
#endif
#endif
/* 0cce9228-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PrivilegeUse_Sensitive_defined)
DEFINE_GUID(
Audit_PrivilegeUse_Sensitive,
0x0cce9228,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PrivilegeUse_Sensitive_defined
#endif
#endif
/* 0cce9229-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PrivilegeUse_NonSensitive_defined)
DEFINE_GUID(
Audit_PrivilegeUse_NonSensitive,
0x0cce9229,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PrivilegeUse_NonSensitive_defined
#endif
#endif
/* 0cce922a-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PrivilegeUse_Others_defined)
DEFINE_GUID(
Audit_PrivilegeUse_Others,
0x0cce922a,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PrivilegeUse_Others_defined
#endif
#endif
/* 0cce922b-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DetailedTracking_ProcessCreation_define
d)
DEFINE_GUID(
Audit_DetailedTracking_ProcessCreation,
0x0cce922b,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DetailedTracking_ProcessCreation_defined
#endif
#endif
/* 0cce922c-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DetailedTracking_ProcessTermination_def
ined)
DEFINE_GUID(
Audit_DetailedTracking_ProcessTermination,
0x0cce922c,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DetailedTracking_ProcessTermination_defined
#endif
#endif
/* 0cce922d-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DetailedTracking_DpapiActivity_defined)
DEFINE_GUID(
Audit_DetailedTracking_DpapiActivity,
0x0cce922d,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DetailedTracking_DpapiActivity_defined
#endif
#endif
/* 0cce922e-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DetailedTracking_RpcCall_defined)
DEFINE_GUID(
Audit_DetailedTracking_RpcCall,
0x0cce922e,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DetailedTracking_RpcCall_defined
#endif
#endif
/* 0cce922f-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_AuditPolicy_defined)
DEFINE_GUID(
Audit_PolicyChange_AuditPolicy,
0x0cce922f,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_AuditPolicy_defined
#endif
#endif
/* 0cce9230-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_AuthenticationPolicy_defin
ed)
DEFINE_GUID(
Audit_PolicyChange_AuthenticationPolicy,
0x0cce9230,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_AuthenticationPolicy_defined
#endif
#endif
/* 0cce9231-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_AuthorizationPolicy_define
d)
DEFINE_GUID(
Audit_PolicyChange_AuthorizationPolicy,
0x0cce9231,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_AuthorizationPolicy_defined
#endif
#endif
/* 0cce9232-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_MpsscvRulePolicy_defined)
DEFINE_GUID(
Audit_PolicyChange_MpsscvRulePolicy,
0x0cce9232,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_MpsscvRulePolicy_defined
#endif
#endif
/* 0cce9233-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_WfpIPSecPolicy_defined)
DEFINE_GUID(
Audit_PolicyChange_WfpIPSecPolicy,
0x0cce9233,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_WfpIPSecPolicy_defined
#endif
#endif
/* 0cce9234-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_Others_defined)
DEFINE_GUID(
Audit_PolicyChange_Others,
0x0cce9234,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_Others_defined
#endif
#endif
/* 0cce9235-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_UserAccount_defined)
DEFINE_GUID(
Audit_AccountManagement_UserAccount,
0x0cce9235,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_UserAccount_defined
#endif
#endif
/* 0cce9236-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_ComputerAccount_defin
ed)
DEFINE_GUID(
Audit_AccountManagement_ComputerAccount,
0x0cce9236,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_ComputerAccount_defined
#endif
#endif
/* 0cce9237-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_SecurityGroup_defined
)
DEFINE_GUID(
Audit_AccountManagement_SecurityGroup,
0x0cce9237,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_SecurityGroup_defined
#endif
#endif
/* 0cce9238-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_DistributionGroup_def
ined)
DEFINE_GUID(
Audit_AccountManagement_DistributionGroup,
0x0cce9238,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_DistributionGroup_defined
#endif
#endif
/* 0cce9239-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_ApplicationGroup_defi
ned)
DEFINE_GUID(
Audit_AccountManagement_ApplicationGroup,
0x0cce9239,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_ApplicationGroup_defined
#endif
#endif
/* 0cce923a-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_Others_defined)
DEFINE_GUID(
Audit_AccountManagement_Others,
0x0cce923a,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_Others_defined
#endif
#endif
/* 0cce923b-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DSAccess_DSAccess_defined)
DEFINE_GUID(
Audit_DSAccess_DSAccess,
0x0cce923b,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DSAccess_DSAccess_defined
#endif
#endif
/* 0cce923c-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DsAccess_AdAuditChanges_defined)
DEFINE_GUID(
Audit_DsAccess_AdAuditChanges,
0x0cce923c,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DsAccess_AdAuditChanges_defined
#endif
#endif
/* 0cce923d-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Ds_Replication_defined)
DEFINE_GUID(
Audit_Ds_Replication,
0x0cce923d,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Ds_Replication_defined
#endif
#endif
/* 0cce923e-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Ds_DetailedReplication_defined)
DEFINE_GUID(
Audit_Ds_DetailedReplication,
0x0cce923e,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Ds_DetailedReplication_defined
#endif
#endif
/* 0cce923f-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountLogon_CredentialValidation_defin
ed)
DEFINE_GUID(
Audit_AccountLogon_CredentialValidation,
0x0cce923f,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountLogon_CredentialValidation_defined
#endif
#endif
/* 0cce9240-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountLogon_Kerberos_defined)
DEFINE_GUID(
Audit_AccountLogon_Kerberos,
0x0cce9240,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountLogon_Kerberos_defined
#endif
#endif
/* 0cce9241-69ae-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountLogon_Others_defined)
DEFINE_GUID(
Audit_AccountLogon_Others,
0x0cce9241,
0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountLogon_Others_defined
#endif
#endif
#endif // DEFINE_GUID
//
// All categories are named as <Audit_CategoryName>
//
#ifdef DEFINE_GUID
/* 69979848-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_System_defined)
DEFINE_GUID(
Audit_System,
0x69979848,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_System_defined
#endif
#endif
/* 69979849-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_Logon_defined)
DEFINE_GUID(
Audit_Logon,
0x69979849,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_Logon_defined
#endif
#endif
/* 6997984a-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_ObjectAccess_defined)
DEFINE_GUID(
Audit_ObjectAccess,
0x6997984a,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_ObjectAccess_defined
#endif
#endif
/* 6997984b-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PrivilegeUse_defined)
DEFINE_GUID(
Audit_PrivilegeUse,
0x6997984b,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PrivilegeUse_defined
#endif
#endif
/* 6997984c-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DetailedTracking_defined)
DEFINE_GUID(
Audit_DetailedTracking,
0x6997984c,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DetailedTracking_defined
#endif
#endif
/* 6997984d-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_PolicyChange_defined)
DEFINE_GUID(
Audit_PolicyChange,
0x6997984d,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_PolicyChange_defined
#endif
#endif
/* 6997984e-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountManagement_defined)
DEFINE_GUID(
Audit_AccountManagement,
0x6997984e,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountManagement_defined
#endif
#endif
/* 6997984f-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_DirectoryServiceAccess_defined)
DEFINE_GUID(
Audit_DirectoryServiceAccess,
0x6997984f,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_DirectoryServiceAccess_defined
#endif
#endif
/* 69979850-797a-11d9-bed3-505054503030 */
#if !defined(INITGUID) || !defined(Audit_AccountLogon_defined)
DEFINE_GUID(
Audit_AccountLogon,
0x69979850,
0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30
);
#ifdef INITGUID
#define Audit_AccountLogon_defined
#endif
#endif
#endif // DEFINE_GUID
#ifndef _NTSECAPI_ #ifndef _NTSECAPI_
#define _NTSECAPI_ #define _NTSECAPI_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _NTDEF_ #ifndef _NTDEF_
typedef LONG NTSTATUS, *PNTSTATUS; typedef LONG NTSTATUS, *PNTSTATUS;
#endif #endif
skipping to change at line 89 skipping to change at line 821
#define LSA_MODE_LOG_FULL (0x00000008L) #define LSA_MODE_LOG_FULL (0x00000008L)
#ifndef _NTLSA_IFS_ #ifndef _NTLSA_IFS_
// begin_ntifs // begin_ntifs
// //
// Used by a logon process to indicate what type of logon is being // Used by a logon process to indicate what type of logon is being
// requested. // requested.
// //
typedef enum _SECURITY_LOGON_TYPE { typedef enum _SECURITY_LOGON_TYPE {
Interactive = 2, // Interactively logged on (locally or remotely) UndefinedLogonType = 0, // This is used to specify an undefied logon type
Network, // Accessing system via network Interactive = 2, // Interactively logged on (locally or remotely)
Batch, // Started via a batch queue Network, // Accessing system via network
Service, // Service started by service controller Batch, // Started via a batch queue
Proxy, // Proxy logon Service, // Service started by service controller
Unlock, // Unlock workstation Proxy, // Proxy logon
NetworkCleartext, // Network logon with cleartext credentials Unlock, // Unlock workstation
NewCredentials, // Clone caller, new default credentials NetworkCleartext, // Network logon with cleartext credentials
NewCredentials, // Clone caller, new default credentials
//The types below only exist in Windows XP and greater
#if (_WIN32_WINNT >= 0x0501)
RemoteInteractive, // Remote, yet interactive. Terminal server RemoteInteractive, // Remote, yet interactive. Terminal server
CachedInteractive, // Try cached credentials without hitting the net. CachedInteractive, // Try cached credentials without hitting the net.
// The types below only exist in Windows Server 2003 and greater
#endif
#if (_WIN32_WINNT >= 0x0502)
CachedRemoteInteractive, // Same as RemoteInteractive, this is used internal ly for auditing purpose CachedRemoteInteractive, // Same as RemoteInteractive, this is used internal ly for auditing purpose
CachedUnlock // Cached Unlock workstation CachedUnlock // Cached Unlock workstation
#endif
} SECURITY_LOGON_TYPE, *PSECURITY_LOGON_TYPE; } SECURITY_LOGON_TYPE, *PSECURITY_LOGON_TYPE;
// end_ntifs // end_ntifs
#endif // _NTLSA_IFS_ #endif // _NTLSA_IFS_
#ifndef _NTLSA_IFS_ #ifndef _NTLSA_IFS_
// begin_ntifs // begin_ntifs
//
// All of this stuff (between the Ifndef _NTLSA_AUDIT_ and its endif) were not
// present in NTIFS prior to Windows Server 2003 SP1. All of the definitions how
ever
// exist down to windows 2000 (except for the few exceptions noted in the code).
//
#ifndef _NTLSA_AUDIT_ #ifndef _NTLSA_AUDIT_
#define _NTLSA_AUDIT_ #define _NTLSA_AUDIT_
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// // // //
// Data types related to Auditing // // Data types related to Auditing //
// // // //
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
skipping to change at line 191 skipping to change at line 936
SeAdtParmTypeSid, //Produces 1 parameter. SeAdtParmTypeSid, //Produces 1 parameter.
//Received value: //Received value:
// //
// SID (variable length) // SID (variable length)
// //
//Results in: //Results in:
// //
// String representation of SID // String representation of SID
// //
SeAdtParmTypeLogonId, //Produces 3 parameters. SeAdtParmTypeLogonId, //Produces 4 parameters.
//Received Value: //Received Value:
// //
// LUID (fixed length) // LUID (fixed length)
// //
//Results in: //Results in:
// //
// param 1: Username string // param 1: Sid string
// param 2: domain name string // param 2: Username string
// param 3: Logon ID (Luid) string // param 3: domain name string
// param 4: Logon ID (Luid) string
SeAdtParmTypeNoLogonId, //Produces 3 parameters. SeAdtParmTypeNoLogonId, //Produces 3 parameters.
//Received value: //Received value:
// //
// None. // None.
// //
//Results in: //Results in:
// //
// param 1: "-" // param 1: "-"
// param 2: "-" // param 2: "-"
// param 3: "-" // param 3: "-"
// param 4: "-"
// //
//Note: //Note:
// //
// This type is used when a logon ID // This type is used when a logon ID
// is needed, but one is not available // is needed, but one is not available
// to pass. For example, if an // to pass. For example, if an
// impersonation logon ID is expected // impersonation logon ID is expected
// but the subject is not impersonating // but the subject is not impersonating
// anyone. // anyone.
// //
skipping to change at line 256 skipping to change at line 1003
// %%1062\n\t\t%1066\n\t\t%%601 // %%1062\n\t\t%1066\n\t\t%%601
// //
// The %%numbers are signals to the // The %%numbers are signals to the
// event viewer to perform parameter // event viewer to perform parameter
// substitution before display. // substitution before display.
// //
SeAdtParmTypePrivs, //Produces 1 parameter with formatting. SeAdtParmTypePrivs, //Produces 1 parameter with formatting.
//Received value: //Received value:
// //
// ??? Check with RobertRe and ScottBi
//
//Results in: //Results in:
// //
// formatted unicode string similar to // formatted unicode string similar to
// that for access types. Each priv // that for access types. Each priv
// will be formatted to be displayed // will be formatted to be displayed
// on its own line. E.g., // on its own line. E.g.,
// //
// %%642\n\t\t%%651\n\t\t%%655 // %%642\n\t\t%%651\n\t\t%%655
// //
skipping to change at line 285 skipping to change at line 1030
SeAdtParmTypeHexUlong, //Produces 1 parameter SeAdtParmTypeHexUlong, //Produces 1 parameter
//Received value: //Received value:
// //
// Ulong // Ulong
// //
//Results in: //Results in:
// //
// Unicode string representation of // Unicode string representation of
// unsigned integer value in hexadecimal. // unsigned integer value in hexadecimal.
// In W2k this value did not exist, it was ParmTypeLUID
SeAdtParmTypePtr, //Produces 1 parameter SeAdtParmTypePtr, //Produces 1 parameter
//Received value: //Received value:
// //
// pointer // pointer
// //
//Results in: //Results in:
// //
// Unicode string representation of // Unicode string representation of
// unsigned integer value in hexadecimal. // unsigned integer value in hexadecimal.
//
// Everything below exists only in Windows XP and greater
//
SeAdtParmTypeTime, //Produces 2 parameters SeAdtParmTypeTime, //Produces 2 parameters
//Received value: //Received value:
// //
// LARGE_INTEGER // LARGE_INTEGER
// //
//Results in: //Results in:
// //
// Unicode string representation of // Unicode string representation of
// date and time. // date and time.
skipping to change at line 317 skipping to change at line 1068
//Received value: //Received value:
// //
// GUID pointer // GUID pointer
// //
//Results in: //Results in:
// //
// Unicode string representation of GUID // Unicode string representation of GUID
// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
// //
//
// Everything below exists only in Windows Server 2003 and Greater
//
SeAdtParmTypeLuid, // SeAdtParmTypeLuid, //
//Produces 1 parameter //Produces 1 parameter
//Received value: //Received value:
// //
// LUID // LUID
// //
//Results in: //Results in:
// //
// Hex LUID // Hex LUID
// //
skipping to change at line 412 skipping to change at line 1167
SeAdtParmTypeDateTime, //Produces 1 Parameter SeAdtParmTypeDateTime, //Produces 1 Parameter
//Received value: //Received value:
// //
// LARGE_INTEGER // LARGE_INTEGER
// //
//Results in: //Results in:
// //
// Unicode string representation of // Unicode string representation of
// date and time (in _one_ string). // date and time (in _one_ string).
SeAdtParmTypeSockAddr // Produces 2 parameters SeAdtParmTypeSockAddr, // Produces 2 parameters
// //
// Received value: // Received value:
// //
// pointer to SOCKADDR_IN/SOCKADDR_IN6 // pointer to SOCKADDR_IN/SOCKADDR_IN6
// structure // structure
// //
// Results in: // Results in:
// //
// param 1: IP address string // param 1: IP address string
// param 2: Port number string // param 2: Port number string
// //
//
// Everything below this exists only in Longhorn and greater
//
SeAdtParmTypeSD, // Produces 1 parameters
//
// Received value:
//
// pointer to SECURITY_DESCRIPTOR
// structure
//
// Results in:
//
// SDDL string representation of SD
//
SeAdtParmTypeLogonHours, // Produces 1 parameters
//
// Received value:
//
// pointer to LOGON_HOURS
// structure
//
// Results in:
//
// String representation of allowed logon ho
urs
//
SeAdtParmTypeLogonIdNoSid, //Produces 3 parameters.
//Received Value:
//
// LUID (fixed length)
//
//Results in:
//
// param 1: Username string
// param 2: domain name string
// param 3: Logon ID (Luid) string
SeAdtParmTypeUlongNoConv, // Produces 1 parameter.
// Received Value:
// Ulong
//
//Results in:
// Not converted to string
//
SeAdtParmTypeSockAddrNoPort // Produces 1 parameter
//
// Received value:
//
// pointer to SOCKADDR_IN/SOCKADDR_IN6
// structure
//
// Results in:
//
// param 1: IPv4/IPv6 address string
//
} 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;
#define SE_ADT_OBJECT_ONLY 0x1 #define SE_ADT_OBJECT_ONLY 0x1
skipping to change at line 462 skipping to change at line 1276
#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 {
ULONG CategoryId; ULONG CategoryId;
ULONG AuditId; ULONG AuditId;
ULONG ParameterCount; ULONG ParameterCount;
ULONG Length; ULONG Length;
USHORT FlatSubCategoryId;
USHORT Type; USHORT Type;
ULONG Flags; ULONG Flags;
SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[ SE_MAX_AUDIT_PARAMETERS ]; SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[ SE_MAX_AUDIT_PARAMETERS ];
} SE_ADT_PARAMETER_ARRAY, *PSE_ADT_PARAMETER_ARRAY; } SE_ADT_PARAMETER_ARRAY, *PSE_ADT_PARAMETER_ARRAY;
#define SE_ADT_PARAMETERS_SELF_RELATIVE 0x00000001 #define SE_ADT_PARAMETERS_SELF_RELATIVE 0x00000001
#define SE_ADT_PARAMETERS_SEND_TO_LSA 0x00000002
#define SE_ADT_PARAMETER_EXTENSIBLE_AUDIT 0x00000004
#define SE_ADT_PARAMETER_GENERIC_AUDIT 0x00000008
#define SE_ADT_PARAMETER_WRITE_SYNCHRONOUS 0x00000010
//
// This macro only existed in longhorn and after
//
#define LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE(AuditParameters) \
( sizeof(SE_ADT_PARAMETER_ARRAY) - \
sizeof(SE_ADT_PARAMETER_ARRAY_ENTRY) * \
(SE_MAX_AUDIT_PARAMETERS - AuditParameters->ParameterCount) )
#endif // _NTLSA_AUDIT_ #endif // _NTLSA_AUDIT_
// end_ntifs // end_ntifs
#endif // _NTLSA_IFS_ #endif // _NTLSA_IFS_
// //
// Audit Event Categories // Audit Event Categories
// //
// The following are the built-in types or Categories of audit event. // The following are the built-in types or Categories of audit event.
// WARNING! This structure is subject to expansion. The user should not // WARNING! This structure is subject to expansion. The user should not
// compute the number of elements of this type directly, but instead // compute the number of elements of this type directly, but instead
// should obtain the count of elements by calling LsaQueryInformationPolicy() // should obtain the count of elements by calling LsaQueryInformationPolicy()
// for the PolicyAuditEventsInformation class and extracting the count from // for the PolicyAuditEventsInformation class and extracting the count from
// the MaximumAuditEventCount field of the returned structure. // the MaximumAuditEventCount field of the returned structure.
// //
typedef enum _POLICY_AUDIT_EVENT_TYPE { typedef enum _POLICY_AUDIT_EVENT_TYPE {
AuditCategorySystem, AuditCategorySystem = 0,
AuditCategoryLogon, AuditCategoryLogon,
AuditCategoryObjectAccess, AuditCategoryObjectAccess,
AuditCategoryPrivilegeUse, AuditCategoryPrivilegeUse,
AuditCategoryDetailedTracking, AuditCategoryDetailedTracking,
AuditCategoryPolicyChange, AuditCategoryPolicyChange,
AuditCategoryAccountManagement, AuditCategoryAccountManagement,
AuditCategoryDirectoryServiceAccess, AuditCategoryDirectoryServiceAccess,
AuditCategoryAccountLogon AuditCategoryAccountLogon
} POLICY_AUDIT_EVENT_TYPE, *PPOLICY_AUDIT_EVENT_TYPE; } POLICY_AUDIT_EVENT_TYPE, *PPOLICY_AUDIT_EVENT_TYPE;
skipping to change at line 590 skipping to change at line 1418
// begin_ntifs // begin_ntifs
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
// However, the function has always been there, so it is okay to use
// even on w2k
//
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_bcount(AuthenticationInformationLength) PVOID AuthenticationInformation ,
__in ULONG AuthenticationInformationLength, __in ULONG AuthenticationInformationLength,
__in_opt PTOKEN_GROUPS LocalGroups, __in_opt PTOKEN_GROUPS LocalGroups,
skipping to change at line 784 skipping to change at line 1618
// DomainIndex field. // DomainIndex field.
// //
// DomainIndex - Is the index of an entry in a related // DomainIndex - Is the index of an entry in a related
// LSA_REFERENCED_DOMAIN_LIST data structure describing the // LSA_REFERENCED_DOMAIN_LIST data structure describing the
// domain in which the account was found. // domain in which the account was found.
// //
// If there is no corresponding reference domain for an entry, then // If there is no corresponding reference domain for an entry, then
// this field will contain a negative value. // this field will contain a negative value.
// //
#if (_WIN32_WINNT >= 0x0501)
typedef struct _LSA_TRANSLATED_SID2 { typedef struct _LSA_TRANSLATED_SID2 {
SID_NAME_USE Use; SID_NAME_USE Use;
PSID Sid; PSID Sid;
LONG DomainIndex; LONG DomainIndex;
ULONG Flags; ULONG Flags;
} LSA_TRANSLATED_SID2, *PLSA_TRANSLATED_SID2; } LSA_TRANSLATED_SID2, *PLSA_TRANSLATED_SID2;
// where members have the following usage: // where members have the following usage:
skipping to change at line 808 skipping to change at line 1643
// //
// Sid - Contains the complete Sid of the tranlated SID // Sid - Contains the complete Sid of the tranlated SID
// //
// DomainIndex - Is the index of an entry in a related // DomainIndex - Is the index of an entry in a related
// LSA_REFERENCED_DOMAIN_LIST data structure describing the // LSA_REFERENCED_DOMAIN_LIST data structure describing the
// domain in which the account was found. // domain in which the account was found.
// //
// If there is no corresponding reference domain for an entry, then // If there is no corresponding reference domain for an entry, then
// this field will contain a negative value. // this field will contain a negative value.
// //
#endif
// //
// The following data type is used in SID to name lookup services to // The following data type is used in SID to name lookup services to
// describe the domains referenced in the lookup operation. // describe the domains referenced in the lookup operation.
// //
typedef struct _LSA_TRANSLATED_NAME { typedef struct _LSA_TRANSLATED_NAME {
SID_NAME_USE Use; SID_NAME_USE Use;
LSA_UNICODE_STRING Name; LSA_UNICODE_STRING Name;
skipping to change at line 851 skipping to change at line 1687
// server (primary or backup). // server (primary or backup).
// //
typedef enum _POLICY_LSA_SERVER_ROLE { typedef enum _POLICY_LSA_SERVER_ROLE {
PolicyServerRoleBackup = 2, PolicyServerRoleBackup = 2,
PolicyServerRolePrimary PolicyServerRolePrimary
} POLICY_LSA_SERVER_ROLE, *PPOLICY_LSA_SERVER_ROLE; } POLICY_LSA_SERVER_ROLE, *PPOLICY_LSA_SERVER_ROLE;
#if (_WIN32_WINNT < 0x0502)
//
// The following data type is used to represent the state of the LSA
// server (enabled or disabled). Some operations may only be performed on
// an enabled LSA server.
//
typedef enum _POLICY_SERVER_ENABLE_STATE {
PolicyServerEnabled = 2,
PolicyServerDisabled
} POLICY_SERVER_ENABLE_STATE, *PPOLICY_SERVER_ENABLE_STATE;
#endif
// //
// The following data type is used to specify the auditing options for // The following data type is used to specify the auditing options for
// an Audit Event Type. // an Audit Event Type.
// //
typedef ULONG POLICY_AUDIT_EVENT_OPTIONS, *PPOLICY_AUDIT_EVENT_OPTIONS; typedef ULONG POLICY_AUDIT_EVENT_OPTIONS, *PPOLICY_AUDIT_EVENT_OPTIONS;
// where the following flags can be set: // where the following flags can be set:
// //
// POLICY_AUDIT_EVENT_UNCHANGED - Leave existing auditing options // POLICY_AUDIT_EVENT_UNCHANGED - Leave existing auditing options
skipping to change at line 895 skipping to change at line 1746
PolicyPrimaryDomainInformation, PolicyPrimaryDomainInformation,
PolicyPdAccountInformation, PolicyPdAccountInformation,
PolicyAccountDomainInformation, PolicyAccountDomainInformation,
PolicyLsaServerRoleInformation, PolicyLsaServerRoleInformation,
PolicyReplicaSourceInformation, PolicyReplicaSourceInformation,
PolicyDefaultQuotaInformation, PolicyDefaultQuotaInformation,
PolicyModificationInformation, PolicyModificationInformation,
PolicyAuditFullSetInformation, PolicyAuditFullSetInformation,
PolicyAuditFullQueryInformation, PolicyAuditFullQueryInformation,
PolicyDnsDomainInformation, PolicyDnsDomainInformation,
PolicyDnsDomainInformationInt PolicyDnsDomainInformationInt,
PolicyLocalAccountDomainInformation,
PolicyLastEntry
} POLICY_INFORMATION_CLASS, *PPOLICY_INFORMATION_CLASS; } POLICY_INFORMATION_CLASS, *PPOLICY_INFORMATION_CLASS;
// //
// The following data type corresponds to the PolicyAuditLogInformation // The following data type corresponds to the PolicyAuditLogInformation
// information class. It is used to represent information relating to // information class. It is used to represent information relating to
// the Audit Log. // the Audit Log.
// //
// This structure may be used in both query and set operations. However, // This structure may be used in both query and set operations. However,
// when used in set operations, some fields are ignored. // when used in set operations, some fields are ignored.
skipping to change at line 996 skipping to change at line 1849
// indexed by Audit Event Type. // indexed by Audit Event Type.
// //
// MaximumAuditEventCount - Specifiesa count of the number of Audit // MaximumAuditEventCount - Specifiesa count of the number of Audit
// Event Types specified by the EventAuditingOptions parameter. If // Event Types specified by the EventAuditingOptions parameter. If
// this count is less than the number of Audit Event Types supported // this count is less than the number of Audit Event Types supported
// by the system, the Auditing Options for Event Types with IDs // by the system, the Auditing Options for Event Types with IDs
// higher than (MaximumAuditEventCount + 1) are left unchanged. // higher than (MaximumAuditEventCount + 1) are left unchanged.
// //
// //
// The following data type is used to represent information relating to
// the audit requirements.
//
typedef struct _POLICY_AUDIT_SUBCATEGORIES_INFO {
ULONG MaximumSubCategoryCount;
PPOLICY_AUDIT_EVENT_OPTIONS EventAuditingOptions;
} POLICY_AUDIT_SUBCATEGORIES_INFO, *PPOLICY_AUDIT_SUBCATEGORIES_INFO;
typedef struct _POLICY_AUDIT_CATEGORIES_INFO {
ULONG MaximumCategoryCount;
PPOLICY_AUDIT_SUBCATEGORIES_INFO SubCategoriesInfo;
} POLICY_AUDIT_CATEGORIES_INFO, *PPOLICY_AUDIT_CATEGORIES_INFO;
//
// Valid bits for Per user policy mask.
//
#define PER_USER_POLICY_UNCHANGED (0x00)
#define PER_USER_AUDIT_SUCCESS_INCLUDE (0x01)
#define PER_USER_AUDIT_SUCCESS_EXCLUDE (0x02)
#define PER_USER_AUDIT_FAILURE_INCLUDE (0x04)
#define PER_USER_AUDIT_FAILURE_EXCLUDE (0x08)
#define PER_USER_AUDIT_NONE (0x10)
#define VALID_PER_USER_AUDIT_POLICY_FLAG (PER_USER_AUDIT_SUCCESS_INCLUDE | \
PER_USER_AUDIT_SUCCESS_EXCLUDE | \
PER_USER_AUDIT_FAILURE_INCLUDE | \
PER_USER_AUDIT_FAILURE_EXCLUDE | \
PER_USER_AUDIT_NONE)
//
// The following structure corresponds to the PolicyAccountDomainInformation // The following structure corresponds to the PolicyAccountDomainInformation
// information class. // information class.
// //
typedef struct _POLICY_ACCOUNT_DOMAIN_INFO { typedef struct _POLICY_ACCOUNT_DOMAIN_INFO {
LSA_UNICODE_STRING DomainName; LSA_UNICODE_STRING DomainName;
PSID DomainSid; PSID DomainSid;
} POLICY_ACCOUNT_DOMAIN_INFO, *PPOLICY_ACCOUNT_DOMAIN_INFO; } POLICY_ACCOUNT_DOMAIN_INFO, *PPOLICY_ACCOUNT_DOMAIN_INFO;
skipping to change at line 1170 skipping to change at line 2059
} POLICY_AUDIT_FULL_QUERY_INFO, *PPOLICY_AUDIT_FULL_QUERY_INFO; } POLICY_AUDIT_FULL_QUERY_INFO, *PPOLICY_AUDIT_FULL_QUERY_INFO;
// //
// The following data type defines the classes of Policy Information // The following data type defines the classes of Policy Information
// that may be queried/set that has domain wide effect. // that may be queried/set that has domain wide effect.
// //
typedef enum _POLICY_DOMAIN_INFORMATION_CLASS { typedef enum _POLICY_DOMAIN_INFORMATION_CLASS {
// PolicyDomainQualityOfServiceInformation, // value was used in W2K; no longer #if (_WIN32_WINNT <= 0x0500)
supported PolicyDomainQualityOfServiceInformation = 1,
#endif
PolicyDomainEfsInformation = 2, PolicyDomainEfsInformation = 2,
PolicyDomainKerberosTicketInformation PolicyDomainKerberosTicketInformation
} POLICY_DOMAIN_INFORMATION_CLASS, *PPOLICY_DOMAIN_INFORMATION_CLASS; } POLICY_DOMAIN_INFORMATION_CLASS, *PPOLICY_DOMAIN_INFORMATION_CLASS;
#if (_WIN32_WINNT < 0x0502)
//
// QualityOfService information. Corresponds to PolicyDomainQualityOfServiceInf
ormation
//
#define POLICY_QOS_SCHANNEL_REQUIRED 0x00000001
#define POLICY_QOS_OUTBOUND_INTEGRITY 0x00000002
#define POLICY_QOS_OUTBOUND_CONFIDENTIALITY 0x00000004
#define POLICY_QOS_INBOUND_INTEGRITY 0x00000008
#define POLICY_QOS_INBOUND_CONFIDENTIALITY 0x00000010
#define POLICY_QOS_ALLOW_LOCAL_ROOT_CERT_STORE 0x00000020
#define POLICY_QOS_RAS_SERVER_ALLOWED 0x00000040
#define POLICY_QOS_DHCP_SERVER_ALLOWED 0x00000080
//
// Bits 0x00000100 through 0xFFFFFFFF are reserved for future use.
//
#endif
#if (_WIN32_WINNT == 0x0500)
typedef struct _POLICY_DOMAIN_QUALITY_OF_SERVICE_INFO {
ULONG QualityOfService;
} POLICY_DOMAIN_QUALITY_OF_SERVICE_INFO, *PPOLICY_DOMAIN_QUALITY_OF_SERVICE_INFO
;
//
// where the members have the following usage:
//
// QualityOfService - Determines what specific QOS actions a machine should tak
e
//
#endif
// //
// The following structure corresponds to the PolicyEfsInformation // The following structure corresponds to the PolicyEfsInformation
// information class // information class
// //
typedef struct _POLICY_DOMAIN_EFS_INFO { typedef struct _POLICY_DOMAIN_EFS_INFO {
ULONG InfoLength; ULONG InfoLength;
PUCHAR EfsBlob; PUCHAR EfsBlob;
skipping to change at line 1276 skipping to change at line 2199
TrustedPosixOffsetInformation, TrustedPosixOffsetInformation,
TrustedPasswordInformation, TrustedPasswordInformation,
TrustedDomainInformationBasic, TrustedDomainInformationBasic,
TrustedDomainInformationEx, TrustedDomainInformationEx,
TrustedDomainAuthInformation, TrustedDomainAuthInformation,
TrustedDomainFullInformation, TrustedDomainFullInformation,
TrustedDomainAuthInformationInternal, TrustedDomainAuthInformationInternal,
TrustedDomainFullInformationInternal, TrustedDomainFullInformationInternal,
TrustedDomainInformationEx2Internal, TrustedDomainInformationEx2Internal,
TrustedDomainFullInformation2Internal, TrustedDomainFullInformation2Internal,
TrustedDomainSupportedEncryptionTypes,
} TRUSTED_INFORMATION_CLASS, *PTRUSTED_INFORMATION_CLASS; } TRUSTED_INFORMATION_CLASS, *PTRUSTED_INFORMATION_CLASS;
// //
// The following data type corresponds to the TrustedDomainNameInformation // The following data type corresponds to the TrustedDomainNameInformation
// information class. // information class.
// //
typedef struct _TRUSTED_DOMAIN_NAME_INFO { typedef struct _TRUSTED_DOMAIN_NAME_INFO {
LSA_UNICODE_STRING Name; LSA_UNICODE_STRING Name;
skipping to change at line 1366 skipping to change at line 2289
// Direction of the trust // Direction of the trust
// //
#define TRUST_DIRECTION_DISABLED 0x00000000 #define TRUST_DIRECTION_DISABLED 0x00000000
#define TRUST_DIRECTION_INBOUND 0x00000001 #define TRUST_DIRECTION_INBOUND 0x00000001
#define TRUST_DIRECTION_OUTBOUND 0x00000002 #define TRUST_DIRECTION_OUTBOUND 0x00000002
#define TRUST_DIRECTION_BIDIRECTIONAL (TRUST_DIRECTION_INBOUND | TRUST_DIRECTI ON_OUTBOUND) #define TRUST_DIRECTION_BIDIRECTIONAL (TRUST_DIRECTION_INBOUND | TRUST_DIRECTI ON_OUTBOUND)
#define TRUST_TYPE_DOWNLEVEL 0x00000001 // NT4 and before #define TRUST_TYPE_DOWNLEVEL 0x00000001 // NT4 and before
#define TRUST_TYPE_UPLEVEL 0x00000002 // NT5 #define TRUST_TYPE_UPLEVEL 0x00000002 // NT5
#define TRUST_TYPE_MIT 0x00000003 // Trust with a MIT Kerberos realm #define TRUST_TYPE_MIT 0x00000003 // Trust with a MIT Kerberos realm
// #define TRUST_TYPE_DCE 0x00000004 // Trust with a DCE realm
#if (_WIN32_WINNT < 0x0502)
#define TRUST_TYPE_DCE 0x00000004 // Trust with a DCE realm
#endif
// Levels 0x5 - 0x000FFFFF reserved for future use // Levels 0x5 - 0x000FFFFF reserved for future use
// Provider specific trust levels are from 0x00100000 to 0xFFF00000 // Provider specific trust levels are from 0x00100000 to 0xFFF00000
#define TRUST_ATTRIBUTE_NON_TRANSITIVE 0x00000001 // Disallow transitivity #define TRUST_ATTRIBUTE_NON_TRANSITIVE 0x00000001 // Disallow tr
#define TRUST_ATTRIBUTE_UPLEVEL_ONLY 0x00000002 // Trust link only valid ansitivity
for uplevel client #define TRUST_ATTRIBUTE_UPLEVEL_ONLY 0x00000002 // Trust link
#define TRUST_ATTRIBUTE_QUARANTINED_DOMAIN 0x00000004 // Used to quarantine dom only valid for uplevel client
ains #if (_WIN32_WINNT == 0x0500)
#define TRUST_ATTRIBUTE_FOREST_TRANSITIVE 0x00000008 // This link may contain #define TRUST_ATTRIBUTE_TREE_PARENT 0x00400000 // Denotes that we are setti
forest trust information ng the trust
#define TRUST_ATTRIBUTE_CROSS_ORGANIZATION 0x00000010 // This trust is to a dom // to our parent in the org
ain/forest which is not part of this enterprise tree...
#define TRUST_ATTRIBUTE_WITHIN_FOREST 0x00000020 // Trust is internal to t #define TRUST_ATTRIBUTE_TREE_ROOT 0x00800000 // Denotes that we are setti
his forest ng the trust
#define TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL 0x00000040 // Trust is to be treated // to another tree root in a
as external for trust boundary purposes forest...
#define TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION 0x00000080 // MIT trust wi // Trust attributes 0x00000004 through 0x004FFFFF reserved for future use
th RC4 // Trust attributes 0x00F00000 through 0x00400000 are reserved for internal use
// Trust attributes 0x01000000 through 0xFF000000 are reserved for user
// defined values
#define TRUST_ATTRIBUTES_VALID 0xFF02FFFF
#endif
#if (_WIN32_WINNT < 0x0502)
#define TRUST_ATTRIBUTE_FILTER_SIDS 0x00000004 // Used to quarantine dom
ains
#else
#define TRUST_ATTRIBUTE_QUARANTINED_DOMAIN 0x00000004 // Used to qua
rantine domains
#endif
#if (_WIN32_WINNT >= 0x0501)
#define TRUST_ATTRIBUTE_FOREST_TRANSITIVE 0x00000008 // This link m
ay contain forest trust information
#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_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
#if (_WIN32_WINNT >= 0x0600)
#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
#endif
// Trust attributes 0x00000040 through 0x00200000 are reserved for future use // Trust attributes 0x00000040 through 0x00200000 are reserved for future use
#else
// Trust attributes 0x00000010 through 0x00200000 are reserved for future use
#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
#define TRUST_ATTRIBUTES_USER 0xFF000000 #define TRUST_ATTRIBUTES_USER 0xFF000000
typedef struct _TRUSTED_DOMAIN_INFORMATION_EX { typedef struct _TRUSTED_DOMAIN_INFORMATION_EX {
LSA_UNICODE_STRING Name; LSA_UNICODE_STRING Name;
LSA_UNICODE_STRING FlatName; LSA_UNICODE_STRING FlatName;
PSID Sid; PSID Sid;
ULONG TrustDirection; ULONG TrustDirection;
ULONG TrustType; ULONG TrustType;
ULONG TrustAttributes; ULONG TrustAttributes;
skipping to change at line 1454 skipping to change at line 2407
} TRUSTED_DOMAIN_FULL_INFORMATION, *PTRUSTED_DOMAIN_FULL_INFORMATION; } TRUSTED_DOMAIN_FULL_INFORMATION, *PTRUSTED_DOMAIN_FULL_INFORMATION;
typedef struct _TRUSTED_DOMAIN_FULL_INFORMATION2 { typedef struct _TRUSTED_DOMAIN_FULL_INFORMATION2 {
TRUSTED_DOMAIN_INFORMATION_EX2 Information; TRUSTED_DOMAIN_INFORMATION_EX2 Information;
TRUSTED_POSIX_OFFSET_INFO PosixOffset; TRUSTED_POSIX_OFFSET_INFO PosixOffset;
TRUSTED_DOMAIN_AUTH_INFORMATION AuthInformation; TRUSTED_DOMAIN_AUTH_INFORMATION AuthInformation;
} TRUSTED_DOMAIN_FULL_INFORMATION2, *PTRUSTED_DOMAIN_FULL_INFORMATION2; } TRUSTED_DOMAIN_FULL_INFORMATION2, *PTRUSTED_DOMAIN_FULL_INFORMATION2;
typedef struct _TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES {
ULONG SupportedEncryptionTypes;
} TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES, *PTRUSTED_DOMAIN_SUPPORTED_ENCRYPTI
ON_TYPES;
typedef enum { typedef enum {
ForestTrustTopLevelName, ForestTrustTopLevelName,
ForestTrustTopLevelNameEx, ForestTrustTopLevelNameEx,
ForestTrustDomainInfo, ForestTrustDomainInfo,
ForestTrustRecordTypeLast = ForestTrustDomainInfo ForestTrustRecordTypeLast = ForestTrustDomainInfo
} LSA_FOREST_TRUST_RECORD_TYPE; } LSA_FOREST_TRUST_RECORD_TYPE;
#if (_WIN32_WINNT < 0x0502)
#define LSA_FOREST_TRUST_RECORD_TYPE_UNRECOGNIZED 0x80000000
#endif
// //
// Bottom 16 bits of the flags are reserved for disablement reasons // Bottom 16 bits of the flags are reserved for disablement reasons
// //
#define LSA_FTRECORD_DISABLED_REASONS ( 0x0000FFFFL ) #define LSA_FTRECORD_DISABLED_REASONS ( 0x0000FFFFL )
// //
// Reasons for a top-level name forest trust record to be disabled // Reasons for a top-level name forest trust record to be disabled
// //
skipping to change at line 1498 skipping to change at line 2461
#ifdef MIDL_PASS #ifdef MIDL_PASS
PISID Sid; PISID Sid;
#else #else
PSID Sid; PSID Sid;
#endif #endif
LSA_UNICODE_STRING DnsName; LSA_UNICODE_STRING DnsName;
LSA_UNICODE_STRING NetbiosName; LSA_UNICODE_STRING NetbiosName;
} LSA_FOREST_TRUST_DOMAIN_INFO, *PLSA_FOREST_TRUST_DOMAIN_INFO; } LSA_FOREST_TRUST_DOMAIN_INFO, *PLSA_FOREST_TRUST_DOMAIN_INFO;
#if (_WIN32_WINNT >= 0x0502)
// //
// To prevent huge data to be passed in, we should put a limit on LSA_FOREST_TR UST_BINARY_DATA. // To prevent huge data to be passed in, we should put a limit on LSA_FOREST_TR UST_BINARY_DATA.
// 128K is large enough that can't be reached in the near future, and small enough not to // 128K is large enough that can't be reached in the near future, and small enough not to
// cause memory problems. // cause memory problems.
#define MAX_FOREST_TRUST_BINARY_DATA_SIZE ( 128 * 1024 ) #define MAX_FOREST_TRUST_BINARY_DATA_SIZE ( 128 * 1024 )
#endif
typedef struct _LSA_FOREST_TRUST_BINARY_DATA { typedef struct _LSA_FOREST_TRUST_BINARY_DATA {
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0, MAX_FOREST_TRUST_BINARY_DATA_SIZE)] ULONG Length; [range(0, MAX_FOREST_TRUST_BINARY_DATA_SIZE)] ULONG Length;
[size_is( Length )] PUCHAR Buffer; [size_is( Length )] PUCHAR Buffer;
#else #else
ULONG Length; ULONG Length;
PUCHAR Buffer; PUCHAR Buffer;
#endif #endif
skipping to change at line 1543 skipping to change at line 2508
[default] LSA_FOREST_TRUST_BINARY_DATA Data; [default] LSA_FOREST_TRUST_BINARY_DATA Data;
#else #else
LSA_UNICODE_STRING TopLevelName; LSA_UNICODE_STRING TopLevelName;
LSA_FOREST_TRUST_DOMAIN_INFO DomainInfo; LSA_FOREST_TRUST_DOMAIN_INFO DomainInfo;
LSA_FOREST_TRUST_BINARY_DATA Data; // used for unrecognized types LSA_FOREST_TRUST_BINARY_DATA Data; // used for unrecognized types
#endif #endif
} ForestTrustData; } ForestTrustData;
} LSA_FOREST_TRUST_RECORD, *PLSA_FOREST_TRUST_RECORD; } LSA_FOREST_TRUST_RECORD, *PLSA_FOREST_TRUST_RECORD;
#if (_WIN32_WINNT >= 0x0502)
// //
// To prevent forest trust blobs of large size, number of records must be // To prevent forest trust blobs of large size, number of records must be
// smaller than MAX_RECORDS_IN_FOREST_TRUST_INFO // smaller than MAX_RECORDS_IN_FOREST_TRUST_INFO
// //
#define MAX_RECORDS_IN_FOREST_TRUST_INFO 4000 #define MAX_RECORDS_IN_FOREST_TRUST_INFO 4000
#endif
typedef struct _LSA_FOREST_TRUST_INFORMATION { typedef struct _LSA_FOREST_TRUST_INFORMATION {
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0, MAX_RECORDS_IN_FOREST_TRUST_INFO)] ULONG RecordCount; [range(0, MAX_RECORDS_IN_FOREST_TRUST_INFO)] ULONG RecordCount;
[size_is( RecordCount )] PLSA_FOREST_TRUST_RECORD * Entries; [size_is( RecordCount )] PLSA_FOREST_TRUST_RECORD * Entries;
#else #else
ULONG RecordCount; ULONG RecordCount;
PLSA_FOREST_TRUST_RECORD * Entries; PLSA_FOREST_TRUST_RECORD * Entries;
#endif #endif
skipping to change at line 1622 skipping to change at line 2589
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)
typedef struct _LSA_LAST_INTER_LOGON_INFO {
LARGE_INTEGER LastSuccessfulLogon;
LARGE_INTEGER LastFailedLogon;
ULONG FailedAttemptCountSinceLastSuccessfulLogon;
} LSA_LAST_INTER_LOGON_INFO, *PLSA_LAST_INTER_LOGON_INFO;
#endif
#if (_WIN32_WINNT >= 0x0501)
typedef struct _SECURITY_LOGON_SESSION_DATA { typedef struct _SECURITY_LOGON_SESSION_DATA {
ULONG Size ; ULONG Size;
LUID LogonId ; LUID LogonId;
LSA_UNICODE_STRING UserName ; LSA_UNICODE_STRING UserName;
LSA_UNICODE_STRING LogonDomain ; LSA_UNICODE_STRING LogonDomain;
LSA_UNICODE_STRING AuthenticationPackage ; LSA_UNICODE_STRING AuthenticationPackage;
ULONG LogonType ; ULONG LogonType;
ULONG Session ; ULONG Session;
PSID Sid ; PSID Sid;
LARGE_INTEGER LogonTime ; LARGE_INTEGER LogonTime;
// //
// new for whistler: // new for whistler:
// //
LSA_UNICODE_STRING LogonServer ; LSA_UNICODE_STRING LogonServer;
LSA_UNICODE_STRING DnsDomainName ; LSA_UNICODE_STRING DnsDomainName;
LSA_UNICODE_STRING Upn ; LSA_UNICODE_STRING Upn;
} SECURITY_LOGON_SESSION_DATA, * PSECURITY_LOGON_SESSION_DATA ;
#if (_WIN32_WINNT >= 0x0600)
//
// new for LH
//
ULONG UserFlags;
LSA_LAST_INTER_LOGON_INFO LastLogonInfo;
LSA_UNICODE_STRING LogonScript;
LSA_UNICODE_STRING ProfilePath;
LSA_UNICODE_STRING HomeDirectory;
LSA_UNICODE_STRING HomeDirectoryDrive;
LARGE_INTEGER LogoffTime;
LARGE_INTEGER KickOffTime;
LARGE_INTEGER PasswordLastSet;
LARGE_INTEGER PasswordCanChange;
LARGE_INTEGER PasswordMustChange;
#endif
} 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
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
); );
NTSTATUS NTSTATUS
skipping to change at line 1731 skipping to change at line 2732
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)
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
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
); );
#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")
#if (_WIN32_WINNT >= 0x0501)
#define SE_REMOTE_INTERACTIVE_LOGON_NAME TEXT("SeRemoteInteractiveLogonRight" ) #define SE_REMOTE_INTERACTIVE_LOGON_NAME TEXT("SeRemoteInteractiveLogonRight" )
#define SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME TEXT("SeDenyRemoteInteractiveLogon Right") #define SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME TEXT("SeDenyRemoteInteractiveLogon Right")
#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,
skipping to change at line 1887 skipping to change at line 2892
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)
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
skipping to change at line 1919 skipping to change at line 2925
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
// //
// 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,
skipping to change at line 1965 skipping to change at line 2972
// end_ntifs // end_ntifs
// //
// SPNEGO package stuff // SPNEGO package stuff
// //
enum NEGOTIATE_MESSAGES { enum NEGOTIATE_MESSAGES {
NegEnumPackagePrefixes = 0, NegEnumPackagePrefixes = 0,
NegGetCallerName = 1, NegGetCallerName = 1,
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;
UCHAR Prefix[ NEGOTIATE_MAX_PREFIX ]; UCHAR Prefix[ NEGOTIATE_MAX_PREFIX ];
} NEGOTIATE_PACKAGE_PREFIX, * PNEGOTIATE_PACKAGE_PREFIX ; } NEGOTIATE_PACKAGE_PREFIX, * PNEGOTIATE_PACKAGE_PREFIX;
typedef struct _NEGOTIATE_PACKAGE_PREFIXES { typedef struct _NEGOTIATE_PACKAGE_PREFIXES {
ULONG MessageType ; ULONG MessageType;
ULONG PrefixCount ; ULONG PrefixCount;
ULONG Offset ; // Offset to array of _PREFIX above ULONG Offset; // Offset to array of _PREFIX above
ULONG Pad ; // Align structure for 64-bit #if(_WIN32_WINNT >= 0x0502)
} NEGOTIATE_PACKAGE_PREFIXES, *PNEGOTIATE_PACKAGE_PREFIXES ; ULONG Pad; // Align structure for 64-bit
#endif
} NEGOTIATE_PACKAGE_PREFIXES, *PNEGOTIATE_PACKAGE_PREFIXES;
typedef struct _NEGOTIATE_CALLER_NAME_REQUEST { typedef struct _NEGOTIATE_CALLER_NAME_REQUEST {
ULONG MessageType ; ULONG MessageType;
LUID LogonId ; LUID LogonId;
} NEGOTIATE_CALLER_NAME_REQUEST, *PNEGOTIATE_CALLER_NAME_REQUEST ; } NEGOTIATE_CALLER_NAME_REQUEST, *PNEGOTIATE_CALLER_NAME_REQUEST;
typedef struct _NEGOTIATE_CALLER_NAME_RESPONSE { typedef struct _NEGOTIATE_CALLER_NAME_RESPONSE {
ULONG MessageType ; ULONG MessageType;
PWSTR CallerName ; PWSTR CallerName;
} NEGOTIATE_CALLER_NAME_RESPONSE, * PNEGOTIATE_CALLER_NAME_RESPONSE ; } NEGOTIATE_CALLER_NAME_RESPONSE, * PNEGOTIATE_CALLER_NAME_RESPONSE;
#ifndef _NTDEF_ #ifndef _NTDEF_
typedef LSA_UNICODE_STRING UNICODE_STRING, *PUNICODE_STRING; typedef LSA_UNICODE_STRING UNICODE_STRING, *PUNICODE_STRING;
typedef LSA_STRING STRING, *PSTRING ; typedef LSA_STRING STRING, *PSTRING ;
#endif #endif
#ifndef _DOMAIN_PASSWORD_INFORMATION_DEFINED #ifndef _DOMAIN_PASSWORD_INFORMATION_DEFINED
#define _DOMAIN_PASSWORD_INFORMATION_DEFINED #define _DOMAIN_PASSWORD_INFORMATION_DEFINED
typedef struct _DOMAIN_PASSWORD_INFORMATION { typedef struct _DOMAIN_PASSWORD_INFORMATION {
USHORT MinPasswordLength; USHORT MinPasswordLength;
skipping to change at line 2015 skipping to change at line 3024
#if defined(MIDL_PASS) #if defined(MIDL_PASS)
OLD_LARGE_INTEGER MaxPasswordAge; OLD_LARGE_INTEGER MaxPasswordAge;
OLD_LARGE_INTEGER MinPasswordAge; OLD_LARGE_INTEGER MinPasswordAge;
#else #else
LARGE_INTEGER MaxPasswordAge; LARGE_INTEGER MaxPasswordAge;
LARGE_INTEGER MinPasswordAge; LARGE_INTEGER MinPasswordAge;
#endif #endif
} DOMAIN_PASSWORD_INFORMATION, *PDOMAIN_PASSWORD_INFORMATION; } DOMAIN_PASSWORD_INFORMATION, *PDOMAIN_PASSWORD_INFORMATION;
#endif #endif
#if (_WIN32_WINNT >= 0x0501)
// //
// PasswordProperties flags // PasswordProperties flags
// //
#define DOMAIN_PASSWORD_COMPLEX 0x00000001L #define DOMAIN_PASSWORD_COMPLEX 0x00000001L
#define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002L #define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002L
#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004L #define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004L
#define DOMAIN_LOCKOUT_ADMINS 0x00000008L #define DOMAIN_LOCKOUT_ADMINS 0x00000008L
#define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010L #define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010L
#define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020L #define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020L
#if(_WIN32_WINNT >= 0x0502)
#define DOMAIN_NO_LM_OWF_CHANGE 0x00000040L
#endif
#endif
#ifndef _PASSWORD_NOTIFICATION_DEFINED #ifndef _PASSWORD_NOTIFICATION_DEFINED
#define _PASSWORD_NOTIFICATION_DEFINED #define _PASSWORD_NOTIFICATION_DEFINED
typedef NTSTATUS (*PSAM_PASSWORD_NOTIFICATION_ROUTINE) ( typedef NTSTATUS (*PSAM_PASSWORD_NOTIFICATION_ROUTINE) (
PUNICODE_STRING UserName, PUNICODE_STRING UserName,
ULONG RelativeId, ULONG RelativeId,
PUNICODE_STRING NewPassword PUNICODE_STRING NewPassword
); );
#define SAM_PASSWORD_CHANGE_NOTIFY_ROUTINE "PasswordChangeNotify" #define SAM_PASSWORD_CHANGE_NOTIFY_ROUTINE "PasswordChangeNotify"
skipping to change at line 2097 skipping to change at line 3111
// //
// MSV1.0 LsaLogonUser() submission message types. // MSV1.0 LsaLogonUser() submission message types.
// //
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 Longhorn and up
MsV1_0S4ULogon = 12,
} 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 2236 skipping to change at line 3252
#define MSV1_0_DONT_TRY_GUEST_ACCOUNT 0x10 #define MSV1_0_DONT_TRY_GUEST_ACCOUNT 0x10
#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x20 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x20
#define MSV1_0_RETURN_PASSWORD_EXPIRY 0x40 #define MSV1_0_RETURN_PASSWORD_EXPIRY 0x40
// this next flag says that CaseInsensitiveChallengeResponse // this next flag says that CaseInsensitiveChallengeResponse
// (aka LmResponse) contains a client challenge in the first 8 bytes // (aka LmResponse) contains a client challenge in the first 8 bytes
#define MSV1_0_USE_CLIENT_CHALLENGE 0x80 #define MSV1_0_USE_CLIENT_CHALLENGE 0x80
#define MSV1_0_TRY_GUEST_ACCOUNT_ONLY 0x100 #define MSV1_0_TRY_GUEST_ACCOUNT_ONLY 0x100
#define MSV1_0_RETURN_PROFILE_PATH 0x200 #define MSV1_0_RETURN_PROFILE_PATH 0x200
#define MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY 0x400 #define MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY 0x400
#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x800 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x800
//#if (_WIN32_WINNT >= 0x0501) -- Disabled until IIS fixes their target version.
#define MSV1_0_DISABLE_PERSONAL_FALLBACK 0x00001000 #define MSV1_0_DISABLE_PERSONAL_FALLBACK 0x00001000
#define MSV1_0_ALLOW_FORCE_GUEST 0x00002000 #define MSV1_0_ALLOW_FORCE_GUEST 0x00002000
//#endif
#if (_WIN32_WINNT >= 0x0502)
#define MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED 0x00004000 #define MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED 0x00004000
// Start
// Doesnt exist in Windows XP but does exist in Windows 2000 Security Rollup and
up
#define MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY 0x00008000 #define MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY 0x00008000
#endif
#define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000 #define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000
// Defined in Windows Server 2003 SP1 and above
#define MSV1_0_ALLOW_MSVCHAPV2 0x00010000 #define MSV1_0_ALLOW_MSVCHAPV2 0x00010000
#if (_WIN32_WINNT >= 0x0600)
//Defined in Longhorn and up
#define MSV1_0_S4U2SELF 0x00020000 // no password is needed
#define MSV1_0_CHECK_LOGONHOURS_FOR_S4U 0x00040000 // check logon hours for
S4U logon
#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
// //
// This is the list of subauthentication dlls used in MS // This is the list of subauthentication dlls used in MS
skipping to change at line 2285 skipping to change at line 3316
UNICODE_STRING LogonDomainName; UNICODE_STRING LogonDomainName;
UNICODE_STRING UserName; UNICODE_STRING UserName;
UNICODE_STRING Workstation; UNICODE_STRING Workstation;
UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
STRING AuthenticationInfo1; STRING AuthenticationInfo1;
STRING AuthenticationInfo2; STRING AuthenticationInfo2;
ULONG ParameterControl; ULONG ParameterControl;
ULONG SubAuthPackageId; ULONG SubAuthPackageId;
} MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON; } MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON;
#if (_WIN32_WINNT >= 0x0600)
//
// s4u2self logon
//
// Defined in Longhorn and above
//
// request to enforce logon hours policy
//
#define MSV1_0_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2
typedef struct _MSV1_0_S4U_LOGON {
MSV1_0_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags;
UNICODE_STRING UserPrincipalName; // username or username@domain
UNICODE_STRING DomainName; // Optional: if missing, using the local machine
} MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON;
#endif
// //
// Values for UserFlags. // Values for UserFlags.
// //
#define LOGON_GUEST 0x01 #define LOGON_GUEST 0x01
#define LOGON_NOENCRYPTION 0x02 #define LOGON_NOENCRYPTION 0x02
#define LOGON_CACHED_ACCOUNT 0x04 #define LOGON_CACHED_ACCOUNT 0x04
#define LOGON_USED_LM_PASSWORD 0x08 #define LOGON_USED_LM_PASSWORD 0x08
#define LOGON_EXTRA_SIDS 0x20 #define LOGON_EXTRA_SIDS 0x20
#define LOGON_SUBAUTH_SESSION_KEY 0x40 #define LOGON_SUBAUTH_SESSION_KEY 0x40
#define LOGON_SERVER_TRUST_ACCOUNT 0x80 #define LOGON_SERVER_TRUST_ACCOUNT 0x80
#define LOGON_NTLMV2_ENABLED 0x100 // says DC understands NTLMv2 #define LOGON_NTLMV2_ENABLED 0x100 // says DC understands NTLMv2
#define LOGON_RESOURCE_GROUPS 0x200 #define LOGON_RESOURCE_GROUPS 0x200
#define LOGON_PROFILE_PATH_RETURNED 0x400 #define LOGON_PROFILE_PATH_RETURNED 0x400
// Defined in Longhorn and above
#define LOGON_NT_V2 0x800 // NT response was used for validati
on
#define LOGON_LM_V2 0x1000 // LM response was used for validati
on
#define LOGON_NTLM_V2 0x2000 // LM response was used to authentic
ate but NT response was used to derive the session key
#if (_WIN32_WINNT >= 0x0600)
#define LOGON_OPTIMIZED 0x4000 // this is an optimized logon
#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_NO_OPTIMIZED 0x20000 // optimized logon has been disabled
for this 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
skipping to change at line 2349 skipping to change at line 3415
// NTLM3 definitions. // NTLM3 definitions.
// //
#define MSV1_0_NTLM3_RESPONSE_LENGTH 16 #define MSV1_0_NTLM3_RESPONSE_LENGTH 16
#define MSV1_0_NTLM3_OWF_LENGTH 16 #define MSV1_0_NTLM3_OWF_LENGTH 16
// //
// this is the longest amount of time we'll allow challenge response // this is the longest amount of time we'll allow challenge response
// pairs to be used. Note that this also has to allow for worst case clock skew // pairs to be used. Note that this also has to allow for worst case clock skew
// //
#if (_WIN32_WINNT == 0x0500)
#define MSV1_0_MAX_NTLM3_LIFE 1800 // 30 minutes (in seconds)
#else
#define MSV1_0_MAX_NTLM3_LIFE 129600 // 36 hours (in seconds) #define MSV1_0_MAX_NTLM3_LIFE 129600 // 36 hours (in seconds)
#endif
#define MSV1_0_MAX_AVL_SIZE 64000 #define MSV1_0_MAX_AVL_SIZE 64000
#if (_WIN32_WINNT >= 0x0501)
// //
// MsvAvFlags bit values // MsvAvFlags bit values
// //
// 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)
#define MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES 0x00000002 // the client sup
ports
// hand-shake mes
sages integrity
#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
UCHAR HiRespType; // highest id number understood by client UCHAR HiRespType; // highest id number understood by client
USHORT Flags; // reserved; must be sent as zero at this version USHORT Flags; // reserved; must be sent as zero at this version
ULONG MsgWord; // 32 bit message from client to server (for use by auth protocol) ULONG MsgWord; // 32 bit message from client to server (for use by auth protocol)
ULONGLONG TimeStamp; // time stamp when client generated response -- NT s ystem time, quad part ULONGLONG TimeStamp; // time stamp when client generated response -- NT s ystem time, quad part
UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH]; UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH];
ULONG AvPairsOff; // offset to start of AvPairs (to allow future expansion ) ULONG AvPairsOff; // offset to start of AvPairs (to allow future expansion )
UCHAR Buffer[1]; // start of buffer with AV pairs (or future stuff -- so use the offset) UCHAR Buffer[1]; // start of buffer with AV pairs (or future stuff -- so use the offset)
} MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE; } MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE;
#define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_ RESPONSE_LENGTH) #define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_ RESPONSE_LENGTH)
#if(_WIN32_WINNT >= 0x0502)
#define MSV1_0_NTLM3_MIN_NT_RESPONSE_LENGTH RTL_SIZEOF_THROUGH_FIELD(MSV1_0_NTLM 3_RESPONSE, AvPairsOff) #define MSV1_0_NTLM3_MIN_NT_RESPONSE_LENGTH RTL_SIZEOF_THROUGH_FIELD(MSV1_0_NTLM 3_RESPONSE, AvPairsOff)
#endif
typedef enum { typedef enum {
MsvAvEOL, // end of list MsvAvEOL, // end of list
MsvAvNbComputerName, // server's computer name -- NetBIOS MsvAvNbComputerName, // server's computer name -- NetBIOS
MsvAvNbDomainName, // server's domain name -- NetBIOS MsvAvNbDomainName, // server's domain name -- NetBIOS
MsvAvDnsComputerName, // server's computer name -- DNS MsvAvDnsComputerName, // server's computer name -- DNS
MsvAvDnsDomainName, // server's domain name -- DNS MsvAvDnsDomainName, // server's domain name -- DNS
#if (_WIN32_WINNT >= 0x0501)
MsvAvDnsTreeName, // server's tree name -- DNS MsvAvDnsTreeName, // server's tree name -- DNS
MsvAvFlags // server's extended flags -- DWORD mask MsvAvFlags, // server's extended flags -- DWORD mask
#if (_WIN32_WINNT >= 0x0600)
MsvAvTimestamp, // contains the server's local time in FILETIME,
// (64 bit 100 ns ticks since 1602
// (UTC)) in little endian byte order
MsvAvRestrictions, // token restrictions
#endif
#endif
} MSV1_0_AVID; } MSV1_0_AVID;
typedef struct _MSV1_0_AV_PAIR { typedef struct _MSV1_0_AV_PAIR {
USHORT AvId; USHORT AvId;
USHORT AvLen; USHORT AvLen;
// Data is treated as byte array following structure // Data is treated as byte array following structure
} MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR; } MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// // // //
// CALL PACKAGE Related Data Structures // // CALL PACKAGE Related Data Structures //
skipping to change at line 2416 skipping to change at line 3504
MsV1_0EnumerateUsers, // Both submission and response MsV1_0EnumerateUsers, // Both submission and response
MsV1_0GetUserInfo, // Both submission and response MsV1_0GetUserInfo, // Both submission and response
MsV1_0ReLogonUsers, // Submission only MsV1_0ReLogonUsers, // Submission only
MsV1_0ChangePassword, // Both submission and response MsV1_0ChangePassword, // Both submission and response
MsV1_0ChangeCachedPassword, // Both submission and response MsV1_0ChangeCachedPassword, // Both submission and response
MsV1_0GenericPassthrough, // Both submission and response MsV1_0GenericPassthrough, // Both submission and response
MsV1_0CacheLogon, // Submission only, no response MsV1_0CacheLogon, // Submission only, no response
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)
MsV1_0SetProcessOption, // Submission only, no response MsV1_0SetProcessOption, // Submission only, no response
#endif
#if (_WIN32_WINNT >= 0x0600)
MsV1_0ConfigLocalAliases,
#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;
typedef struct _MSV1_0_CHANGEPASSWORD_RESPONSE { typedef struct _MSV1_0_CHANGEPASSWORD_RESPONSE {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
BOOLEAN PasswordInfoValid; BOOLEAN PasswordInfoValid;
DOMAIN_PASSWORD_INFORMATION DomainPasswordInfo; DOMAIN_PASSWORD_INFORMATION DomainPasswordInfo;
} MSV1_0_CHANGEPASSWORD_RESPONSE, *PMSV1_0_CHANGEPASSWORD_RESPONSE; } MSV1_0_CHANGEPASSWORD_RESPONSE, *PMSV1_0_CHANGEPASSWORD_RESPONSE;
#if(_WIN32_WINNT >= 0x0502)
// //
// MsV1_0GenericPassthrough - for remoting a CallPackage to // MsV1_0GenericPassthrough - for remoting a CallPackage to
// a domain controller on the specified domain // a domain controller on the specified domain
// //
typedef struct _MSV1_0_PASSTHROUGH_REQUEST { typedef struct _MSV1_0_PASSTHROUGH_REQUEST {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING DomainName; UNICODE_STRING DomainName;
UNICODE_STRING PackageName; UNICODE_STRING PackageName;
ULONG DataLength; ULONG DataLength;
PUCHAR LogonData; PUCHAR LogonData;
ULONG Pad ; ULONG Pad ;
} MSV1_0_PASSTHROUGH_REQUEST, *PMSV1_0_PASSTHROUGH_REQUEST; } MSV1_0_PASSTHROUGH_REQUEST, *PMSV1_0_PASSTHROUGH_REQUEST;
typedef struct _MSV1_0_PASSTHROUGH_RESPONSE { typedef struct _MSV1_0_PASSTHROUGH_RESPONSE {
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG Pad; ULONG Pad;
ULONG DataLength; ULONG DataLength;
PUCHAR ValidationData; PUCHAR ValidationData;
} MSV1_0_PASSTHROUGH_RESPONSE, *PMSV1_0_PASSTHROUGH_RESPONSE; } MSV1_0_PASSTHROUGH_RESPONSE, *PMSV1_0_PASSTHROUGH_RESPONSE;
#endif
// //
// MsV1_0SubAuthInfo submit buffer and response - for submitting a buffer to a // MsV1_0SubAuthInfo submit buffer and response - for submitting a buffer to a
// specified Subauthentication Package during an LsaCallAuthenticationPackage(). // specified Subauthentication Package during an LsaCallAuthenticationPackage().
// If this Subauthentication is to be done locally, then package this message // If this Subauthentication is to be done locally, then package this message
// in LsaCallAuthenticationPackage(). If this SubAuthentication needs to be done // in LsaCallAuthenticationPackage(). If this SubAuthentication needs to be done
// on the domain controller, then call LsaCallauthenticationPackage with the // on the domain controller, then call LsaCallauthenticationPackage with the
// message type being MsV1_0GenericPassThrough and the LogonData in this struct // message type being MsV1_0GenericPassThrough and the LogonData in this struct
// should be a PMSV1_0_SUBAUTH_REQUEST // should be a PMSV1_0_SUBAUTH_REQUEST
// //
skipping to change at line 2478 skipping to change at line 3573
ULONG SubAuthInfoLength; ULONG SubAuthInfoLength;
PUCHAR SubAuthSubmitBuffer; PUCHAR SubAuthSubmitBuffer;
} MSV1_0_SUBAUTH_REQUEST, *PMSV1_0_SUBAUTH_REQUEST; } MSV1_0_SUBAUTH_REQUEST, *PMSV1_0_SUBAUTH_REQUEST;
typedef struct _MSV1_0_SUBAUTH_RESPONSE{ typedef struct _MSV1_0_SUBAUTH_RESPONSE{
MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
ULONG SubAuthInfoLength; ULONG SubAuthInfoLength;
PUCHAR SubAuthReturnBuffer; PUCHAR SubAuthReturnBuffer;
} MSV1_0_SUBAUTH_RESPONSE, *PMSV1_0_SUBAUTH_RESPONSE; } MSV1_0_SUBAUTH_RESPONSE, *PMSV1_0_SUBAUTH_RESPONSE;
#if(_WIN32_WINNT >= 0x0501)
#define RtlGenRandom SystemFunction036 #define RtlGenRandom SystemFunction036
#endif
#if(_WIN32_WINNT >= 0x0500)
#define RtlEncryptMemory SystemFunction040 #define RtlEncryptMemory SystemFunction040
#define RtlDecryptMemory SystemFunction041 #define RtlDecryptMemory SystemFunction041
#endif
#if(_WIN32_WINNT >= 0x0501)
BOOLEAN BOOLEAN
RtlGenRandom( RtlGenRandom(
__out_bcount(RandomBufferLength) PVOID RandomBuffer, __out_bcount(RandomBufferLength) PVOID RandomBuffer,
__in ULONG RandomBufferLength __in ULONG RandomBufferLength
); );
#endif
/*
* #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.
// //
#define RTL_ENCRYPT_MEMORY_SIZE 8 #define RTL_ENCRYPT_MEMORY_SIZE 8
// //
// Allow Encrypt/Decrypt across process boundaries. // Allow Encrypt/Decrypt across process boundaries.
skipping to change at line 2522 skipping to change at line 3627
__in ULONG MemorySize, __in ULONG MemorySize,
__in ULONG OptionFlags __in ULONG OptionFlags
); );
NTSTATUS NTSTATUS
RtlDecryptMemory( RtlDecryptMemory(
__inout_bcount(MemorySize) PVOID Memory, __inout_bcount(MemorySize) PVOID Memory,
__in ULONG MemorySize, __in ULONG MemorySize,
__in ULONG OptionFlags __in ULONG OptionFlags
); );
//#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
// as crypto systems. Values over 127 are local values, and may be changed // as crypto systems. Values over 127 are local values, and may be changed
// without notice. // without notice.
#define KERB_ETYPE_NULL 0 #define KERB_ETYPE_NULL 0
#define KERB_ETYPE_DES_CBC_CRC 1 #define KERB_ETYPE_DES_CBC_CRC 1
#define KERB_ETYPE_DES_CBC_MD4 2 #define KERB_ETYPE_DES_CBC_MD4 2
#define KERB_ETYPE_DES_CBC_MD5 3 #define KERB_ETYPE_DES_CBC_MD5 3
#define KERB_ETYPE_AES128_CTS_HMAC_SHA1_96 17
#define KERB_ETYPE_AES256_CTS_HMAC_SHA1_96 18
#define KERB_ETYPE_RC4_MD4 -128 // FFFFFF80 #define KERB_ETYPE_RC4_MD4 -128 // FFFFFF80
#define KERB_ETYPE_RC4_PLAIN2 -129 #define KERB_ETYPE_RC4_PLAIN2 -129
#define KERB_ETYPE_RC4_LM -130 #define KERB_ETYPE_RC4_LM -130
#define KERB_ETYPE_RC4_SHA -131 #define KERB_ETYPE_RC4_SHA -131
#define KERB_ETYPE_DES_PLAIN -132 #define KERB_ETYPE_DES_PLAIN -132
#define KERB_ETYPE_RC4_HMAC_OLD -133 // FFFFFF7B #define KERB_ETYPE_RC4_HMAC_OLD -133 // FFFFFF7B
#define KERB_ETYPE_RC4_PLAIN_OLD -134 #define KERB_ETYPE_RC4_PLAIN_OLD -134
#define KERB_ETYPE_RC4_HMAC_OLD_EXP -135 #define KERB_ETYPE_RC4_HMAC_OLD_EXP -135
#define KERB_ETYPE_RC4_PLAIN_OLD_EXP -136 #define KERB_ETYPE_RC4_PLAIN_OLD_EXP -136
#define KERB_ETYPE_RC4_PLAIN -140 #define KERB_ETYPE_RC4_PLAIN -140
#define KERB_ETYPE_RC4_PLAIN_EXP -141 #define KERB_ETYPE_RC4_PLAIN_EXP -141
// //
// used internally by userapi.cxx
//
#define KERB_ETYPE_AES128_CTS_HMAC_SHA1_96_PLAIN -148
#define KERB_ETYPE_AES256_CTS_HMAC_SHA1_96_PLAIN -149
//
// Pkinit encryption types // Pkinit encryption types
// //
#define KERB_ETYPE_DSA_SHA1_CMS 9 #define KERB_ETYPE_DSA_SHA1_CMS 9
#define KERB_ETYPE_RSA_MD5_CMS 10 #define KERB_ETYPE_RSA_MD5_CMS 10
#define KERB_ETYPE_RSA_SHA1_CMS 11 #define KERB_ETYPE_RSA_SHA1_CMS 11
#define KERB_ETYPE_RC2_CBC_ENV 12 #define KERB_ETYPE_RC2_CBC_ENV 12
#define KERB_ETYPE_RSA_ENV 13 #define KERB_ETYPE_RSA_ENV 13
#define KERB_ETYPE_RSA_ES_OEAP_ENV 14 #define KERB_ETYPE_RSA_ES_OEAP_ENV 14
#define KERB_ETYPE_DES_EDE3_CBC_ENV 15 #define KERB_ETYPE_DES_EDE3_CBC_ENV 15
skipping to change at line 2573 skipping to change at line 3688
// Deprecated // Deprecated
// //
#define KERB_ETYPE_DSA_SIGN 8 #define KERB_ETYPE_DSA_SIGN 8
#define KERB_ETYPE_RSA_PRIV 9 #define KERB_ETYPE_RSA_PRIV 9
#define KERB_ETYPE_RSA_PUB 10 #define KERB_ETYPE_RSA_PUB 10
#define KERB_ETYPE_RSA_PUB_MD5 11 #define KERB_ETYPE_RSA_PUB_MD5 11
#define KERB_ETYPE_RSA_PUB_SHA1 12 #define KERB_ETYPE_RSA_PUB_SHA1 12
#define KERB_ETYPE_PKCS7_PUB 13 #define KERB_ETYPE_PKCS7_PUB 13
#if(_WIN32_WINNT >= 0x0502)
// //
// Unsupported but defined types // Unsupported but defined types
// //
#define KERB_ETYPE_DES3_CBC_MD5 5 #define KERB_ETYPE_DES3_CBC_MD5 5
#define KERB_ETYPE_DES3_CBC_SHA1 7 #define KERB_ETYPE_DES3_CBC_SHA1 7
#define KERB_ETYPE_DES3_CBC_SHA1_KD 16 #define KERB_ETYPE_DES3_CBC_SHA1_KD 16
#endif
// //
// In use types // In use types
// //
#define KERB_ETYPE_DES_CBC_MD5_NT 20 #define KERB_ETYPE_DES_CBC_MD5_NT 20
#define KERB_ETYPE_RC4_HMAC_NT 23 #define KERB_ETYPE_RC4_HMAC_NT 23
#define KERB_ETYPE_RC4_HMAC_NT_EXP 24 #define KERB_ETYPE_RC4_HMAC_NT_EXP 24
// Checksum algorithms. // Checksum algorithms.
// These algorithms are keyed internally for our use. // These algorithms are keyed internally for our use.
#define KERB_CHECKSUM_NONE 0 #define KERB_CHECKSUM_NONE 0
#define KERB_CHECKSUM_CRC32 1 #define KERB_CHECKSUM_CRC32 1
#define KERB_CHECKSUM_MD4 2 #define KERB_CHECKSUM_MD4 2
#define KERB_CHECKSUM_KRB_DES_MAC 4 #define KERB_CHECKSUM_KRB_DES_MAC 4
#if (_WIN32_WINNT >= 0x0501)
#define KERB_CHECKSUM_KRB_DES_MAC_K 5 #define KERB_CHECKSUM_KRB_DES_MAC_K 5
#endif
#define KERB_CHECKSUM_MD5 7 #define KERB_CHECKSUM_MD5 7
#define KERB_CHECKSUM_MD5_DES 8 #define KERB_CHECKSUM_MD5_DES 8
#define KERB_CHECKSUM_SHA1_NEW 14 // defined in RFC3961
#define KERB_CHECKSUM_HMAC_SHA1_96_AES128 15
#define KERB_CHECKSUM_HMAC_SHA1_96_AES256 16
#define KERB_CHECKSUM_LM -130 #define KERB_CHECKSUM_LM -130
#define KERB_CHECKSUM_SHA1 -131 #define KERB_CHECKSUM_SHA1 -131
#define KERB_CHECKSUM_REAL_CRC32 -132 #define KERB_CHECKSUM_REAL_CRC32 -132
#define KERB_CHECKSUM_DES_MAC -133 #define KERB_CHECKSUM_DES_MAC -133
#define KERB_CHECKSUM_DES_MAC_MD5 -134 #define KERB_CHECKSUM_DES_MAC_MD5 -134
#define KERB_CHECKSUM_MD25 -135 #define KERB_CHECKSUM_MD25 -135
#define KERB_CHECKSUM_RC4_MD5 -136 #define KERB_CHECKSUM_RC4_MD5 -136
#define KERB_CHECKSUM_MD5_HMAC -137 // used by netlogon #define KERB_CHECKSUM_MD5_HMAC -137 // used by netlogon
#define KERB_CHECKSUM_HMAC_MD5 -138 // used by Kerberos #define KERB_CHECKSUM_HMAC_MD5 -138 // used by Kerberos
//
// used internally by userapi.cxx
//
#define KERB_CHECKSUM_HMAC_SHA1_96_AES128_Ki -150
#define KERB_CHECKSUM_HMAC_SHA1_96_AES256_Ki -151
#define AUTH_REQ_ALLOW_FORWARDABLE 0x00000001 #define AUTH_REQ_ALLOW_FORWARDABLE 0x00000001
#define AUTH_REQ_ALLOW_PROXIABLE 0x00000002 #define AUTH_REQ_ALLOW_PROXIABLE 0x00000002
#define AUTH_REQ_ALLOW_POSTDATE 0x00000004 #define AUTH_REQ_ALLOW_POSTDATE 0x00000004
#define AUTH_REQ_ALLOW_RENEWABLE 0x00000008 #define AUTH_REQ_ALLOW_RENEWABLE 0x00000008
#define AUTH_REQ_ALLOW_NOADDRESS 0x00000010 #define AUTH_REQ_ALLOW_NOADDRESS 0x00000010
#define AUTH_REQ_ALLOW_ENC_TKT_IN_SKEY 0x00000020 #define AUTH_REQ_ALLOW_ENC_TKT_IN_SKEY 0x00000020
#define AUTH_REQ_ALLOW_VALIDATE 0x00000040 #define AUTH_REQ_ALLOW_VALIDATE 0x00000040
#define AUTH_REQ_VALIDATE_CLIENT 0x00000080 #define AUTH_REQ_VALIDATE_CLIENT 0x00000080
#define AUTH_REQ_OK_AS_DELEGATE 0x00000100 #define AUTH_REQ_OK_AS_DELEGATE 0x00000100
#define AUTH_REQ_PREAUTH_REQUIRED 0x00000200 #define AUTH_REQ_PREAUTH_REQUIRED 0x00000200
#define AUTH_REQ_TRANSITIVE_TRUST 0x00000400 #define AUTH_REQ_TRANSITIVE_TRUST 0x00000400
#if(_WIN32_WINNT >= 0x0502)
#define AUTH_REQ_ALLOW_S4U_DELEGATE 0x00000800 #define AUTH_REQ_ALLOW_S4U_DELEGATE 0x00000800
#endif
#define AUTH_REQ_PER_USER_FLAGS (AUTH_REQ_ALLOW_FORWARDABLE | \ #define AUTH_REQ_PER_USER_FLAGS (AUTH_REQ_ALLOW_FORWARDABLE | \
AUTH_REQ_ALLOW_PROXIABLE | \ AUTH_REQ_ALLOW_PROXIABLE | \
AUTH_REQ_ALLOW_POSTDATE | \ AUTH_REQ_ALLOW_POSTDATE | \
AUTH_REQ_ALLOW_RENEWABLE | \ AUTH_REQ_ALLOW_RENEWABLE | \
AUTH_REQ_ALLOW_VALIDATE ) AUTH_REQ_ALLOW_VALIDATE )
// //
// Ticket Flags: // Ticket Flags:
// //
skipping to change at line 2646 skipping to change at line 3778
#define KERB_TICKET_FLAGS_proxy 0x08000000 #define KERB_TICKET_FLAGS_proxy 0x08000000
#define KERB_TICKET_FLAGS_may_postdate 0x04000000 #define KERB_TICKET_FLAGS_may_postdate 0x04000000
#define KERB_TICKET_FLAGS_postdated 0x02000000 #define KERB_TICKET_FLAGS_postdated 0x02000000
#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)
#define KERB_TICKET_FLAGS_cname_in_pa_data 0x00040000
#endif
#define KERB_TICKET_FLAGS_reserved1 0x00000001 #define KERB_TICKET_FLAGS_reserved1 0x00000001
#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)
skipping to change at line 2671 skipping to change at line 3807
#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 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
#if (_WIN32_WINNT >= 0x0600)
#define KRB_NT_X500_PRINCIPAL 6 // Encoded X.500 Distingished name [RF
C 2253]
#endif
#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
skipping to change at line 2711 skipping to change at line 3854
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
typedef enum _KERB_LOGON_SUBMIT_TYPE { typedef enum _KERB_LOGON_SUBMIT_TYPE {
KerbInteractiveLogon = 2, KerbInteractiveLogon = 2,
KerbSmartCardLogon = 6, KerbSmartCardLogon = 6,
KerbWorkstationUnlockLogon = 7, KerbWorkstationUnlockLogon = 7,
KerbSmartCardUnlockLogon = 8, KerbSmartCardUnlockLogon = 8,
KerbProxyLogon = 9, KerbProxyLogon = 9,
KerbTicketLogon = 10, KerbTicketLogon = 10,
KerbTicketUnlockLogon = 11, KerbTicketUnlockLogon = 11,
KerbS4ULogon = 12 //#if (_WIN32_WINNT >= 0x0501) -- Disabled until IIS fixes their target version.
KerbS4ULogon = 12,
//#endif
#if (_WIN32_WINNT >= 0x0600)
KerbCertificateLogon = 13,
KerbCertificateS4ULogon = 14,
KerbCertificateUnlockLogon = 15,
#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 2738 skipping to change at line 3888
UNICODE_STRING Pin; UNICODE_STRING Pin;
ULONG CspDataLength; ULONG CspDataLength;
PUCHAR CspData; PUCHAR CspData;
} KERB_SMART_CARD_LOGON, *PKERB_SMART_CARD_LOGON; } KERB_SMART_CARD_LOGON, *PKERB_SMART_CARD_LOGON;
typedef struct _KERB_SMART_CARD_UNLOCK_LOGON { typedef struct _KERB_SMART_CARD_UNLOCK_LOGON {
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)
//
// let the KDC detect account mapping conflicts for the same certificate.
//
#define KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES 0x1
typedef struct _KERB_CERTIFICATE_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType; // KerbCertificateLogon
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 Pin;
ULONG Flags; // additional flags
ULONG CspDataLength;
PUCHAR CspData; // contains the smartcard CSP data
} KERB_CERTIFICATE_LOGON, *PKERB_CERTIFICATE_LOGON;
typedef struct _KERB_CERTIFICATE_UNLOCK_LOGON {
KERB_CERTIFICATE_LOGON Logon;
LUID LogonId;
} KERB_CERTIFICATE_UNLOCK_LOGON, *PKERB_CERTIFICATE_UNLOCK_LOGON;
//
// 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_LOGONHOURS 0x2
typedef struct _KERB_CERTIFICATE_S4U_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags;
UNICODE_STRING UserPrincipalName;
// OPTIONAL, certificate mapping hints: username or username@domain
UNICODE_STRING DomainName; // used to locate the forest
// OPTIONAL, certificate mapping hints: if missing, using the local
machine's domain
ULONG CertificateLength; // for the client certificate
PUCHAR Certificate; // for the client certificate, BER encoded
} KERB_CERTIFICATE_S4U_LOGON, *PKERB_CERTIFICATE_S4U_LOGON;
#endif
// //
// Structure used for a ticket-only logon // Structure used for a ticket-only logon
// //
typedef struct _KERB_TICKET_LOGON { typedef struct _KERB_TICKET_LOGON {
KERB_LOGON_SUBMIT_TYPE MessageType; KERB_LOGON_SUBMIT_TYPE MessageType;
ULONG Flags; ULONG Flags;
ULONG ServiceTicketLength; ULONG ServiceTicketLength;
ULONG TicketGrantingTicketLength; ULONG TicketGrantingTicketLength;
PUCHAR ServiceTicket; // REQUIRED: Service ticket "host" PUCHAR ServiceTicket; // REQUIRED: Service ticket "host"
skipping to change at line 2762 skipping to change at line 3955
// Flags for the ticket logon flags field // Flags for the ticket logon flags field
// //
#define KERB_LOGON_FLAG_ALLOW_EXPIRED_TICKET 0x1 #define KERB_LOGON_FLAG_ALLOW_EXPIRED_TICKET 0x1
typedef struct _KERB_TICKET_UNLOCK_LOGON { typedef struct _KERB_TICKET_UNLOCK_LOGON {
KERB_TICKET_LOGON Logon; KERB_TICKET_LOGON Logon;
LUID LogonId; LUID LogonId;
} KERB_TICKET_UNLOCK_LOGON, *PKERB_TICKET_UNLOCK_LOGON; } KERB_TICKET_UNLOCK_LOGON, *PKERB_TICKET_UNLOCK_LOGON;
//#if (_WIN32_WINNT >= 0x0501) -- Disabled until IIS fixes their target version.
// //
// Used for S4U Client requests // Used for S4U Client requests
// //
// //
#if (_WIN32_WINNT >= 0x0600)
//
// request to enforce logon hours policy
//
#define KERB_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2
#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
// //
// Use the same profile structure as MSV1_0 // Use the same profile structure as MSV1_0
// //
typedef enum _KERB_PROFILE_BUFFER_TYPE { typedef enum _KERB_PROFILE_BUFFER_TYPE {
KerbInteractiveProfile = 2, KerbInteractiveProfile = 2,
KerbSmartCardProfile = 4, KerbSmartCardProfile = 4,
KerbTicketProfile = 6 KerbTicketProfile = 6
} KERB_PROFILE_BUFFER_TYPE, *PKERB_PROFILE_BUFFER_TYPE; } KERB_PROFILE_BUFFER_TYPE, *PKERB_PROFILE_BUFFER_TYPE;
skipping to change at line 2822 skipping to change at line 4028
// //
// For a ticket logon profile, we return the session key from the ticket // For a ticket logon profile, we return the session key from the ticket
// //
typedef struct KERB_CRYPTO_KEY { typedef struct KERB_CRYPTO_KEY {
LONG KeyType; LONG KeyType;
ULONG Length; ULONG Length;
PUCHAR Value; PUCHAR Value;
} KERB_CRYPTO_KEY, *PKERB_CRYPTO_KEY; } KERB_CRYPTO_KEY, *PKERB_CRYPTO_KEY;
typedef struct KERB_CRYPTO_KEY32 {
LONG KeyType;
ULONG Length;
ULONG Offset;
} KERB_CRYPTO_KEY32, *PKERB_CRYPTO_KEY32;
typedef struct _KERB_TICKET_PROFILE { typedef struct _KERB_TICKET_PROFILE {
KERB_INTERACTIVE_PROFILE Profile; KERB_INTERACTIVE_PROFILE Profile;
KERB_CRYPTO_KEY SessionKey; KERB_CRYPTO_KEY SessionKey;
} KERB_TICKET_PROFILE, *PKERB_TICKET_PROFILE; } KERB_TICKET_PROFILE, *PKERB_TICKET_PROFILE;
typedef enum _KERB_PROTOCOL_MESSAGE_TYPE { typedef enum _KERB_PROTOCOL_MESSAGE_TYPE {
KerbDebugRequestMessage = 0, KerbDebugRequestMessage = 0,
KerbQueryTicketCacheMessage, KerbQueryTicketCacheMessage,
KerbChangeMachinePasswordMessage, KerbChangeMachinePasswordMessage,
KerbVerifyPacMessage, KerbVerifyPacMessage,
KerbRetrieveTicketMessage, KerbRetrieveTicketMessage,
KerbUpdateAddressesMessage, KerbUpdateAddressesMessage,
KerbPurgeTicketCacheMessage, KerbPurgeTicketCacheMessage,
KerbChangePasswordMessage, KerbChangePasswordMessage,
KerbRetrieveEncodedTicketMessage, KerbRetrieveEncodedTicketMessage,
KerbDecryptDataMessage, KerbDecryptDataMessage,
KerbAddBindingCacheEntryMessage, KerbAddBindingCacheEntryMessage,
KerbSetPasswordMessage, KerbSetPasswordMessage,
KerbSetPasswordExMessage, KerbSetPasswordExMessage,
#if (_WIN32_WINNT == 0x0500)
KerbAddExtraCredentialsMessage = 17
#endif
#if (_WIN32_WINNT >= 0x0501)
KerbVerifyCredentialsMessage, KerbVerifyCredentialsMessage,
KerbQueryTicketCacheExMessage, KerbQueryTicketCacheExMessage,
KerbPurgeTicketCacheExMessage, KerbPurgeTicketCacheExMessage,
#endif
#if (_WIN32_WINNT >= 0x0502)
KerbRefreshSmartcardCredentialsMessage, KerbRefreshSmartcardCredentialsMessage,
KerbAddExtraCredentialsMessage, KerbAddExtraCredentialsMessage,
KerbQuerySupplementalCredentialsMessage, KerbQuerySupplementalCredentialsMessage,
#endif
#if (_WIN32_WINNT >= 0x0600)
KerbTransferCredentialsMessage, KerbTransferCredentialsMessage,
KerbQueryTicketCacheEx2Message, KerbQueryTicketCacheEx2Message,
KerbSubmitTicketMessage,
#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 2870 skipping to change at line 4092
typedef struct _KERB_TICKET_CACHE_INFO { typedef struct _KERB_TICKET_CACHE_INFO {
UNICODE_STRING ServerName; UNICODE_STRING ServerName;
UNICODE_STRING RealmName; UNICODE_STRING RealmName;
LARGE_INTEGER StartTime; LARGE_INTEGER StartTime;
LARGE_INTEGER EndTime; LARGE_INTEGER EndTime;
LARGE_INTEGER RenewTime; LARGE_INTEGER RenewTime;
LONG EncryptionType; LONG EncryptionType;
ULONG TicketFlags; ULONG TicketFlags;
} KERB_TICKET_CACHE_INFO, *PKERB_TICKET_CACHE_INFO; } KERB_TICKET_CACHE_INFO, *PKERB_TICKET_CACHE_INFO;
#if (_WIN32_WINNT >= 0x0501)
typedef struct _KERB_TICKET_CACHE_INFO_EX { typedef struct _KERB_TICKET_CACHE_INFO_EX {
UNICODE_STRING ClientName; UNICODE_STRING ClientName;
UNICODE_STRING ClientRealm; UNICODE_STRING ClientRealm;
UNICODE_STRING ServerName; UNICODE_STRING ServerName;
UNICODE_STRING ServerRealm; UNICODE_STRING ServerRealm;
LARGE_INTEGER StartTime; LARGE_INTEGER StartTime;
LARGE_INTEGER EndTime; LARGE_INTEGER EndTime;
LARGE_INTEGER RenewTime; LARGE_INTEGER RenewTime;
LONG EncryptionType; LONG EncryptionType;
ULONG TicketFlags; ULONG TicketFlags;
} KERB_TICKET_CACHE_INFO_EX, *PKERB_TICKET_CACHE_INFO_EX; } KERB_TICKET_CACHE_INFO_EX, *PKERB_TICKET_CACHE_INFO_EX;
#endif
typedef struct _KERB_TICKET_CACHE_INFO_EX2 { typedef struct _KERB_TICKET_CACHE_INFO_EX2 {
UNICODE_STRING ClientName; UNICODE_STRING ClientName;
UNICODE_STRING ClientRealm; UNICODE_STRING ClientRealm;
UNICODE_STRING ServerName; UNICODE_STRING ServerName;
UNICODE_STRING ServerRealm; UNICODE_STRING ServerRealm;
LARGE_INTEGER StartTime; LARGE_INTEGER StartTime;
LARGE_INTEGER EndTime; LARGE_INTEGER EndTime;
LARGE_INTEGER RenewTime; LARGE_INTEGER RenewTime;
LONG EncryptionType; LONG EncryptionType;
skipping to change at line 2896 skipping to change at line 4120
UNICODE_STRING ServerRealm; UNICODE_STRING ServerRealm;
LARGE_INTEGER StartTime; LARGE_INTEGER StartTime;
LARGE_INTEGER EndTime; LARGE_INTEGER EndTime;
LARGE_INTEGER RenewTime; LARGE_INTEGER RenewTime;
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;
} KERB_TICKET_CACHE_INFO_EX2, *PKERB_TICKET_CACHE_INFO_EX2; } KERB_TICKET_CACHE_INFO_EX2, *PKERB_TICKET_CACHE_INFO_EX2;
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)
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
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;
// //
// Types for retrieving encoded ticket from the cache // Types for retrieving encoded ticket from the cache
// //
skipping to change at line 2932 skipping to change at line 4158
#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 ;
#define __SECHANDLE_DEFINED__ #define __SECHANDLE_DEFINED__
#endif // __SECHANDLE_DEFINED__ #endif // __SECHANDLE_DEFINED__
#if (_WIN32_WINNT >= 0x0501)
// Ticket Flags // Ticket Flags
#define KERB_USE_DEFAULT_TICKET_FLAGS 0x0 #define KERB_USE_DEFAULT_TICKET_FLAGS 0x0
// CacheOptions // CacheOptions
#define KERB_RETRIEVE_TICKET_DEFAULT 0x0 #define KERB_RETRIEVE_TICKET_DEFAULT 0x0
#endif
#define KERB_RETRIEVE_TICKET_DONT_USE_CACHE 0x1 #define KERB_RETRIEVE_TICKET_DONT_USE_CACHE 0x1
#define KERB_RETRIEVE_TICKET_USE_CACHE_ONLY 0x2 #define KERB_RETRIEVE_TICKET_USE_CACHE_ONLY 0x2
#define KERB_RETRIEVE_TICKET_USE_CREDHANDLE 0x4 #define KERB_RETRIEVE_TICKET_USE_CREDHANDLE 0x4
#if (_WIN32_WINNT >= 0x0501)
#define KERB_RETRIEVE_TICKET_AS_KERB_CRED 0x8 #define KERB_RETRIEVE_TICKET_AS_KERB_CRED 0x8
#define KERB_RETRIEVE_TICKET_WITH_SEC_CRED 0x10 #define KERB_RETRIEVE_TICKET_WITH_SEC_CRED 0x10
#endif
#if (_WIN32_WINNT >= 0x0600)
#define KERB_RETRIEVE_TICKET_CACHE_TICKET 0x20 #define KERB_RETRIEVE_TICKET_CACHE_TICKET 0x20
#endif
#if (_WIN32_WINNT >= 0x0501)
// Encryption Type options // Encryption Type options
#define KERB_ETYPE_DEFAULT 0x0 // don't specify etype in tkt req. #define KERB_ETYPE_DEFAULT 0x0 // don't specify etype in tkt req.
typedef struct _KERB_AUTH_DATA { typedef struct _KERB_AUTH_DATA {
ULONG Type; ULONG Type;
ULONG Length; ULONG Length;
PUCHAR Data; PUCHAR Data;
} KERB_AUTH_DATA, *PKERB_AUTH_DATA; } KERB_AUTH_DATA, *PKERB_AUTH_DATA;
typedef struct _KERB_NET_ADDRESS { typedef struct _KERB_NET_ADDRESS {
ULONG Family; ULONG Family;
ULONG Length; ULONG Length;
PCHAR Address; PCHAR Address;
} KERB_NET_ADDRESS, *PKERB_NET_ADDRESS; } KERB_NET_ADDRESS, *PKERB_NET_ADDRESS;
typedef struct _KERB_NET_ADDRESSES { typedef struct _KERB_NET_ADDRESSES {
ULONG Number; ULONG Number;
KERB_NET_ADDRESS Addresses[ANYSIZE_ARRAY]; KERB_NET_ADDRESS Addresses[ANYSIZE_ARRAY];
} KERB_NET_ADDRESSES, *PKERB_NET_ADDRESSES; } KERB_NET_ADDRESSES, *PKERB_NET_ADDRESSES;
#endif
// //
// Types for the information about a ticket // Types for the information about a ticket
// //
typedef struct _KERB_EXTERNAL_NAME { typedef struct _KERB_EXTERNAL_NAME {
SHORT NameType; SHORT NameType;
USHORT NameCount; USHORT NameCount;
UNICODE_STRING Names[ANYSIZE_ARRAY]; UNICODE_STRING Names[ANYSIZE_ARRAY];
} KERB_EXTERNAL_NAME, *PKERB_EXTERNAL_NAME; } KERB_EXTERNAL_NAME, *PKERB_EXTERNAL_NAME;
skipping to change at line 3018 skipping to change at line 4252
// Used to purge entries from the ticket cache // Used to purge entries from the ticket cache
// //
typedef struct _KERB_PURGE_TKT_CACHE_REQUEST { typedef struct _KERB_PURGE_TKT_CACHE_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId; LUID LogonId;
UNICODE_STRING ServerName; UNICODE_STRING ServerName;
UNICODE_STRING RealmName; UNICODE_STRING RealmName;
} KERB_PURGE_TKT_CACHE_REQUEST, *PKERB_PURGE_TKT_CACHE_REQUEST; } KERB_PURGE_TKT_CACHE_REQUEST, *PKERB_PURGE_TKT_CACHE_REQUEST;
#if (_WIN32_WINNT >= 0x0501)
// //
// Flags for purge requests // Flags for purge requests
// //
#define KERB_PURGE_ALL_TICKETS 1 #define KERB_PURGE_ALL_TICKETS 1
typedef struct _KERB_PURGE_TKT_CACHE_EX_REQUEST { typedef struct _KERB_PURGE_TKT_CACHE_EX_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId; LUID LogonId;
ULONG Flags; ULONG Flags;
KERB_TICKET_CACHE_INFO_EX TicketTemplate; KERB_TICKET_CACHE_INFO_EX TicketTemplate;
} KERB_PURGE_TKT_CACHE_EX_REQUEST, *PKERB_PURGE_TKT_CACHE_EX_REQUEST; } KERB_PURGE_TKT_CACHE_EX_REQUEST, *PKERB_PURGE_TKT_CACHE_EX_REQUEST;
#endif
typedef struct _KERB_SUBMIT_TKT_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType;
LUID LogonId;
ULONG Flags;
KERB_CRYPTO_KEY32 Key; // key to decrypt KERB_CRED
ULONG KerbCredSize;
ULONG KerbCredOffset;
} KERB_SUBMIT_TKT_REQUEST, *PKERB_SUBMIT_TKT_REQUEST;
// //
// 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 {
skipping to change at line 3120 skipping to change at line 4365
// is required for this operation. // is required for this operation.
// //
typedef struct _KERB_ADD_BINDING_CACHE_ENTRY_REQUEST { typedef struct _KERB_ADD_BINDING_CACHE_ENTRY_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING RealmName; UNICODE_STRING RealmName;
UNICODE_STRING KdcAddress; UNICODE_STRING KdcAddress;
ULONG AddressType; //dsgetdc.h DS_NETBIOS_ADDRESS||DS_INET_ ADDRESS ULONG AddressType; //dsgetdc.h DS_NETBIOS_ADDRESS||DS_INET_ ADDRESS
} KERB_ADD_BINDING_CACHE_ENTRY_REQUEST, *PKERB_ADD_BINDING_CACHE_ENTRY_REQUEST; } KERB_ADD_BINDING_CACHE_ENTRY_REQUEST, *PKERB_ADD_BINDING_CACHE_ENTRY_REQUEST;
#if (_WIN32_WINNT >= 0x0502)
// //
// Request structure for reacquiring smartcard credentials for a // Request structure for reacquiring smartcard credentials for a
// given LUID. // given LUID.
// Requires TCB. // Requires TCB.
// //
typedef struct _KERB_REFRESH_SCCRED_REQUEST { typedef struct _KERB_REFRESH_SCCRED_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING CredentialBlob; // optional UNICODE_STRING CredentialBlob; // optional
LUID LogonId; LUID LogonId;
ULONG Flags; ULONG Flags;
skipping to change at line 3142 skipping to change at line 4388
// //
// Flags for KERB_REFRESH_SCCRED_REQUEST // Flags for KERB_REFRESH_SCCRED_REQUEST
// //
// KERB_REFRESH_SCCRED_RELEASE // KERB_REFRESH_SCCRED_RELEASE
// Release the smartcard handle for LUID // Release the smartcard handle for LUID
// //
// KERB_REFRESH_SCCRED_GETTGT // KERB_REFRESH_SCCRED_GETTGT
// Use the certificate hash in the blob to get a TGT for the logon // Use the certificate hash in the blob to get a TGT for the logon
// session. // session.
// //
#define KERB_REFRESH_SCCRED_RELEASE 0x0 #define KERB_REFRESH_SCCRED_RELEASE 0x0
#define KERB_REFRESH_SCCRED_GETTGT 0x1 #define KERB_REFRESH_SCCRED_GETTGT 0x1
#endif
#if (_WIN32_WINNT != 0x0501)
// //
// Request structure for adding extra Server credentials to a given // Request structure for adding extra Server credentials to a given
// logon session. Only applicable during AcceptSecurityContext, and // logon session. Only applicable during AcceptSecurityContext, and
// requires TCB to alter "other" creds // requires TCB to alter "other" creds
// //
typedef struct _KERB_ADD_CREDENTIALS_REQUEST { typedef struct _KERB_ADD_CREDENTIALS_REQUEST {
KERB_PROTOCOL_MESSAGE_TYPE MessageType; KERB_PROTOCOL_MESSAGE_TYPE MessageType;
UNICODE_STRING UserName; UNICODE_STRING UserName;
UNICODE_STRING DomainName; UNICODE_STRING DomainName;
UNICODE_STRING Password; UNICODE_STRING Password;
LUID LogonId; // optional LUID LogonId; // optional
ULONG Flags; ULONG Flags;
} KERB_ADD_CREDENTIALS_REQUEST, *PKERB_ADD_CREDENTIALS_REQUEST; } KERB_ADD_CREDENTIALS_REQUEST, *PKERB_ADD_CREDENTIALS_REQUEST;
#define KERB_REQUEST_ADD_CREDENTIAL 1 #define KERB_REQUEST_ADD_CREDENTIAL 1
#define KERB_REQUEST_REPLACE_CREDENTIAL 2 #define KERB_REQUEST_REPLACE_CREDENTIAL 2
#define KERB_REQUEST_REMOVE_CREDENTIAL 4 #define KERB_REQUEST_REMOVE_CREDENTIAL 4
#endif
// //
// Request structure for transferring credentials between 2 luids. // Request structure for transferring credentials between 2 luids.
// 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
typedef struct _POLICY_AUDIT_SID_ARRAY {
ULONG UsersCount;
#ifdef MIDL_PASS
[size_is(UsersCount)] PAUDIT_SID_RPC* UserSidArray;
#else
PSID* UserSidArray;
#endif
} POLICY_AUDIT_SID_ARRAY, *PPOLICY_AUDIT_SID_ARRAY;
typedef struct _AUDIT_POLICY_INFORMATION {
GUID AuditSubCategoryGuid;
ULONG AuditingInformation;
GUID AuditCategoryGuid;
} AUDIT_POLICY_INFORMATION, *PAUDIT_POLICY_INFORMATION;
typedef const PAUDIT_POLICY_INFORMATION PCAUDIT_POLICY_INFORMATION, LPCAUDIT_POL
ICY_INFORMATION;
#define AUDIT_SET_SYSTEM_POLICY (0x0001)
#define AUDIT_QUERY_SYSTEM_POLICY (0x0002)
#define AUDIT_SET_USER_POLICY (0x0004)
#define AUDIT_QUERY_USER_POLICY (0x0008)
#define AUDIT_ENUMERATE_USERS (0x0010)
#define AUDIT_SET_MISC_POLICY (0x0020)
#define AUDIT_QUERY_MISC_POLICY (0x0040)
#define AUDIT_GENERIC_ALL (STANDARD_RIGHTS_REQUIRED |\
AUDIT_SET_SYSTEM_POLICY |\
AUDIT_QUERY_SYSTEM_POLICY |\
AUDIT_SET_USER_POLICY |\
AUDIT_QUERY_USER_POLICY |\
AUDIT_ENUMERATE_USERS |\
AUDIT_SET_MISC_POLICY |\
AUDIT_QUERY_MISC_POLICY)
#define AUDIT_GENERIC_READ (STANDARD_RIGHTS_READ |\
AUDIT_QUERY_SYSTEM_POLICY |\
AUDIT_QUERY_USER_POLICY |\
AUDIT_ENUMERATE_USERS |\
AUDIT_QUERY_MISC_POLICY)
#define AUDIT_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\
AUDIT_SET_USER_POLICY |\
AUDIT_SET_MISC_POLICY |\
AUDIT_SET_SYSTEM_POLICY)
#define AUDIT_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE)
BOOLEAN
NTAPI
AuditSetSystemPolicy(
__in_ecount(PolicyCount) PCAUDIT_POLICY_INFORMATION pAuditPolicy,
__in ULONG PolicyCount
);
BOOLEAN
NTAPI
AuditSetPerUserPolicy(
__in const PSID pSid,
__in_ecount(PolicyCount) PCAUDIT_POLICY_INFORMATION pAuditPolicy,
__in ULONG PolicyCount
);
BOOLEAN
NTAPI
AuditQuerySystemPolicy(
__in_ecount(PolicyCount) const GUID* pSubCategoryGuids,
__in ULONG PolicyCount,
__deref_out_ecount(PolicyCount) PAUDIT_POLICY_INFORMATION* ppAuditPolicy
);
BOOLEAN
NTAPI
AuditQueryPerUserPolicy(
__in const PSID pSid,
__in_ecount(PolicyCount) const GUID* pSubCategoryGuids,
__in ULONG PolicyCount,
__deref_out_ecount(PolicyCount) PAUDIT_POLICY_INFORMATION* ppAuditPolicy
);
BOOLEAN
NTAPI
AuditEnumeratePerUserPolicy(
__out PPOLICY_AUDIT_SID_ARRAY* ppAuditSidArray
);
BOOLEAN
NTAPI
AuditComputeEffectivePolicyBySid(
__in const PSID pSid,
__in_ecount(PolicyCount) const GUID* pSubCategoryGuids,
__in ULONG PolicyCount,
__deref_out_ecount(PolicyCount) PAUDIT_POLICY_INFORMATION* ppAuditPolicy
);
BOOLEAN
NTAPI
AuditComputeEffectivePolicyByToken(
__in HANDLE hTokenHandle,
__in_ecount(PolicyCount) const GUID* pSubCategoryGuids,
__in ULONG PolicyCount,
__deref_out_ecount(PolicyCount) PAUDIT_POLICY_INFORMATION* ppAuditPolicy
);
BOOLEAN
NTAPI
AuditEnumerateCategories(
__deref_out_ecount(*pCountReturned) GUID** ppAuditCategoriesArray,
__out PULONG pCountReturned
);
BOOLEAN
NTAPI
AuditEnumerateSubCategories(
__in_opt const GUID* pAuditCategoryGuid,
__in BOOLEAN bRetrieveAllSubCategories,
__deref_out_ecount(*pCountReturned) GUID** ppAuditSubCategoriesArray,
__out PULONG pCountReturned
);
BOOLEAN
NTAPI
AuditLookupCategoryNameW(
__in const GUID* pAuditCategoryGuid,
__deref_out PWSTR* ppszCategoryName
);
BOOLEAN
NTAPI
AuditLookupCategoryNameA(
__in const GUID* pAuditCategoryGuid,
__deref_out PSTR* ppszCategoryName
);
#ifdef UNICODE
#define AuditLookupCategoryName AuditLookupCategoryNameW
#else
#define AuditLookupCategoryName AuditLookupCategoryNameA
#endif
BOOLEAN
NTAPI
AuditLookupSubCategoryNameW(
__in const GUID* pAuditSubCategoryGuid,
__deref_out PWSTR* ppszSubCategoryName
);
BOOLEAN
NTAPI
AuditLookupSubCategoryNameA(
__in const GUID* pAuditSubCategoryGuid,
__deref_out PSTR* ppszSubCategoryName
);
#ifdef UNICODE
#define AuditLookupSubCategoryName AuditLookupSubCategoryNameW
#else
#define AuditLookupSubCategoryName AuditLookupSubCategoryNameA
#endif
BOOLEAN
NTAPI
AuditLookupCategoryIdFromCategoryGuid(
__in const GUID* pAuditCategoryGuid,
__out PPOLICY_AUDIT_EVENT_TYPE pAuditCategoryId
);
BOOLEAN
NTAPI
AuditLookupCategoryGuidFromCategoryId(
__in POLICY_AUDIT_EVENT_TYPE AuditCategoryId,
__out GUID* pAuditCategoryGuid
);
BOOLEAN
NTAPI
AuditSetSecurity(
__in SECURITY_INFORMATION SecurityInformation,
__in PSECURITY_DESCRIPTOR pSecurityDescriptor
);
BOOLEAN
NTAPI
AuditQuerySecurity(
__in SECURITY_INFORMATION SecurityInformation,
__deref_out PSECURITY_DESCRIPTOR *ppSecurityDescriptor
);
VOID
NTAPI
AuditFree(
__in PVOID Buffer
);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _NTSECAPI_ */ #endif /* _NTSECAPI_ */
 End of changes. 129 change blocks. 
73 lines changed or deleted 1567 lines changed or added


 sddl.h (5.2.3790.3959-Windows 5.0)   sddl.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 44 skipping to change at line 44
#define SDDL_GROUP TEXT("G") // Group tag #define SDDL_GROUP TEXT("G") // Group tag
#define SDDL_DACL TEXT("D") // DACL tag #define SDDL_DACL TEXT("D") // DACL tag
#define SDDL_SACL TEXT("S") // SACL tag #define SDDL_SACL TEXT("S") // SACL tag
// //
// SDDL Security descriptor controls // SDDL Security descriptor controls
// //
#define SDDL_PROTECTED TEXT("P") // DACL or SACL Prot ected #define SDDL_PROTECTED TEXT("P") // DACL or SACL Prot ected
#define SDDL_AUTO_INHERIT_REQ TEXT("AR") // Auto inherit requ est #define SDDL_AUTO_INHERIT_REQ TEXT("AR") // Auto inherit requ est
#define SDDL_AUTO_INHERITED TEXT("AI") // DACL/SACL are aut o inherited #define SDDL_AUTO_INHERITED TEXT("AI") // DACL/SACL are aut o inherited
#define SDDL_NULL_ACL TEXT("NO_ACCESS_CONTROL") // Null ACL
// //
// SDDL Ace types // SDDL Ace types
// //
#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
// //
// 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 96 skipping to change at line 98
#define SDDL_GENERIC_WRITE TEXT("GW") #define SDDL_GENERIC_WRITE TEXT("GW")
#define SDDL_GENERIC_EXECUTE TEXT("GX") #define SDDL_GENERIC_EXECUTE TEXT("GX")
#define SDDL_FILE_ALL TEXT("FA") #define SDDL_FILE_ALL TEXT("FA")
#define SDDL_FILE_READ TEXT("FR") #define SDDL_FILE_READ TEXT("FR")
#define SDDL_FILE_WRITE TEXT("FW") #define SDDL_FILE_WRITE TEXT("FW")
#define SDDL_FILE_EXECUTE TEXT("FX") #define SDDL_FILE_EXECUTE TEXT("FX")
#define SDDL_KEY_ALL TEXT("KA") #define SDDL_KEY_ALL TEXT("KA")
#define SDDL_KEY_READ TEXT("KR") #define SDDL_KEY_READ TEXT("KR")
#define SDDL_KEY_WRITE TEXT("KW") #define SDDL_KEY_WRITE TEXT("KW")
#define SDDL_KEY_EXECUTE TEXT("KX") #define SDDL_KEY_EXECUTE TEXT("KX")
#define SDDL_NO_WRITE_UP TEXT("NW")
#define SDDL_NO_READ_UP TEXT("NR")
#define SDDL_NO_EXECUTE_UP TEXT("NX")
// //
// SDDL User alias max size // SDDL User alias max size
// - currently, upto two supported eg. "DA" // - currently, upto two supported eg. "DA"
// - modify this if more WCHARs need to be there in future e.g. "DAX" // - modify this if more WCHARs need to be there in future e.g. "DAX"
// //
#define SDDL_ALIAS_SIZE 2 #define SDDL_ALIAS_SIZE 2
// //
skipping to change at line 135 skipping to change at line 140
#define SDDL_CREATOR_OWNER TEXT("CO") // Creator owner #define SDDL_CREATOR_OWNER TEXT("CO") // Creator owner
#define SDDL_CREATOR_GROUP TEXT("CG") // Creator group #define SDDL_CREATOR_GROUP TEXT("CG") // Creator group
#define SDDL_LOCAL_SYSTEM TEXT("SY") // Local system #define SDDL_LOCAL_SYSTEM TEXT("SY") // Local system
#define SDDL_POWER_USERS TEXT("PU") // Power users #define SDDL_POWER_USERS TEXT("PU") // Power users
#define SDDL_EVERYONE TEXT("WD") // Everyone ( World ) #define SDDL_EVERYONE TEXT("WD") // Everyone ( World )
#define SDDL_REPLICATOR TEXT("RE") // Replicator #define SDDL_REPLICATOR TEXT("RE") // Replicator
#define SDDL_INTERACTIVE TEXT("IU") // Interactive logon user #define SDDL_INTERACTIVE TEXT("IU") // Interactive logon user
#define SDDL_NETWORK TEXT("NU") // Nework logon user #define SDDL_NETWORK TEXT("NU") // Nework logon user
#define SDDL_SERVICE TEXT("SU") // Service logon use r #define SDDL_SERVICE TEXT("SU") // Service logon use r
#define SDDL_RESTRICTED_CODE TEXT("RC") // Restricted code #define SDDL_RESTRICTED_CODE TEXT("RC") // Restricted code
#define SDDL_WRITE_RESTRICTED_CODE TEXT("WR") // Write Restricted code
#define SDDL_ANONYMOUS TEXT("AN") // Anonymous Logon #define SDDL_ANONYMOUS TEXT("AN") // Anonymous Logon
#define SDDL_SCHEMA_ADMINISTRATORS TEXT("SA") // Schema Administra tors #define SDDL_SCHEMA_ADMINISTRATORS TEXT("SA") // Schema Administra tors
#define SDDL_CERT_SERV_ADMINISTRATORS TEXT("CA") // Certificate Serve r Administrators #define SDDL_CERT_SERV_ADMINISTRATORS TEXT("CA") // Certificate Serve r Administrators
#define SDDL_RAS_SERVERS TEXT("RS") // RAS servers group #define SDDL_RAS_SERVERS TEXT("RS") // RAS servers group
#define SDDL_ENTERPRISE_ADMINS TEXT("EA") // Enterprise admini strators #define SDDL_ENTERPRISE_ADMINS TEXT("EA") // Enterprise admini strators
#define SDDL_GROUP_POLICY_ADMINS TEXT("PA") // Group Policy admi nistrators #define SDDL_GROUP_POLICY_ADMINS TEXT("PA") // Group Policy admi nistrators
#define SDDL_ALIAS_PREW2KCOMPACC TEXT("RU") // alias to allow pr evious windows 2000 #define SDDL_ALIAS_PREW2KCOMPACC TEXT("RU") // alias to allow pr evious windows 2000
#define SDDL_LOCAL_SERVICE TEXT("LS") // Local service acc ount (for services) #define SDDL_LOCAL_SERVICE TEXT("LS") // Local service acc ount (for services)
#define SDDL_NETWORK_SERVICE TEXT("NS") // Network service a ccount (for services) #define SDDL_NETWORK_SERVICE TEXT("NS") // Network service a ccount (for services)
#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_CRYPTO_OPERATORS TEXT("CY") // Crypto Operators
#define SDDL_OWNER_RIGHTS TEXT("OW") // Owner Rights SID
#define SDDL_EVENT_LOG_READERS TEXT("ER") // Event log readers
//
// Integrity Labels
//
#define SDDL_ML_LOW TEXT("LW") // Low mandatory lev
el
#define SDDL_ML_MEDIUM TEXT("ME") // Medium mandatory
level
#define SDDL_ML_HIGH TEXT("HI") // High mandatory le
vel
#define SDDL_ML_SYSTEM TEXT("SI") // System mandatory
level
// //
// SDDL Seperators - character version // SDDL Seperators - character version
// //
#define SDDL_SEPERATORC TEXT(';') #define SDDL_SEPERATORC TEXT(';')
#define SDDL_DELIMINATORC TEXT(':') #define SDDL_DELIMINATORC TEXT(':')
#define SDDL_ACE_BEGINC TEXT('(') #define SDDL_ACE_BEGINC TEXT('(')
#define SDDL_ACE_ENDC TEXT(')') #define SDDL_ACE_ENDC TEXT(')')
// //
skipping to change at line 169 skipping to change at line 187
// //
#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(")")
#if !defined(_NTDDK_) #if !defined(_NTDDK_)
#if(_WIN32_WINNT >= 0x0500) #if(_WIN32_WINNT >= 0x0500)
WINADVAPI
BOOL BOOL
WINAPI WINAPI
ConvertSidToStringSidA( ConvertSidToStringSidA(
IN PSID Sid, IN PSID Sid,
OUT LPSTR *StringSid __out_ecount(1) LPSTR *StringSid
); );
WINADVAPI
BOOL BOOL
WINAPI WINAPI
ConvertSidToStringSidW( ConvertSidToStringSidW(
IN PSID Sid, IN PSID Sid,
OUT LPWSTR *StringSid __out_ecount(1) LPWSTR *StringSid
); );
#ifdef UNICODE #ifdef UNICODE
#define ConvertSidToStringSid ConvertSidToStringSidW #define ConvertSidToStringSid ConvertSidToStringSidW
#else #else
#define ConvertSidToStringSid ConvertSidToStringSidA #define ConvertSidToStringSid ConvertSidToStringSidA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI
BOOL BOOL
WINAPI WINAPI
ConvertStringSidToSidA( ConvertStringSidToSidA(
IN LPCSTR StringSid, IN LPCSTR StringSid,
OUT PSID *Sid OUT PSID *Sid
); );
WINADVAPI
BOOL BOOL
WINAPI WINAPI
ConvertStringSidToSidW( ConvertStringSidToSidW(
IN LPCWSTR StringSid, IN LPCWSTR StringSid,
OUT PSID *Sid OUT PSID *Sid
); );
#ifdef UNICODE #ifdef UNICODE
#define ConvertStringSidToSid ConvertStringSidToSidW #define ConvertStringSidToSid ConvertStringSidToSidW
#else #else
#define ConvertStringSidToSid ConvertStringSidToSidA #define ConvertStringSidToSid ConvertStringSidToSidA
#endif // !UNICODE #endif // !UNICODE
WINADVAPI
BOOL BOOL
WINAPI WINAPI
ConvertStringSecurityDescriptorToSecurityDescriptorA( ConvertStringSecurityDescriptorToSecurityDescriptorA(
IN LPCSTR StringSecurityDescriptor, IN LPCSTR StringSecurityDescriptor,
IN DWORD StringSDRevision, IN DWORD StringSDRevision,
OUT PSECURITY_DESCRIPTOR *SecurityDescriptor, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor,
OUT PULONG SecurityDescriptorSize OPTIONAL OUT PULONG SecurityDescriptorSize OPTIONAL
); );
WINADVAPI
BOOL BOOL
WINAPI WINAPI
ConvertStringSecurityDescriptorToSecurityDescriptorW( ConvertStringSecurityDescriptorToSecurityDescriptorW(
IN LPCWSTR StringSecurityDescriptor, IN LPCWSTR StringSecurityDescriptor,
IN DWORD StringSDRevision, IN DWORD StringSDRevision,
OUT PSECURITY_DESCRIPTOR *SecurityDescriptor, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor,
OUT PULONG SecurityDescriptorSize OPTIONAL OUT PULONG SecurityDescriptorSize OPTIONAL
); );
#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
WINADVAPI
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,
OUT LPSTR *StringSecurityDescriptor OPTIONAL, __out_ecount(1) LPSTR *StringSecurityDescriptor,
OUT PULONG StringSecurityDescriptorLen OPTIONAL OUT PULONG StringSecurityDescriptorLen OPTIONAL
); );
WINADVAPI
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,
OUT LPWSTR *StringSecurityDescriptor OPTIONAL, __out_ecount(1) LPWSTR *StringSecurityDescriptor,
OUT PULONG StringSecurityDescriptorLen OPTIONAL OUT PULONG StringSecurityDescriptorLen OPTIONAL
); );
#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 */
 End of changes. 17 change blocks. 
12 lines changed or deleted 27 lines changed or added


 winbase.h (5.2.3790.3959-Windows 5.0)   winbase.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 101 skipping to change at line 101
#define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION #define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
#define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR #define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
#define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION #define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION
#define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION #define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION
#define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW #define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW
#define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION #define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION
#define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION #define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION
#define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE #define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
#define EXCEPTION_POSSIBLE_DEADLOCK STATUS_POSSIBLE_DEADLOCK #define EXCEPTION_POSSIBLE_DEADLOCK STATUS_POSSIBLE_DEADLOCK
#define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT #define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
#define MoveMemory RtlMoveMemory #define MoveMemory RtlMoveMemory
#define CopyMemory RtlCopyMemory #define CopyMemory RtlCopyMemory
#define FillMemory RtlFillMemory #define FillMemory RtlFillMemory
#define ZeroMemory RtlZeroMemory #define ZeroMemory RtlZeroMemory
#define SecureZeroMemory RtlSecureZeroMemory #define SecureZeroMemory RtlSecureZeroMemory
#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
// //
#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
skipping to change at line 155 skipping to change at line 157
#define CALLBACK_STREAM_SWITCH 0x00000001 #define CALLBACK_STREAM_SWITCH 0x00000001
// //
// Define CopyFileEx option flags // Define CopyFileEx option flags
// //
#define COPY_FILE_FAIL_IF_EXISTS 0x00000001 #define COPY_FILE_FAIL_IF_EXISTS 0x00000001
#define COPY_FILE_RESTARTABLE 0x00000002 #define COPY_FILE_RESTARTABLE 0x00000002
#define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004 #define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
#define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008 #define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
//
// Gap for private copyfile flags
//
#if (_WIN32_WINNT >= 0x0600)
#define COPY_FILE_COPY_SYMLINK 0x00000800
#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 196 skipping to change at line 206
// //
// Define the dwPipeMode values for CreateNamedPipe // Define the dwPipeMode values for CreateNamedPipe
// //
#define PIPE_WAIT 0x00000000 #define PIPE_WAIT 0x00000000
#define PIPE_NOWAIT 0x00000001 #define PIPE_NOWAIT 0x00000001
#define PIPE_READMODE_BYTE 0x00000000 #define PIPE_READMODE_BYTE 0x00000000
#define PIPE_READMODE_MESSAGE 0x00000002 #define PIPE_READMODE_MESSAGE 0x00000002
#define PIPE_TYPE_BYTE 0x00000000 #define PIPE_TYPE_BYTE 0x00000000
#define PIPE_TYPE_MESSAGE 0x00000004 #define PIPE_TYPE_MESSAGE 0x00000004
#define PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000
#define PIPE_REJECT_REMOTE_CLIENTS 0x00000008
// //
// Define the well known values for CreateNamedPipe nMaxInstances // Define the well known values for CreateNamedPipe nMaxInstances
// //
#define PIPE_UNLIMITED_INSTANCES 255 #define PIPE_UNLIMITED_INSTANCES 255
// //
// Define the Security Quality of Service bits to be passed // Define the Security Quality of Service bits to be passed
// into CreateFile // into CreateFile
skipping to change at line 238 skipping to change at line 250
DWORD Offset; DWORD Offset;
DWORD OffsetHigh; DWORD OffsetHigh;
}; };
PVOID Pointer; PVOID Pointer;
}; };
HANDLE hEvent; HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED; } OVERLAPPED, *LPOVERLAPPED;
typedef struct _OVERLAPPED_ENTRY {
ULONG_PTR lpCompletionKey;
LPOVERLAPPED lpOverlapped;
ULONG_PTR Internal;
DWORD dwNumberOfBytesTransferred;
} OVERLAPPED_ENTRY, *LPOVERLAPPED_ENTRY;
typedef struct _SECURITY_ATTRIBUTES { typedef struct _SECURITY_ATTRIBUTES {
DWORD nLength; DWORD nLength;
LPVOID lpSecurityDescriptor; LPVOID lpSecurityDescriptor;
BOOL bInheritHandle; BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; } SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef struct _PROCESS_INFORMATION { typedef struct _PROCESS_INFORMATION {
HANDLE hProcess; HANDLE hProcess;
HANDLE hThread; HANDLE hThread;
DWORD dwProcessId; DWORD dwProcessId;
skipping to change at line 298 skipping to change at line 317
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
typedef RTL_CRITICAL_SECTION CRITICAL_SECTION; typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION; typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION; typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG; typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG; typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_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
//
// Run once flags
//
#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
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
);
//
// 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 WINBASEAPI
__out_opt __out_opt
PVOID PVOID
WINAPI WINAPI
EncodePointer ( EncodePointer (
__in_opt PVOID Ptr __in_opt PVOID Ptr
); );
WINBASEAPI WINBASEAPI
__out_opt __out_opt
skipping to change at line 634 skipping to change at line 826
#define NONZEROLHND (LMEM_MOVEABLE) #define NONZEROLHND (LMEM_MOVEABLE)
#define NONZEROLPTR (LMEM_FIXED) #define NONZEROLPTR (LMEM_FIXED)
#define LocalDiscard( h ) LocalReAlloc( (h), 0, LMEM_MOVEABLE ) #define LocalDiscard( h ) LocalReAlloc( (h), 0, LMEM_MOVEABLE )
/* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */ /* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */
#define LMEM_DISCARDED 0x4000 #define LMEM_DISCARDED 0x4000
#define LMEM_LOCKCOUNT 0x00FF #define LMEM_LOCKCOUNT 0x00FF
// //
// NUMA values
//
#define NUMA_NO_PREFERRED_NODE ((DWORD) -1)
//
// dwCreationFlag values // dwCreationFlag values
// //
#define DEBUG_PROCESS 0x00000001 #define DEBUG_PROCESS 0x00000001
#define DEBUG_ONLY_THIS_PROCESS 0x00000002 #define DEBUG_ONLY_THIS_PROCESS 0x00000002
#define CREATE_SUSPENDED 0x00000004 #define CREATE_SUSPENDED 0x00000004
#define DETACHED_PROCESS 0x00000008 #define DETACHED_PROCESS 0x00000008
skipping to change at line 660 skipping to change at line 857
#define CREATE_NEW_PROCESS_GROUP 0x00000200 #define CREATE_NEW_PROCESS_GROUP 0x00000200
#define CREATE_UNICODE_ENVIRONMENT 0x00000400 #define CREATE_UNICODE_ENVIRONMENT 0x00000400
#define CREATE_SEPARATE_WOW_VDM 0x00000800 #define CREATE_SEPARATE_WOW_VDM 0x00000800
#define CREATE_SHARED_WOW_VDM 0x00001000 #define CREATE_SHARED_WOW_VDM 0x00001000
#define CREATE_FORCEDOS 0x00002000 #define CREATE_FORCEDOS 0x00002000
#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000 #define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000 #define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
#define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000 #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
#define INHERIT_CALLER_PRIORITY 0x00020000
#define CREATE_PROTECTED_PROCESS 0x00040000
#define EXTENDED_STARTUPINFO_PRESENT 0x00080000
#define PROCESS_MODE_BACKGROUND_BEGIN 0x00100000
#define PROCESS_MODE_BACKGROUND_END 0x00200000
#define CREATE_BREAKAWAY_FROM_JOB 0x01000000 #define CREATE_BREAKAWAY_FROM_JOB 0x01000000
#define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x02000000 #define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x02000000
#define CREATE_DEFAULT_ERROR_MODE 0x04000000 #define CREATE_DEFAULT_ERROR_MODE 0x04000000
#define CREATE_NO_WINDOW 0x08000000 #define CREATE_NO_WINDOW 0x08000000
#define PROFILE_USER 0x10000000 #define PROFILE_USER 0x10000000
#define PROFILE_KERNEL 0x20000000 #define PROFILE_KERNEL 0x20000000
#define PROFILE_SERVER 0x40000000 #define PROFILE_SERVER 0x40000000
#define CREATE_IGNORE_SYSTEM_DEFAULT 0x80000000 #define CREATE_IGNORE_SYSTEM_DEFAULT 0x80000000
#define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
#define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1) #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
skipping to change at line 684 skipping to change at line 891
#define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN #define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
#define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1) #define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
#define THREAD_PRIORITY_NORMAL 0 #define THREAD_PRIORITY_NORMAL 0
#define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX #define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
#define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1) #define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
#define THREAD_PRIORITY_ERROR_RETURN (MAXLONG) #define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)
#define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT #define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
#define THREAD_MODE_BACKGROUND_BEGIN 0x00010000
#define THREAD_MODE_BACKGROUND_END 0x00020000
//
// GetFinalPathNameByHandle
//
#define VOLUME_NAME_DOS 0x0 //default
#define VOLUME_NAME_GUID 0x1
#define VOLUME_NAME_NT 0x2
#define VOLUME_NAME_NONE 0x4
#define FILE_NAME_NORMALIZED 0x0 //default
#define FILE_NAME_OPENED 0x8
// //
// Debug APIs // Debug APIs
// //
#define EXCEPTION_DEBUG_EVENT 1 #define EXCEPTION_DEBUG_EVENT 1
#define CREATE_THREAD_DEBUG_EVENT 2 #define CREATE_THREAD_DEBUG_EVENT 2
#define CREATE_PROCESS_DEBUG_EVENT 3 #define CREATE_PROCESS_DEBUG_EVENT 3
#define EXIT_THREAD_DEBUG_EVENT 4 #define EXIT_THREAD_DEBUG_EVENT 4
#define EXIT_PROCESS_DEBUG_EVENT 5 #define EXIT_PROCESS_DEBUG_EVENT 5
#define LOAD_DLL_DEBUG_EVENT 6 #define LOAD_DLL_DEBUG_EVENT 6
#define UNLOAD_DLL_DEBUG_EVENT 7 #define UNLOAD_DLL_DEBUG_EVENT 7
skipping to change at line 770 skipping to change at line 992
CREATE_PROCESS_DEBUG_INFO CreateProcessInfo; CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
EXIT_THREAD_DEBUG_INFO ExitThread; EXIT_THREAD_DEBUG_INFO ExitThread;
EXIT_PROCESS_DEBUG_INFO ExitProcess; EXIT_PROCESS_DEBUG_INFO ExitProcess;
LOAD_DLL_DEBUG_INFO LoadDll; LOAD_DLL_DEBUG_INFO LoadDll;
UNLOAD_DLL_DEBUG_INFO UnloadDll; UNLOAD_DLL_DEBUG_INFO UnloadDll;
OUTPUT_DEBUG_STRING_INFO DebugString; OUTPUT_DEBUG_STRING_INFO DebugString;
RIP_INFO RipInfo; RIP_INFO RipInfo;
} u; } u;
} DEBUG_EVENT, *LPDEBUG_EVENT; } DEBUG_EVENT, *LPDEBUG_EVENT;
//
// JIT Debugging Info. This structure is defined to have constant size in
// both the emulated and native environment.
//
typedef struct _JIT_DEBUG_INFO {
DWORD dwSize;
DWORD dwProcessorArchitecture;
DWORD dwThreadID;
DWORD dwReserved0;
ULONG64 lpExceptionAddress;
ULONG64 lpExceptionRecord;
ULONG64 lpContextRecord;
} JIT_DEBUG_INFO, *LPJIT_DEBUG_INFO;
typedef JIT_DEBUG_INFO JIT_DEBUG_INFO32, *LPJIT_DEBUG_INFO32;
typedef JIT_DEBUG_INFO JIT_DEBUG_INFO64, *LPJIT_DEBUG_INFO64;
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
typedef PCONTEXT LPCONTEXT; 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
skipping to change at line 1029 skipping to change at line 1269
#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePoin ter_acq #define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePoin ter_acq
#define InterlockedIncrement64 _InterlockedIncrement64 #define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64 #define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedExchange64 _InterlockedExchange64 #define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq #define InterlockedExchangeAcquire64 _InterlockedExchange64_acq
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq #define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq
#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel #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 LONGLONG
__cdecl __cdecl
InterlockedIncrement64 ( InterlockedIncrement64 (
__inout LONGLONG volatile *Addend __inout LONGLONG volatile *Addend
); );
LONGLONG LONGLONG
__cdecl __cdecl
InterlockedDecrement64 ( InterlockedDecrement64 (
skipping to change at line 1111 skipping to change at line 1643
); );
LONGLONG LONGLONG
__cdecl __cdecl
InterlockedCompareExchangeRelease64 ( InterlockedCompareExchangeRelease64 (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG ExChange, __in LONGLONG ExChange,
__in LONGLONG Comperand __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 LONG
__cdecl __cdecl
InterlockedIncrement ( InterlockedIncrement (
__inout LONG volatile *lpAddend __inout LONG volatile *lpAddend
); );
LONG LONG
__cdecl __cdecl
InterlockedDecrement ( InterlockedDecrement (
__inout LONG volatile *lpAddend __inout LONG volatile *lpAddend
skipping to change at line 1198 skipping to change at line 1757
__in_opt PVOID Exchange, __in_opt PVOID Exchange,
__in_opt PVOID Comperand __in_opt PVOID Comperand
); );
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
#if !defined (InterlockedAnd) #if !defined (InterlockedAnd)
#define InterlockedAnd InterlockedAnd_Inline #define InterlockedAnd InterlockedAnd_Inline
LONG
FORCEINLINE FORCEINLINE
LONG
InterlockedAnd_Inline ( InterlockedAnd_Inline (
__inout LONG volatile *Target, __inout LONG volatile *Target,
__in LONG Set __in LONG Set
) )
{ {
LONG i; LONG i;
LONG j; LONG j;
j = *Target; j = *Target;
do { do {
skipping to change at line 1226 skipping to change at line 1785
return j; return j;
} }
#endif #endif
#if !defined (InterlockedOr) #if !defined (InterlockedOr)
#define InterlockedOr InterlockedOr_Inline #define InterlockedOr InterlockedOr_Inline
LONG
FORCEINLINE FORCEINLINE
LONG
InterlockedOr_Inline ( InterlockedOr_Inline (
__inout LONG volatile *Target, __inout LONG volatile *Target,
__in LONG Set __in LONG Set
) )
{ {
LONG i; LONG i;
LONG j; LONG j;
j = *Target; j = *Target;
do { do {
skipping to change at line 1254 skipping to change at line 1813
return j; return j;
} }
#endif #endif
#if !defined (InterlockedXor) #if !defined (InterlockedXor)
#define InterlockedXor InterlockedXor_Inline #define InterlockedXor InterlockedXor_Inline
LONG
FORCEINLINE FORCEINLINE
LONG
InterlockedXor_Inline ( InterlockedXor_Inline (
__inout LONG volatile *Target, __inout LONG volatile *Target,
__in LONG Set __in LONG Set
) )
{ {
LONG i; LONG i;
LONG j; LONG j;
j = *Target; j = *Target;
do { do {
skipping to change at line 1282 skipping to change at line 1841
return j; return j;
} }
#endif #endif
#if !defined (InterlockedAnd64) #if !defined (InterlockedAnd64)
#define InterlockedAnd64 InterlockedAnd64_Inline #define InterlockedAnd64 InterlockedAnd64_Inline
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedAnd64_Inline ( InterlockedAnd64_Inline (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Destination; Old = *Destination;
} while (InterlockedCompareExchange64(Destination, } while (InterlockedCompareExchange64(Destination,
skipping to change at line 1306 skipping to change at line 1865
return Old; return Old;
} }
#endif #endif
#if !defined (InterlockedOr64) #if !defined (InterlockedOr64)
#define InterlockedOr64 InterlockedOr64_Inline #define InterlockedOr64 InterlockedOr64_Inline
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedOr64_Inline ( InterlockedOr64_Inline (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Destination; Old = *Destination;
} while (InterlockedCompareExchange64(Destination, } while (InterlockedCompareExchange64(Destination,
skipping to change at line 1330 skipping to change at line 1889
return Old; return Old;
} }
#endif #endif
#if !defined (InterlockedXor64) #if !defined (InterlockedXor64)
#define InterlockedXor64 InterlockedXor64_Inline #define InterlockedXor64 InterlockedXor64_Inline
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedXor64_Inline ( InterlockedXor64_Inline (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Destination; Old = *Destination;
} while (InterlockedCompareExchange64(Destination, } while (InterlockedCompareExchange64(Destination,
skipping to change at line 1354 skipping to change at line 1913
return Old; return Old;
} }
#endif #endif
#if !defined (InterlockedBitTestAndSet) #if !defined (InterlockedBitTestAndSet)
#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline #define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline
BOOLEAN
FORCEINLINE FORCEINLINE
BOOLEAN
InterlockedBitTestAndSet_Inline ( InterlockedBitTestAndSet_Inline (
__inout LONG *Base, __inout LONG volatile *Base,
__in LONG Bit __in LONG Bit
) )
{ {
LONG tBit; LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1)); tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedOr(&Base[Bit/(sizeof(*Base)*8)], tBit)&tBit) != 0); return (BOOLEAN)((InterlockedOr(&Base[Bit/(sizeof(*Base)*8)], tBit)&tBit) != 0);
} }
#endif #endif
#if !defined (InterlockedBitTestAndReset) #if !defined (InterlockedBitTestAndReset)
#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline #define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline
BOOLEAN
FORCEINLINE FORCEINLINE
BOOLEAN
InterlockedBitTestAndReset_Inline ( InterlockedBitTestAndReset_Inline (
__inout LONG *Base, __inout LONG volatile *Base,
__in LONG Bit __in LONG Bit
) )
{ {
LONG tBit; LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1)); tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedAnd(&Base[Bit/(sizeof(*Base)*8)], ~tBit)&tBit) != 0); return (BOOLEAN)((InterlockedAnd(&Base[Bit/(sizeof(*Base)*8)], ~tBit)&tBit) != 0);
} }
#endif #endif
#if !defined (InterlockedBitTestAndComplement) #if !defined (InterlockedBitTestAndComplement)
#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline #define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline
BOOLEAN
FORCEINLINE FORCEINLINE
BOOLEAN
InterlockedBitTestAndComplement_Inline ( InterlockedBitTestAndComplement_Inline (
__inout LONG *Base, __inout LONG volatile *Base,
__in LONG Bit __in LONG Bit
) )
{ {
LONG tBit; LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1)); tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedXor(&Base[Bit/(sizeof(*Base)*8)], tBit)&tBit) ! = 0); return (BOOLEAN)((InterlockedXor(&Base[Bit/(sizeof(*Base)*8)], tBit)&tBit) ! = 0);
} }
#endif #endif
#endif #endif
#pragma intrinsic(_InterlockedIncrement) #pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedIncrement_acq) #pragma intrinsic(_InterlockedIncrement_acq)
#pragma intrinsic(_InterlockedIncrement_rel) #pragma intrinsic(_InterlockedIncrement_rel)
#pragma intrinsic(_InterlockedDecrement) #pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedDecrement_acq) #pragma intrinsic(_InterlockedDecrement_acq)
#pragma intrinsic(_InterlockedDecrement_rel) #pragma intrinsic(_InterlockedDecrement_rel)
#pragma intrinsic(_InterlockedExchange) #pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchangeAdd) #pragma intrinsic(_InterlockedExchangeAdd)
skipping to change at line 1432 skipping to change at line 1990
#pragma intrinsic(_InterlockedCompareExchangePointer_acq) #pragma intrinsic(_InterlockedCompareExchangePointer_acq)
#pragma intrinsic(_InterlockedCompareExchangePointer_rel) #pragma intrinsic(_InterlockedCompareExchangePointer_rel)
#pragma intrinsic(_InterlockedIncrement64) #pragma intrinsic(_InterlockedIncrement64)
#pragma intrinsic(_InterlockedDecrement64) #pragma intrinsic(_InterlockedDecrement64)
#pragma intrinsic(_InterlockedExchange64) #pragma intrinsic(_InterlockedExchange64)
#pragma intrinsic(_InterlockedExchange64_acq) #pragma intrinsic(_InterlockedExchange64_acq)
#pragma intrinsic(_InterlockedCompareExchange64) #pragma intrinsic(_InterlockedCompareExchange64)
#pragma intrinsic(_InterlockedCompareExchange64_acq) #pragma intrinsic(_InterlockedCompareExchange64_acq)
#pragma intrinsic(_InterlockedCompareExchange64_rel) #pragma intrinsic(_InterlockedCompareExchange64_rel)
#pragma intrinsic(_InterlockedExchangeAdd64) #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) #elif defined(_M_AMD64) && !defined(RC_INVOKED)
#define InterlockedAnd _InterlockedAnd
#define InterlockedOr _InterlockedOr
#define InterlockedXor _InterlockedXor
#define InterlockedIncrement _InterlockedIncrement #define InterlockedIncrement _InterlockedIncrement
#define InterlockedIncrementAcquire InterlockedIncrement #define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement #define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedDecrement _InterlockedDecrement #define InterlockedDecrement _InterlockedDecrement
#define InterlockedDecrementAcquire InterlockedDecrement #define InterlockedDecrementAcquire InterlockedDecrement
#define InterlockedDecrementRelease InterlockedDecrement #define InterlockedDecrementRelease InterlockedDecrement
#define InterlockedExchange _InterlockedExchange #define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd #define InterlockedExchangeAdd _InterlockedExchangeAdd
#define InterlockedCompareExchange _InterlockedCompareExchange #define InterlockedCompareExchange _InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange #define InterlockedCompareExchangeAcquire InterlockedCompareExchange
skipping to change at line 1462 skipping to change at line 2060
#define InterlockedXor64 _InterlockedXor64 #define InterlockedXor64 _InterlockedXor64
#define InterlockedIncrement64 _InterlockedIncrement64 #define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64 #define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedExchange64 _InterlockedExchange64 #define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 #define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 #define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
LONG 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 ( InterlockedIncrement (
__inout LONG volatile *Addend __inout LONG volatile *Addend
); );
LONG LONG
InterlockedDecrement ( InterlockedDecrement (
__inout LONG volatile *Addend __inout LONG volatile *Addend
); );
LONG LONG
InterlockedExchange ( InterlockedExchange (
__inout LONG volatile *Target, __inout LONG volatile *Target,
__in LONG Value __in LONG Value
); );
LONG LONG
InterlockedExchangeAdd ( InterlockedExchangeAdd (
__inout LONG volatile *Addend, __inout LONG volatile *Addend,
__in LONG Value __in LONG Value
); );
LONG LONG
InterlockedCompareExchange ( InterlockedCompareExchange (
__inout LONG volatile *Destination, __inout LONG volatile *Destination,
__in LONG ExChange, __in LONG ExChange,
__in LONG Comperand __in LONG Comperand
); );
PVOID PVOID
InterlockedCompareExchangePointer ( InterlockedCompareExchangePointer (
__inout PVOID volatile *Destination, __inout PVOID volatile *Destination,
__in_opt PVOID Exchange, __in_opt PVOID Exchange,
__in_opt PVOID Comperand __in_opt PVOID Comperand
); );
PVOID PVOID
InterlockedExchangePointer ( InterlockedExchangePointer (
__inout PVOID volatile *Target, __inout PVOID volatile *Target,
__in_opt PVOID Value __in_opt PVOID Value
); );
LONG64 LONG64
InterlockedAnd64 ( InterlockedAnd64 (
__inout LONG64 volatile *Destination, __inout LONG64 volatile *Destination,
__in LONG64 Value __in LONG64 Value
); );
LONG64 LONG64
InterlockedOr64 ( InterlockedOr64 (
__inout LONG64 volatile *Destination, __inout LONG64 volatile *Destination,
__in LONG64 Value __in LONG64 Value
); );
LONG64 LONG64
InterlockedXor64 ( InterlockedXor64 (
__inout LONG64 volatile *Destination, __inout LONG64 volatile *Destination,
__in LONG64 Value __in LONG64 Value
); );
LONG64 LONG64
InterlockedIncrement64 ( InterlockedIncrement64 (
__inout LONG64 volatile *Addend __inout LONG64 volatile *Addend
); );
LONG64 LONG64
InterlockedDecrement64 ( InterlockedDecrement64 (
__inout LONG64 volatile *Addend __inout LONG64 volatile *Addend
); );
LONG64 LONG64
InterlockedExchange64 ( InterlockedExchange64 (
__inout LONG64 volatile *Target, __inout LONG64 volatile *Target,
__in LONG64 Value __in LONG64 Value
); );
LONG64 LONG64
InterlockedExchangeAdd64 ( InterlockedExchangeAdd64 (
__inout LONG64 volatile *Addend, __inout LONG64 volatile *Addend,
__in LONG64 Value __in LONG64 Value
); );
LONG64 LONG64
InterlockedCompareExchange64 ( InterlockedCompareExchange64 (
__inout LONG64 volatile *Destination, __inout LONG64 volatile *Destination,
__in LONG64 ExChange, __in LONG64 ExChange,
__in LONG64 Comperand __in LONG64 Comperand
); );
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
#pragma intrinsic(_InterlockedIncrement) #pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement) #pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedExchange) #pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchangeAdd) #pragma intrinsic(_InterlockedExchangeAdd)
#pragma intrinsic(_InterlockedCompareExchange) #pragma intrinsic(_InterlockedCompareExchange)
#pragma intrinsic(_InterlockedExchangePointer) #pragma intrinsic(_InterlockedExchangePointer)
#pragma intrinsic(_InterlockedCompareExchangePointer) #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 #else // X86 interlocked definitions
WINBASEAPI WINBASEAPI
LONG LONG
WINAPI WINAPI
InterlockedIncrement ( InterlockedIncrement (
__inout LONG volatile *lpAddend __inout LONG volatile *lpAddend
); );
skipping to change at line 1619 skipping to change at line 2300
__in LONGLONG Exchange, __in LONGLONG Exchange,
__in LONGLONG Comperand __in LONGLONG Comperand
); );
#endif #endif
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
#if (_WIN32_WINNT >= 0x0502) #if (_WIN32_WINNT >= 0x0502)
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedAnd64 ( InterlockedAnd64 (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Destination; Old = *Destination;
} while (InterlockedCompareExchange64(Destination, } while (InterlockedCompareExchange64(Destination,
Old & Value, Old & Value,
Old) != Old); Old) != Old);
return Old; return Old;
} }
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedOr64 ( InterlockedOr64 (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Destination; Old = *Destination;
} while (InterlockedCompareExchange64(Destination, } while (InterlockedCompareExchange64(Destination,
Old | Value, Old | Value,
Old) != Old); Old) != Old);
return Old; return Old;
} }
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedXor64 ( InterlockedXor64 (
__inout LONGLONG volatile *Destination, __inout LONGLONG volatile *Destination,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Destination; Old = *Destination;
} while (InterlockedCompareExchange64(Destination, } while (InterlockedCompareExchange64(Destination,
Old ^ Value, Old ^ Value,
Old) != Old); Old) != Old);
return Old; return Old;
} }
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedIncrement64 ( InterlockedIncrement64 (
__inout LONGLONG volatile *Addend __inout LONGLONG volatile *Addend
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Addend; Old = *Addend;
} while (InterlockedCompareExchange64(Addend, } while (InterlockedCompareExchange64(Addend,
Old + 1, Old + 1,
Old) != Old); Old) != Old);
return Old + 1; return Old + 1;
} }
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedDecrement64 ( InterlockedDecrement64 (
__inout LONGLONG volatile *Addend __inout LONGLONG volatile *Addend
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Addend; Old = *Addend;
} while (InterlockedCompareExchange64(Addend, } while (InterlockedCompareExchange64(Addend,
Old - 1, Old - 1,
Old) != Old); Old) != Old);
return Old - 1; return Old - 1;
} }
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedExchange64 ( InterlockedExchange64 (
__inout LONGLONG volatile *Target, __inout LONGLONG volatile *Target,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Target; Old = *Target;
} while (InterlockedCompareExchange64(Target, } while (InterlockedCompareExchange64(Target,
Value, Value,
Old) != Old); Old) != Old);
return Old; return Old;
} }
LONGLONG
FORCEINLINE FORCEINLINE
LONGLONG
InterlockedExchangeAdd64( InterlockedExchangeAdd64(
__inout LONGLONG volatile *Addend, __inout LONGLONG volatile *Addend,
__in LONGLONG Value __in LONGLONG Value
) )
{ {
LONGLONG Old; LONGLONG Old;
do { do {
Old = *Addend; Old = *Addend;
} while (InterlockedCompareExchange64(Addend, } while (InterlockedCompareExchange64(Addend,
skipping to change at line 1871 skipping to change at line 2552
#else #else
CALLBACK CALLBACK
#endif #endif
WinMain ( WinMain (
__in HINSTANCE hInstance, __in HINSTANCE hInstance,
__in_opt HINSTANCE hPrevInstance, __in_opt HINSTANCE hPrevInstance,
__in_opt LPSTR lpCmdLine, __in_opt LPSTR lpCmdLine,
__in int nShowCmd __in int nShowCmd
); );
int
#if defined(_M_CEE_PURE)
__clrcall
#else
WINAPI
#endif
wWinMain(
__in HINSTANCE hInstance,
__in_opt HINSTANCE hPrevInstance,
__in_opt LPWSTR lpCmdLine,
__in int nShowCmd
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FreeLibrary ( FreeLibrary (
__in HMODULE hLibModule __in HMODULE hLibModule
); );
WINBASEAPI WINBASEAPI
DECLSPEC_NORETURN DECLSPEC_NORETURN
VOID VOID
skipping to change at line 1910 skipping to change at line 2604
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetVersion ( GetVersion (
VOID VOID
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalAlloc ( GlobalAlloc (
__in UINT uFlags, __in UINT uFlags,
__in SIZE_T dwBytes __in SIZE_T dwBytes
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalReAlloc ( GlobalReAlloc (
__in HGLOBAL hMem, __in HGLOBAL hMem,
__in SIZE_T dwBytes, __in SIZE_T dwBytes,
__in UINT uFlags __in UINT uFlags
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
skipping to change at line 1943 skipping to change at line 2637
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GlobalFlags ( GlobalFlags (
__in HGLOBAL hMem __in HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
__out __out_opt
LPVOID LPVOID
WINAPI WINAPI
GlobalLock ( GlobalLock (
__in HGLOBAL hMem __in HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
__out __out_opt
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 __out_opt
HGLOBAL HGLOBAL
WINAPI WINAPI
GlobalFree( GlobalFree(
__deref HGLOBAL hMem __deref HGLOBAL hMem
); );
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
GlobalCompact( GlobalCompact(
skipping to change at line 2036 skipping to change at line 2730
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX; } MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GlobalMemoryStatusEx( GlobalMemoryStatusEx(
__out LPMEMORYSTATUSEX lpBuffer __out LPMEMORYSTATUSEX lpBuffer
); );
WINBASEAPI WINBASEAPI
__out __out_bcount_opt( "(uFlags&LMEM_FIXED) ? uBytes : 0" )
HLOCAL HLOCAL
WINAPI WINAPI
LocalAlloc( LocalAlloc(
__in UINT uFlags, __in UINT uFlags,
__in SIZE_T uBytes __in SIZE_T uBytes
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HLOCAL HLOCAL
WINAPI WINAPI
LocalReAlloc( LocalReAlloc(
__in HLOCAL hMem, __in HLOCAL hMem,
__in SIZE_T uBytes, __in SIZE_T uBytes,
__in UINT uFlags __in UINT uFlags
); );
WINBASEAPI WINBASEAPI
__out __out_opt
LPVOID LPVOID
WINAPI WINAPI
LocalLock( LocalLock(
__in HLOCAL hMem __in HLOCAL hMem
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HLOCAL HLOCAL
WINAPI WINAPI
LocalHandle( LocalHandle(
__in LPCVOID pMem __in LPCVOID pMem
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
LocalUnlock( LocalUnlock(
skipping to change at line 2122 skipping to change at line 2816
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FlushInstructionCache( FlushInstructionCache(
__in HANDLE hProcess, __in HANDLE hProcess,
__in_bcount_opt(dwSize) LPCVOID lpBaseAddress, __in_bcount_opt(dwSize) LPCVOID lpBaseAddress,
__in SIZE_T dwSize __in SIZE_T dwSize
); );
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI WINBASEAPI
__bcount(dwSize) 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
WINBASEAPI
__bcount_opt(dwSize)
LPVOID LPVOID
WINAPI WINAPI
VirtualAlloc( VirtualAlloc(
__in_opt LPVOID lpAddress, __in_opt LPVOID lpAddress,
__in SIZE_T dwSize, __in SIZE_T dwSize,
__in DWORD flAllocationType, __in DWORD flAllocationType,
__in DWORD flProtect __in DWORD flProtect
); );
WINBASEAPI WINBASEAPI
skipping to change at line 2162 skipping to change at line 2891
WINBASEAPI WINBASEAPI
SIZE_T SIZE_T
WINAPI WINAPI
VirtualQuery( VirtualQuery(
__in_opt LPCVOID lpAddress, __in_opt LPCVOID lpAddress,
__out_bcount_part(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer, __out_bcount_part(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength __in SIZE_T dwLength
); );
WINBASEAPI WINBASEAPI
__bcount(dwSize) __bcount_opt(dwSize)
LPVOID LPVOID
WINAPI WINAPI
VirtualAllocEx( VirtualAllocEx(
__in HANDLE hProcess, __in HANDLE hProcess,
__in_opt LPVOID lpAddress, __in_opt LPVOID lpAddress,
__in SIZE_T dwSize, __in SIZE_T dwSize,
__in DWORD flAllocationType, __in DWORD flAllocationType,
__in DWORD flProtect __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 WINBASEAPI
UINT UINT
WINAPI WINAPI
GetWriteWatch( GetWriteWatch(
__in DWORD dwFlags, __in DWORD dwFlags,
__in PVOID lpBaseAddress, __in PVOID lpBaseAddress,
__in SIZE_T dwRegionSize, __in SIZE_T dwRegionSize,
__out_ecount_part(*lpdwCount, *lpdwCount) PVOID *lpAddresses, __out_ecount_part(*lpdwCount, *lpdwCount) PVOID *lpAddresses,
__inout ULONG_PTR *lpdwCount, __inout ULONG_PTR *lpdwCount,
__out PULONG lpdwGranularity __out PULONG lpdwGranularity
skipping to change at line 2251 skipping to change at line 2997
SIZE_T SIZE_T
WINAPI WINAPI
VirtualQueryEx( VirtualQueryEx(
__in HANDLE hProcess, __in HANDLE hProcess,
__in_opt LPCVOID lpAddress, __in_opt LPCVOID lpAddress,
__out_bcount_part(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer, __out_bcount_part(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer,
__in SIZE_T dwLength __in SIZE_T dwLength
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
HeapCreate( HeapCreate(
__in DWORD flOptions, __in DWORD flOptions,
__in SIZE_T dwInitialSize, __in SIZE_T dwInitialSize,
__in SIZE_T dwMaximumSize __in SIZE_T dwMaximumSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
skipping to change at line 2389 skipping to change at line 3135
WINAPI WINAPI
HeapWalk( HeapWalk(
__in HANDLE hHeap, __in HANDLE hHeap,
__inout LPPROCESS_HEAP_ENTRY lpEntry __inout LPPROCESS_HEAP_ENTRY lpEntry
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
HeapSetInformation ( HeapSetInformation (
__in HANDLE HeapHandle, __in_opt HANDLE HeapHandle,
__in HEAP_INFORMATION_CLASS HeapInformationClass, __in HEAP_INFORMATION_CLASS HeapInformationClass,
__in_bcount_opt(HeapInformationLength) PVOID HeapInformation, __in_bcount_opt(HeapInformationLength) PVOID HeapInformation,
__in SIZE_T HeapInformationLength __in SIZE_T HeapInformationLength
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
HeapQueryInformation ( HeapQueryInformation (
__in HANDLE HeapHandle, __in_opt HANDLE HeapHandle,
__in HEAP_INFORMATION_CLASS HeapInformationClass, __in HEAP_INFORMATION_CLASS HeapInformationClass,
__out_bcount_part_opt(HeapInformationLength, *ReturnLength) PVOID HeapInform ation, __out_bcount_part_opt(HeapInformationLength, *ReturnLength) PVOID HeapInform ation,
__in SIZE_T HeapInformationLength, __in SIZE_T HeapInformationLength,
__out_opt PSIZE_T ReturnLength __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
skipping to change at line 2486 skipping to change at line 3232
__in LPCWSTR lpszShortPath, __in LPCWSTR lpszShortPath,
__out_ecount_part(cchBuffer, return + 1) LPWSTR lpszLongPath, __out_ecount_part(cchBuffer, return + 1) LPWSTR lpszLongPath,
__in DWORD cchBuffer __in DWORD cchBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define GetLongPathName GetLongPathNameW #define GetLongPathName GetLongPathNameW
#else #else
#define GetLongPathName GetLongPathNameA #define GetLongPathName GetLongPathNameA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
DWORD
WINAPI
GetLongPathNameTransactedA(
__in LPCSTR lpszShortPath,
__out_ecount_part(cchBuffer, return + 1) LPSTR lpszLongPath,
__in DWORD cchBuffer,
__in HANDLE hTransaction
);
WINBASEAPI
DWORD
WINAPI
GetLongPathNameTransactedW(
__in LPCWSTR lpszShortPath,
__out_ecount_part(cchBuffer, return + 1) LPWSTR lpszLongPath,
__in DWORD cchBuffer,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define GetLongPathNameTransacted GetLongPathNameTransactedW
#else
#define GetLongPathNameTransacted GetLongPathNameTransactedA
#endif // !UNICODE
#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
skipping to change at line 2573 skipping to change at line 3347
BOOL BOOL
WINAPI WINAPI
SetProcessWorkingSetSizeEx( SetProcessWorkingSetSizeEx(
__in HANDLE hProcess, __in HANDLE hProcess,
__in SIZE_T dwMinimumWorkingSetSize, __in SIZE_T dwMinimumWorkingSetSize,
__in SIZE_T dwMaximumWorkingSetSize, __in SIZE_T dwMaximumWorkingSetSize,
__in DWORD Flags __in DWORD Flags
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
OpenProcess( OpenProcess(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in DWORD dwProcessId __in DWORD dwProcessId
); );
WINBASEAPI WINBASEAPI
__out __out
skipping to change at line 2727 skipping to change at line 3500
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
// //
// Fiber creation flags // Fiber creation flags
// //
#define FIBER_FLAG_FLOAT_SWITCH 0x1 // context switch floating point #define FIBER_FLAG_FLOAT_SWITCH 0x1 // context switch floating point
WINBASEAPI WINBASEAPI
__out __out_opt
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 WINBASEAPI
__out __out_opt
LPVOID LPVOID
WINAPI WINAPI
CreateFiberEx( CreateFiberEx(
__in SIZE_T dwStackCommitSize, __in SIZE_T dwStackCommitSize,
__in SIZE_T dwStackReserveSize, __in SIZE_T dwStackReserveSize,
__in DWORD dwFlags, __in DWORD dwFlags,
__in LPFIBER_START_ROUTINE lpStartAddress, __in LPFIBER_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter __in_opt LPVOID lpParameter
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
DeleteFiber( DeleteFiber(
__in LPVOID lpFiber __in LPVOID lpFiber
); );
WINBASEAPI WINBASEAPI
__out __out_opt
LPVOID LPVOID
WINAPI WINAPI
ConvertThreadToFiber( ConvertThreadToFiber(
__in_opt LPVOID lpParameter __in_opt LPVOID lpParameter
); );
WINBASEAPI WINBASEAPI
__out __out_opt
LPVOID LPVOID
WINAPI WINAPI
ConvertThreadToFiberEx( ConvertThreadToFiberEx(
__in_opt LPVOID lpParameter, __in_opt LPVOID lpParameter,
__in DWORD dwFlags __in DWORD dwFlags
); );
#if (_WIN32_WINNT >= 0x0501)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ConvertFiberToThread( ConvertFiberToThread(
VOID VOID
); );
#endif
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
IsThreadAFiber(
VOID
);
#endif
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
SwitchToFiber( SwitchToFiber(
__in LPVOID lpFiber __in LPVOID lpFiber
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SwitchToThread( SwitchToThread(
VOID VOID
); );
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateThread( CreateThread(
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize, __in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress, __in LPTHREAD_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter, __in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags, __in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId __out_opt LPDWORD lpThreadId
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateRemoteThread( CreateRemoteThread(
__in HANDLE hProcess, __in HANDLE hProcess,
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize, __in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress, __in LPTHREAD_START_ROUTINE lpStartAddress,
__in_opt LPVOID lpParameter, __in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags, __in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId __out_opt LPDWORD lpThreadId
skipping to change at line 2851 skipping to change at line 3639
__inout PULONG StackSizeInBytes __inout PULONG StackSizeInBytes
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetProcessIdOfThread( GetProcessIdOfThread(
__in HANDLE Thread __in HANDLE Thread
); );
#if (_WIN32_WINNT >= 0x0502)
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetThreadId( GetThreadId(
__in HANDLE Thread __in HANDLE Thread
); );
#endif // _WIN32_WINNT >= 0x0502
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetProcessId( GetProcessId(
__in HANDLE Process __in HANDLE Process
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
skipping to change at line 2921 skipping to change at line 3713
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsSystemResumeAutomatic( IsSystemResumeAutomatic(
VOID VOID
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
OpenThread( OpenThread(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in DWORD dwThreadId __in DWORD dwThreadId
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
skipping to change at line 3024 skipping to change at line 3816
__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
); );
#ifdef _M_CEE_PURE
#define GetLastError System::Runtime::InteropServices::Marshal::GetLastWin32Erro
r
#else
WINBASEAPI WINBASEAPI
__checkReturn
DWORD DWORD
WINAPI WINAPI
GetLastError( GetLastError(
VOID VOID
); );
#endif
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
SetLastError( SetLastError(
__in DWORD dwErrCode __in DWORD dwErrCode
); );
#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)
skipping to change at line 3070 skipping to change at line 3867
BOOL BOOL
WINAPI WINAPI
GetOverlappedResult( GetOverlappedResult(
__in HANDLE hFile, __in HANDLE hFile,
__in LPOVERLAPPED lpOverlapped, __in LPOVERLAPPED lpOverlapped,
__out LPDWORD lpNumberOfBytesTransferred, __out LPDWORD lpNumberOfBytesTransferred,
__in BOOL bWait __in BOOL bWait
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateIoCompletionPort( CreateIoCompletionPort(
__in HANDLE FileHandle, __in HANDLE FileHandle,
__in_opt HANDLE ExistingCompletionPort, __in_opt HANDLE ExistingCompletionPort,
__in ULONG_PTR CompletionKey, __in ULONG_PTR CompletionKey,
__in DWORD NumberOfConcurrentThreads __in DWORD NumberOfConcurrentThreads
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetQueuedCompletionStatus( GetQueuedCompletionStatus(
__in HANDLE CompletionPort, __in HANDLE CompletionPort,
__out LPDWORD lpNumberOfBytesTransferred, __out LPDWORD lpNumberOfBytesTransferred,
__out PULONG_PTR lpCompletionKey, __out PULONG_PTR lpCompletionKey,
__out LPOVERLAPPED *lpOverlapped, __out LPOVERLAPPED *lpOverlapped,
__in DWORD dwMilliseconds __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 WINBASEAPI
BOOL BOOL
WINAPI WINAPI
PostQueuedCompletionStatus( PostQueuedCompletionStatus(
__in HANDLE CompletionPort, __in HANDLE CompletionPort,
__in DWORD dwNumberOfBytesTransferred, __in DWORD dwNumberOfBytesTransferred,
__in ULONG_PTR dwCompletionKey, __in ULONG_PTR dwCompletionKey,
__in_opt LPOVERLAPPED lpOverlapped __in_opt LPOVERLAPPED lpOverlapped
); );
#if (_WIN32_WINNT >= 0x0600)
//
// The following flags allows an application to change
// the semantics of IO completion notification.
//
//
// Don't queue an entry to an associated completion port if returning success
// synchronously.
//
#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
//
// Don't set the file handle event on IO completion.
//
#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
WINBASEAPI
BOOL
WINAPI
SetFileCompletionNotificationModes(
__in HANDLE FileHandle,
__in UCHAR Flags
);
WINBASEAPI
BOOL
WINAPI
SetFileIoOverlappedRange(
__in HANDLE FileHandle,
__in PUCHAR OverlappedRangeStart,
__in ULONG Length
);
#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 WINBASEAPI
UINT UINT
WINAPI WINAPI
GetErrorMode(
VOID
);
WINBASEAPI
UINT
WINAPI
SetErrorMode( SetErrorMode(
__in UINT uMode __in UINT uMode
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReadProcessMemory( ReadProcessMemory(
__in HANDLE hProcess, __in HANDLE hProcess,
__in LPCVOID lpBaseAddress, __in LPCVOID lpBaseAddress,
skipping to change at line 3151 skipping to change at line 4008
__inout LPCONTEXT lpContext __inout LPCONTEXT lpContext
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetThreadContext( SetThreadContext(
__in HANDLE hThread, __in HANDLE hThread,
__in CONST CONTEXT *lpContext __in CONST CONTEXT *lpContext
); );
WINBASEAPI
BOOL
WINAPI
Wow64GetThreadContext(
__in HANDLE hThread,
__inout PWOW64_CONTEXT lpContext
);
WINBASEAPI
BOOL
WINAPI
Wow64SetThreadContext(
__in HANDLE hThread,
__in CONST WOW64_CONTEXT *lpContext
);
#endif #endif
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SuspendThread( SuspendThread(
__in HANDLE hThread __in HANDLE hThread
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
Wow64SuspendThread(
__in HANDLE hThread
);
WINBASEAPI
DWORD
WINAPI
ResumeThread( ResumeThread(
__in HANDLE hThread __in HANDLE hThread
); );
#if(_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) #if(_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
typedef typedef
VOID VOID
(APIENTRY *PAPCFUNC)( (APIENTRY *PAPCFUNC)(
__in ULONG_PTR dwParam __in ULONG_PTR dwParam
skipping to change at line 3281 skipping to change at line 4162
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
LeaveCriticalSection( LeaveCriticalSection(
__inout LPCRITICAL_SECTION lpCriticalSection __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
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
InitializeCriticalSectionAndSpinCount( InitializeCriticalSectionAndSpinCount(
__out LPCRITICAL_SECTION lpCriticalSection, __out LPCRITICAL_SECTION lpCriticalSection,
__in DWORD dwSpinCount __in DWORD dwSpinCount
); );
WINBASEAPI WINBASEAPI
BOOL
WINAPI
InitializeCriticalSectionEx(
__out LPCRITICAL_SECTION lpCriticalSection,
__in DWORD dwSpinCount,
__in DWORD Flags
);
WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SetCriticalSectionSpinCount( SetCriticalSectionSpinCount(
__inout LPCRITICAL_SECTION lpCriticalSection, __inout LPCRITICAL_SECTION lpCriticalSection,
__in DWORD dwSpinCount __in DWORD dwSpinCount
); );
#endif #endif
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
WINBASEAPI WINBASEAPI
skipping to change at line 3377 skipping to change at line 4269
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
Sleep( Sleep(
__in DWORD dwMilliseconds __in DWORD dwMilliseconds
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HGLOBAL HGLOBAL
WINAPI WINAPI
LoadResource( LoadResource(
__in_opt HMODULE hModule, __in_opt HMODULE hModule,
__in HRSRC hResInfo __in HRSRC hResInfo
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SizeofResource( SizeofResource(
__in_opt HMODULE hModule, __in_opt HMODULE hModule,
__in HRSRC hResInfo __in HRSRC hResInfo
); );
WINBASEAPI WINBASEAPI
__out
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
__out
ATOM ATOM
WINAPI WINAPI
DeleteAtom( DeleteAtom(
__in ATOM nAtom __in ATOM nAtom
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
SetHandleCount( SetHandleCount(
skipping to change at line 3523 skipping to change at line 4413
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetFileSizeEx( GetFileSizeEx(
__in HANDLE hFile, __in HANDLE hFile,
__out PLARGE_INTEGER lpFileSize __out PLARGE_INTEGER lpFileSize
); );
WINBASEAPI WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
GetStdHandle( GetStdHandle(
__in DWORD nStdHandle __in DWORD nStdHandle
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetStdHandle( SetStdHandle(
__in DWORD nStdHandle, __in DWORD nStdHandle,
__in HANDLE hHandle __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 WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WriteFile( WriteFile(
__in HANDLE hFile, __in HANDLE hFile,
__in_bcount(nNumberOfBytesToWrite) LPCVOID lpBuffer, __in_bcount_opt(nNumberOfBytesToWrite) LPCVOID lpBuffer,
__in DWORD nNumberOfBytesToWrite, __in DWORD nNumberOfBytesToWrite,
__out_opt LPDWORD lpNumberOfBytesWritten, __out_opt LPDWORD lpNumberOfBytesWritten,
__inout_opt LPOVERLAPPED lpOverlapped __inout_opt LPOVERLAPPED lpOverlapped
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ReadFile( ReadFile(
__in HANDLE hFile, __in HANDLE hFile,
__out_bcount_part(nNumberOfBytesToRead, *lpNumberOfBytesRead) LPVOID lpBuffe r, __out_bcount_part_opt(nNumberOfBytesToRead, *lpNumberOfBytesRead) __out_data _source(FILE) LPVOID lpBuffer,
__in DWORD nNumberOfBytesToRead, __in DWORD nNumberOfBytesToRead,
__out_opt LPDWORD lpNumberOfBytesRead, __out_opt LPDWORD lpNumberOfBytesRead,
__inout_opt LPOVERLAPPED lpOverlapped __inout_opt LPOVERLAPPED lpOverlapped
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FlushFileBuffers( FlushFileBuffers(
__in HANDLE hFile __in HANDLE hFile
skipping to change at line 3622 skipping to change at line 4524
BOOL BOOL
WINAPI WINAPI
SetEndOfFile( SetEndOfFile(
__in HANDLE hFile __in HANDLE hFile
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
SetFilePointer( SetFilePointer(
__in HANDLE hFile, __in HANDLE hFile,
__in LONG lDistanceToMove, __in LONG lDistanceToMove,
__in_opt PLONG lpDistanceToMoveHigh, __inout_opt PLONG lpDistanceToMoveHigh,
__in DWORD dwMoveMethod __in DWORD dwMoveMethod
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFilePointerEx( SetFilePointerEx(
__in HANDLE hFile, __in HANDLE hFile,
__in LARGE_INTEGER liDistanceToMove, __in LARGE_INTEGER liDistanceToMove,
__out_opt PLARGE_INTEGER lpNewFilePointer, __out_opt PLARGE_INTEGER lpNewFilePointer,
__in DWORD dwMoveMethod __in DWORD dwMoveMethod
skipping to change at line 3665 skipping to change at line 4567
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileTime( SetFileTime(
__in HANDLE hFile, __in HANDLE hFile,
__in_opt CONST FILETIME *lpCreationTime, __in_opt CONST FILETIME *lpCreationTime,
__in_opt CONST FILETIME *lpLastAccessTime, __in_opt CONST FILETIME *lpLastAccessTime,
__in_opt CONST FILETIME *lpLastWriteTime __in_opt CONST FILETIME *lpLastWriteTime
); );
#if _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetFileValidData( SetFileValidData(
__in HANDLE hFile, __in HANDLE hFile,
__in LONGLONG ValidDataLength __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
skipping to change at line 3785 skipping to change at line 4691
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)
BOOL BOOL
WINAPI WINAPI
GetCommConfig( GetCommConfig(
__in HANDLE hCommDev, __in HANDLE hCommDev,
__out_opt LPCOMMCONFIG lpCC, __out_bcount_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,
__out 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
); );
skipping to change at line 4118 skipping to change at line 5025
typedef struct _TIME_ZONE_INFORMATION { typedef struct _TIME_ZONE_INFORMATION {
LONG Bias; LONG Bias;
WCHAR StandardName[ 32 ]; WCHAR StandardName[ 32 ];
SYSTEMTIME StandardDate; SYSTEMTIME StandardDate;
LONG StandardBias; LONG StandardBias;
WCHAR DaylightName[ 32 ]; WCHAR DaylightName[ 32 ];
SYSTEMTIME DaylightDate; SYSTEMTIME DaylightDate;
LONG DaylightBias; LONG DaylightBias;
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION; } 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 WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SystemTimeToTzSpecificLocalTime( SystemTimeToTzSpecificLocalTime(
__in_opt LPTIME_ZONE_INFORMATION lpTimeZoneInformation, __in_opt CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation,
__in LPSYSTEMTIME lpUniversalTime, __in CONST SYSTEMTIME *lpUniversalTime,
__out LPSYSTEMTIME lpLocalTime __out LPSYSTEMTIME lpLocalTime
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
TzSpecificLocalTimeToSystemTime( TzSpecificLocalTimeToSystemTime(
__in_opt LPTIME_ZONE_INFORMATION lpTimeZoneInformation, __in_opt CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation,
__in LPSYSTEMTIME lpLocalTime, __in CONST SYSTEMTIME *lpLocalTime,
__out LPSYSTEMTIME lpUniversalTime __out LPSYSTEMTIME lpUniversalTime
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTimeZoneInformation( GetTimeZoneInformation(
__out LPTIME_ZONE_INFORMATION lpTimeZoneInformation __out LPTIME_ZONE_INFORMATION lpTimeZoneInformation
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetTimeZoneInformation( SetTimeZoneInformation(
__in CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation __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( SystemTimeToFileTime(
__in CONST SYSTEMTIME *lpSystemTime, __in CONST SYSTEMTIME *lpSystemTime,
__out LPFILETIME lpFileTime __out LPFILETIME lpFileTime
skipping to change at line 4220 skipping to change at line 5153
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTickCount( GetTickCount(
VOID VOID
); );
WINBASEAPI WINBASEAPI
ULONGLONG
WINAPI
GetTickCount64(
VOID
);
WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetSystemTimeAdjustment( SetSystemTimeAdjustment(
__in DWORD dwTimeAdjustment, __in DWORD dwTimeAdjustment,
__in BOOL bTimeAdjustmentDisabled __in BOOL bTimeAdjustmentDisabled
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
skipping to change at line 4241 skipping to change at line 5181
__out PDWORD lpTimeAdjustment, __out PDWORD lpTimeAdjustment,
__out PDWORD lpTimeIncrement, __out PDWORD lpTimeIncrement,
__out PBOOL lpTimeAdjustmentDisabled __out PBOOL lpTimeAdjustmentDisabled
); );
#if !defined(MIDL_PASS) #if !defined(MIDL_PASS)
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
FormatMessageA( FormatMessageA(
DWORD dwFlags, __in DWORD dwFlags,
LPCVOID lpSource, __in_opt LPCVOID lpSource,
DWORD dwMessageId, __in DWORD dwMessageId,
DWORD dwLanguageId, __in DWORD dwLanguageId,
LPSTR lpBuffer, __out LPSTR lpBuffer,
DWORD nSize, __in DWORD nSize,
va_list *Arguments __in_opt va_list *Arguments
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
FormatMessageW( FormatMessageW(
DWORD dwFlags, __in DWORD dwFlags,
LPCVOID lpSource, __in_opt LPCVOID lpSource,
DWORD dwMessageId, __in DWORD dwMessageId,
DWORD dwLanguageId, __in DWORD dwLanguageId,
LPWSTR lpBuffer, __out LPWSTR lpBuffer,
DWORD nSize, __in DWORD nSize,
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 4293 skipping to change at line 5233
#else #else
return FormatMessageA( return FormatMessageA(
#endif #endif
dwFlags, dwFlags,
lpSource, lpSource,
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_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 WINBASEAPI
skipping to change at line 4423 skipping to change at line 5363
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetMailslotInfo( SetMailslotInfo(
__in HANDLE hMailslot, __in HANDLE hMailslot,
__in DWORD lReadTimeout __in DWORD lReadTimeout
); );
WINBASEAPI WINBASEAPI
__out __out_opt __out_data_source(FILE)
LPVOID LPVOID
WINAPI WINAPI
MapViewOfFile( MapViewOfFile(
__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
); );
skipping to change at line 4555 skipping to change at line 5495
__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)
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
OpenEncryptedFileRawA( OpenEncryptedFileRawA(
__in LPCSTR lpFileName, __in LPCSTR lpFileName,
__in ULONG ulFlags, __in ULONG ulFlags,
__deref_out PVOID *pvContext __deref_out PVOID *pvContext
); );
WINADVAPI WINADVAPI
skipping to change at line 4671 skipping to change at line 5612
__out_ecount(iMaxLength) LPWSTR lpString1, __out_ecount(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)
#pragma warning(push)
#pragma warning(disable:4995)
#endif
WINBASEAPI WINBASEAPI
__out __out
LPSTR LPSTR
WINAPI WINAPI
lstrcpyA( lstrcpyA(
__out LPSTR lpString1, __out LPSTR lpString1,
__in LPCSTR lpString2 __in LPCSTR lpString2
); );
WINBASEAPI WINBASEAPI
__out __out
skipping to change at line 4715 skipping to change at line 5661
lstrcatW( lstrcatW(
__inout LPWSTR lpString1, __inout LPWSTR lpString1,
__in LPCWSTR lpString2 __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)
#pragma warning(pop)
#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
__out
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
__out
HFILE HFILE
WINAPI WINAPI
_lopen( _lopen(
__in LPCSTR lpPathName, __in LPCSTR lpPathName,
__in int iReadWrite __in int iReadWrite
); );
WINBASEAPI WINBASEAPI
__out
HFILE HFILE
WINAPI WINAPI
_lcreat( _lcreat(
__in LPCSTR lpPathName, __in LPCSTR lpPathName,
__in int iAttribute __in int iAttribute
); );
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
skipping to change at line 4937 skipping to change at line 5884
__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( ReadFileEx(
__in HANDLE hFile, __in HANDLE hFile,
__out_bcount(nNumberOfBytesToRead) LPVOID lpBuffer, __out_bcount_opt(nNumberOfBytesToRead) __out_data_source(FILE) LPVOID lpBuff er,
__in DWORD nNumberOfBytesToRead, __in DWORD nNumberOfBytesToRead,
__inout LPOVERLAPPED lpOverlapped, __inout LPOVERLAPPED lpOverlapped,
__in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine __in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
WriteFileEx( WriteFileEx(
__in HANDLE hFile, __in HANDLE hFile,
__in_bcount(nNumberOfBytesToWrite) LPCVOID lpBuffer, __in_bcount_opt(nNumberOfBytesToWrite) LPCVOID lpBuffer,
__in DWORD nNumberOfBytesToWrite, __in DWORD nNumberOfBytesToWrite,
__inout LPOVERLAPPED lpOverlapped, __inout LPOVERLAPPED lpOverlapped,
__in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine __in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
BackupRead( BackupRead(
__in HANDLE hFile, __in HANDLE hFile,
skipping to change at line 5017 skipping to change at line 5964
#define BACKUP_INVALID 0x00000000 #define BACKUP_INVALID 0x00000000
#define BACKUP_DATA 0x00000001 #define BACKUP_DATA 0x00000001
#define BACKUP_EA_DATA 0x00000002 #define BACKUP_EA_DATA 0x00000002
#define BACKUP_SECURITY_DATA 0x00000003 #define BACKUP_SECURITY_DATA 0x00000003
#define BACKUP_ALTERNATE_DATA 0x00000004 #define BACKUP_ALTERNATE_DATA 0x00000004
#define BACKUP_LINK 0x00000005 #define BACKUP_LINK 0x00000005
#define BACKUP_PROPERTY_DATA 0x00000006 #define BACKUP_PROPERTY_DATA 0x00000006
#define BACKUP_OBJECT_ID 0x00000007 #define BACKUP_OBJECT_ID 0x00000007
#define BACKUP_REPARSE_DATA 0x00000008 #define BACKUP_REPARSE_DATA 0x00000008
#define BACKUP_SPARSE_BLOCK 0x00000009 #define BACKUP_SPARSE_BLOCK 0x00000009
#define BACKUP_TXFS_DATA 0x0000000a
// //
// 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
skipping to change at line 5117 skipping to change at line 6065
HANDLE hStdError; HANDLE hStdError;
} STARTUPINFOW, *LPSTARTUPINFOW; } STARTUPINFOW, *LPSTARTUPINFOW;
#ifdef UNICODE #ifdef UNICODE
typedef STARTUPINFOW STARTUPINFO; typedef STARTUPINFOW STARTUPINFO;
typedef LPSTARTUPINFOW LPSTARTUPINFO; typedef LPSTARTUPINFOW LPSTARTUPINFO;
#else #else
typedef STARTUPINFOA STARTUPINFO; typedef STARTUPINFOA STARTUPINFO;
typedef LPSTARTUPINFOA LPSTARTUPINFO; typedef LPSTARTUPINFOA LPSTARTUPINFO;
#endif // UNICODE #endif // UNICODE
typedef struct _STARTUPINFOEXA {
STARTUPINFOA StartupInfo;
struct _PROC_THREAD_ATTRIBUTE_LIST *lpAttributeList;
} STARTUPINFOEXA, *LPSTARTUPINFOEXA;
typedef struct _STARTUPINFOEXW {
STARTUPINFOW StartupInfo;
struct _PROC_THREAD_ATTRIBUTE_LIST *lpAttributeList;
} STARTUPINFOEXW, *LPSTARTUPINFOEXW;
#ifdef UNICODE
typedef STARTUPINFOEXW STARTUPINFOEX;
typedef LPSTARTUPINFOEXW LPSTARTUPINFOEX;
#else
typedef STARTUPINFOEXA STARTUPINFOEX;
typedef LPSTARTUPINFOEXA LPSTARTUPINFOEX;
#endif // UNICODE
#define SHUTDOWN_NORETRY 0x00000001 #define SHUTDOWN_NORETRY 0x00000001
typedef struct _WIN32_FIND_DATAA { typedef struct _WIN32_FIND_DATAA {
DWORD dwFileAttributes; DWORD dwFileAttributes;
FILETIME ftCreationTime; FILETIME ftCreationTime;
FILETIME ftLastAccessTime; FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime; FILETIME ftLastWriteTime;
DWORD nFileSizeHigh; DWORD nFileSizeHigh;
DWORD nFileSizeLow; DWORD nFileSizeLow;
DWORD dwReserved0; DWORD dwReserved0;
skipping to change at line 5172 skipping to change at line 6136
typedef struct _WIN32_FILE_ATTRIBUTE_DATA { typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
DWORD dwFileAttributes; DWORD dwFileAttributes;
FILETIME ftCreationTime; FILETIME ftCreationTime;
FILETIME ftLastAccessTime; FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime; FILETIME ftLastWriteTime;
DWORD nFileSizeHigh; DWORD nFileSizeHigh;
DWORD nFileSizeLow; DWORD nFileSizeLow;
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA; } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
//
// Synchronization APIs
//
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateMutexA( CreateMutexA(
__in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes, __in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes,
__in BOOL bInitialOwner, __in BOOL bInitialOwner,
__in_opt LPCSTR lpName __in_opt LPCSTR lpName
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateMutexW( CreateMutexW(
__in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes, __in_opt LPSECURITY_ATTRIBUTES lpMutexAttributes,
__in BOOL bInitialOwner, __in BOOL bInitialOwner,
__in_opt LPCWSTR lpName __in_opt LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateMutex CreateMutexW #define CreateMutex CreateMutexW
#else #else
#define CreateMutex CreateMutexA #define CreateMutex CreateMutexA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out __out_opt
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 WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
OpenMutexW( OpenMutexW(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in LPCWSTR lpName __in LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenMutex OpenMutexW #define OpenMutex OpenMutexW
#else #else
#define OpenMutex OpenMutexA #define OpenMutex OpenMutexA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateEventA( CreateEventA(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes, __in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in BOOL bManualReset, __in BOOL bManualReset,
__in BOOL bInitialState, __in BOOL bInitialState,
__in_opt LPCSTR lpName __in_opt LPCSTR lpName
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateEventW( CreateEventW(
__in_opt LPSECURITY_ATTRIBUTES lpEventAttributes, __in_opt LPSECURITY_ATTRIBUTES lpEventAttributes,
__in BOOL bManualReset, __in BOOL bManualReset,
__in BOOL bInitialState, __in BOOL bInitialState,
__in_opt LPCWSTR lpName __in_opt LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateEvent CreateEventW #define CreateEvent CreateEventW
#else #else
#define CreateEvent CreateEventA #define CreateEvent CreateEventA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
OpenEventA( OpenEventA(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in LPCSTR lpName __in LPCSTR lpName
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
OpenEventW( OpenEventW(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in LPCWSTR lpName __in LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenEvent OpenEventW #define OpenEvent OpenEventW
#else #else
#define OpenEvent OpenEventA #define OpenEvent OpenEventA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out __out_opt
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 __out_opt
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 __out_opt
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 WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
OpenSemaphoreW( OpenSemaphoreW(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in LPCWSTR lpName __in LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenSemaphore OpenSemaphoreW #define OpenSemaphore OpenSemaphoreW
#else #else
skipping to change at line 5330 skipping to change at line 6298
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) #if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
typedef typedef
VOID VOID
(APIENTRY *PTIMERAPCROUTINE)( (APIENTRY *PTIMERAPCROUTINE)(
__in_opt LPVOID lpArgToCompletionRoutine, __in_opt LPVOID lpArgToCompletionRoutine,
__in DWORD dwTimerLowValue, __in DWORD dwTimerLowValue,
__in DWORD dwTimerHighValue __in DWORD dwTimerHighValue
); );
WINBASEAPI WINBASEAPI
__out __out_opt
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 __out_opt
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 __out_opt
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 WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
OpenWaitableTimerW( OpenWaitableTimerW(
__in DWORD dwDesiredAccess, __in DWORD dwDesiredAccess,
__in BOOL bInheritHandle, __in BOOL bInheritHandle,
__in LPCWSTR lpTimerName __in LPCWSTR lpTimerName
); );
#ifdef UNICODE #ifdef UNICODE
#define OpenWaitableTimer OpenWaitableTimerW #define OpenWaitableTimer OpenWaitableTimerW
#else #else
skipping to change at line 5395 skipping to change at line 6363
__in_opt LPVOID lpArgToCompletionRoutine, __in_opt LPVOID lpArgToCompletionRoutine,
__in BOOL fResume __in BOOL fResume
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CancelWaitableTimer( CancelWaitableTimer(
__in HANDLE hTimer __in HANDLE hTimer
); );
#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
__out_opt
HANDLE
WINAPI
CreateSemaphoreExA(
__in_opt LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
__in LONG lInitialCount,
__in LONG lMaximumCount,
__in_opt LPCSTR lpName,
__reserved DWORD dwFlags,
__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
#define CreateSemaphoreEx CreateSemaphoreExW
#else
#define CreateSemaphoreEx CreateSemaphoreExA
#endif // !UNICODE
#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateWaitableTimerExA(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in_opt LPCSTR lpTimerName,
__in DWORD dwFlags,
__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
#define CreateWaitableTimerEx CreateWaitableTimerExW
#else
#define CreateWaitableTimerEx CreateWaitableTimerExA
#endif // !UNICODE
#endif /* (_WIN32_WINNT >= 0x0600) */
#endif /* (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) */ #endif /* (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400) */
WINBASEAPI WINBASEAPI
__out __out_opt
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 WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateFileMappingW( CreateFileMappingW(
__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 LPCWSTR lpName __in_opt LPCWSTR lpName
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateFileMapping CreateFileMappingW #define CreateFileMapping CreateFileMappingW
#else #else
#define CreateFileMapping CreateFileMappingA #define CreateFileMapping CreateFileMappingA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreateFileMappingNumaA(
__in HANDLE hFile,
__in_opt LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
__in DWORD flProtect,
__in DWORD dwMaximumSizeHigh,
__in DWORD dwMaximumSizeLow,
__in_opt LPCSTR lpName,
__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
#else
#define CreateFileMappingNuma CreateFileMappingNumaA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
__out __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 WINBASEAPI
skipping to change at line 5479 skipping to change at line 6603
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0501 #if _WIN32_WINNT >= 0x0501
typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE { typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE {
LowMemoryResourceNotification, LowMemoryResourceNotification,
HighMemoryResourceNotification HighMemoryResourceNotification
} MEMORY_RESOURCE_NOTIFICATION_TYPE; } MEMORY_RESOURCE_NOTIFICATION_TYPE;
WINBASEAPI WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateMemoryResourceNotification( CreateMemoryResourceNotification(
__in MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType __in MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
QueryMemoryResourceNotification( QueryMemoryResourceNotification(
__in HANDLE ResourceNotificationHandle, __in HANDLE ResourceNotificationHandle,
__out PBOOL ResourceState __out PBOOL ResourceState
); );
#endif // _WIN32_WINNT >= 0x0501 #endif // _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
__out __out_opt
HMODULE HMODULE
WINAPI WINAPI
LoadLibraryA( LoadLibraryA(
__in LPCSTR lpLibFileName __in LPCSTR lpLibFileName
); );
WINBASEAPI WINBASEAPI
__out __out_opt
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 WINBASEAPI
__out __out_opt
HMODULE HMODULE
WINAPI WINAPI
LoadLibraryExA( LoadLibraryExA(
__in LPCSTR lpLibFileName, __in LPCSTR lpLibFileName,
__reserved HANDLE hFile, __reserved HANDLE hFile,
__in DWORD dwFlags __in DWORD dwFlags
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HMODULE HMODULE
WINAPI WINAPI
LoadLibraryExW( LoadLibraryExW(
__in LPCWSTR lpLibFileName, __in LPCWSTR lpLibFileName,
__reserved HANDLE hFile, __reserved HANDLE hFile,
__in DWORD dwFlags __in DWORD dwFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define LoadLibraryEx LoadLibraryExW #define LoadLibraryEx LoadLibraryExW
#else #else
#define LoadLibraryEx LoadLibraryExA #define LoadLibraryEx LoadLibraryExA
#endif // !UNICODE #endif // !UNICODE
#define DONT_RESOLVE_DLL_REFERENCES 0x00000001 #define DONT_RESOLVE_DLL_REFERENCES 0x00000001
#define LOAD_LIBRARY_AS_DATAFILE 0x00000002 #define LOAD_LIBRARY_AS_DATAFILE 0x00000002
#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008 #define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010 #define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x00000010
#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x00000020
#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x00000040
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetModuleFileNameA( GetModuleFileNameA(
__in_opt HMODULE hModule, __in_opt HMODULE hModule,
__out_ecount_part(nSize, return + 1) LPCH lpFilename, __out_ecount_part(nSize, return + 1) LPCH lpFilename,
__in DWORD nSize __in DWORD nSize
); );
WINBASEAPI WINBASEAPI
skipping to change at line 5568 skipping to change at line 6694
__out_ecount_part(nSize, return + 1) LPWCH lpFilename, __out_ecount_part(nSize, return + 1) LPWCH lpFilename,
__in DWORD nSize __in DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetModuleFileName GetModuleFileNameW #define GetModuleFileName GetModuleFileNameW
#else #else
#define GetModuleFileName GetModuleFileNameA #define GetModuleFileName GetModuleFileNameA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out __out_opt
HMODULE HMODULE
WINAPI WINAPI
GetModuleHandleA( GetModuleHandleA(
__in_opt LPCSTR lpModuleName __in_opt LPCSTR lpModuleName
); );
WINBASEAPI WINBASEAPI
__out __out_opt
HMODULE HMODULE
WINAPI WINAPI
GetModuleHandleW( GetModuleHandleW(
__in_opt LPCWSTR lpModuleName __in_opt LPCWSTR lpModuleName
); );
#ifdef UNICODE #ifdef UNICODE
#define GetModuleHandle GetModuleHandleW #define GetModuleHandle GetModuleHandleW
#else #else
#define GetModuleHandle GetModuleHandleA #define GetModuleHandle GetModuleHandleA
#endif // !UNICODE #endif // !UNICODE
skipping to change at line 5663 skipping to change at line 6789
__in LPCWSTR ExeName __in LPCWSTR ExeName
); );
#ifdef UNICODE #ifdef UNICODE
#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW #define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW
#else #else
#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA #define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA
#endif // !UNICODE #endif // !UNICODE
#endif #endif
#if _WIN32_WINNT >= 0x0600
#define PROCESS_NAME_NATIVE 0x00000001
WINBASEAPI
BOOL
WINAPI
QueryFullProcessImageNameA(
__in HANDLE hProcess,
__in DWORD dwFlags,
__out_ecount_part(*lpdwSize, *lpdwSize) LPSTR lpExeName,
__inout PDWORD lpdwSize
);
WINBASEAPI
BOOL
WINAPI
QueryFullProcessImageNameW(
__in HANDLE hProcess,
__in DWORD dwFlags,
__out_ecount_part(*lpdwSize, *lpdwSize) LPWSTR lpExeName,
__inout PDWORD lpdwSize
);
#ifdef UNICODE
#define QueryFullProcessImageName QueryFullProcessImageNameW
#else
#define QueryFullProcessImageName QueryFullProcessImageNameA
#endif // !UNICODE
#endif
//
// Extended process and thread attribute support
//
#define PROC_THREAD_ATTRIBUTE_NUMBER 0x0000FFFF
#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_ADDITIVE 0x00040000 // Attribute may be "accumul
ated," e.g. bitmasks, counters, etc.
typedef enum _PROC_THREAD_ATTRIBUTE_NUM {
ProcThreadAttributeParentProcess = 0,
ProcThreadAttributeExtendedFlags,
ProcThreadAttributeHandleList,
ProcThreadAttributeMax
} PROC_THREAD_ATTRIBUTE_NUM;
#define ProcThreadAttributeValue(Number, Thread, Input, Additive) \
(((Number) & PROC_THREAD_ATTRIBUTE_NUMBER) | \
((Thread != FALSE) ? PROC_THREAD_ATTRIBUTE_THREAD : 0) | \
((Input != FALSE) ? PROC_THREAD_ATTRIBUTE_INPUT : 0) | \
((Additive != FALSE) ? PROC_THREAD_ATTRIBUTE_ADDITIVE : 0))
#define PROC_THREAD_ATTRIBUTE_PARENT_PROCESS \
ProcThreadAttributeValue (ProcThreadAttributeParentProcess, FALSE, TRUE, FAL
SE)
#define PROC_THREAD_ATTRIBUTE_EXTENDED_FLAGS \
ProcThreadAttributeValue (ProcThreadAttributeExtendedFlags, FALSE, TRUE, TRU
E)
#define PROC_THREAD_ATTRIBUTE_HANDLE_LIST \
ProcThreadAttributeValue (ProcThreadAttributeHandleList, FALSE, TRUE, FALSE)
typedef struct _PROC_THREAD_ATTRIBUTE_LIST *PPROC_THREAD_ATTRIBUTE_LIST, *LPPROC
_THREAD_ATTRIBUTE_LIST;
WINBASEAPI
BOOL
WINAPI
InitializeProcThreadAttributeList(
__out_xcount_opt(*lpSize) LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
__in DWORD dwAttributeCount,
__in __reserved DWORD dwFlags,
__inout PSIZE_T lpSize
);
WINBASEAPI
VOID
WINAPI
DeleteProcThreadAttributeList(
__inout LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList
);
#define PROC_THREAD_ATTRIBUTE_REPLACE_VALUE 0x00000001
WINBASEAPI
BOOL
WINAPI
UpdateProcThreadAttribute(
__inout LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
__in DWORD dwFlags,
__in DWORD_PTR Attribute,
__in_bcount_opt(cbSize) PVOID lpValue,
__in SIZE_T cbSize,
__out_bcount_opt(cbSize) PVOID lpPreviousValue,
__in_opt PSIZE_T lpReturnSize
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateProcessA( CreateProcessA(
__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,
skipping to change at line 5781 skipping to change at line 7000
GetCommandLineW( GetCommandLineW(
VOID VOID
); );
#ifdef UNICODE #ifdef UNICODE
#define GetCommandLine GetCommandLineW #define GetCommandLine GetCommandLineW
#else #else
#define GetCommandLine GetCommandLineA #define GetCommandLine GetCommandLineA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__success(return < nSize)
__success(return != 0)
DWORD DWORD
WINAPI WINAPI
GetEnvironmentVariableA( GetEnvironmentVariableA(
__in LPCSTR lpName, __in_opt LPCSTR lpName,
__out_ecount_part_opt(nSize, return + 1) LPSTR lpBuffer, __out_ecount_part_opt(nSize, return + 1) LPSTR lpBuffer,
__in DWORD nSize __in DWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return < nSize)
__success(return != 0)
DWORD DWORD
WINAPI WINAPI
GetEnvironmentVariableW( GetEnvironmentVariableW(
__in LPCWSTR lpName, __in_opt LPCWSTR lpName,
__out_ecount_part_opt(nSize, return + 1) LPWSTR lpBuffer, __out_ecount_part_opt(nSize, return + 1) LPWSTR lpBuffer,
__in DWORD nSize __in DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetEnvironmentVariable GetEnvironmentVariableW #define GetEnvironmentVariable GetEnvironmentVariableW
#else #else
#define GetEnvironmentVariable GetEnvironmentVariableA #define GetEnvironmentVariable GetEnvironmentVariableA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
skipping to change at line 5837 skipping to change at line 7060
LPCTSTR lpName, LPCTSTR lpName,
LPCTSTR lpValue LPCTSTR lpValue
) )
{ {
#ifdef UNICODE #ifdef UNICODE
return SetEnvironmentVariableW( return SetEnvironmentVariableW(
#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( ExpandEnvironmentStringsA(
__in LPCSTR lpSrc, __in LPCSTR lpSrc,
__out_ecount_part_opt(nSize, return) LPSTR lpDst, __out_ecount_part_opt(nSize, return) LPSTR lpDst,
__in DWORD nSize __in DWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return <= nSize)
__success(return != 0)
DWORD DWORD
WINAPI WINAPI
ExpandEnvironmentStringsW( ExpandEnvironmentStringsW(
__in LPCWSTR lpSrc, __in LPCWSTR lpSrc,
__out_ecount_part_opt(nSize, return) LPWSTR lpDst, __out_ecount_part_opt(nSize, return) LPWSTR lpDst,
__in DWORD nSize __in DWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define ExpandEnvironmentStrings ExpandEnvironmentStringsW #define ExpandEnvironmentStrings ExpandEnvironmentStringsW
#else #else
skipping to change at line 5916 skipping to change at line 7143
#ifdef UNICODE #ifdef UNICODE
#define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW
#else #else
#define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA #define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
OutputDebugStringA( OutputDebugStringA(
__in LPCSTR lpOutputString __in_opt LPCSTR lpOutputString
); );
WINBASEAPI WINBASEAPI
VOID VOID
WINAPI WINAPI
OutputDebugStringW( OutputDebugStringW(
__in LPCWSTR lpOutputString __in_opt LPCWSTR lpOutputString
); );
#ifdef UNICODE #ifdef UNICODE
#define OutputDebugString OutputDebugStringW #define OutputDebugString OutputDebugStringW
#else #else
#define OutputDebugString OutputDebugStringA #define OutputDebugString OutputDebugStringA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__out __out_opt
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 __out_opt
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 __out_opt
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 WINBASEAPI
__out __out_opt
HRSRC HRSRC
WINAPI WINAPI
FindResourceExW( FindResourceExW(
__in_opt HMODULE hModule, __in_opt HMODULE hModule,
__in LPCWSTR lpType, __in LPCWSTR lpType,
__in LPCWSTR lpName, __in LPCWSTR lpName,
__in WORD wLanguage __in WORD wLanguage
); );
#ifdef UNICODE #ifdef UNICODE
#define FindResourceEx FindResourceExW #define FindResourceEx FindResourceExW
skipping to change at line 6104 skipping to change at line 7331
__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_UPDATE_LN (0x0010)
#define RESOURCE_UPDATE_MUI (0x0020)
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
__out
HANDLE HANDLE
WINAPI WINAPI
BeginUpdateResourceA( BeginUpdateResourceA(
__in LPCSTR pFileName, __in LPCSTR pFileName,
__in BOOL bDeleteExistingResources __in BOOL bDeleteExistingResources
); );
WINBASEAPI WINBASEAPI
__out
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
skipping to change at line 6175 skipping to change at line 7490
__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
WINBASEAPI WINBASEAPI
__out
ATOM ATOM
WINAPI WINAPI
GlobalAddAtomA( GlobalAddAtomA(
__in_opt LPCSTR lpString __in_opt LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
__out
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
__out
ATOM ATOM
WINAPI WINAPI
GlobalFindAtomA( GlobalFindAtomA(
__in_opt LPCSTR lpString __in_opt LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
__out
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
skipping to change at line 6237 skipping to change at line 7548
__out_ecount_part(nSize, return + 1) LPWSTR lpBuffer, __out_ecount_part(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
__out
ATOM ATOM
WINAPI WINAPI
AddAtomA( AddAtomA(
__in_opt LPCSTR lpString __in_opt LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
__out
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
__out
ATOM ATOM
WINAPI WINAPI
FindAtomA( FindAtomA(
__in_opt LPCSTR lpString __in_opt LPCSTR lpString
); );
WINBASEAPI WINBASEAPI
__out
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
skipping to change at line 6649 skipping to change at line 7956
#define GetSystemDirectory GetSystemDirectoryW #define GetSystemDirectory GetSystemDirectoryW
#else #else
#define GetSystemDirectory GetSystemDirectoryA #define GetSystemDirectory GetSystemDirectoryA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTempPathA( GetTempPathA(
__in DWORD nBufferLength, __in DWORD nBufferLength,
__out_ecount_part(nBufferLength, return + 1) LPSTR lpBuffer __out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetTempPathW( GetTempPathW(
__in DWORD nBufferLength, __in DWORD nBufferLength,
__out_ecount_part(nBufferLength, return + 1) LPWSTR lpBuffer __out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define GetTempPath GetTempPathW #define GetTempPath GetTempPathW
#else #else
#define GetTempPath GetTempPathA #define GetTempPath GetTempPathA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
skipping to change at line 6705 skipping to change at line 8012
UINT uUnique, UINT uUnique,
LPTSTR lpTempFileName LPTSTR lpTempFileName
) )
{ {
#ifdef UNICODE #ifdef UNICODE
return GetTempFileNameW( return GetTempFileNameW(
#else #else
return GetTempFileNameA( return GetTempFileNameA(
#endif #endif
lpPathName, lpPathName,
lpPrefixString, lpPrefixString,
uUnique, uUnique,
lpTempFileName lpTempFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
UINT UINT
WINAPI WINAPI
GetWindowsDirectoryA( GetWindowsDirectoryA(
__out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer, __out_ecount_part_opt(uSize, return + 1) LPSTR lpBuffer,
__in UINT uSize __in UINT uSize
); );
WINBASEAPI WINBASEAPI
UINT UINT
skipping to change at line 6859 skipping to change at line 8166
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 WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetCurrentDirectoryA( GetCurrentDirectoryA(
__in DWORD nBufferLength, __in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer __out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
skipping to change at line 7010 skipping to change at line 8317
LPCTSTR lpPathName, LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes LPSECURITY_ATTRIBUTES lpSecurityAttributes
) )
{ {
#ifdef UNICODE #ifdef UNICODE
return CreateDirectoryW( return CreateDirectoryW(
#else #else
return CreateDirectoryA( return CreateDirectoryA(
#endif #endif
lpPathName, lpPathName,
lpSecurityAttributes lpSecurityAttributes
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
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
skipping to change at line 7037 skipping to change at line 8344
__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
WINBASEAPI
BOOL
WINAPI
CreateDirectoryTransactedA(
__in LPCSTR lpTemplateDirectory,
__in LPCSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
CreateDirectoryTransactedW(
__in LPCWSTR lpTemplateDirectory,
__in LPCWSTR lpNewDirectory,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define CreateDirectoryTransacted CreateDirectoryTransactedW
#else
#define CreateDirectoryTransacted CreateDirectoryTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RemoveDirectoryA( RemoveDirectoryA(
__in LPCSTR lpPathName __in LPCSTR lpPathName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
RemoveDirectoryW( RemoveDirectoryW(
__in LPCWSTR lpPathName __in LPCWSTR lpPathName
); );
#ifdef UNICODE #ifdef UNICODE
#define RemoveDirectory RemoveDirectoryW #define RemoveDirectory RemoveDirectoryW
#else #else
#define RemoveDirectory RemoveDirectoryA #define RemoveDirectory RemoveDirectoryA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
RemoveDirectoryTransactedA(
__in LPCSTR lpPathName,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
RemoveDirectoryTransactedW(
__in LPCWSTR lpPathName,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define RemoveDirectoryTransacted RemoveDirectoryTransactedW
#else
#define RemoveDirectoryTransacted RemoveDirectoryTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetFullPathNameA( GetFullPathNameA(
__in LPCSTR lpFileName, __in LPCSTR lpFileName,
__in DWORD nBufferLength, __in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer, __out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer,
__deref_opt_out LPSTR *lpFilePart __deref_opt_out LPSTR *lpFilePart
); );
WINBASEAPI WINBASEAPI
skipping to change at line 7078 skipping to change at line 8437
__in LPCWSTR lpFileName, __in LPCWSTR lpFileName,
__in DWORD nBufferLength, __in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer, __out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer,
__deref_opt_out LPWSTR *lpFilePart __deref_opt_out LPWSTR *lpFilePart
); );
#ifdef UNICODE #ifdef UNICODE
#define GetFullPathName GetFullPathNameW #define GetFullPathName GetFullPathNameW
#else #else
#define GetFullPathName GetFullPathNameA #define GetFullPathName GetFullPathNameA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
DWORD
WINAPI
GetFullPathNameTransactedA(
__in LPCSTR lpFileName,
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPSTR lpBuffer,
__deref_opt_out LPSTR *lpFilePart,
__in HANDLE hTransaction
);
WINBASEAPI
DWORD
WINAPI
GetFullPathNameTransactedW(
__in LPCWSTR lpFileName,
__in DWORD nBufferLength,
__out_ecount_part_opt(nBufferLength, return + 1) LPWSTR lpBuffer,
__deref_opt_out LPWSTR *lpFilePart,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define GetFullPathNameTransacted GetFullPathNameTransactedW
#else
#define GetFullPathNameTransacted GetFullPathNameTransactedA
#endif // !UNICODE
#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
skipping to change at line 7163 skipping to change at line 8551
__in DWORD dwCreationDisposition, __in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes, __in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile __in_opt HANDLE hTemplateFile
); );
#ifdef UNICODE #ifdef UNICODE
#define CreateFile CreateFileW #define CreateFile CreateFileW
#else #else
#define CreateFile CreateFileA #define CreateFile CreateFileA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
__out
HANDLE
WINAPI
CreateFileTransactedA(
__in LPCSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile,
__in HANDLE hTransaction,
__in_opt PUSHORT pusMiniVersion,
__reserved PVOID lpExtendedParameter
);
WINBASEAPI
__out
HANDLE
WINAPI
CreateFileTransactedW(
__in LPCWSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile,
__in HANDLE hTransaction,
__in_opt PUSHORT pusMiniVersion,
__reserved PVOID lpExtendedParameter
);
#ifdef UNICODE
#define CreateFileTransacted CreateFileTransactedW
#else
#define CreateFileTransacted CreateFileTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
#if _WIN32_WINNT >= 0x0502 #if _WIN32_WINNT >= 0x0502
WINBASEAPI WINBASEAPI
__out __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,
skipping to change at line 7216 skipping to change at line 8646
WINAPI WINAPI
GetFileAttributesW( GetFileAttributesW(
__in LPCWSTR lpFileName __in LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define GetFileAttributes GetFileAttributesW #define GetFileAttributes GetFileAttributesW
#else #else
#define GetFileAttributes GetFileAttributesA #define GetFileAttributes GetFileAttributesA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
SetFileAttributesTransactedA(
__in LPCSTR lpFileName,
__in DWORD dwFileAttributes,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
SetFileAttributesTransactedW(
__in LPCWSTR lpFileName,
__in DWORD dwFileAttributes,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define SetFileAttributesTransacted SetFileAttributesTransactedW
#else
#define SetFileAttributesTransacted SetFileAttributesTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
typedef enum _GET_FILEEX_INFO_LEVELS { typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard, GetFileExInfoStandard,
GetFileExMaxInfoLevel GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS; } GET_FILEEX_INFO_LEVELS;
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
GetFileAttributesTransactedA(
__in LPCSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
GetFileAttributesTransactedW(
__in LPCWSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define GetFileAttributesTransacted GetFileAttributesTransactedW
#else
#define GetFileAttributesTransacted GetFileAttributesTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetFileAttributesExA( GetFileAttributesExA(
__in LPCSTR lpFileName, __in LPCSTR lpFileName,
__in GET_FILEEX_INFO_LEVELS fInfoLevelId, __in GET_FILEEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFileInformation __out LPVOID lpFileInformation
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
skipping to change at line 7248 skipping to change at line 8732
#define GetFileAttributesEx GetFileAttributesExW #define GetFileAttributesEx GetFileAttributesExW
#else #else
#define GetFileAttributesEx GetFileAttributesExA #define GetFileAttributesEx GetFileAttributesExA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetCompressedFileSizeA( GetCompressedFileSizeA(
__in LPCSTR lpFileName, __in LPCSTR lpFileName,
__out LPDWORD lpFileSizeHigh __out_opt LPDWORD lpFileSizeHigh
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
GetCompressedFileSizeW( GetCompressedFileSizeW(
__in LPCWSTR lpFileName, __in LPCWSTR lpFileName,
__out LPDWORD lpFileSizeHigh __out_opt LPDWORD lpFileSizeHigh
); );
#ifdef UNICODE #ifdef UNICODE
#define GetCompressedFileSize GetCompressedFileSizeW #define GetCompressedFileSize GetCompressedFileSizeW
#else #else
#define GetCompressedFileSize GetCompressedFileSizeA #define GetCompressedFileSize GetCompressedFileSizeA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
DWORD
WINAPI
GetCompressedFileSizeTransactedA(
__in LPCSTR lpFileName,
__out_opt LPDWORD lpFileSizeHigh,
__in HANDLE hTransaction
);
WINBASEAPI
DWORD
WINAPI
GetCompressedFileSizeTransactedW(
__in LPCWSTR lpFileName,
__out_opt LPDWORD lpFileSizeHigh,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define GetCompressedFileSizeTransacted GetCompressedFileSizeTransactedW
#else
#define GetCompressedFileSizeTransacted GetCompressedFileSizeTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteFileA( DeleteFileA(
__in LPCSTR lpFileName __in LPCSTR lpFileName
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
DeleteFileW( DeleteFileW(
__in LPCWSTR lpFileName __in LPCWSTR lpFileName
); );
#ifdef UNICODE #ifdef UNICODE
#define DeleteFile DeleteFileW #define DeleteFile DeleteFileW
#else #else
#define DeleteFile DeleteFileA #define DeleteFile DeleteFileA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
BOOL
WINAPI
DeleteFileTransactedA(
__in LPCSTR lpFileName,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
DeleteFileTransactedW(
__in LPCWSTR lpFileName,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define DeleteFileTransacted DeleteFileTransactedW
#else
#define DeleteFileTransacted DeleteFileTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
#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 */
#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_ecount_opt(OemNameSize) LPSTR lpOemName,
__in DWORD OemNameSize, __in DWORD OemNameSize,
skipping to change at line 7373 skipping to change at line 8907
__out LPVOID lpFindFileData, __out LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp, __in FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter, __reserved LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags __in DWORD dwAdditionalFlags
); );
#ifdef UNICODE #ifdef UNICODE
#define FindFirstFileEx FindFirstFileExW #define FindFirstFileEx FindFirstFileExW
#else #else
#define FindFirstFileEx FindFirstFileExA #define FindFirstFileEx FindFirstFileExA
#endif // !UNICODE #endif // !UNICODE
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstFileTransactedA(
__in LPCSTR lpFileName,
__in FINDEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags,
__in HANDLE hTransaction
);
WINBASEAPI
__out
HANDLE
WINAPI
FindFirstFileTransactedW(
__in LPCWSTR lpFileName,
__in FINDEX_INFO_LEVELS fInfoLevelId,
__out LPVOID lpFindFileData,
__in FINDEX_SEARCH_OPS fSearchOp,
__reserved LPVOID lpSearchFilter,
__in DWORD dwAdditionalFlags,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define FindFirstFileTransacted FindFirstFileTransactedW
#else
#define FindFirstFileTransacted FindFirstFileTransactedA
#endif // !UNICODE
#endif
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
WINBASEAPI WINBASEAPI
__out __out
HANDLE HANDLE
WINAPI WINAPI
FindFirstFileA( FindFirstFileA(
__in LPCSTR lpFileName, __in LPCSTR lpFileName,
__out LPWIN32_FIND_DATAA lpFindFileData __out LPWIN32_FIND_DATAA lpFindFileData
); );
skipping to change at line 7487 skipping to change at line 9058
#ifdef UNICODE #ifdef UNICODE
return CopyFileW( return CopyFileW(
#else #else
return CopyFileA( return CopyFileA(
#endif #endif
lpExistingFileName, lpExistingFileName,
lpNewFileName, lpNewFileName,
bFailIfExists bFailIfExists
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
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,
skipping to change at line 7531 skipping to change at line 9102
__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
); );
#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
WINBASEAPI
BOOL
WINAPI
CopyFileTransactedA(
__in LPCSTR lpExistingFileName,
__in LPCSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData,
__in_opt LPBOOL pbCancel,
__in DWORD dwCopyFlags,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
CopyFileTransactedW(
__in LPCWSTR lpExistingFileName,
__in LPCWSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData,
__in_opt LPBOOL pbCancel,
__in DWORD dwCopyFlags,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define CopyFileTransacted CopyFileTransactedW
#else
#define CopyFileTransacted CopyFileTransactedA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
#endif /* _WIN32_WINNT >= 0x0400 */ #endif /* _WIN32_WINNT >= 0x0400 */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileA( MoveFileA(
__in LPCSTR lpExistingFileName, __in LPCSTR lpExistingFileName,
__in LPCSTR lpNewFileName __in LPCSTR lpNewFileName
); );
WINBASEAPI WINBASEAPI
skipping to change at line 7571 skipping to change at line 9176
{ {
#ifdef UNICODE #ifdef UNICODE
return MoveFileW( return MoveFileW(
#else #else
return MoveFileA( return MoveFileA(
#endif #endif
lpExistingFileName, lpExistingFileName,
lpNewFileName lpNewFileName
); );
} }
#endif /* _M_CEE */ #endif /* _M_CEE */
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileExA( MoveFileExA(
__in LPCSTR lpExistingFileName, __in LPCSTR lpExistingFileName,
__in 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 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
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MoveFileWithProgressA( MoveFileWithProgressA(
__in LPCSTR lpExistingFileName, __in LPCSTR lpExistingFileName,
__in 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 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)
WINBASEAPI
BOOL
WINAPI
MoveFileTransactedA(
__in LPCSTR lpExistingFileName,
__in_opt LPCSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData,
__in DWORD dwFlags,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
MoveFileTransactedW(
__in LPCWSTR lpExistingFileName,
__in_opt LPCWSTR lpNewFileName,
__in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
__in_opt LPVOID lpData,
__in DWORD dwFlags,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define MoveFileTransacted MoveFileTransactedW
#else
#define MoveFileTransacted MoveFileTransactedA
#endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0600)
#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)
#if (_WIN32_WINNT >= 0x0500) #if (_WIN32_WINNT >= 0x0500)
skipping to change at line 7691 skipping to change at line 9326
__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)
//
// API call to create hard links.
//
WINBASEAPI
BOOL
WINAPI
CreateHardLinkTransactedA(
__in LPCSTR lpFileName,
__in LPCSTR lpExistingFileName,
__reserved LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction
);
WINBASEAPI
BOOL
WINAPI
CreateHardLinkTransactedW(
__in LPCWSTR lpFileName,
__in LPCWSTR lpExistingFileName,
__reserved LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define CreateHardLinkTransacted CreateHardLinkTransactedW
#else
#define CreateHardLinkTransacted CreateHardLinkTransactedA
#endif // !UNICODE
#endif // (_WIN32_WINNT >= 0x0600)
#if (_WIN32_WINNT >= 0x0501) #if (_WIN32_WINNT >= 0x0501)
// //
// API call to enumerate for streams within a file // API call to enumerate for streams within a file
// //
typedef enum _STREAM_INFO_LEVELS { typedef enum _STREAM_INFO_LEVELS {
FindStreamInfoStandard, FindStreamInfoStandard,
FindStreamInfoMaxInfoLevel FindStreamInfoMaxInfoLevel
skipping to change at line 7727 skipping to change at line 9393
__out LPVOID lpFindStreamData, __out LPVOID lpFindStreamData,
__reserved DWORD dwFlags __reserved DWORD dwFlags
); );
BOOL BOOL
APIENTRY APIENTRY
FindNextStreamW( FindNextStreamW(
__in HANDLE hFindStream, __in HANDLE hFindStream,
__out LPVOID lpFindStreamData __out LPVOID lpFindStreamData
); );
#endif // (_WIN32_WINNT >= 0x0501)
#endif // (_WIN32_WINNT >= 0x0500) #if _WIN32_WINNT >= 0x0600
HANDLE
WINAPI
FindFirstFileNameW (
__in LPCWSTR lpFileName,
__in DWORD dwFlags,
__inout LPDWORD StringLength,
__inout_ecount(*StringLength) PWCHAR LinkName
);
BOOL
APIENTRY
FindNextFileNameW (
__in HANDLE hFindStream,
__inout LPDWORD StringLength,
__inout_ecount(*StringLength) PWCHAR LinkName
);
HANDLE
WINAPI
FindFirstFileNameTransactedW (
__in LPCWSTR lpFileName,
__in DWORD dwFlags,
__inout LPDWORD StringLength,
__inout_ecount(*StringLength) PWCHAR LinkName,
__in_opt HANDLE hTransaction
);
#endif
WINBASEAPI WINBASEAPI
__out __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,
skipping to change at line 7844 skipping to change at line 9540
WaitNamedPipeW( WaitNamedPipeW(
__in LPCWSTR lpNamedPipeName, __in LPCWSTR lpNamedPipeName,
__in DWORD nTimeOut __in DWORD nTimeOut
); );
#ifdef UNICODE #ifdef UNICODE
#define WaitNamedPipe WaitNamedPipeW #define WaitNamedPipe WaitNamedPipeW
#else #else
#define WaitNamedPipe WaitNamedPipeA #define WaitNamedPipe WaitNamedPipeA
#endif // !UNICODE #endif // !UNICODE
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
BOOL
WINAPI
SetNamedPipeAttribute(
__in HANDLE Pipe,
__in PIPE_ATTRIBUTE_TYPE AttributeType,
__in PSTR AttributeName,
__in PVOID AttributeValue,
__in SIZE_T AttributeValueLength
);
WINBASEAPI
BOOL
WINAPI
GetNamedPipeClientComputerNameA(
__in HANDLE Pipe,
__out_bcount(ClientComputerNameLength) LPSTR ClientComputerName,
__in ULONG ClientComputerNameLength
);
WINBASEAPI
BOOL
WINAPI
GetNamedPipeClientComputerNameW(
__in HANDLE Pipe,
__out_bcount(ClientComputerNameLength) LPWSTR ClientComputerName,
__in ULONG ClientComputerNameLength
);
#ifdef UNICODE
#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameW
#else
#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
GetNamedPipeClientProcessId(
__in HANDLE Pipe,
__out PULONG ClientProcessId
);
WINBASEAPI
BOOL
WINAPI
GetNamedPipeClientSessionId(
__in HANDLE Pipe,
__out PULONG ClientSessionId
);
WINBASEAPI
BOOL
WINAPI
GetNamedPipeServerProcessId(
__in HANDLE Pipe,
__out PULONG ServerProcessId
);
WINBASEAPI
BOOL
WINAPI
GetNamedPipeServerSessionId(
__in HANDLE Pipe,
__out PULONG ServerSessionId
);
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
skipping to change at line 7911 skipping to change at line 9689
__out_opt LPDWORD lpFileSystemFlags, __out_opt LPDWORD lpFileSystemFlags,
__out_ecount_opt(nFileSystemNameSize) LPWSTR lpFileSystemNameBuffer, __out_ecount_opt(nFileSystemNameSize) LPWSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize __in DWORD nFileSystemNameSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetVolumeInformation GetVolumeInformationW #define GetVolumeInformation GetVolumeInformationW
#else #else
#define GetVolumeInformation GetVolumeInformationA #define GetVolumeInformation GetVolumeInformationA
#endif // !UNICODE #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
BOOL
WINAPI
CancelIoEx(
__in HANDLE hFile,
__in_opt LPOVERLAPPED lpOverlapped
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CancelIo( CancelIo(
__in HANDLE hFile __in HANDLE hFile
); );
WINBASEAPI
BOOL
WINAPI
SetFileBandwidthReservation(
__in HANDLE hFile,
__in DWORD nPeriodMilliseconds,
__in DWORD nBytesPerPeriod,
__in BOOL bDiscardable,
__out LPDWORD lpTransferSize,
__out LPDWORD lpNumOutstandingRequests
);
WINBASEAPI
BOOL
WINAPI
GetFileBandwidthReservation(
__in HANDLE hFile,
__out LPDWORD lpPeriodMilliseconds,
__out LPDWORD lpBytesPerPeriod,
__out LPBOOL pDiscardable,
__out LPDWORD lpTransferSize,
__out LPDWORD lpNumOutstandingRequests
);
// //
// 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
skipping to change at line 8107 skipping to change at line 9940
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_opt LPCSTR *lpStrings, __in_ecount_opt(wNumStrings) LPCSTR *lpStrings,
__in_bcount_opt(dwDataSize) LPVOID lpRawData __in_bcount_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_opt LPCWSTR *lpStrings, __in_ecount_opt(wNumStrings) LPCWSTR *lpStrings,
__in_bcount_opt(dwDataSize) LPVOID lpRawData __in_bcount_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
skipping to change at line 8169 skipping to change at line 10002
__in SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, __in SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
__deref_out PHANDLE DuplicateTokenHandle __deref_out PHANDLE DuplicateTokenHandle
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetKernelObjectSecurity ( GetKernelObjectSecurity (
__in HANDLE Handle, __in HANDLE Handle,
__in SECURITY_INFORMATION RequestedInformation, __in SECURITY_INFORMATION RequestedInformation,
__out_bcount(nLength) PSECURITY_DESCRIPTOR pSecurityDescriptor, __out_bcount_opt(nLength) PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in DWORD nLength, __in DWORD nLength,
__out LPDWORD lpnLengthNeeded __out LPDWORD lpnLengthNeeded
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ImpersonateNamedPipeClient( ImpersonateNamedPipeClient(
__in HANDLE hNamedPipe __in HANDLE hNamedPipe
); );
skipping to change at line 8211 skipping to change at line 10044
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheck ( AccessCheck (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor, __in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in HANDLE ClientToken, __in HANDLE ClientToken,
__in DWORD DesiredAccess, __in DWORD DesiredAccess,
__in PGENERIC_MAPPING GenericMapping, __in PGENERIC_MAPPING GenericMapping,
__out_bcount_part(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_SET P rivilegeSet, __out_bcount_part_opt(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_S ET PrivilegeSet,
__inout LPDWORD PrivilegeSetLength, __inout LPDWORD PrivilegeSetLength,
__out LPDWORD GrantedAccess, __out LPDWORD GrantedAccess,
__out LPBOOL AccessStatus __out LPBOOL AccessStatus
); );
#if(_WIN32_WINNT >= 0x0500) #if(_WIN32_WINNT >= 0x0500)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckByType ( AccessCheckByType (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor, __in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in_opt PSID PrincipalSelfSid, __in_opt PSID PrincipalSelfSid,
__in HANDLE ClientToken, __in HANDLE ClientToken,
__in DWORD DesiredAccess, __in DWORD DesiredAccess,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, __inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength, __in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping, __in PGENERIC_MAPPING GenericMapping,
__out_bcount_part(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_SET P rivilegeSet, __out_bcount_part_opt(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_S ET PrivilegeSet,
__inout LPDWORD PrivilegeSetLength, __inout LPDWORD PrivilegeSetLength,
__out LPDWORD GrantedAccess, __out LPDWORD GrantedAccess,
__out LPBOOL AccessStatus __out LPBOOL AccessStatus
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckByTypeResultList ( AccessCheckByTypeResultList (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor, __in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in_opt PSID PrincipalSelfSid, __in_opt PSID PrincipalSelfSid,
__in HANDLE ClientToken, __in HANDLE ClientToken,
__in DWORD DesiredAccess, __in DWORD DesiredAccess,
__inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, __inout_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
__in DWORD ObjectTypeListLength, __in DWORD ObjectTypeListLength,
__in PGENERIC_MAPPING GenericMapping, __in PGENERIC_MAPPING GenericMapping,
__out_bcount_part(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_SET P rivilegeSet, __out_bcount_part_opt(*PrivilegeSetLength, *PrivilegeSetLength) PPRIVILEGE_S ET PrivilegeSet,
__inout LPDWORD PrivilegeSetLength, __inout LPDWORD PrivilegeSetLength,
__out LPDWORD GrantedAccessList, __out LPDWORD GrantedAccessList,
__out LPDWORD AccessStatusList __out LPDWORD AccessStatusList
); );
#endif /* _WIN32_WINNT >= 0x0500 */ #endif /* _WIN32_WINNT >= 0x0500 */
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
OpenProcessToken ( OpenProcessToken (
skipping to change at line 8280 skipping to change at line 10113
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetTokenInformation ( GetTokenInformation (
__in HANDLE TokenHandle, __in HANDLE TokenHandle,
__in TOKEN_INFORMATION_CLASS TokenInformationClass, __in TOKEN_INFORMATION_CLASS TokenInformationClass,
__out_bcount_part_opt(TokenInformationLength, *ReturnLength) LPVOID TokenInf ormation, __out_bcount_part_opt(TokenInformationLength, *ReturnLength) LPVOID TokenInf ormation,
__in DWORD TokenInformationLength, __in DWORD TokenInformationLength,
__out_opt PDWORD ReturnLength __out PDWORD ReturnLength
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
SetTokenInformation ( SetTokenInformation (
__in HANDLE TokenHandle, __in HANDLE TokenHandle,
__in TOKEN_INFORMATION_CLASS TokenInformationClass, __in TOKEN_INFORMATION_CLASS TokenInformationClass,
__in_bcount(TokenInformationLength) LPVOID TokenInformation, __in_bcount(TokenInformationLength) LPVOID TokenInformation,
__in DWORD TokenInformationLength __in DWORD TokenInformationLength
skipping to change at line 8331 skipping to change at line 10164
__in HANDLE ClientToken, __in HANDLE ClientToken,
__inout PPRIVILEGE_SET RequiredPrivileges, __inout PPRIVILEGE_SET RequiredPrivileges,
__out LPBOOL pfResult __out LPBOOL pfResult
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckAndAuditAlarmA ( AccessCheckAndAuditAlarmA (
__in LPCSTR SubsystemName, __in LPCSTR SubsystemName,
__in 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 WINADVAPI
BOOL BOOL
WINAPI WINAPI
AccessCheckAndAuditAlarmW ( AccessCheckAndAuditAlarmW (
__in LPCWSTR SubsystemName, __in LPCWSTR SubsystemName,
__in LPVOID HandleId, __in_opt LPVOID HandleId,
__in LPWSTR ObjectTypeName, __in LPWSTR ObjectTypeName,
__in_opt LPWSTR ObjectName, __in_opt LPWSTR 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
); );
skipping to change at line 8668 skipping to change at line 10501
__in PSID pSid, __in PSID pSid,
__in WELL_KNOWN_SID_TYPE WellKnownSidType __in WELL_KNOWN_SID_TYPE WellKnownSidType
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CreateWellKnownSid( CreateWellKnownSid(
__in WELL_KNOWN_SID_TYPE WellKnownSidType, __in WELL_KNOWN_SID_TYPE WellKnownSidType,
__in_opt PSID DomainSid, __in_opt PSID DomainSid,
__out_bcount_part(*cbSid, *cbSid) PSID pSid, __out_bcount_part_opt(*cbSid, *cbSid) PSID pSid,
__inout DWORD *cbSid __inout DWORD *cbSid
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EqualDomainSid( EqualDomainSid(
__in PSID pSid1, __in PSID pSid1,
__in PSID pSid2, __in PSID pSid2,
__out BOOL *pfEqual __out BOOL *pfEqual
skipping to change at line 8907 skipping to change at line 10740
WINAPI WINAPI
AddAccessAllowedAceEx ( AddAccessAllowedAceEx (
__inout PACL pAcl, __inout PACL pAcl,
__in DWORD dwAceRevision, __in DWORD dwAceRevision,
__in DWORD AceFlags, __in DWORD AceFlags,
__in DWORD AccessMask, __in DWORD AccessMask,
__in PSID pSid __in PSID pSid
); );
#endif /* _WIN32_WINNT >= 0x0500 */ #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 */
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
AddAccessDeniedAce ( AddAccessDeniedAce (
__inout PACL pAcl, __inout PACL pAcl,
__in DWORD dwAceRevision, __in DWORD dwAceRevision,
__in DWORD AccessMask, __in DWORD AccessMask,
__in PSID pSid __in PSID pSid
); );
skipping to change at line 9022 skipping to change at line 10868
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
IsValidSecurityDescriptor ( IsValidSecurityDescriptor (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor __in PSECURITY_DESCRIPTOR pSecurityDescriptor
); );
WINADVAPI WINADVAPI
BOOL
WINAPI
IsValidRelativeSecurityDescriptor (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor,
__in ULONG SecurityDescriptorLength,
__in SECURITY_INFORMATION RequiredInformation
);
WINADVAPI
DWORD DWORD
WINAPI WINAPI
GetSecurityDescriptorLength ( GetSecurityDescriptorLength (
__in PSECURITY_DESCRIPTOR pSecurityDescriptor __in PSECURITY_DESCRIPTOR pSecurityDescriptor
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetSecurityDescriptorControl ( GetSecurityDescriptorControl (
skipping to change at line 9273 skipping to change at line 11128
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
MakeAbsoluteSD2 ( MakeAbsoluteSD2 (
__inout_bcount_part(*lpdwBufferSize, *lpdwBufferSize) PSECURITY_DESCRIPTOR p SelfRelativeSecurityDescriptor, __inout_bcount_part(*lpdwBufferSize, *lpdwBufferSize) PSECURITY_DESCRIPTOR p SelfRelativeSecurityDescriptor,
__inout LPDWORD lpdwBufferSize __inout LPDWORD lpdwBufferSize
); );
WINADVAPI WINADVAPI
VOID
WINAPI
QuerySecurityAccessMask(
__in SECURITY_INFORMATION SecurityInformation,
__out LPDWORD DesiredAccess
);
WINADVAPI
VOID
WINAPI
SetSecurityAccessMask(
__in SECURITY_INFORMATION SecurityInformation,
__out LPDWORD DesiredAccess
);
WINADVAPI
BOOL BOOL
WINAPI 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 WINADVAPI
BOOL BOOL
WINAPI WINAPI
skipping to change at line 9372 skipping to change at line 11243
WINAPI WINAPI
FindCloseChangeNotification( FindCloseChangeNotification(
__in HANDLE hChangeHandle __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_bcount_part(nBufferLength, *lpBytesReturned) LPVOID lpBuffer,
__in DWORD nBufferLength, __in DWORD nBufferLength,
__in BOOL bWatchSubtree, __in BOOL bWatchSubtree,
__in DWORD dwNotifyFilter, __in DWORD dwNotifyFilter,
__out LPDWORD lpBytesReturned, __out_opt LPDWORD lpBytesReturned,
__inout 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 WINBASEAPI
BOOL BOOL
WINAPI WINAPI
VirtualLock( VirtualLock(
__in LPVOID lpAddress, __in LPVOID lpAddress,
__in SIZE_T dwSize __in SIZE_T dwSize
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
VirtualUnlock( VirtualUnlock(
__in LPVOID lpAddress, __in LPVOID lpAddress,
__in SIZE_T dwSize __in SIZE_T dwSize
); );
WINBASEAPI WINBASEAPI
__out __out_opt __out_data_source(FILE)
LPVOID LPVOID
WINAPI WINAPI
MapViewOfFileEx( MapViewOfFileEx(
__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
); );
#if _WIN32_WINNT >= 0x0600
WINBASEAPI
__out __out_data_source(FILE)
LPVOID
WINAPI
MapViewOfFileExNuma(
__in HANDLE hFileMappingObject,
__in DWORD dwDesiredAccess,
__in DWORD dwFileOffsetHigh,
__in DWORD dwFileOffsetLow,
__in SIZE_T dwNumberOfBytesToMap,
__in_opt LPVOID lpBaseAddress,
__in DWORD nndPreferred
);
#endif // _WIN32_WINNT >= 0x0600
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
SetPriorityClass( SetPriorityClass(
__in HANDLE hProcess, __in HANDLE hProcess,
__in DWORD dwPriorityClass __in DWORD dwPriorityClass
); );
WINBASEAPI WINBASEAPI
DWORD DWORD
skipping to change at line 9740 skipping to change at line 11629
#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)
BOOL BOOL
WINAPI WINAPI
GetComputerNameA ( GetComputerNameA (
__out_ecount_part(*nSize, *nSize + 1) LPSTR lpBuffer, __out_ecount_part_opt(*nSize, *nSize + 1) __out_has_type_adt_props(SAL_Valid CompNameT) LPSTR lpBuffer,
__inout LPDWORD nSize __inout LPDWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return != 0)
BOOL BOOL
WINAPI WINAPI
GetComputerNameW ( GetComputerNameW (
__out_ecount_part(*nSize, *nSize + 1) LPWSTR lpBuffer, __out_ecount_part_opt(*nSize, *nSize + 1) __out_has_type_adt_props(SAL_Valid CompNameT) 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
skipping to change at line 9792 skipping to change at line 11683
ComputerNameDnsDomain, ComputerNameDnsDomain,
ComputerNameDnsFullyQualified, ComputerNameDnsFullyQualified,
ComputerNamePhysicalNetBIOS, ComputerNamePhysicalNetBIOS,
ComputerNamePhysicalDnsHostname, ComputerNamePhysicalDnsHostname,
ComputerNamePhysicalDnsDomain, ComputerNamePhysicalDnsDomain,
ComputerNamePhysicalDnsFullyQualified, ComputerNamePhysicalDnsFullyQualified,
ComputerNameMax ComputerNameMax
} COMPUTER_NAME_FORMAT ; } COMPUTER_NAME_FORMAT ;
WINBASEAPI WINBASEAPI
__success(return != 0)
BOOL BOOL
WINAPI WINAPI
GetComputerNameExA ( GetComputerNameExA (
__in COMPUTER_NAME_FORMAT NameType, __in COMPUTER_NAME_FORMAT NameType,
__out_ecount_part_opt(*nSize, *nSize + 1) LPSTR lpBuffer, __out_ecount_part_opt(*nSize, *nSize + 1) LPSTR lpBuffer,
__inout LPDWORD nSize __inout LPDWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return != 0)
BOOL BOOL
WINAPI WINAPI
GetComputerNameExW ( GetComputerNameExW (
__in COMPUTER_NAME_FORMAT NameType, __in COMPUTER_NAME_FORMAT NameType,
__out_ecount_part_opt(*nSize, *nSize + 1) LPWSTR lpBuffer, __out_ecount_part_opt(*nSize, *nSize + 1) LPWSTR lpBuffer,
__inout LPDWORD nSize __inout LPDWORD nSize
); );
#ifdef UNICODE #ifdef UNICODE
#define GetComputerNameEx GetComputerNameExW #define GetComputerNameEx GetComputerNameExW
#else #else
skipping to change at line 9834 skipping to change at line 11727
__in COMPUTER_NAME_FORMAT NameType, __in COMPUTER_NAME_FORMAT NameType,
__in LPCWSTR lpBuffer __in LPCWSTR lpBuffer
); );
#ifdef UNICODE #ifdef UNICODE
#define SetComputerNameEx SetComputerNameExW #define SetComputerNameEx SetComputerNameExW
#else #else
#define SetComputerNameEx SetComputerNameExA #define SetComputerNameEx SetComputerNameExA
#endif // !UNICODE #endif // !UNICODE
WINBASEAPI WINBASEAPI
__success(return == TRUE)
BOOL BOOL
WINAPI WINAPI
DnsHostnameToComputerNameA ( DnsHostnameToComputerNameA (
__in LPCSTR Hostname, __in LPCSTR Hostname,
__out_ecount_part_opt(*nSize, *nSize + 1) LPSTR ComputerName, __out_ecount_part_opt(*nSize, *nSize + 1) __out_has_type_adt_props(SAL_Valid CompNameT) LPSTR ComputerName,
__inout LPDWORD nSize __inout LPDWORD nSize
); );
WINBASEAPI WINBASEAPI
__success(return == TRUE)
BOOL BOOL
WINAPI WINAPI
DnsHostnameToComputerNameW ( DnsHostnameToComputerNameW (
__in LPCWSTR Hostname, __in LPCWSTR Hostname,
__out_ecount_part_opt(*nSize, *nSize + 1) LPWSTR ComputerName, __out_ecount_part_opt(*nSize, *nSize + 1) __out_has_type_adt_props(SAL_Valid CompNameT) 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(*pcbBuffer, *pcbBuffer) LPSTR lpBuffer, __out_ecount_part_opt(*pcbBuffer, *pcbBuffer) LPSTR lpBuffer,
__inout LPDWORD pcbBuffer __inout LPDWORD pcbBuffer
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
GetUserNameW ( GetUserNameW (
__out_ecount_part(*pcbBuffer, *pcbBuffer) LPWSTR lpBuffer, __out_ecount_part_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 9964 skipping to change at line 11859
__deref_opt_out_bcount_full(*pdwProfileLength) PVOID *ppProfileBuffer, __deref_opt_out_bcount_full(*pdwProfileLength) PVOID *ppProfileBuffer,
__out_opt LPDWORD pdwProfileLength, __out_opt LPDWORD pdwProfileLength,
__out_opt PQUOTA_LIMITS pQuotaLimits __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)
#endif // (_WIN32_WINNT >= 0x0600)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
ImpersonateLoggedOnUser( ImpersonateLoggedOnUser(
__in HANDLE hToken __in HANDLE hToken
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
skipping to change at line 10129 skipping to change at line 12028
RegisterWaitForSingleObject( RegisterWaitForSingleObject(
__deref_out PHANDLE phNewWaitObject, __deref_out 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 WINBASEAPI
__out
HANDLE HANDLE
WINAPI WINAPI
RegisterWaitForSingleObjectEx( RegisterWaitForSingleObjectEx(
__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
); );
skipping to change at line 10176 skipping to change at line 12074
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 WINBASEAPI
__out __out_opt
HANDLE HANDLE
WINAPI WINAPI
CreateTimerQueue( CreateTimerQueue(
VOID VOID
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
CreateTimerQueueTimer( CreateTimerQueueTimer(
skipping to change at line 10227 skipping to change at line 12125
WINBASEAPI WINBASEAPI
__checkReturn __checkReturn
BOOL BOOL
WINAPI WINAPI
DeleteTimerQueueEx( DeleteTimerQueueEx(
__in HANDLE TimerQueue, __in HANDLE TimerQueue,
__in_opt HANDLE CompletionEvent __in_opt HANDLE CompletionEvent
); );
WINBASEAPI WINBASEAPI
__out
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
); );
skipping to change at line 10256 skipping to change at line 12153
); );
WINBASEAPI WINBASEAPI
__checkReturn __checkReturn
BOOL BOOL
WINAPI WINAPI
DeleteTimerQueue( DeleteTimerQueue(
__in HANDLE TimerQueue __in HANDLE TimerQueue
); );
#endif // _WIN32_WINNT #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
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)
FORCEINLINE
VOID
InitializeThreadpoolEnvironment(
__out PTP_CALLBACK_ENVIRON pcbe
)
{
TpInitializeCallbackEnviron(pcbe);
}
FORCEINLINE
VOID
SetThreadpoolCallbackPool(
__inout PTP_CALLBACK_ENVIRON pcbe,
__in PTP_POOL ptpp
)
{
TpSetCallbackThreadpool(pcbe, ptpp);
}
FORCEINLINE
VOID
SetThreadpoolCallbackCleanupGroup(
__inout PTP_CALLBACK_ENVIRON pcbe,
__in PTP_CLEANUP_GROUP ptpcg,
__in_opt PTP_CLEANUP_GROUP_CANCEL_CALLBACK pfng
)
{
TpSetCallbackCleanupGroup(pcbe, ptpcg, pfng);
}
FORCEINLINE
VOID
SetThreadpoolCallbackRunsLong(
__inout PTP_CALLBACK_ENVIRON pcbe
)
{
TpSetCallbackLongFunction(pcbe);
}
FORCEINLINE
VOID
SetThreadpoolCallbackLibrary(
__inout PTP_CALLBACK_ENVIRON pcbe,
__in PVOID mod
)
{
TpSetCallbackRaceWithDll(pcbe, mod);
}
FORCEINLINE
VOID
DestroyThreadpoolEnvironment(
__inout PTP_CALLBACK_ENVIRON pcbe
)
{
TpDestroyCallbackEnviron(pcbe);
}
#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
//
WINBASEAPI
__out_opt
HANDLE
WINAPI
CreatePrivateNamespaceA(
__in_opt LPSECURITY_ATTRIBUTES lpPrivateNamespaceAttributes,
__in LPVOID lpBoundaryDescriptor,
__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
#else
#define CreatePrivateNamespace CreatePrivateNamespaceA
#endif // !UNICODE
WINBASEAPI
__out_opt
HANDLE
WINAPI
OpenPrivateNamespaceA(
__in LPVOID lpBoundaryDescriptor,
__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
BOOLEAN
WINAPI
ClosePrivateNamespace(
__in HANDLE Handle,
__in ULONG Flags
);
//
// Boundary descriptors support
//
__out_opt
HANDLE
APIENTRY
CreateBoundaryDescriptorA(
__in LPCSTR Name,
__in ULONG Flags
);
__out_opt
HANDLE
APIENTRY
CreateBoundaryDescriptorW(
__in LPCWSTR Name,
__in ULONG Flags
);
#ifdef UNICODE
#define CreateBoundaryDescriptor CreateBoundaryDescriptorW
#else
#define CreateBoundaryDescriptor CreateBoundaryDescriptorA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
AddSIDToBoundaryDescriptor(
__inout HANDLE * BoundaryDescriptor,
__in PSID RequiredSid
);
WINBASEAPI
VOID
WINAPI
DeleteBoundaryDescriptor(
__in HANDLE BoundaryDescriptor
);
#endif // _WIN32_WINNT >= 0x0600
#endif // _WIN32_WINNT >= 0x0500
#if(_WIN32_WINNT >= 0x0400) #if(_WIN32_WINNT >= 0x0400)
// //
// Plug-and-Play API's // Plug-and-Play API's
// //
#define HW_PROFILE_GUIDLEN 39 // 36-characters plus NULL terminator #define HW_PROFILE_GUIDLEN 39 // 36-characters plus NULL terminator
#define MAX_PROFILE_LEN 80 #define MAX_PROFILE_LEN 80
#define DOCKINFO_UNDOCKED (0x1) #define DOCKINFO_UNDOCKED (0x1)
skipping to change at line 10367 skipping to change at line 12712
__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)
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>
/* Abnormal termination codes */ /* Abnormal termination codes */
#define TC_NORMAL 0 #define TC_NORMAL 0
#define TC_HARDERR 1 #define TC_HARDERR 1
skipping to change at line 10439 skipping to change at line 12799
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
AllocateUserPhysicalPages( AllocateUserPhysicalPages(
__in HANDLE hProcess, __in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages, __inout PULONG_PTR NumberOfPages,
__out_ecount_part(*NumberOfPages, *NumberOfPages) PULONG_PTR PageArray __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 WINBASEAPI
BOOL BOOL
WINAPI WINAPI
FreeUserPhysicalPages( FreeUserPhysicalPages(
__in HANDLE hProcess, __in HANDLE hProcess,
__inout PULONG_PTR NumberOfPages, __inout PULONG_PTR NumberOfPages,
__in_ecount(*NumberOfPages) PULONG_PTR PageArray __in_ecount(*NumberOfPages) PULONG_PTR PageArray
); );
WINBASEAPI WINBASEAPI
skipping to change at line 10467 skipping to change at line 12841
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
MapUserPhysicalPagesScatter( MapUserPhysicalPagesScatter(
__in_ecount(NumberOfPages) PVOID *VirtualAddresses, __in_ecount(NumberOfPages) PVOID *VirtualAddresses,
__in ULONG_PTR NumberOfPages, __in ULONG_PTR NumberOfPages,
__in_ecount_opt(NumberOfPages) PULONG_PTR PageArray __in_ecount_opt(NumberOfPages) PULONG_PTR PageArray
); );
WINBASEAPI WINBASEAPI
__out __out_opt
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 __out_opt
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 __out_opt
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 __out_opt
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
skipping to change at line 10549 skipping to change at line 12923
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_bcount(cbJobObjectInformationLength) LPVOID lpJobObjectInformation,
__in DWORD cbJobObjectInformationLength __in DWORD cbJobObjectInformationLength
); );
#if (_WIN32_WINNT >= 0x0501)
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsProcessInJob ( IsProcessInJob (
__in HANDLE ProcessHandle, __in HANDLE ProcessHandle,
__in_opt HANDLE JobHandle, __in_opt HANDLE JobHandle,
__out PBOOL Result __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_ecount(NumJob) PJOB_SET_ARRAY UserJobSet,
__in ULONG Flags); __in ULONG Flags);
WINBASEAPI WINBASEAPI
__out __out_opt
PVOID PVOID
WINAPI WINAPI
AddVectoredExceptionHandler ( AddVectoredExceptionHandler (
__in ULONG First, __in ULONG First,
__in PVECTORED_EXCEPTION_HANDLER Handler __in PVECTORED_EXCEPTION_HANDLER Handler
); );
WINBASEAPI WINBASEAPI
ULONG ULONG
WINAPI WINAPI
RemoveVectoredExceptionHandler ( RemoveVectoredExceptionHandler (
__in PVOID Handle __in PVOID Handle
); );
WINBASEAPI WINBASEAPI
__out __out_opt
PVOID PVOID
WINAPI WINAPI
AddVectoredContinueHandler ( AddVectoredContinueHandler (
__in ULONG First, __in ULONG First,
__in PVECTORED_EXCEPTION_HANDLER Handler __in PVECTORED_EXCEPTION_HANDLER Handler
); );
WINBASEAPI WINBASEAPI
ULONG ULONG
WINAPI WINAPI
skipping to change at line 10858 skipping to change at line 13236
typedef ACTCTXW ACTCTX; typedef ACTCTXW ACTCTX;
typedef PACTCTXW PACTCTX; typedef PACTCTXW PACTCTX;
#else #else
typedef ACTCTXA ACTCTX; typedef ACTCTXA ACTCTX;
typedef PACTCTXA PACTCTX; typedef PACTCTXA PACTCTX;
#endif // UNICODE #endif // UNICODE
typedef const ACTCTXA *PCACTCTXA; typedef const ACTCTXA *PCACTCTXA;
typedef const ACTCTXW *PCACTCTXW; typedef const ACTCTXW *PCACTCTXW;
#ifdef UNICODE #ifdef UNICODE
typedef ACTCTXW ACTCTX;
typedef PCACTCTXW PCACTCTX; typedef PCACTCTXW PCACTCTX;
#else #else
typedef ACTCTXA ACTCTX;
typedef PCACTCTXA PCACTCTX; typedef PCACTCTXA PCACTCTX;
#endif // UNICODE #endif // UNICODE
#endif
#if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
WINBASEAPI WINBASEAPI
__out __out
HANDLE HANDLE
WINAPI WINAPI
CreateActCtxA( CreateActCtxA(
__in PCACTCTXA pActCtx __in PCACTCTXA pActCtx
); );
WINBASEAPI WINBASEAPI
__out __out
HANDLE HANDLE
skipping to change at line 10914 skipping to change at line 13286
BOOL BOOL
WINAPI WINAPI
ZombifyActCtx( ZombifyActCtx(
__inout HANDLE hActCtx __inout HANDLE hActCtx
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ActivateActCtx( ActivateActCtx(
__inout 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)
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); __deref_out HANDLE *lphActCtx);
#endif
#if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENA
BLED
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;
HANDLE hActCtx; HANDLE hActCtx;
skipping to change at line 10982 skipping to change at line 13350
// 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)
#endif
#if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
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
); );
skipping to change at line 11023 skipping to change at line 13387
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
); );
#endif
#if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENA
BLED
#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;
typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT _BASIC_INFORMATION; typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT _BASIC_INFORMATION;
#define ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED 1 #define ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED 1
#endif // !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED) #endif // !defined(ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED)
#endif #endif
#define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX (0x00000004) #define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX (0x00000004)
#define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE (0x00000008) #define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE (0x00000008)
#define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS (0x00000010) #define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS (0x00000010)
#define QUERY_ACTCTX_FLAG_NO_ADDREF (0x80000000) #define QUERY_ACTCTX_FLAG_NO_ADDREF (0x80000000)
#endif
#if (_WIN32_WINNT >= 0x0500) || (_WIN32_FUSION >= 0x0100)
// //
// switch (ulInfoClass) // switch (ulInfoClass)
// //
// case ActivationContextBasicInformation: // case ActivationContextBasicInformation:
// pvSubInstance == NULL // pvSubInstance == NULL
// pvBuffer is of type PACTIVATION_CONTEXT_BASIC_INFORMATION // pvBuffer is of type PACTIVATION_CONTEXT_BASIC_INFORMATION
// //
// case ActivationContextDetailedInformation: // case ActivationContextDetailedInformation:
// pvSubInstance == NULL // pvSubInstance == NULL
// pvBuffer is of type PACTIVATION_CONTEXT_DETAILED_INFORMATION // pvBuffer is of type PACTIVATION_CONTEXT_DETAILED_INFORMATION
skipping to change at line 11073 skipping to change at line 13429
// pvSubInstance is of type PULONG // pvSubInstance is of type PULONG
// *pvSubInstance < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCoun t // *pvSubInstance < ACTIVATION_CONTEXT_DETAILED_INFORMATION::ulAssemblyCoun t
// pvBuffer is of type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION // pvBuffer is of type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
// //
// case FileInformationInAssemblyOfAssemblyInActivationContext: // case FileInformationInAssemblyOfAssemblyInActivationContext:
// pvSubInstance is of type PACTIVATION_CONTEXT_QUERY_INDEX // pvSubInstance is of type PACTIVATION_CONTEXT_QUERY_INDEX
// 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 :
// pvSubInstance == NULL
// pvBuffer is of type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION
//
// String are placed after the structs. // String are placed after the structs.
// //
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,
skipping to change at line 11098 skipping to change at line 13458
typedef BOOL (WINAPI * PQUERYACTCTXW_FUNC)( typedef 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_bcount_part_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) #endif // (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWAR E_ENABLED
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
ProcessIdToSessionId( ProcessIdToSessionId(
__in DWORD dwProcessId, __in DWORD dwProcessId,
__out DWORD *pSessionId __out DWORD *pSessionId
); );
#if _WIN32_WINNT >= 0x0501 #if _WIN32_WINNT >= 0x0501
WINBASEAPI WINBASEAPI
DWORD DWORD
WINAPI WINAPI
WTSGetActiveConsoleSessionId(); WTSGetActiveConsoleSessionId(
VOID
);
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
IsWow64Process( IsWow64Process(
__in HANDLE hProcess, __in HANDLE hProcess,
__out PBOOL Wow64Process __out PBOOL Wow64Process
); );
#endif // (_WIN32_WINNT >= 0x0501) #endif // (_WIN32_WINNT >= 0x0501)
skipping to change at line 11168 skipping to change at line 13530
); );
WINBASEAPI WINBASEAPI
BOOL BOOL
WINAPI WINAPI
GetNumaAvailableMemoryNode( GetNumaAvailableMemoryNode(
__in UCHAR Node, __in UCHAR Node,
__out PULONGLONG AvailableBytes __out PULONGLONG AvailableBytes
); );
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
GetNumaProximityNode(
__in ULONG ProximityId,
__out PUCHAR NodeNumber
);
#endif
//
// Application restart and data recovery callback
//
typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK)(PVOID pvParameter);
//
// Max length of commandline in characters (including the NULL character that ca
n be registered for restart)
//
#define RESTART_MAX_CMD_LINE 2048
//
// Do not restart the process for termination due to application crashes
//
#define RESTART_NO_CRASH 1
//
// Do not restart the process for termination due to application hangs
//
#define RESTART_NO_HANG 2
//
// Do not restart the process for termination due to patch installations
//
#define RESTART_NO_PATCH 4
//
// Do not restart the process when the system is rebooted because the
//
#define RESTART_NO_REBOOT 8
WINBASEAPI
HRESULT
WINAPI
RegisterApplicationRecoveryCallback(
__in APPLICATION_RECOVERY_CALLBACK pRecoveyCallback,
__in_opt PVOID pvParameter,
__in DWORD dwPingInterval,
__in DWORD dwFlags
);
WINBASEAPI
HRESULT
WINAPI
UnregisterApplicationRecoveryCallback();
WINBASEAPI
HRESULT
WINAPI
RegisterApplicationRestart(
__in_opt PCWSTR pwzCommandline,
__in DWORD dwFlags
);
WINBASEAPI
HRESULT
WINAPI
UnregisterApplicationRestart();
#define RECOVERY_DEFAULT_PING_INTERVAL 5000
#define RECOVERY_MAX_PING_INTERVAL (5 * 60 * 1000)
WINBASEAPI
HRESULT
WINAPI
GetApplicationRecoveryCallback(
__in HANDLE hProcess,
__out APPLICATION_RECOVERY_CALLBACK* pRecoveryCallback,
__deref_opt_out_opt PVOID* ppvParameter,
__out_opt PDWORD pdwPingInterval,
__out_opt PDWORD pdwFlags
);
WINBASEAPI
HRESULT
WINAPI
GetApplicationRestartSettings(
__in HANDLE hProcess,
__out_ecount_opt(*pcchSize) PWSTR pwzCommandline,
__inout PDWORD pcchSize,
__out_opt PDWORD pdwFlags
);
WINBASEAPI
HRESULT
WINAPI
ApplicationRecoveryInProgress(
__out PBOOL pbCancelled
);
WINBASEAPI
VOID
WINAPI
ApplicationRecoveryFinished(
__in BOOL bSuccess
);
#if (_WIN32_WINNT >= 0x0600)
typedef enum _FILE_INFO_BY_HANDLE_CLASS {
FileBasicInfo,
FileStandardInfo,
FileNameInfo,
FileRenameInfo,
FileDispositionInfo,
FileAllocationInfo,
FileEndOfFileInfo,
FileStreamInfo,
FileCompressionInfo,
FileAttributeTagInfo,
FileIdBothDirectoryInfo,
FileIdBothDirectoryRestartInfo,
FileIoPriorityHintInfo,
MaximumFileInfoByHandleClass
} FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS;
typedef struct _FILE_BASIC_INFO {
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
LARGE_INTEGER ChangeTime;
DWORD FileAttributes;
} FILE_BASIC_INFO, *PFILE_BASIC_INFO;
typedef struct _FILE_STANDARD_INFO {
LARGE_INTEGER AllocationSize;
LARGE_INTEGER EndOfFile;
DWORD NumberOfLinks;
BOOLEAN DeletePending;
BOOLEAN Directory;
} FILE_STANDARD_INFO, *PFILE_STANDARD_INFO;
typedef struct _FILE_NAME_INFO {
DWORD FileNameLength;
WCHAR FileName[1];
} FILE_NAME_INFO, *PFILE_NAME_INFO;
typedef struct _FILE_RENAME_INFO {
BOOLEAN ReplaceIfExists;
HANDLE RootDirectory;
DWORD FileNameLength;
WCHAR FileName[1];
} FILE_RENAME_INFO, *PFILE_RENAME_INFO;
typedef struct _FILE_ALLOCATION_INFO {
LARGE_INTEGER AllocationSize;
} FILE_ALLOCATION_INFO, *PFILE_ALLOCATION_INFO;
typedef struct _FILE_END_OF_FILE_INFO {
LARGE_INTEGER EndOfFile;
} FILE_END_OF_FILE_INFO, *PFILE_END_OF_FILE_INFO;
typedef struct _FILE_STREAM_INFO {
DWORD NextEntryOffset;
DWORD StreamNameLength;
LARGE_INTEGER StreamSize;
LARGE_INTEGER StreamAllocationSize;
WCHAR StreamName[1];
} FILE_STREAM_INFO, *PFILE_STREAM_INFO;
typedef struct _FILE_COMPRESSION_INFO {
LARGE_INTEGER CompressedFileSize;
WORD CompressionFormat;
UCHAR CompressionUnitShift;
UCHAR ChunkShift;
UCHAR ClusterShift;
UCHAR Reserved[3];
} FILE_COMPRESSION_INFO, *PFILE_COMPRESSION_INFO;
typedef struct _FILE_ATTRIBUTE_TAG_INFO {
DWORD FileAttributes;
DWORD ReparseTag;
} FILE_ATTRIBUTE_TAG_INFO, *PFILE_ATTRIBUTE_TAG_INFO;
typedef struct _FILE_DISPOSITION_INFO {
BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFO, *PFILE_DISPOSITION_INFO;
typedef struct _FILE_ID_BOTH_DIR_INFO {
DWORD NextEntryOffset;
DWORD FileIndex;
LARGE_INTEGER CreationTime;
LARGE_INTEGER LastAccessTime;
LARGE_INTEGER LastWriteTime;
LARGE_INTEGER ChangeTime;
LARGE_INTEGER EndOfFile;
LARGE_INTEGER AllocationSize;
DWORD FileAttributes;
DWORD FileNameLength;
DWORD EaSize;
CCHAR ShortNameLength;
WCHAR ShortName[12];
LARGE_INTEGER FileId;
WCHAR FileName[1];
} FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO;
typedef enum _PRIORITY_HINT {
IoPriorityHintVeryLow = 0,
IoPriorityHintLow,
IoPriorityHintNormal,
MaximumIoPriorityHintType
} PRIORITY_HINT;
typedef struct _FILE_IO_PRIORITY_HINT_INFO {
PRIORITY_HINT PriorityHint;
} FILE_IO_PRIORITY_HINT_INFO, *PFILE_IO_PRIORITY_HINT_INFO;
BOOL
WINAPI
SetFileInformationByHandle(
__in HANDLE hFile,
__in FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
__in_bcount(dwBufferSize) LPVOID lpFileInformation,
__in DWORD dwBufferSize
);
BOOL
WINAPI
GetFileInformationByHandleEx(
__in HANDLE hFile,
__in FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
__out_bcount(dwBufferSize) LPVOID lpFileInformation,
__in DWORD dwBufferSize
);
typedef enum _FILE_ID_TYPE {
FileIdType,
ObjectIdType,
MaximumFileIdType
} FILE_ID_TYPE, *PFILE_ID_TYPE;
typedef struct FILE_ID_DESCRIPTOR {
DWORD dwSize; // Size of the struct
FILE_ID_TYPE Type; // Describes the type of identifier passed in.
union {
LARGE_INTEGER FileId;
GUID ObjectId;
};
} FILE_ID_DESCRIPTOR, *LPFILE_ID_DESCRIPTOR;
__out
HANDLE
WINAPI
OpenFileById (
__in HANDLE hVolumeHint,
__in LPFILE_ID_DESCRIPTOR lpFileId,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwFlagsAndAttributes
);
#endif
#if (_WIN32_WINNT >= 0x0600)
//
// Flags to be passed into CREATE_SYMBOLIC_LINK
//
#define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1)
#define VALID_SYMBOLIC_LINK_FLAGS SYMBOLIC_LINK_FLAG_DIRECTORY // & whatever ot
her flags we think of!
BOOLEAN
APIENTRY
CreateSymbolicLinkA (
__in LPCSTR lpSymlinkFileName,
__in LPCSTR lpTargetFileName,
__in DWORD dwFlags
);
BOOLEAN
APIENTRY
CreateSymbolicLinkW (
__in LPCWSTR lpSymlinkFileName,
__in LPCWSTR lpTargetFileName,
__in DWORD dwFlags
);
#ifdef UNICODE
#define CreateSymbolicLink CreateSymbolicLinkW
#else
#define CreateSymbolicLink CreateSymbolicLinkA
#endif // !UNICODE
BOOLEAN
APIENTRY
CreateSymbolicLinkTransactedA (
__in LPCSTR lpSymlinkFileName,
__in LPCSTR lpTargetFileName,
__in DWORD dwFlags,
__in HANDLE hTransaction
);
BOOLEAN
APIENTRY
CreateSymbolicLinkTransactedW (
__in LPCWSTR lpSymlinkFileName,
__in LPCWSTR lpTargetFileName,
__in DWORD dwFlags,
__in HANDLE hTransaction
);
#ifdef UNICODE
#define CreateSymbolicLinkTransacted CreateSymbolicLinkTransactedW
#else
#define CreateSymbolicLinkTransacted CreateSymbolicLinkTransactedA
#endif // !UNICODE
DWORD
WINAPI
GetFinalPathNameByHandleA (
__in HANDLE hFile,
__out_ecount(cchFilePath) LPSTR lpszFilePath,
__in DWORD cchFilePath,
__in DWORD dwFlags
);
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)
#if (_WIN32_WINNT >= 0x0600)
WINBASEAPI
BOOL
WINAPI
QueryActCtxSettingsW(
__in_opt DWORD dwFlags,
__in_opt HANDLE hActCtx,
__in_opt PCWSTR settingsNameSpace,
__in PCWSTR settingName,
__out_bcount_part_opt(dwBuffer, *pdwWrittenOrRequired) PWSTR pvBuffer,
__in SIZE_T dwBuffer,
__out_opt SIZE_T *pdwWrittenOrRequired
);
#endif
#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
 End of changes. 285 change blocks. 
237 lines changed or deleted 2964 lines changed or added


 wincred.h (5.2.3790.3959-Windows 5.0)   wincred.h (6.0.6002.18005-Windows 6.0) 
//depot/vbl_srv_wcsmain/ds/published/inc/wincred.w#4 - integrate change 66730 (t ext)
/*++ BUILD Version: 0001 // Increment this if a change has global effects /*++ BUILD Version: 0001 // Increment this if a change has global effects
Copyright (c) 2000 Microsoft Corporation Copyright (c) 2000 Microsoft Corporation
Module Name: Module Name:
wincred.h wincred.h
Abstract: Abstract:
This module contains the public data structures and API definitions This module contains the public data structures and API definitions
needed for the Credential Manager. needed for the Credential Manager.
Author: Author:
Cliff Van Dyke (CliffV) 11-January-2000
Revision History: Revision History:
--*/ --*/
#ifndef _WINCRED_H_ #ifndef _WINCRED_H_
#define _WINCRED_H_ #define _WINCRED_H_
#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 DECLSPEC_IMPORT #define CREDUIAPI EXTERN_C DECLSPEC_IMPORT
#else #else
#define CREDUIAPI #define CREDUIAPI EXTERN_C
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
// //
// Ensure PCtxtHandle is defined // Ensure PCtxtHandle is defined
// //
skipping to change at line 135 skipping to change at line 134
#define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L) // ntsubauth #define STATUS_ACCOUNT_LOCKED_OUT ((NTSTATUS)0xC0000234L) // ntsubauth
#define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L) // ntsubauth #define STATUS_ACCOUNT_EXPIRED ((NTSTATUS)0xC0000193L) // ntsubauth
#define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL) #define STATUS_LOGON_TYPE_NOT_GRANTED ((NTSTATUS)0xC000015BL)
// Don't require lmerr.h // Don't require lmerr.h
#define NERR_BASE 2100 #define NERR_BASE 2100
#define NERR_PasswordExpired (NERR_BASE+142) /* The password of this user has expired. */ #define NERR_PasswordExpired (NERR_BASE+142) /* The password of this user has expired. */
#define CREDUIP_IS_USER_PASSWORD_ERROR( _Status ) ( \ #define CREDUIP_IS_USER_PASSWORD_ERROR( _Status ) ( \
(_Status) == ERROR_LOGON_FAILURE || \ (_Status) == ERROR_LOGON_FAILURE || \
(_Status) == HRESULT_FROM_WIN32( ERROR_LOGON_FAILURE ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_LOGON_FAILURE ) || \
(_Status) == STATUS_LOGON_FAILURE || \ (_Status) == STATUS_LOGON_FAILURE || \
(_Status) == HRESULT_FROM_NT( STATUS_LOGON_FAILURE ) || \ (_Status) == HRESULT_FROM_NT( STATUS_LOGON_FAILURE ) || \
(_Status) == ERROR_ACCESS_DENIED || \ (_Status) == ERROR_ACCESS_DENIED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_ACCESS_DENIED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_ACCESS_DENIED ) || \
(_Status) == STATUS_ACCESS_DENIED || \ (_Status) == STATUS_ACCESS_DENIED || \
(_Status) == HRESULT_FROM_NT( STATUS_ACCESS_DENIED ) || \ (_Status) == HRESULT_FROM_NT( STATUS_ACCESS_DENIED ) || \
(_Status) == ERROR_INVALID_PASSWORD || \ (_Status) == ERROR_INVALID_PASSWORD || \
(_Status) == HRESULT_FROM_WIN32( ERROR_INVALID_PASSWORD ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_INVALID_PASSWORD ) || \
(_Status) == STATUS_WRONG_PASSWORD || \ (_Status) == STATUS_WRONG_PASSWORD || \
(_Status) == HRESULT_FROM_NT( STATUS_WRONG_PASSWORD ) || \ (_Status) == HRESULT_FROM_NT( STATUS_WRONG_PASSWORD ) || \
(_Status) == SEC_E_NO_CREDENTIALS || \ (_Status) == SEC_E_NO_CREDENTIALS || \
(_Status) == SEC_E_LOGON_DENIED \ (_Status) == SEC_E_LOGON_DENIED \
) )
#define CREDUIP_IS_DOWNGRADE_ERROR( _Status ) ( \ #define CREDUIP_IS_DOWNGRADE_ERROR( _Status ) ( \
(_Status) == ERROR_DOWNGRADE_DETECTED || \ (_Status) == ERROR_DOWNGRADE_DETECTED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_DOWNGRADE_DETECTED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_DOWNGRADE_DETECTED ) || \
(_Status) == STATUS_DOWNGRADE_DETECTED || \ (_Status) == STATUS_DOWNGRADE_DETECTED || \
(_Status) == HRESULT_FROM_NT( STATUS_DOWNGRADE_DETECTED ) \ (_Status) == HRESULT_FROM_NT( STATUS_DOWNGRADE_DETECTED ) \
) )
#define CREDUIP_IS_EXPIRED_ERROR( _Status ) ( \ #define CREDUIP_IS_EXPIRED_ERROR( _Status ) ( \
(_Status) == ERROR_PASSWORD_EXPIRED || \ (_Status) == ERROR_PASSWORD_EXPIRED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_PASSWORD_EXPIRED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_PASSWORD_EXPIRED ) || \
(_Status) == STATUS_PASSWORD_EXPIRED || \ (_Status) == STATUS_PASSWORD_EXPIRED || \
(_Status) == HRESULT_FROM_NT( STATUS_PASSWORD_EXPIRED ) || \ (_Status) == HRESULT_FROM_NT( STATUS_PASSWORD_EXPIRED ) || \
(_Status) == ERROR_PASSWORD_MUST_CHANGE || \ (_Status) == ERROR_PASSWORD_MUST_CHANGE || \
(_Status) == HRESULT_FROM_WIN32( ERROR_PASSWORD_MUST_CHANGE ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_PASSWORD_MUST_CHANGE ) || \
(_Status) == STATUS_PASSWORD_MUST_CHANGE || \ (_Status) == STATUS_PASSWORD_MUST_CHANGE || \
(_Status) == HRESULT_FROM_NT( STATUS_PASSWORD_MUST_CHANGE ) || \ (_Status) == HRESULT_FROM_NT( STATUS_PASSWORD_MUST_CHANGE ) || \
(_Status) == NERR_PasswordExpired || \ (_Status) == NERR_PasswordExpired || \
(_Status) == HRESULT_FROM_WIN32( NERR_PasswordExpired ) \ (_Status) == __HRESULT_FROM_WIN32( NERR_PasswordExpired ) \
) )
#define CREDUI_IS_AUTHENTICATION_ERROR( _Status ) ( \ #define CREDUI_IS_AUTHENTICATION_ERROR( _Status ) ( \
CREDUIP_IS_USER_PASSWORD_ERROR( _Status ) || \ CREDUIP_IS_USER_PASSWORD_ERROR( _Status ) || \
CREDUIP_IS_DOWNGRADE_ERROR( _Status ) || \ CREDUIP_IS_DOWNGRADE_ERROR( _Status ) || \
CREDUIP_IS_EXPIRED_ERROR( _Status ) \ CREDUIP_IS_EXPIRED_ERROR( _Status ) \
) )
#define CREDUI_NO_PROMPT_AUTHENTICATION_ERROR( _Status ) ( \ #define CREDUI_NO_PROMPT_AUTHENTICATION_ERROR( _Status ) ( \
(_Status) == ERROR_AUTHENTICATION_FIREWALL_FAILED || \ (_Status) == ERROR_AUTHENTICATION_FIREWALL_FAILED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_AUTHENTICATION_FIREWALL_FAILED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_AUTHENTICATION_FIREWALL_FAILED ) || \
(_Status) == STATUS_AUTHENTICATION_FIREWALL_FAILED || \ (_Status) == STATUS_AUTHENTICATION_FIREWALL_FAILED || \
(_Status) == HRESULT_FROM_NT( STATUS_AUTHENTICATION_FIREWALL_FAILED ) || \ (_Status) == HRESULT_FROM_NT( STATUS_AUTHENTICATION_FIREWALL_FAILED ) || \
(_Status) == ERROR_ACCOUNT_DISABLED || \ (_Status) == ERROR_ACCOUNT_DISABLED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_ACCOUNT_DISABLED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_ACCOUNT_DISABLED ) || \
(_Status) == STATUS_ACCOUNT_DISABLED || \ (_Status) == STATUS_ACCOUNT_DISABLED || \
(_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_DISABLED ) || \ (_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_DISABLED ) || \
(_Status) == ERROR_ACCOUNT_RESTRICTION || \ (_Status) == ERROR_ACCOUNT_RESTRICTION || \
(_Status) == HRESULT_FROM_WIN32( ERROR_ACCOUNT_RESTRICTION ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_ACCOUNT_RESTRICTION ) || \
(_Status) == STATUS_ACCOUNT_RESTRICTION || \ (_Status) == STATUS_ACCOUNT_RESTRICTION || \
(_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_RESTRICTION ) || \ (_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_RESTRICTION ) || \
(_Status) == ERROR_ACCOUNT_LOCKED_OUT || \ (_Status) == ERROR_ACCOUNT_LOCKED_OUT || \
(_Status) == HRESULT_FROM_WIN32( ERROR_ACCOUNT_LOCKED_OUT ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_ACCOUNT_LOCKED_OUT ) || \
(_Status) == STATUS_ACCOUNT_LOCKED_OUT || \ (_Status) == STATUS_ACCOUNT_LOCKED_OUT || \
(_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_LOCKED_OUT ) || \ (_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_LOCKED_OUT ) || \
(_Status) == ERROR_ACCOUNT_EXPIRED || \ (_Status) == ERROR_ACCOUNT_EXPIRED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_ACCOUNT_EXPIRED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_ACCOUNT_EXPIRED ) || \
(_Status) == STATUS_ACCOUNT_EXPIRED || \ (_Status) == STATUS_ACCOUNT_EXPIRED || \
(_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_EXPIRED ) || \ (_Status) == HRESULT_FROM_NT( STATUS_ACCOUNT_EXPIRED ) || \
(_Status) == ERROR_LOGON_TYPE_NOT_GRANTED || \ (_Status) == ERROR_LOGON_TYPE_NOT_GRANTED || \
(_Status) == HRESULT_FROM_WIN32( ERROR_LOGON_TYPE_NOT_GRANTED ) || \ (_Status) == __HRESULT_FROM_WIN32( ERROR_LOGON_TYPE_NOT_GRANTED ) || \
(_Status) == STATUS_LOGON_TYPE_NOT_GRANTED || \ (_Status) == STATUS_LOGON_TYPE_NOT_GRANTED || \
(_Status) == HRESULT_FROM_NT( STATUS_LOGON_TYPE_NOT_GRANTED ) \ (_Status) == HRESULT_FROM_NT( STATUS_LOGON_TYPE_NOT_GRANTED ) \
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Structures // Structures
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// Credential Attribute // Credential Attribute
skipping to change at line 224 skipping to change at line 223
// Maximum length of the UserName field. The worst case is <User>@<DnsDomain> // Maximum length of the UserName field. The worst case is <User>@<DnsDomain>
#define CRED_MAX_USERNAME_LENGTH (256+1+256) #define CRED_MAX_USERNAME_LENGTH (256+1+256)
// Maximum length of the TargetName field for CRED_TYPE_GENERIC (in characters) // Maximum length of the TargetName field for CRED_TYPE_GENERIC (in characters)
#define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767 #define CRED_MAX_GENERIC_TARGET_NAME_LENGTH 32767
// Maximum length of the TargetName field for CRED_TYPE_DOMAIN_* (in characters) // Maximum length of the TargetName field for CRED_TYPE_DOMAIN_* (in characters)
// Largest one is <DfsRoot>\<DfsShare> // Largest one is <DfsRoot>\<DfsShare>
#define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH (256+1+80) #define CRED_MAX_DOMAIN_TARGET_NAME_LENGTH (256+1+80)
// Maximum length of a target namespace
#define CRED_MAX_TARGETNAME_NAMESPACE_LENGTH (256)
// Maximum length of a target attribute
#define CRED_MAX_TARGETNAME_ATTRIBUTE_LENGTH (256)
// Maximum size of the Credential Attribute Value field (in bytes) // Maximum size of the Credential Attribute Value field (in bytes)
#define CRED_MAX_VALUE_SIZE 256 #define CRED_MAX_VALUE_SIZE (256)
// Maximum number of attributes per credential // Maximum number of attributes per credential
#define CRED_MAX_ATTRIBUTES 64 #define CRED_MAX_ATTRIBUTES 64
typedef struct _CREDENTIAL_ATTRIBUTEA { typedef struct _CREDENTIAL_ATTRIBUTEA {
LPSTR Keyword; LPSTR Keyword;
DWORD Flags; DWORD Flags;
DWORD ValueSize; DWORD ValueSize;
LPBYTE Value; LPBYTE Value;
} CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA; } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA;
skipping to change at line 267 skipping to change at line 272
#else #else
typedef CREDENTIAL_ATTRIBUTEA CREDENTIAL_ATTRIBUTE; typedef CREDENTIAL_ATTRIBUTEA CREDENTIAL_ATTRIBUTE;
typedef PCREDENTIAL_ATTRIBUTEA PCREDENTIAL_ATTRIBUTE; typedef PCREDENTIAL_ATTRIBUTEA PCREDENTIAL_ATTRIBUTE;
#endif // UNICODE #endif // UNICODE
// //
// Special values of the TargetName field // Special values of the TargetName field
// //
#define CRED_SESSION_WILDCARD_NAME_W L"*Session" #define CRED_SESSION_WILDCARD_NAME_W L"*Session"
#define CRED_SESSION_WILDCARD_NAME_A "*Session" #define CRED_SESSION_WILDCARD_NAME_A "*Session"
#define CRED_UNIVERSAL_WILDCARD_W L'*'
#define CRED_UNIVERSAL_WILDCARD_A '*'
#define CRED_SESSION_WILDCARD_NAME_LENGTH (sizeof(CRED_SESSION_WILDCARD_NAME_A)- 1) #define CRED_SESSION_WILDCARD_NAME_LENGTH (sizeof(CRED_SESSION_WILDCARD_NAME_A)- 1)
#define CRED_TARGETNAME_DOMAIN_NAMESPACE_W L"Domain"
#define CRED_TARGETNAME_DOMAIN_NAMESPACE_A "Domain"
#define CRED_TARGETNAME_DOMAIN_NAMESPACE_LENGTH (sizeof(CRED_TARGETNAME_DOMAIN_N
AMESPACE_A)-1)
#define CRED_UNIVERSAL_WILDCARD_W L'*'
#define CRED_UNIVERSAL_WILDCARD_A '*'
#define CRED_TARGETNAME_LEGACYGENERIC_NAMESPACE_W L"LegacyGeneric"
#define CRED_TARGETNAME_LEGACYGENERIC_NAMESPACE_A "LegacyGeneric"
#define CRED_TARGETNAME_LEGACYGENERIC_NAMESPACE_LENGTH (sizeof(CRED_TARGETNAME_L
EGACYGENERIC_NAMESPACE_A)-1)
#define CRED_TARGETNAME_NAMESPACE_SEPERATOR_W L':'
#define CRED_TARGETNAME_NAMESPACE_SEPERATOR_A ':'
#define CRED_TARGETNAME_ATTRIBUTE_SEPERATOR_W L'='
#define CRED_TARGETNAME_ATTRIBUTE_SEPERATOR_A '='
#define CRED_TARGETNAME_ATTRIBUTE_TARGET_W L"target"
#define CRED_TARGETNAME_ATTRIBUTE_TARGET_A "target"
#define CRED_TARGETNAME_ATTRIBUTE_TARGET_LENGTH (sizeof(CRED_TARGETNAME_ATTRIBUT
E_TARGET_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_NAME_W L"name"
#define CRED_TARGETNAME_ATTRIBUTE_NAME_A "name"
#define CRED_TARGETNAME_ATTRIBUTE_NAME_LENGTH (sizeof(CRED_TARGETNAME_ATTRIBUTE_
NAME_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_BATCH_W L"batch"
#define CRED_TARGETNAME_ATTRIBUTE_BATCH_A "batch"
#define CRED_TARGETNAME_ATTRIBUTE_BATCH_LENGTH (sizeof(CRED_TARGETNAME_ATTRIBUTE
_BATCH_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_INTERACTIVE_W L"interactive"
#define CRED_TARGETNAME_ATTRIBUTE_INTERACTIVE_A "interactive"
#define CRED_TARGETNAME_ATTRIBUTE_INTERACTIVE_LENGTH (sizeof(CRED_TARGETNAME_ATT
RIBUTE_INTERACTIVE_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_SERVICE_W L"service"
#define CRED_TARGETNAME_ATTRIBUTE_SERVICE_A "service"
#define CRED_TARGETNAME_ATTRIBUTE_SERVICE_LENGTH (sizeof(CRED_TARGETNAME_ATTRIBU
TE_SERVICE_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_NETWORK_W L"network"
#define CRED_TARGETNAME_ATTRIBUTE_NETWORK_A "network"
#define CRED_TARGETNAME_ATTRIBUTE_NETWORK_LENGTH (sizeof(CRED_TARGETNAME_ATTRIBU
TE_NETWORK_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_NETWORKCLEARTEXT_W L"networkcleartext"
#define CRED_TARGETNAME_ATTRIBUTE_NETWORKCLEARTEXT_A "networkcleartext"
#define CRED_TARGETNAME_ATTRIBUTE_NETWORKCLEARTEXT_LENGTH (sizeof(CRED_TARGETNAM
E_ATTRIBUTE_NETWORKCLEARTEXT_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_REMOTEINTERACTIVE_W L"remoteinteractive"
#define CRED_TARGETNAME_ATTRIBUTE_REMOTEINTERACTIVE_A "remoteinteractive"
#define CRED_TARGETNAME_ATTRIBUTE_REMOTEINTERACTIVE_LENGTH (sizeof(CRED_TARGETNA
ME_ATTRIBUTE_REMOTEINTERACTIVE_A)-1)
#define CRED_TARGETNAME_ATTRIBUTE_CACHEDINTERACTIVE_W L"cachedinteractive"
#define CRED_TARGETNAME_ATTRIBUTE_CACHEDINTERACTIVE_A "cachedinteractive"
#define CRED_TARGETNAME_ATTRIBUTE_CACHEDINTERACTIVE_LENGTH (sizeof(CRED_TARGETNA
ME_ATTRIBUTE_CACHEDINTERACTIVE_A)-1)
#ifdef UNICODE #ifdef UNICODE
#define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_W #define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_W
#define CRED_TARGETNAME_DOMAIN_NAMESPACE CRED_TARGETNAME_DOMAIN_NAMESPACE_W
#define CRED_UNIVERSAL_WILDCARD = CRED_UNIVERSAL_WILDCARD_W
#define CRED_TARGETNAME_NAMESPACE_SEPERATOR = CRED_TARGETNAME_NAMESPACE_SEPERATO
R_W
#define CRED_TARGETNAME_ATTRIBUTE_SEPERATOR = CRED_TARGETNAME_ATTRIBUTE_SEPERATO
R_W
#define CRED_TARGETNAME_ATTRIBUTE_NAME CRED_TARGETNAME_ATTRIBUTE_NAME_W
#define CRED_TARGETNAME_ATTRIBUTE_TARGET CRED_TARGETNAME_ATTRIBUTE_TARGET_W
#define CRED_TARGETNAME_ATTRIBUTE_BATCH CRED_TARGETNAME_ATTRIBUTE_BATCH_W
#define CRED_TARGETNAME_ATTRIBUTE_INTERACTIVE CRED_TARGETNAME_ATTRIBUTE_INTERACT
IVE_W
#define CRED_TARGETNAME_ATTRIBUTE_SERVICE CRED_TARGETNAME_ATTRIBUTE_SERVICE_W
#define CRED_TARGETNAME_ATTRIBUTE_NETWORK CRED_TARGETNAME_ATTRIBUTE_NETWORK_W
#define CRED_TARGETNAME_ATTRIBUTE_NETWORKCLEARTEXT CRED_TARGETNAME_ATTRIBUTE_NET
WORKCLEARTEXT_W
#define CRED_TARGETNAME_ATTRIBUTE_REMOTEINTERACTIVE CRED_TARGETNAME_ATTRIBUTE_RE
MOTEINTERACTIVE_W
#define CRED_TARGETNAME_ATTRIBUTE_CACHEDINTERACTIVE CRED_TARGETNAME_ATTRIBUTE_CA
CHEDINTERACTIVE_W
#else #else
#define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_A #define CRED_SESSION_WILDCARD_NAME CRED_SESSION_WILDCARD_NAME_A
#define CRED_TARGETNAME_DOMAIN_NAMESPACE CRED_TARGETNAME_DOMAIN_NAMESPACE_A
#define CRED_UNIVERSAL_WILDCARD = CRED_UNIVERSAL_WILDCARD_A
#define CRED_TARGETNAME_NAMESPACE_SEPERATOR = CRED_TARGETNAME_NAMESPACE_SEPERATO
R_A
#define CRED_TARGETNAME_ATTRIBUTE_SEPERATOR = CRED_TARGETNAME_ATTRIBUTE_SEPERATO
R_A
#define CRED_TARGETNAME_ATTRIBUTE_NAME CRED_TARGETNAME_ATTRIBUTE_NAME_A
#define CRED_TARGETNAME_ATTRIBUTE_TARGET CRED_TARGETNAME_ATTRIBUTE_TARGET_A
#define CRED_TARGETNAME_ATTRIBUTE_BATCH CRED_TARGETNAME_ATTRIBUTE_BATCH_A
#define CRED_TARGETNAME_ATTRIBUTE_INTERACTIVE CRED_TARGETNAME_ATTRIBUTE_INTERACT
IVE_A
#define CRED_TARGETNAME_ATTRIBUTE_SERVICE CRED_TARGETNAME_ATTRIBUTE_SERVICE_A
#define CRED_TARGETNAME_ATTRIBUTE_NETWORK CRED_TARGETNAME_ATTRIBUTE_NETWORK_A
#define CRED_TARGETNAME_ATTRIBUTE_NETWORKCLEARTEXT CRED_TARGETNAME_ATTRIBUTE_NET
WORKCLEARTEXT_A
#define CRED_TARGETNAME_ATTRIBUTE_REMOTEINTERACTIVE CRED_TARGETNAME_ATTRIBUTE_RE
MOTEINTERACTIVE_A
#define CRED_TARGETNAME_ATTRIBUTE_CACHEDINTERACTIVE CRED_TARGETNAME_ATTRIBUTE_CA
CHEDINTERACTIVE_A
#endif // UNICODE #endif // UNICODE
// //
// Add\Extract Logon type from flags
//
#define CRED_LOGON_TYPES_MASK 0xF000 // Mask to get logon types
#define CredAppendLogonTypeToFlags(Flags, LogonType) (Flags) |= ((LogonType
) << 12)
#define CredGetLogonTypeFromFlags(Flags) ((SECURITY_LOGON_TYPE)
(((Flags) & CRED_LOGON_TYPES_MASK) >> 12))
#define CredRemoveLogonTypeFromFlags(Flags) (Flags) &= ~CRED_LOGON
_TYPES_MASK
//
// Values of the Credential Flags field. // Values of the Credential Flags field.
// //
#define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001 #define CRED_FLAGS_PASSWORD_FOR_CERT 0x0001
#define CRED_FLAGS_PROMPT_NOW 0x0002 #define CRED_FLAGS_PROMPT_NOW 0x0002
#define CRED_FLAGS_USERNAME_TARGET 0x0004 #define CRED_FLAGS_USERNAME_TARGET 0x0004
#define CRED_FLAGS_OWF_CRED_BLOB 0x0008 #define CRED_FLAGS_OWF_CRED_BLOB 0x0008
#define CRED_FLAGS_VALID_FLAGS 0x000F // Mask of all valid flags #define CRED_FLAGS_REQUIRE_CONFIRMATION 0x0010
#define CRED_FLAGS_VALID_FLAGS 0xF01F // Mask of all valid flags
// //
// Values of the Credential Type field. // Values of the Credential Type field.
// //
#define CRED_TYPE_GENERIC 1 #define CRED_TYPE_GENERIC 1
#define CRED_TYPE_DOMAIN_PASSWORD 2 #define CRED_TYPE_DOMAIN_PASSWORD 2
#define CRED_TYPE_DOMAIN_CERTIFICATE 3 #define CRED_TYPE_DOMAIN_CERTIFICATE 3
#define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4
#define CRED_TYPE_MAXIMUM 5 // Maximum supported cred type #define CRED_TYPE_GENERIC_CERTIFICATE 5
#define CRED_TYPE_MAXIMUM 6 // Maximum supported cred type
#define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000) // Allow new application s to run on old OSes #define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000) // Allow new application s to run on old OSes
// //
// Maximum size of the CredBlob field (in bytes) // Maximum size of the CredBlob field (in bytes)
// //
#define CRED_MAX_CREDENTIAL_BLOB_SIZE 512 #define CRED_MAX_CREDENTIAL_BLOB_SIZE 512
// //
// Values of the Credential Persist field // Values of the Credential Persist field
// //
skipping to change at line 317 skipping to change at line 401
// //
// 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;
LPBYTE CredentialBlob; __field_bcount(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;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[string] wchar_t *TargetName; [string,max_is(CRED_MAX_GENERIC_TARGET_NAME_LENGTH-1)] wchar_t *TargetName;
#else // MIDL_PASS #else // MIDL_PASS
LPWSTR TargetName; LPWSTR TargetName;
#endif // MIDL_PASS #endif // MIDL_PASS
#ifdef MIDL_PASS #ifdef MIDL_PASS
[string] wchar_t *Comment; [string,max_is(CRED_MAX_STRING_LENGTH-1)] wchar_t *Comment;
#else // MIDL_PASS #else // MIDL_PASS
LPWSTR Comment; LPWSTR Comment;
#endif // MIDL_PASS #endif // MIDL_PASS
FILETIME LastWritten; FILETIME LastWritten;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0,CRED_MAX_CREDENTIAL_BLOB_SIZE)] [range(0,CRED_MAX_CREDENTIAL_BLOB_SIZE)]
#endif // MIDL_PASS #endif // MIDL_PASS
DWORD CredentialBlobSize; DWORD CredentialBlobSize;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[size_is(CredentialBlobSize)] [size_is(CredentialBlobSize)]
skipping to change at line 357 skipping to change at line 441
DWORD Persist; DWORD Persist;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0,CRED_MAX_ATTRIBUTES)] [range(0,CRED_MAX_ATTRIBUTES)]
#endif // MIDL_PASS #endif // MIDL_PASS
DWORD AttributeCount; DWORD AttributeCount;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[size_is(AttributeCount)] [size_is(AttributeCount)]
#endif // MIDL_PASS #endif // MIDL_PASS
PCREDENTIAL_ATTRIBUTEW Attributes; PCREDENTIAL_ATTRIBUTEW Attributes;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[string] wchar_t *TargetAlias; [string,max_is(CRED_MAX_STRING_LENGTH-1)] wchar_t *TargetAlias;
#else // MIDL_PASS #else // MIDL_PASS
LPWSTR TargetAlias; LPWSTR TargetAlias;
#endif // MIDL_PASS #endif // MIDL_PASS
#ifdef MIDL_PASS #ifdef MIDL_PASS
[string] wchar_t *UserName; [string,max_is(CRED_MAX_USERNAME_LENGTH-1)] wchar_t *UserName;
#else // MIDL_PASS #else // MIDL_PASS
LPWSTR UserName; LPWSTR UserName;
#endif // MIDL_PASS #endif // MIDL_PASS
} CREDENTIALW, *PCREDENTIALW; } CREDENTIALW, *PCREDENTIALW;
#ifdef UNICODE #ifdef UNICODE
typedef CREDENTIALW CREDENTIAL; typedef CREDENTIALW CREDENTIAL;
typedef PCREDENTIALW PCREDENTIAL; typedef PCREDENTIALW PCREDENTIAL;
#else #else
typedef CREDENTIALA CREDENTIAL; typedef CREDENTIALA CREDENTIAL;
skipping to change at line 386 skipping to change at line 470
// //
// Value of the Flags field in CREDENTIAL_TARGET_INFORMATION // Value of the Flags field in CREDENTIAL_TARGET_INFORMATION
// //
#define CRED_TI_SERVER_FORMAT_UNKNOWN 0x0001 // Don't know if server name is DNS or netbios format #define CRED_TI_SERVER_FORMAT_UNKNOWN 0x0001 // Don't know if server name is DNS or netbios format
#define CRED_TI_DOMAIN_FORMAT_UNKNOWN 0x0002 // Don't know if domain name is DNS or netbios format #define CRED_TI_DOMAIN_FORMAT_UNKNOWN 0x0002 // Don't know if domain name is DNS or netbios format
#define CRED_TI_ONLY_PASSWORD_REQUIRED 0x0004 // Server only requires a passwo rd and not a username #define CRED_TI_ONLY_PASSWORD_REQUIRED 0x0004 // Server only requires a passwo rd and not a username
#define CRED_TI_USERNAME_TARGET 0x0008 // TargetName is username #define CRED_TI_USERNAME_TARGET 0x0008 // TargetName is username
#define CRED_TI_CREATE_EXPLICIT_CRED 0x0010 // When creating a cred, create one named TargetInfo->TargetName #define CRED_TI_CREATE_EXPLICIT_CRED 0x0010 // When creating a cred, create one named TargetInfo->TargetName
#define CRED_TI_WORKGROUP_MEMBER 0x0020 // Indicates the machine is a me mber of a workgroup #define CRED_TI_WORKGROUP_MEMBER 0x0020 // Indicates the machine is a me mber of a workgroup
#define CRED_TI_VALID_FLAGS 0x003F #define CRED_TI_VALID_FLAGS 0xF07F
// //
// A credential target // A credential target
// //
typedef struct _CREDENTIAL_TARGET_INFORMATIONA { typedef struct _CREDENTIAL_TARGET_INFORMATIONA {
LPSTR TargetName; LPSTR TargetName;
LPSTR NetbiosServerName; LPSTR NetbiosServerName;
LPSTR DnsServerName; LPSTR DnsServerName;
LPSTR NetbiosDomainName; LPSTR NetbiosDomainName;
LPSTR DnsDomainName; LPSTR DnsDomainName;
LPSTR DnsTreeName; LPSTR DnsTreeName;
LPSTR PackageName; LPSTR PackageName;
ULONG Flags; ULONG Flags;
DWORD CredTypeCount; DWORD CredTypeCount;
LPDWORD CredTypes; LPDWORD CredTypes;
} CREDENTIAL_TARGET_INFORMATIONA, *PCREDENTIAL_TARGET_INFORMATIONA; } CREDENTIAL_TARGET_INFORMATIONA, *PCREDENTIAL_TARGET_INFORMATIONA;
typedef struct _CREDENTIAL_TARGET_INFORMATIONW { typedef struct _CREDENTIAL_TARGET_INFORMATIONW {
#ifdef MIDL_PASS #ifdef MIDL_PASS
[string] wchar_t *TargetName; [string,max_is(CRED_MAX_DOMAIN_TARGET_NAME_LENGTH-1)] wchar_t *TargetName;
[string] wchar_t *NetbiosServerName; [string,max_is(CRED_MAX_DOMAIN_TARGET_NAME_LENGTH-1)] wchar_t *NetbiosServer
[string] wchar_t *DnsServerName; Name;
[string] wchar_t *NetbiosDomainName; [string,max_is(CRED_MAX_DOMAIN_TARGET_NAME_LENGTH-1)] wchar_t *DnsServerName
[string] wchar_t *DnsDomainName; ;
[string] wchar_t *DnsTreeName; [string,max_is(CRED_MAX_DOMAIN_TARGET_NAME_LENGTH-1)] wchar_t *NetbiosDomain
[string] wchar_t *PackageName; Name;
[string,max_is(CRED_MAX_DOMAIN_TARGET_NAME_LENGTH-1)] wchar_t *DnsDomainName
;
[string,max_is(CRED_MAX_DOMAIN_TARGET_NAME_LENGTH-1)] wchar_t *DnsTreeName;
[string,max_is(CRED_MAX_STRING_LENGTH-1)] wchar_t *PackageName;
#else // MIDL_PASS #else // MIDL_PASS
LPWSTR TargetName; LPWSTR TargetName;
LPWSTR NetbiosServerName; LPWSTR NetbiosServerName;
LPWSTR DnsServerName; LPWSTR DnsServerName;
LPWSTR NetbiosDomainName; LPWSTR NetbiosDomainName;
LPWSTR DnsDomainName; LPWSTR DnsDomainName;
LPWSTR DnsTreeName; LPWSTR DnsTreeName;
LPWSTR PackageName; LPWSTR PackageName;
#endif // MIDL_PASS #endif // MIDL_PASS
ULONG Flags; ULONG Flags;
skipping to change at line 468 skipping to change at line 552
// //
// This credential can be pass to LsaLogonUser to ask it to find a credential wi th a // This credential can be pass to LsaLogonUser to ask it to find a credential wi th a
// TargetName of UserName. // TargetName of UserName.
// //
typedef struct _USERNAME_TARGET_CREDENTIAL_INFO { typedef struct _USERNAME_TARGET_CREDENTIAL_INFO {
LPWSTR UserName; LPWSTR UserName;
} USERNAME_TARGET_CREDENTIAL_INFO, *PUSERNAME_TARGET_CREDENTIAL_INFO; } USERNAME_TARGET_CREDENTIAL_INFO, *PUSERNAME_TARGET_CREDENTIAL_INFO;
// //
// Marshaled credential blob information.
//
typedef struct _BINARY_BLOB_CREDENTIAL_INFO {
ULONG cbBlob;
LPBYTE pbBlob;
} BINARY_BLOB_CREDENTIAL_INFO, *PBINARY_BLOB_CREDENTIAL_INFO;
//
// Credential type for credential marshaling routines // Credential type for credential marshaling routines
// //
typedef enum _CRED_MARSHAL_TYPE { typedef enum _CRED_MARSHAL_TYPE {
CertCredential = 1, CertCredential = 1,
UsernameTargetCredential UsernameTargetCredential,
BinaryBlobCredential
} CRED_MARSHAL_TYPE, *PCRED_MARSHAL_TYPE; } CRED_MARSHAL_TYPE, *PCRED_MARSHAL_TYPE;
// //
// Protection type for credential providers secret protection routines
//
typedef enum _CRED_PROTECTION_TYPE {
CredUnprotected,
CredUserProtection,
CredTrustedProtection
} CRED_PROTECTION_TYPE, *PCRED_PROTECTION_TYPE;
//
// Values for authentication buffers packing
//
#define CRED_PACK_PROTECTED_CREDENTIALS 0x1
#define CRED_PACK_WOW_BUFFER 0x2
#define CRED_PACK_GENERIC_CREDENTIALS 0x4
//
// Credential UI info // Credential UI info
// //
typedef struct _CREDUI_INFOA typedef struct _CREDUI_INFOA
{ {
DWORD cbSize; DWORD cbSize;
HWND hwndParent; HWND hwndParent;
PCSTR pszMessageText; PCSTR pszMessageText;
PCSTR pszCaptionText; PCSTR pszCaptionText;
HBITMAP hbmBanner; HBITMAP hbmBanner;
skipping to change at line 561 skipping to change at line 672
CREDUI_FLAGS_ALWAYS_SHOW_UI | \ CREDUI_FLAGS_ALWAYS_SHOW_UI | \
CREDUI_FLAGS_REQUIRE_SMARTCARD | \ CREDUI_FLAGS_REQUIRE_SMARTCARD | \
CREDUI_FLAGS_PASSWORD_ONLY_OK | \ CREDUI_FLAGS_PASSWORD_ONLY_OK | \
CREDUI_FLAGS_VALIDATE_USERNAME | \ CREDUI_FLAGS_VALIDATE_USERNAME | \
CREDUI_FLAGS_COMPLETE_USERNAME | \ CREDUI_FLAGS_COMPLETE_USERNAME | \
CREDUI_FLAGS_PERSIST | \ CREDUI_FLAGS_PERSIST | \
CREDUI_FLAGS_SERVER_CREDENTIAL | \ CREDUI_FLAGS_SERVER_CREDENTIAL | \
CREDUI_FLAGS_EXPECT_CONFIRMATION | \ CREDUI_FLAGS_EXPECT_CONFIRMATION | \
CREDUI_FLAGS_GENERIC_CREDENTIALS | \ CREDUI_FLAGS_GENERIC_CREDENTIALS | \
CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS | \ CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS | \
CREDUI_FLAGS_KEEP_USERNAME ) CREDUI_FLAGS_KEEP_USERNAME )
//
// Flags for CredUIPromptForWindowsCredentials and CPUS_CREDUI Usage Scenarios
//
#define CREDUIWIN_GENERIC 0x00000001 // Plain text username/p
assword is being requested
#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_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_CURRENT_USER 0x00000200 // Only the incoming cre
d for the specific auth package should be enumerated
#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 ( \
CREDUIWIN_GENERIC | \
CREDUIWIN_CHECKBOX | \
CREDUIWIN_AUTHPACKAGE_ONLY | \
CREDUIWIN_IN_CRED_ONLY | \
CREDUIWIN_ENUMERATE_ADMINS | \
CREDUIWIN_ENUMERATE_CURRENT_USER | \
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
skipping to change at line 621 skipping to change at line 753
__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
//
#define CRED_ENUMERATE_ALL_CREDENTIALS 0x1
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredEnumerateW ( CredEnumerateW (
__in LPCWSTR Filter, __in_opt LPCWSTR Filter,
__reserved DWORD Flags, __reserved DWORD Flags,
__out DWORD *Count, __out DWORD *Count,
__deref_out_ecount(*Count) PCREDENTIALW **Credential __deref_out_ecount(*Count) PCREDENTIALW **Credential
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredEnumerateA ( CredEnumerateA (
__in LPCSTR Filter, __in_opt LPCSTR Filter,
__reserved DWORD Flags, __reserved DWORD Flags,
__out DWORD *Count, __out DWORD *Count,
__deref_out_ecount(*Count) PCREDENTIALA **Credential __deref_out_ecount(*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
skipping to change at line 851 skipping to change at line 989
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
BOOL
WINAPI
CredUnPackAuthenticationBufferW(
__in DWORD dwFlags,
__in_bcount(cbAuthBuffer) PVOID pAuthBuffer,
__in DWORD cbAuthBuffer,
__out_ecount_opt(*pcchMaxUserName) LPWSTR pszUserName,
__inout DWORD* pcchMaxUserName,
__out_ecount_opt(*pcchMaxDomainName) LPWSTR pszDomainName,
__inout_opt DWORD* pcchMaxDomainName,
__out_ecount_opt(*pcchMaxPassword) LPWSTR pszPassword,
__inout DWORD* pcchMaxPassword
);
CREDUIAPI
BOOL
WINAPI
CredUnPackAuthenticationBufferA(
__in DWORD dwFlags,
__in_bcount(cbAuthBuffer) PVOID pAuthBuffer,
__in DWORD cbAuthBuffer,
__out_ecount_opt(*pcchMaxUserName) LPSTR pszUserName,
__inout DWORD* pcchlMaxUserName,
__out_ecount_opt(*pcchMaxDomainName) LPSTR pszDomainName,
__inout_opt DWORD* pcchMaxDomainName,
__out_ecount_opt(*pcchMaxPassword) LPSTR pszPassword,
__inout DWORD* pcchMaxPassword
);
#ifdef UNICODE
#define CredUnPackAuthenticationBuffer CredUnPackAuthenticationBufferW
#else
#define CredUnPackAuthenticationBuffer CredUnPackAuthenticationBufferA
#endif //UNICODE
CREDUIAPI
BOOL
WINAPI
CredPackAuthenticationBufferW(
__in DWORD dwFlags,
__in LPWSTR pszUserName,
__in LPWSTR pszPassword,
__out_bcount_opt(*pcbPackedCredentials) PBYTE pPackedCredentials,
__inout DWORD* pcbPackedCredentials
);
CREDUIAPI
BOOL
WINAPI
CredPackAuthenticationBufferA(
__in DWORD dwFlags,
__in LPSTR pszUserName,
__in LPSTR pszPassword,
__out_bcount_opt(*pcbPackedCredentials) PBYTE pPackedCredentials,
__inout DWORD* pcbPackedCredentials
);
#ifdef UNICODE
#define CredPackAuthenticationBuffer CredPackAuthenticationBufferW
#else
#define CredPackAuthenticationBuffer CredPackAuthenticationBufferA
#endif //UNICODE
WINADVAPI
BOOL
WINAPI
CredProtectW(
__in BOOL fAsSelf,
__in_ecount(cchCredentials) LPWSTR pszCredentials,
__in DWORD cchCredentials,
__out_ecount(*pcchMaxChars) LPWSTR pszProtectedCredentials,
__inout DWORD* pcchMaxChars,
__out_opt CRED_PROTECTION_TYPE* ProtectionType
);
WINADVAPI
BOOL
WINAPI
CredProtectA(
__in BOOL fAsSelf,
__in_ecount(cchCredentials) LPSTR pszCredentials,
__in DWORD cchCredentials,
__out_ecount(*pcchMaxChars) LPSTR pszProtectedCredentials,
__inout DWORD* pcchMaxChars,
__out_opt CRED_PROTECTION_TYPE* ProtectionType
);
#ifdef UNICODE
#define CredProtect CredProtectW
#else
#define CredProtect CredProtectA
#endif //UNICODE
WINADVAPI
BOOL
WINAPI
CredUnprotectW(
__in BOOL fAsSelf,
__in_ecount(cchProtectedCredentials) LPWSTR pszProtectedCredentials,
__in DWORD cchProtectedCredentials,
__out_ecount(*pcchMaxChars) LPWSTR pszCredentials,
__inout DWORD* pcchMaxChars
);
WINADVAPI
BOOL
WINAPI
CredUnprotectA(
__in BOOL fAsSelf,
__in_ecount(cchProtectedCredentials) LPSTR pszProtectedCredentials,
__in DWORD cchProtectedCredentials,
__out_ecount(*pcchMaxChars) LPSTR pszCredentials,
__inout DWORD* pcchMaxChars
);
#ifdef UNICODE
#define CredUnprotect CredUnprotectW
#else
#define CredUnprotect CredUnprotectA
#endif //UNICODE
WINADVAPI
BOOL
WINAPI
CredIsProtectedW(
__in LPWSTR pszProtectedCredentials,
__out CRED_PROTECTION_TYPE* pProtectionType
);
WINADVAPI
BOOL
WINAPI
CredIsProtectedA(
__in LPSTR pszProtectedCredentials,
__out CRED_PROTECTION_TYPE* pProtectionType
);
#ifdef UNICODE
#define CredIsProtected CredIsProtectedW
#else
#define CredIsProtected CredIsProtectedA
#endif //UNICODE
WINADVAPI
BOOL
WINAPI
CredFindBestCredentialW (
IN LPCWSTR TargetName,
IN DWORD Type,
IN DWORD Flags,
OUT PCREDENTIALW *Credential
);
WINADVAPI
BOOL
WINAPI
CredFindBestCredentialA (
IN LPCSTR TargetName,
IN DWORD Type,
IN DWORD Flags,
OUT PCREDENTIALA *Credential
);
#ifdef UNICODE
#define CredFindBestCredential CredFindBestCredentialW
#else
#define CredFindBestCredential CredFindBestCredentialA
#endif // UNICODE
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CredGetSessionTypes ( CredGetSessionTypes (
__in DWORD MaximumPersistCount, __in DWORD MaximumPersistCount,
__out LPDWORD MaximumPersist __out LPDWORD MaximumPersist
); );
WINADVAPI WINADVAPI
VOID VOID
skipping to change at line 874 skipping to change at line 1182
); );
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,
__out_ecount(ulUserNameBufferSize) PWSTR pszUserName, __inout_ecount(ulUserNameBufferSize) PWSTR pszUserName,
__in ULONG ulUserNameBufferSize, __in ULONG ulUserNameBufferSize,
__out_ecount(ulPasswordBufferSize) PWSTR pszPassword, __inout_ecount(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,
__out_ecount(ulUserNameBufferSize) PSTR pszUserName, __inout_ecount(ulUserNameBufferSize) PSTR pszUserName,
__in ULONG ulUserNameBufferSize, __in ULONG ulUserNameBufferSize,
__out_ecount(ulPasswordBufferSize) PSTR pszPassword, __inout_ecount(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(
__in_opt PCREDUI_INFOW pUiInfo,
__in DWORD dwAuthError,
__inout ULONG *pulAuthPackage,
__in_bcount_opt(ulInAuthBufferSize) LPCVOID pvInAuthBuffer,
__in ULONG ulInAuthBufferSize,
__deref_out_bcount_full(*pulOutAuthBufferSize) LPVOID * ppvOutAuthBuffer,
__out ULONG * pulOutAuthBufferSize,
__inout_opt BOOL *pfSave,
__in DWORD dwFlags
);
CREDUIAPI
DWORD
WINAPI
CredUIPromptForWindowsCredentialsA(
__in_opt PCREDUI_INFOA pUiInfo,
__in DWORD dwAuthError,
__inout ULONG *pulAuthPackage,
__in_bcount_opt(ulInAuthBufferSize) LPCVOID pvInAuthBuffer,
__in ULONG ulInAuthBufferSize,
__deref_out_bcount_full(*pulOutAuthBufferSize) LPVOID * ppvOutAuthBuffer,
__out ULONG * pulOutAuthBufferSize,
__inout_opt BOOL *pfSave,
__in DWORD dwFlags
);
#ifdef UNICODE
#define CredUIPromptForWindowsCredentials CredUIPromptForWindowsCredentialsW
#else
#define CredUIPromptForWindowsCredentials CredUIPromptForWindowsCredentialsA
#endif
CREDUIAPI
DWORD
WINAPI
CredUIParseUserNameW( CredUIParseUserNameW(
__in CONST WCHAR *UserName, __in CONST WCHAR *UserName,
__out_ecount(userBufferSize) WCHAR *user, __out_ecount(userBufferSize) WCHAR *user,
__in ULONG userBufferSize, __in ULONG userBufferSize,
__out_ecount(domainBufferSize) WCHAR *domain, __out_ecount(domainBufferSize) WCHAR *domain,
__in ULONG domainBufferSize __in ULONG domainBufferSize
); );
CREDUIAPI CREDUIAPI
DWORD DWORD
skipping to change at line 939 skipping to change at line 1283
#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,
__out_ecount(ulUserBufferSize) PWSTR UserName, __inout_ecount(ulUserBufferSize) PWSTR UserName,
__in ULONG ulUserBufferSize, __in ULONG ulUserBufferSize,
__out_ecount(ulPasswordBufferSize) PWSTR pszPassword, __inout_ecount(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,
__out_ecount(ulUserBufferSize) PSTR UserName, __inout_ecount(ulUserBufferSize) PSTR UserName,
__in ULONG ulUserBufferSize, __in ULONG ulUserBufferSize,
__out_ecount(ulPasswordBufferSize) PSTR pszPassword, __inout_ecount(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
 End of changes. 51 change blocks. 
46 lines changed or deleted 428 lines changed or added


 wincrypt.h (5.2.3790.3959-Windows 5.0)   wincrypt.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 15 skipping to change at line 15
// //
// File: wincrypt.h // File: wincrypt.h
// //
// Contents: Cryptographic API Prototypes and Definitions // Contents: Cryptographic API Prototypes and Definitions
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#ifndef __WINCRYPT_H__ #ifndef __WINCRYPT_H__
#define __WINCRYPT_H__ #define __WINCRYPT_H__
#include <specstrings.h> /* for SAL annotations */
#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(push) #pragma warning(push)
#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)
skipping to change at line 36 skipping to change at line 38
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _HRESULT_DEFINED #ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED #define _HRESULT_DEFINED
typedef LONG HRESULT; typedef __success(return >= 0) long HRESULT;
#endif
#endif // !_HRESULT_DEFINED
#ifndef WINADVAPI #ifndef WINADVAPI
#define WINADVAPI #define WINADVAPI
#endif #endif
#ifndef WINAPI #ifndef WINAPI
#define WINAPI __stdcall #define WINAPI __stdcall
#endif #endif
#ifndef CALLBACK #ifndef CALLBACK
skipping to change at line 72 skipping to change at line 73
#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 !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
#else
#if !defined(_CRYPT32_)
#define WINCRYPT32API DECLSPEC_IMPORT
#else
#define WINCRYPT32API
#endif
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if !defined(WINCRYPT32STRINGAPI)
#if !defined(_CRYPT32STRING_) #if !defined(_CRYPT32STRING_)
# define WINCRYPT32STRINGAPI WINCRYPT32API #define WINCRYPT32STRINGAPI WINCRYPT32API
#else #else
# define WINCRYPT32STRINGAPI #define WINCRYPT32STRINGAPI
#endif
#endif #endif
// //
// Algorithm IDs and Flags // Algorithm IDs and Flags
// //
// ALG_ID crackers // ALG_ID crackers
#define GET_ALG_CLASS(x) (x & (7 << 13)) #define GET_ALG_CLASS(x) (x & (7 << 13))
#define GET_ALG_TYPE(x) (x & (15 << 9)) #define GET_ALG_TYPE(x) (x & (15 << 9))
#define GET_ALG_SID(x) (x & (511)) #define GET_ALG_SID(x) (x & (511))
// Algorithm classes // Algorithm classes
// certenrolld_begin -- ALG_CLASS_*
#define ALG_CLASS_ANY (0) #define ALG_CLASS_ANY (0)
#define ALG_CLASS_SIGNATURE (1 << 13) #define ALG_CLASS_SIGNATURE (1 << 13)
#define ALG_CLASS_MSG_ENCRYPT (2 << 13) #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
#define ALG_CLASS_DATA_ENCRYPT (3 << 13) #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
#define ALG_CLASS_HASH (4 << 13) #define ALG_CLASS_HASH (4 << 13)
#define ALG_CLASS_KEY_EXCHANGE (5 << 13) #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
#define ALG_CLASS_ALL (7 << 13) #define ALG_CLASS_ALL (7 << 13)
// certenrolld_end
// Algorithm types // Algorithm types
#define ALG_TYPE_ANY (0) #define ALG_TYPE_ANY (0)
#define ALG_TYPE_DSS (1 << 9) #define ALG_TYPE_DSS (1 << 9)
#define ALG_TYPE_RSA (2 << 9) #define ALG_TYPE_RSA (2 << 9)
#define ALG_TYPE_BLOCK (3 << 9) #define ALG_TYPE_BLOCK (3 << 9)
#define ALG_TYPE_STREAM (4 << 9) #define ALG_TYPE_STREAM (4 << 9)
#define ALG_TYPE_DH (5 << 9) #define ALG_TYPE_DH (5 << 9)
#define ALG_TYPE_SECURECHANNEL (6 << 9) #define ALG_TYPE_SECURECHANNEL (6 << 9)
skipping to change at line 126 skipping to change at line 145
#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)
#define ALG_SID_ECDSA 3
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
// 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
#define ALG_SID_3DES_112 9 #define ALG_SID_3DES_112 9
#define ALG_SID_CYLINK_MEK 12 #define ALG_SID_CYLINK_MEK 12
#define ALG_SID_RC5 13 #define ALG_SID_RC5 13
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define ALG_SID_AES_128 14 #define ALG_SID_AES_128 14
#define ALG_SID_AES_192 15 #define ALG_SID_AES_192 15
#define ALG_SID_AES_256 16 #define ALG_SID_AES_256 16
#define ALG_SID_AES 17 #define ALG_SID_AES 17
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
// Fortezza sub-ids // Fortezza sub-ids
#define ALG_SID_SKIPJACK 10 #define ALG_SID_SKIPJACK 10
#define ALG_SID_TEK 11 #define ALG_SID_TEK 11
// KP_MODE // KP_MODE
#define CRYPT_MODE_CBCI 6 // ANSI CBC Interleaved #define CRYPT_MODE_CBCI 6 // ANSI CBC Interleaved
#define CRYPT_MODE_CFBP 7 // ANSI CFB Pipelined #define CRYPT_MODE_CFBP 7 // ANSI CFB Pipelined
#define CRYPT_MODE_OFBP 8 // ANSI OFB Pipelined #define CRYPT_MODE_OFBP 8 // ANSI OFB Pipelined
#define CRYPT_MODE_CBCOFM 9 // ANSI CBC + OF Masking #define CRYPT_MODE_CBCOFM 9 // ANSI CBC + OF Masking
skipping to change at line 167 skipping to change at line 191
// 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)
#define ALG_SID_ECDH 5
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
// 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
#define ALG_SID_SSL3SHAMD5 8 #define ALG_SID_SSL3SHAMD5 8
#define ALG_SID_HMAC 9 #define ALG_SID_HMAC 9
#define ALG_SID_TLS1PRF 10 #define ALG_SID_TLS1PRF 10
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define ALG_SID_HASH_REPLACE_OWF 11 #define ALG_SID_HASH_REPLACE_OWF 11
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION >= NTDDI_WS03)
#define ALG_SID_SHA_256 12 #define ALG_SID_SHA_256 12
#define ALG_SID_SHA_384 13 #define ALG_SID_SHA_384 13
#define ALG_SID_SHA_512 14 #define ALG_SID_SHA_512 14
#endif //(NTDDI_VERSION >= NTDDI_WS03)
// 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)
// misc ECC sub ids
#define ALG_SID_ECMQV 1
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
// 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
#ifndef ALGIDDEF #ifndef ALGIDDEF
#define ALGIDDEF #define ALGIDDEF
typedef unsigned int ALG_ID; typedef unsigned int ALG_ID;
#endif #endif
// 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)
#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)
#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)
#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)
skipping to change at line 239 skipping to change at line 279
#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)
#define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF ) #define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF )
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define CALG_HASH_REPLACE_OWF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_RE PLACE_OWF) #define CALG_HASH_REPLACE_OWF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_RE PLACE_OWF)
#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)
#if (NTDDI_VERSION >= NTDDI_WS03)
#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_WS03)
#if (NTDDI_VERSION >= NTDDI_WINLH)
#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_ECDSA (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_EC
DSA)
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION < NTDDI_WINXP)
// resource number for signatures in the CSP
#define SIGNATURE_RESOURCE_NUMBER 0x29A
typedef struct _VTableProvStruc {
DWORD Version;
FARPROC FuncVerifyImage;
FARPROC FuncReturnhWnd;
DWORD dwProvType;
BYTE *pbContextInfo;
DWORD cbContextInfo;
LPSTR pszProvName;
} VTableProvStruc, *PVTableProvStruc;
#endif //(NTDDI_VERSION < NTDDI_WINXP)
// Used for certenroll.idl:
// certenrolls_begin -- HCRYPT*
typedef ULONG_PTR HCRYPTPROV; typedef ULONG_PTR HCRYPTPROV;
typedef ULONG_PTR HCRYPTKEY; typedef ULONG_PTR HCRYPTKEY;
typedef ULONG_PTR HCRYPTHASH; typedef ULONG_PTR HCRYPTHASH;
// 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)
#define CRYPT_DEFAULT_CONTAINER_OPTIONAL 0x00000080
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
// 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
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define CRYPT_ARCHIVABLE 0x00004000 #define CRYPT_ARCHIVABLE 0x00004000
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION >= NTDDI_WINLH)
#define CRYPT_FORCE_KEY_PROTECTION_HIGH 0x00008000
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#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
#define CRYPT_SSL2_FALLBACK 0x00000002 #define CRYPT_SSL2_FALLBACK 0x00000002
#define CRYPT_DESTROYKEY 0x00000004 #define CRYPT_DESTROYKEY 0x00000004
#define CRYPT_OAEP 0x00000040 // used with RSA encryptions/decrypt ions #define CRYPT_OAEP 0x00000040 // used with RSA encryptions/decrypt ions
// CryptExportKey, CryptImportKey, // CryptExportKey, CryptImportKey,
// CryptEncrypt and CryptDecrypt // CryptEncrypt and CryptDecrypt
#define CRYPT_BLOB_VER3 0x00000080 // export version 3 of a blob type #define CRYPT_BLOB_VER3 0x00000080 // export version 3 of a blob type
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define CRYPT_IPSEC_HMAC_KEY 0x00000100 // CryptImportKey only #define CRYPT_IPSEC_HMAC_KEY 0x00000100 // CryptImportKey only
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION >= NTDDI_WS03)
// dwFlags definitions for CryptDecrypt // dwFlags definitions for CryptDecrypt
// See also CRYPT_OAEP, above. // See also CRYPT_OAEP, above.
// Note, the following flag is not supported for CryptEncrypt // Note, the following flag is not supported for CryptEncrypt
#define CRYPT_DECRYPT_RSA_NO_PADDING_CHECK 0x00000020 #define CRYPT_DECRYPT_RSA_NO_PADDING_CHECK 0x00000020
#endif //(NTDDI_VERSION >= NTDDI_WS03)
// dwFlags definitions for CryptCreateHash // dwFlags definitions for CryptCreateHash
#define CRYPT_SECRETDIGEST 0x00000001 #define CRYPT_SECRETDIGEST 0x00000001
#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)
// 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
#define CRYPT_X931_FORMAT 0x00000004 #define CRYPT_X931_FORMAT 0x00000004
// 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
#define SIMPLEBLOB 0x1 #define SIMPLEBLOB 0x1
#define PUBLICKEYBLOB 0x6 #define PUBLICKEYBLOB 0x6
#define PRIVATEKEYBLOB 0x7 #define PRIVATEKEYBLOB 0x7
#define PLAINTEXTKEYBLOB 0x8 #define PLAINTEXTKEYBLOB 0x8
#define OPAQUEKEYBLOB 0x9 #define OPAQUEKEYBLOB 0x9
#define PUBLICKEYBLOBEX 0xA #define PUBLICKEYBLOBEX 0xA
#define SYMMETRICWRAPKEYBLOB 0xB #define SYMMETRICWRAPKEYBLOB 0xB
#if (NTDDI_VERSION >= NTDDI_WS03)
#define KEYSTATEBLOB 0xC #define KEYSTATEBLOB 0xC
#endif //(NTDDI_VERSION >= NTDDI_WS03)
// certenrolld_end
// certenrolld_begin -- AT_*
#define AT_KEYEXCHANGE 1 #define AT_KEYEXCHANGE 1
#define AT_SIGNATURE 2 #define AT_SIGNATURE 2
// certenrolld_end
#define CRYPT_USERDATA 1 #define CRYPT_USERDATA 1
// dwParam // dwParam
#define KP_IV 1 // Initialization vector #define KP_IV 1 // Initialization vector
#define KP_SALT 2 // Salt value #define KP_SALT 2 // Salt value
#define KP_PADDING 3 // Padding values #define KP_PADDING 3 // Padding values
#define KP_MODE 4 // Mode of the cipher #define KP_MODE 4 // Mode of the cipher
#define KP_MODE_BITS 5 // Number of bits to feedback #define KP_MODE_BITS 5 // Number of bits to feedback
#define KP_PERMISSIONS 6 // Key permissions DWORD #define KP_PERMISSIONS 6 // Key permissions DWORD
skipping to change at line 369 skipping to change at line 456
#define KP_PRECOMP_SHA 25 #define KP_PRECOMP_SHA 25
#define KP_CERTIFICATE 26 // for setting Secure Channel certificat e data (PCT1) #define KP_CERTIFICATE 26 // for setting Secure Channel certificat e data (PCT1)
#define KP_CLEAR_KEY 27 // for setting Secure Channel clear key data (PCT1) #define KP_CLEAR_KEY 27 // for setting Secure Channel clear key data (PCT1)
#define KP_PUB_EX_LEN 28 #define KP_PUB_EX_LEN 28
#define KP_PUB_EX_VAL 29 #define KP_PUB_EX_VAL 29
#define KP_KEYVAL 30 #define KP_KEYVAL 30
#define KP_ADMIN_PIN 31 #define KP_ADMIN_PIN 31
#define KP_KEYEXCHANGE_PIN 32 #define KP_KEYEXCHANGE_PIN 32
#define KP_SIGNATURE_PIN 33 #define KP_SIGNATURE_PIN 33
#define KP_PREHASH 34 #define KP_PREHASH 34
#if (NTDDI_VERSION >= NTDDI_WS03)
#define KP_ROUNDS 35 #define KP_ROUNDS 35
#endif //(NTDDI_VERSION >= NTDDI_WS03)
#define KP_OAEP_PARAMS 36 // for setting OAEP params on RSA keys #define KP_OAEP_PARAMS 36 // for setting OAEP params on RSA keys
#define KP_CMS_KEY_INFO 37 #define KP_CMS_KEY_INFO 37
#define KP_CMS_DH_KEY_INFO 38 #define KP_CMS_DH_KEY_INFO 38
#define KP_PUB_PARAMS 39 // for setting public parameters #define KP_PUB_PARAMS 39 // for setting public parameters
#define KP_VERIFY_PARAMS 40 // for verifying DSA and DH parameters #define KP_VERIFY_PARAMS 40 // for verifying DSA and DH parameters
#define KP_HIGHEST_VERSION 41 // for TLS protocol version setting #define KP_HIGHEST_VERSION 41 // for TLS protocol version setting
#if (NTDDI_VERSION >= NTDDI_WS03)
#define KP_GET_USE_COUNT 42 // for use with PP_CRYPT_COUNT_KEY_USE c ontexts #define KP_GET_USE_COUNT 42 // for use with PP_CRYPT_COUNT_KEY_USE c ontexts
#endif //(NTDDI_VERSION >= NTDDI_WS03)
// KP_PADDING // KP_PADDING
#define PKCS5_PADDING 1 // PKCS 5 (sec 6.2) padding method #define PKCS5_PADDING 1 // PKCS 5 (sec 6.2) padding method
#define RANDOM_PADDING 2 #define RANDOM_PADDING 2
#define ZERO_PADDING 3 #define ZERO_PADDING 3
// KP_MODE // KP_MODE
#define CRYPT_MODE_CBC 1 // Cipher block chaining #define CRYPT_MODE_CBC 1 // Cipher block chaining
#define CRYPT_MODE_ECB 2 // Electronic code book #define CRYPT_MODE_ECB 2 // Electronic code book
#define CRYPT_MODE_OFB 3 // Output feedback mode #define CRYPT_MODE_OFB 3 // Output feedback mode
skipping to change at line 399 skipping to change at line 490
// KP_PERMISSIONS // KP_PERMISSIONS
#define CRYPT_ENCRYPT 0x0001 // Allow encryption #define CRYPT_ENCRYPT 0x0001 // Allow encryption
#define CRYPT_DECRYPT 0x0002 // Allow decryption #define CRYPT_DECRYPT 0x0002 // Allow decryption
#define CRYPT_EXPORT 0x0004 // Allow key to be exported #define CRYPT_EXPORT 0x0004 // Allow key to be exported
#define CRYPT_READ 0x0008 // Allow parameters to be read #define CRYPT_READ 0x0008 // Allow parameters to be read
#define CRYPT_WRITE 0x0010 // Allow parameters to be set #define CRYPT_WRITE 0x0010 // Allow parameters to be set
#define CRYPT_MAC 0x0020 // Allow MACs to be used with key #define CRYPT_MAC 0x0020 // Allow MACs to be used with key
#define CRYPT_EXPORT_KEY 0x0040 // Allow key to be used for exporting ke ys #define CRYPT_EXPORT_KEY 0x0040 // Allow key to be used for exporting ke ys
#define CRYPT_IMPORT_KEY 0x0080 // Allow key to be used for importing ke ys #define CRYPT_IMPORT_KEY 0x0080 // Allow key to be used for importing ke ys
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define CRYPT_ARCHIVE 0x0100 // Allow key to be exported at creation only #define CRYPT_ARCHIVE 0x0100 // Allow key to be exported at creation only
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#define HP_ALGID 0x0001 // Hash algorithm #define HP_ALGID 0x0001 // Hash algorithm
#define HP_HASHVAL 0x0002 // Hash value #define HP_HASHVAL 0x0002 // Hash value
#define HP_HASHSIZE 0x0004 // Hash value size #define HP_HASHSIZE 0x0004 // Hash value size
#define HP_HMAC_INFO 0x0005 // information for creating an HMAC #define HP_HMAC_INFO 0x0005 // information for creating an HMAC
#define HP_TLS1PRF_LABEL 0x0006 // label for TLS1 PRF #define HP_TLS1PRF_LABEL 0x0006 // label for TLS1 PRF
#define HP_TLS1PRF_SEED 0x0007 // seed for TLS1 PRF #define HP_TLS1PRF_SEED 0x0007 // seed for TLS1 PRF
#define CRYPT_FAILED FALSE #define CRYPT_FAILED FALSE
#define CRYPT_SUCCEED TRUE #define CRYPT_SUCCEED TRUE
skipping to change at line 447 skipping to change at line 540
#define PP_ADMIN_PIN 31 #define PP_ADMIN_PIN 31
#define PP_KEYEXCHANGE_PIN 32 #define PP_KEYEXCHANGE_PIN 32
#define PP_SIGNATURE_PIN 33 #define PP_SIGNATURE_PIN 33
#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)
#define PP_CRYPT_COUNT_KEY_USE 41 #define PP_CRYPT_COUNT_KEY_USE 41
#endif //(NTDDI_VERSION >= NTDDI_WS03)
#if (NTDDI_VERSION >= NTDDI_WINLH)
#define PP_USER_CERTSTORE 42
#define PP_SMARTCARD_READER 43
#define PP_SMARTCARD_GUID 45
#define PP_ROOT_CERTSTORE 46
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#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 486 skipping to change at line 587
// //
// 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)
#define PP_PIN_PROMPT_STRING 44
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
// 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
#define PROV_EC_ECDSA_SIG 14 #define PROV_EC_ECDSA_SIG 14
#define PROV_EC_ECNRA_SIG 15 #define PROV_EC_ECNRA_SIG 15
#define PROV_EC_ECDSA_FULL 16 #define PROV_EC_ECDSA_FULL 16
#define PROV_EC_ECNRA_FULL 17 #define PROV_EC_ECNRA_FULL 17
#define PROV_DH_SCHANNEL 18 #define PROV_DH_SCHANNEL 18
#define PROV_SPYRUS_LYNKS 20 #define PROV_SPYRUS_LYNKS 20
#define PROV_RNG 21 #define PROV_RNG 21
#define PROV_INTEL_SEC 22 #define PROV_INTEL_SEC 22
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define PROV_REPLACE_OWF 23 #define PROV_REPLACE_OWF 23
#define PROV_RSA_AES 24 #define PROV_RSA_AES 24
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
// certenrolld_end
#if (NTDDI_VERSION <= NTDDI_WINXP)
//
// STT defined Providers
//
#define PROV_STT_MER 7
#define PROV_STT_ACQ 8
#define PROV_STT_BRND 9
#define PROV_STT_ROOT 10
#define PROV_STT_ISS 11
#endif //(NTDDI_VERSION <= NTDDI_WINXP)
// //
// Provider friendly names // Provider friendly names
// //
#define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0" #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
#define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0" #define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
#ifdef UNICODE #ifdef UNICODE
#define MS_DEF_PROV MS_DEF_PROV_W #define MS_DEF_PROV MS_DEF_PROV_W
#else #else
#define MS_DEF_PROV MS_DEF_PROV_A #define MS_DEF_PROV MS_DEF_PROV_A
skipping to change at line 589 skipping to change at line 708
#endif #endif
#define MS_SCARD_PROV_A "Microsoft Base Smart Card Crypto Provider" #define MS_SCARD_PROV_A "Microsoft Base Smart Card Crypto Provider"
#define MS_SCARD_PROV_W L"Microsoft Base Smart Card Crypto Provider" #define MS_SCARD_PROV_W L"Microsoft Base Smart Card Crypto Provider"
#ifdef UNICODE #ifdef UNICODE
#define MS_SCARD_PROV MS_SCARD_PROV_W #define MS_SCARD_PROV MS_SCARD_PROV_W
#else #else
#define MS_SCARD_PROV MS_SCARD_PROV_A #define MS_SCARD_PROV MS_SCARD_PROV_A
#endif #endif
#if (NTDDI_VERSION >= NTDDI_WS03)
#define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Pr ovider" #define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Pr ovider"
#define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic P rovider" #define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic P rovider"
#elif (NTDDI_VERSION == NTDDI_WINXP)
#define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Pr
ovider (Prototype)"
#define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic P
rovider (Prototype)"
#endif //(NTDDI_VERSION >= NTDDI_WS03)
#if (NTDDI_VERSION >= NTDDI_WINXP)
#ifdef UNICODE #ifdef UNICODE
#define MS_ENH_RSA_AES_PROV MS_ENH_RSA_AES_PROV_W #define MS_ENH_RSA_AES_PROV MS_ENH_RSA_AES_PROV_W
#else #else
#define MS_ENH_RSA_AES_PROV MS_ENH_RSA_AES_PROV_A #define MS_ENH_RSA_AES_PROV MS_ENH_RSA_AES_PROV_A
#endif #endif
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#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.
skipping to change at line 650 skipping to change at line 776
// UI-protected). // UI-protected).
// //
// To enable the new behavior, create the registry DWORD value // To enable the new behavior, create the registry DWORD value
// szKEY_CACHE_ENABLED and set it to 1. The registry DWORD value // szKEY_CACHE_ENABLED and set it to 1. The registry DWORD value
// szKEY_CACHE_SECONDS must also be created and set to the number of seconds // szKEY_CACHE_SECONDS must also be created and set to the number of seconds
// that a cached private key may still be considered usable. // that a cached private key may still be considered usable.
// //
#define szKEY_CACHE_ENABLED "CachePrivateKeys" #define szKEY_CACHE_ENABLED "CachePrivateKeys"
#define szKEY_CACHE_SECONDS "PrivateKeyLifetimeSeconds" #define szKEY_CACHE_SECONDS "PrivateKeyLifetimeSeconds"
#if (NTDDI_VERSION >= NTDDI_WINXP)
// //
// In platforms later than (and not including) Windows Server 2003, private // In platforms later than (and not including) Windows Server 2003, private
// keys are always cached for a period of time per-process, even when // keys are always cached for a period of time per-process, even when
// not being used in any context. // not being used in any context.
// //
// The differences between the process-wide caching settings described below // The differences between the process-wide caching settings described below
// and the Optional Key Timeouts described above are subtle. // and the Optional Key Timeouts described above are subtle.
// //
// - The Optional Key Timeout policy is applied only when an attempt is made // - The Optional Key Timeout policy is applied only when an attempt is made
// to use a specific private key with an open context handle (HCRYPTPROV). // to use a specific private key with an open context handle (HCRYPTPROV).
skipping to change at line 692 skipping to change at line 819
// //
#define szPRIV_KEY_CACHE_MAX_ITEMS "PrivKeyCacheMaxItems" #define szPRIV_KEY_CACHE_MAX_ITEMS "PrivKeyCacheMaxItems"
#define cPRIV_KEY_CACHE_MAX_ITEMS_DEFAULT 20 #define cPRIV_KEY_CACHE_MAX_ITEMS_DEFAULT 20
// //
// Registry value for controlling the interval at which the private key // Registry value for controlling the interval at which the private key
// cache is proactively purged of outdated keys. // cache is proactively purged of outdated keys.
// //
#define szPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS "PrivKeyCachePurgeIntervalSecond s" #define szPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS "PrivKeyCachePurgeIntervalSecond s"
#define cPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS_DEFAULT 86400 // 1 day #define cPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS_DEFAULT 86400 // 1 day
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#define CUR_BLOB_VERSION 2 #define CUR_BLOB_VERSION 2
// structure for use with CryptSetKeyParam for CMS keys // structure for use with CryptSetKeyParam for CMS keys
// DO NOT USE THIS STRUCTURE!!!!! // DO NOT USE THIS STRUCTURE!!!!!
typedef struct _CMS_KEY_INFO { typedef struct _CMS_KEY_INFO {
DWORD dwVersion; // sizeof(CMS_KEY_INFO) DWORD dwVersion; // sizeof(CMS_KEY_INFO)
ALG_ID Algid; // algorithmm id for the key to be converted ALG_ID Algid; // algorithmm id for the key to be converted
BYTE *pbOID; // pointer to OID to hash in wit h Z BYTE *pbOID; // pointer to OID to hash in wit h Z
DWORD cbOID; // length of OID to hash in with Z DWORD cbOID; // length of OID to hash in with Z
skipping to change at line 736 skipping to change at line 864
// uses of dwFlags SCHANNEL_ALG structure // uses of dwFlags SCHANNEL_ALG structure
#define INTERNATIONAL_USAGE 0x00000001 #define INTERNATIONAL_USAGE 0x00000001
typedef struct _PROV_ENUMALGS { typedef struct _PROV_ENUMALGS {
ALG_ID aiAlgid; ALG_ID aiAlgid;
DWORD dwBitLen; DWORD dwBitLen;
DWORD dwNameLen; DWORD dwNameLen;
CHAR szName[20]; CHAR szName[20];
} PROV_ENUMALGS; } PROV_ENUMALGS;
// certenrolls_begin -- PROV_ENUMALGS_EX
typedef struct _PROV_ENUMALGS_EX { typedef struct _PROV_ENUMALGS_EX {
ALG_ID aiAlgid; ALG_ID aiAlgid;
DWORD dwDefaultLen; DWORD dwDefaultLen;
DWORD dwMinLen; DWORD dwMinLen;
DWORD dwMaxLen; DWORD dwMaxLen;
DWORD dwProtocols; DWORD dwProtocols;
DWORD dwNameLen; DWORD dwNameLen;
CHAR szName[20]; CHAR szName[20];
DWORD dwLongNameLen; DWORD dwLongNameLen;
CHAR szLongName[40]; CHAR szLongName[40];
} PROV_ENUMALGS_EX; } PROV_ENUMALGS_EX;
// certenrolls_end
typedef struct _PUBLICKEYSTRUC { typedef struct _PUBLICKEYSTRUC {
BYTE bType; BYTE bType;
BYTE bVersion; BYTE bVersion;
WORD reserved; WORD reserved;
ALG_ID aiKeyAlg; ALG_ID aiKeyAlg;
} BLOBHEADER, PUBLICKEYSTRUC; } BLOBHEADER, PUBLICKEYSTRUC;
typedef struct _RSAPUBKEY { typedef struct _RSAPUBKEY {
DWORD magic; // Has to be RSA1 DWORD magic; // Has to be RSA1
skipping to change at line 801 skipping to change at line 931
GUID Type; GUID Type;
GUID Subtype; GUID Subtype;
} KEY_TYPE_SUBTYPE, *PKEY_TYPE_SUBTYPE; } KEY_TYPE_SUBTYPE, *PKEY_TYPE_SUBTYPE;
typedef struct _CERT_FORTEZZA_DATA_PROP { typedef struct _CERT_FORTEZZA_DATA_PROP {
unsigned char SerialNumber[8]; unsigned char SerialNumber[8];
int CertIndex; int CertIndex;
unsigned char CertLabel[36]; unsigned char CertLabel[36];
} CERT_FORTEZZA_DATA_PROP; } CERT_FORTEZZA_DATA_PROP;
#if (NTDDI_VERSION >= NTDDI_WS03)
typedef struct _CRYPT_RC4_KEY_STATE { typedef struct _CRYPT_RC4_KEY_STATE {
unsigned char Key[16]; unsigned char Key[16];
unsigned char SBox[256]; unsigned char SBox[256];
unsigned char i; unsigned char i;
unsigned char j; unsigned char j;
} CRYPT_RC4_KEY_STATE, *PCRYPT_RC4_KEY_STATE; } CRYPT_RC4_KEY_STATE, *PCRYPT_RC4_KEY_STATE;
typedef struct _CRYPT_DES_KEY_STATE { typedef struct _CRYPT_DES_KEY_STATE {
unsigned char Key[8]; unsigned char Key[8];
unsigned char IV[8]; unsigned char IV[8];
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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
typedef struct _CRYPT_AES_128_KEY_STATE {
unsigned char Key[16];
unsigned char IV[16];
unsigned char EncryptionState[11][16]; // 10 rounds + 1
unsigned char DecryptionState[11][16];
unsigned char Feedback[16];
} CRYPT_AES_128_KEY_STATE, *PCRYPT_AES_128_KEY_STATE;
typedef struct _CRYPT_AES_256_KEY_STATE {
unsigned char Key[32];
unsigned char IV[16];
unsigned char EncryptionState[15][16]; // 14 rounds + 1
unsigned char DecryptionState[15][16];
unsigned char Feedback[16];
} CRYPT_AES_256_KEY_STATE, *PCRYPT_AES_256_KEY_STATE;
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CRYPTOAPI BLOB definitions // CRYPTOAPI BLOB definitions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- *_BLOB
typedef struct _CRYPTOAPI_BLOB { typedef struct _CRYPTOAPI_BLOB {
DWORD cbData; DWORD cbData;
BYTE *pbData; __field_bcount(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;
// certenrolls_end
// 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)
WINADVAPI
BOOL
WINAPI
CryptAcquireContextA(
__out HCRYPTPROV *phProv,
__in_opt LPCSTR szContainer,
__in_opt LPCSTR szProvider,
__in DWORD dwProvType,
__in DWORD dwFlags
);
WINADVAPI
BOOL
WINAPI
CryptAcquireContextW(
__out HCRYPTPROV *phProv,
__in_opt LPCWSTR szContainer,
__in_opt LPCWSTR szProvider,
__in DWORD dwProvType,
__in DWORD dwFlags
);
#ifdef UNICODE
#define CryptAcquireContext CryptAcquireContextW
#else
#define CryptAcquireContext CryptAcquireContextA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH)
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)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptAcquireContextA(
HCRYPTPROV *phProv,
LPCSTR pszContainer,
LPCSTR pszProvider,
DWORD dwProvType,
DWORD dwFlags
);
WINADVAPI
BOOL
WINAPI
CryptAcquireContextW(
HCRYPTPROV *phProv,
LPCWSTR pszContainer,
LPCWSTR pszProvider,
DWORD dwProvType,
DWORD dwFlags
);
#endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH)
#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)
#if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptReleaseContext(
__in HCRYPTPROV hProv,
__in DWORD dwFlags
);
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptReleaseContext( CryptReleaseContext(
HCRYPTPROV hProv, HCRYPTPROV hProv,
DWORD dwFlags ULONG_PTR dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGenKey( CryptGenKey(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
ALG_ID Algid, __in ALG_ID Algid,
DWORD dwFlags, __in DWORD dwFlags,
HCRYPTKEY *phKey __out HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDeriveKey( CryptDeriveKey(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
ALG_ID Algid, __in ALG_ID Algid,
HCRYPTHASH hBaseData, __in HCRYPTHASH hBaseData,
DWORD dwFlags, __in DWORD dwFlags,
HCRYPTKEY *phKey __out HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDestroyKey( CryptDestroyKey(
HCRYPTKEY hKey __in HCRYPTKEY hKey
); );
#if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptSetKeyParam( CryptSetKeyParam(
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
DWORD dwParam, __in DWORD dwParam,
CONST BYTE *pbData, __in CONST BYTE *pbData,
DWORD dwFlags __in DWORD dwFlags
); );
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetKeyParam( CryptSetKeyParam(
HCRYPTKEY hKey, HCRYPTKEY hKey,
DWORD dwParam, DWORD dwParam,
BYTE *pbData, BYTE *pbData,
DWORD *pdwDataLen,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetKeyParam(
__in HCRYPTKEY hKey,
__in DWORD dwParam,
__out_bcount_part(*pdwDataLen, *pdwDataLen) BYTE *pbData,
__inout DWORD *pdwDataLen,
__in DWORD dwFlags
);
#if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptSetHashParam(
__in HCRYPTHASH hHash,
__in DWORD dwParam,
__in CONST BYTE *pbData,
__in DWORD dwFlags
);
#endif //(NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptSetHashParam( CryptSetHashParam(
HCRYPTHASH hHash, HCRYPTHASH hHash,
DWORD dwParam, DWORD dwParam,
CONST BYTE *pbData, BYTE*pbData,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetHashParam( CryptGetHashParam(
HCRYPTHASH hHash, __in HCRYPTHASH hHash,
DWORD dwParam, __in DWORD dwParam,
BYTE *pbData, __out_bcount_part(*pdwDataLen, *pdwDataLen) BYTE *pbData,
DWORD *pdwDataLen, __inout DWORD *pdwDataLen,
DWORD dwFlags __in DWORD dwFlags
);
#if (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptSetProvParam(
__in HCRYPTPROV hProv,
__in DWORD dwParam,
__in CONST BYTE *pbData,
__in DWORD dwFlags
); );
#endif //(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,
CONST BYTE *pbData, BYTE*pbData,
DWORD dwFlags DWORD dwFlags
); );
#endif //(NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetProvParam( CryptGetProvParam(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
DWORD dwParam, __in DWORD dwParam,
BYTE *pbData, __out_bcount_part_opt(*pdwDataLen, *pdwDataLen) BYTE *pbData,
DWORD *pdwDataLen, __inout DWORD *pdwDataLen,
DWORD dwFlags __in DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGenRandom( CryptGenRandom(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
DWORD dwLen, __in DWORD dwLen,
BYTE *pbBuffer __inout_bcount(dwLen) BYTE *pbBuffer
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptGetUserKey( CryptGetUserKey(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
DWORD dwKeySpec, __in DWORD dwKeySpec,
HCRYPTKEY *phUserKey __out HCRYPTKEY *phUserKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptExportKey( CryptExportKey(
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
HCRYPTKEY hExpKey, __in HCRYPTKEY hExpKey,
DWORD dwBlobType, __in DWORD dwBlobType,
DWORD dwFlags, __in DWORD dwFlags,
BYTE *pbData, __out_bcount_part_opt(*pdwDataLen, *pdwDataLen) BYTE *pbData,
DWORD *pdwDataLen __inout DWORD *pdwDataLen
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptImportKey( CryptImportKey(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
CONST BYTE *pbData, __in_bcount(dwDataLen) CONST BYTE *pbData,
DWORD dwDataLen, __in DWORD dwDataLen,
HCRYPTKEY hPubKey, __in HCRYPTKEY hPubKey,
DWORD dwFlags, __in DWORD dwFlags,
HCRYPTKEY *phKey __out HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL __success(0 < return) BOOL
WINAPI WINAPI
CryptEncrypt( CryptEncrypt(
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
HCRYPTHASH hHash, __in HCRYPTHASH hHash,
BOOL Final, __in BOOL Final,
DWORD dwFlags, __in DWORD dwFlags,
BYTE *pbData, __inout_bcount_part(dwBufLen, *pdwDataLen) BYTE *pbData,
DWORD *pdwDataLen, __out DWORD *pdwDataLen,
DWORD dwBufLen __in DWORD dwBufLen
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDecrypt( CryptDecrypt(
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
HCRYPTHASH hHash, __in HCRYPTHASH hHash,
BOOL Final, __in BOOL Final,
DWORD dwFlags, __in DWORD dwFlags,
BYTE *pbData, __inout_bcount_part(*pdwDataLen, *pdwDataLen) BYTE *pbData,
DWORD *pdwDataLen __deref_inout DWORD *pdwDataLen
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptCreateHash( CryptCreateHash(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
ALG_ID Algid, __in ALG_ID Algid,
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
DWORD dwFlags, __in DWORD dwFlags,
HCRYPTHASH *phHash __out HCRYPTHASH *phHash
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptHashData( CryptHashData(
HCRYPTHASH hHash, __in HCRYPTHASH hHash,
CONST BYTE *pbData, __in_bcount(dwDataLen) CONST BYTE *pbData,
DWORD dwDataLen, __in DWORD dwDataLen,
DWORD dwFlags __in DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptHashSessionKey( CryptHashSessionKey(
HCRYPTHASH hHash, __in HCRYPTHASH hHash,
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
DWORD dwFlags __in DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDestroyHash( CryptDestroyHash(
HCRYPTHASH hHash __in HCRYPTHASH hHash
); );
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptSignHashA(
__in HCRYPTHASH hHash,
__in DWORD dwKeySpec,
__in LPCSTR szDescription,
__in DWORD dwFlags,
__out_bcount_part_opt(*pdwSigLen, *pdwSigLen) BYTE *pbSignature,
__inout DWORD *pdwSigLen
);
WINADVAPI
BOOL
WINAPI
CryptSignHashW(
__in HCRYPTHASH hHash,
__in DWORD dwKeySpec,
__in LPCWSTR szDescription,
__in DWORD dwFlags,
__out_bcount_part_opt(*pdwSigLen, *pdwSigLen) BYTE *pbSignature,
__inout DWORD *pdwSigLen
);
#ifdef UNICODE
#define CryptSignHash CryptSignHashW
#else
#define CryptSignHash CryptSignHashA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH)
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 1100 skipping to change at line 1393
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)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptSignHashA(
HCRYPTHASH hHash,
DWORD dwKeySpec,
LPCSTR sDescription,
DWORD dwFlags,
BYTE *pbSignature,
DWORD *pdwSigLen
);
WINADVAPI
BOOL
WINAPI
CryptSignHashW(
HCRYPTHASH hHash,
DWORD dwKeySpec,
LPCWSTR sDescription,
DWORD dwFlags,
BYTE *pbSignature,
DWORD *pdwSigLen
);
#endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH)
#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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptVerifySignatureA(
__in HCRYPTHASH hHash,
__in_bcount(dwSigLen) CONST BYTE *pbSignature,
__in DWORD dwSigLen,
__in HCRYPTKEY hPubKey,
__in LPCSTR szDescription,
__in DWORD dwFlags
);
WINADVAPI
BOOL
WINAPI
CryptVerifySignatureW(
__in HCRYPTHASH hHash,
__in_bcount(dwSigLen) CONST BYTE *pbSignature,
__in DWORD dwSigLen,
__in HCRYPTKEY hPubKey,
__in LPCWSTR szDescription,
__in DWORD dwFlags
);
#ifdef UNICODE
#define CryptVerifySignature CryptVerifySignatureW
#else
#define CryptVerifySignature CryptVerifySignatureA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH)
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 1128 skipping to change at line 1481
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)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptVerifySignatureA(
HCRYPTHASH hHash,
CONST BYTE *pbSignature,
DWORD dwSigLen,
HCRYPTKEY hPubKey,
LPCSTR sDescription,
DWORD dwFlags
);
WINADVAPI
BOOL
WINAPI
CryptVerifySignatureW(
HCRYPTHASH hHash,
CONST BYTE *pbSignature,
DWORD dwSigLen,
HCRYPTKEY hPubKey,
LPCWSTR sDescription,
DWORD dwFlags
);
#endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH)
#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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptSetProviderA(
__in LPCSTR pszProvName,
__in DWORD dwProvType
);
WINADVAPI
BOOL
WINAPI
CryptSetProviderW(
__in LPCWSTR pszProvName,
__in DWORD dwProvType
);
#ifdef UNICODE
#define CryptSetProvider CryptSetProviderW
#else
#define CryptSetProvider CryptSetProviderA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION < NTDDI_WINLH)
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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptSetProviderExA(
__in LPCSTR pszProvName,
__in DWORD dwProvType,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags
);
WINADVAPI
BOOL
WINAPI
CryptSetProviderExW(
__in LPCWSTR pszProvName,
__in DWORD dwProvType,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags
);
#ifdef UNICODE
#define CryptSetProviderEx CryptSetProviderExW
#else
#define CryptSetProviderEx CryptSetProviderExA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION < NTDDI_WINLH)
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 1177 skipping to change at line 1610
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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptGetDefaultProviderA(
__in DWORD dwProvType,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags,
__out_bcount_part(*pcbProvName, *pcbProvName) LPSTR pszProvName,
__out DWORD *pcbProvName
);
WINADVAPI
BOOL
WINAPI
CryptGetDefaultProviderW(
__in DWORD dwProvType,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags,
__out_bcount_part(*pcbProvName, *pcbProvName) LPWSTR pszProvName,
__out DWORD *pcbProvName
);
#ifdef UNICODE
#define CryptGetDefaultProvider CryptGetDefaultProviderW
#else
#define CryptGetDefaultProvider CryptGetDefaultProviderA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION < NTDDI_WINLH)
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 1203 skipping to change at line 1666
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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptEnumProviderTypesA(
__in DWORD dwIndex,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags,
__out DWORD *pdwProvType,
__out_bcount_part(*pcbTypeName, *pcbTypeName) LPSTR szTypeName,
__out DWORD *pcbTypeName
);
WINADVAPI
BOOL
WINAPI
CryptEnumProviderTypesW(
__in DWORD dwIndex,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags,
__out DWORD *pdwProvType,
__out_bcount_part(*pcbTypeName, *pcbTypeName) LPWSTR szTypeName,
__out DWORD *pcbTypeName
);
#ifdef UNICODE
#define CryptEnumProviderTypes CryptEnumProviderTypesW
#else
#define CryptEnumProviderTypes CryptEnumProviderTypesA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH)
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 1226 skipping to change at line 1721
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)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptEnumProviderTypesA(
DWORD dwIndex,
DWORD * pdwReserved,
DWORD dwFlags,
DWORD * pdwProvType,
LPSTR pszTypeName,
DWORD * pcbTypeName
);
WINADVAPI
BOOL
WINAPI
CryptEnumProviderTypesW(
DWORD dwIndex,
DWORD * pdwReserved,
DWORD dwFlags,
DWORD * pdwProvType,
LPWSTR pszTypeName,
DWORD * pcbTypeName
);
#endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH)
#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)
#if (NTDDI_VERSION >= NTDDI_WINLH)
WINADVAPI
BOOL
WINAPI
CryptEnumProvidersA(
__in DWORD dwIndex,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags,
__out DWORD *pdwProvType,
__out_ecount_part_opt(*pcbProvName, *pcbProvName+1) LPSTR szProvName,
__inout DWORD *pcbProvName
);
WINADVAPI
BOOL
WINAPI
CryptEnumProvidersW(
__in DWORD dwIndex,
__reserved DWORD *pdwReserved,
__in DWORD dwFlags,
__out DWORD *pdwProvType,
__out_ecount_part_opt(*pcbProvName, *pcbProvName+1) LPWSTR szProvName,
__inout DWORD *pcbProvName
);
#ifdef UNICODE
#define CryptEnumProviders CryptEnumProvidersW
#else
#define CryptEnumProviders CryptEnumProvidersA
#endif // !UNICODE
#endif //(NTDDI_VERSION >= NTDDI_WINLH)
#if (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_WINLH)
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 1254 skipping to change at line 1809
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)
#if (NTDDI_VERSION < NTDDI_WINXP)
WINADVAPI
BOOL
WINAPI
CryptEnumProvidersA(
DWORD dwIndex,
DWORD * pdwReserved,
DWORD dwFlags,
DWORD * pdwProvType,
LPSTR pszProvName,
DWORD * pcbProvName
);
WINADVAPI
BOOL
WINAPI
CryptEnumProvidersW(
DWORD dwIndex,
DWORD * pdwReserved,
DWORD dwFlags,
DWORD * pdwProvType,
LPWSTR pszProvName,
DWORD * pcbProvName
);
#endif //(NTDDI_VERSION < NTDDI_WINXP)
#if (NTDDI_VERSION < NTDDI_WINLH)
#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)
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptContextAddRef( CryptContextAddRef(
HCRYPTPROV hProv, __in HCRYPTPROV hProv,
DWORD *pdwReserved, __reserved DWORD *pdwReserved,
DWORD dwFlags __in DWORD dwFlags
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDuplicateKey( CryptDuplicateKey(
HCRYPTKEY hKey, __in HCRYPTKEY hKey,
DWORD *pdwReserved, __reserved DWORD *pdwReserved,
DWORD dwFlags, __in DWORD dwFlags,
HCRYPTKEY *phKey __out HCRYPTKEY *phKey
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
CryptDuplicateHash( CryptDuplicateHash(
HCRYPTHASH hHash, __in HCRYPTHASH hHash,
DWORD *pdwReserved, __reserved DWORD *pdwReserved,
DWORD dwFlags, __in DWORD dwFlags,
HCRYPTHASH *phHash __out HCRYPTHASH *phHash
); );
#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, BYTE **pData,
DWORD *dwDecSize DWORD *dwDecSize
); );
#endif //(NTDDI_VERSION >= NTDDI_WS03)
#if (NTDDI_VERSION == NTDDI_WINXP)
typedef struct {
DWORD dwVersion;
ALG_ID algId;
DWORD dwMinKeyLength;
DWORD dwMaxKeyLength;
DWORD dwRequiredFlags;
DWORD dwDisallowedFlags;
} _CRYPT_KEY_LIMITS_V01;
typedef _CRYPT_KEY_LIMITS_V01 CRYPT_KEY_LIMITS, *PCRYPT_KEY_LIMITS;
// Request Flag definitions
#define CRYPTLIMIT_USING_PCT 0x0001
#define CRYPTLIMIT_USING_SGC 0x0002
WINADVAPI
BOOL
WINAPI
CryptGetLocalKeyLimits(
IN ALG_ID algId,
IN DWORD dwFlags,
OUT PCRYPT_KEY_LIMITS pLimits,
IN OUT LPDWORD cbLimitLength);
#endif //(NTDDI_VERSION = NTDDI_WINXP)
#if !defined(_DDK_DRIVER_)
// In Longhorn, the following APIs were updated to support the new
// CNG (Cryptography Next Generation) BCrypt* and NCrypt* APIs in addition
// to the above CAPI1 APIs.
// Include the definitions for the CNG APIs
#include <bcrypt.h>
#include <ncrypt.h>
// 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
// converted to a NCRYPT_KEY_HANDLE via the CNG NCryptTranslateHandle().
typedef ULONG_PTR HCRYPTPROV_OR_NCRYPT_KEY_HANDLE;
// This type is used where the HCRYPTPROV parameter is no longer used.
// The caller should always pass in NULL.
typedef ULONG_PTR HCRYPTPROV_LEGACY;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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
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;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Type used for any algorithm // Type used for any algorithm
// //
// 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
// 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"
skipping to change at line 1349 skipping to change at line 1981
#define szOID_PKCS_10 "1.2.840.113549.1.10" #define szOID_PKCS_10 "1.2.840.113549.1.10"
#define szOID_PKCS_12 "1.2.840.113549.1.12" #define szOID_PKCS_12 "1.2.840.113549.1.12"
#define szOID_RSA_RSA "1.2.840.113549.1.1.1" #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
#define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2" #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
#define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3" #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
#define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4" #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
#define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5" #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
#define szOID_RSA_SETOAEP_RSA "1.2.840.113549.1.1.6" #define szOID_RSA_SETOAEP_RSA "1.2.840.113549.1.1.6"
#define szOID_RSAES_OAEP "1.2.840.113549.1.1.7"
#define szOID_RSA_MGF1 "1.2.840.113549.1.1.8"
#define szOID_RSA_PSPECIFIED "1.2.840.113549.1.1.9"
#define szOID_RSA_SSA_PSS "1.2.840.113549.1.1.10"
#define szOID_RSA_SHA256RSA "1.2.840.113549.1.1.11"
#define szOID_RSA_SHA384RSA "1.2.840.113549.1.1.12"
#define szOID_RSA_SHA512RSA "1.2.840.113549.1.1.13"
#define szOID_RSA_DH "1.2.840.113549.1.3.1" #define szOID_RSA_DH "1.2.840.113549.1.3.1"
#define szOID_RSA_data "1.2.840.113549.1.7.1" #define szOID_RSA_data "1.2.840.113549.1.7.1"
#define szOID_RSA_signedData "1.2.840.113549.1.7.2" #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
#define szOID_RSA_envelopedData "1.2.840.113549.1.7.3" #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
#define szOID_RSA_signEnvData "1.2.840.113549.1.7.4" #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
#define szOID_RSA_digestedData "1.2.840.113549.1.7.5" #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
#define szOID_RSA_hashedData "1.2.840.113549.1.7.5" #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
#define szOID_RSA_encryptedData "1.2.840.113549.1.7.6" #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
skipping to change at line 1393 skipping to change at line 2033
#define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7" #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
#define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9" #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
#define szOID_ANSI_X942 "1.2.840.10046" #define szOID_ANSI_X942 "1.2.840.10046"
#define szOID_ANSI_X942_DH "1.2.840.10046.2.1" #define szOID_ANSI_X942_DH "1.2.840.10046.2.1"
#define szOID_X957 "1.2.840.10040" #define szOID_X957 "1.2.840.10040"
#define szOID_X957_DSA "1.2.840.10040.4.1" #define szOID_X957_DSA "1.2.840.10040.4.1"
#define szOID_X957_SHA1DSA "1.2.840.10040.4.3" #define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
// iso(1) member-body(2) us(840) 10045 keyType(2) unrestricted(1)
#define szOID_ECC_PUBLIC_KEY "1.2.840.10045.2.1"
// iso(1) member-body(2) us(840) 10045 curves(3) prime(1) 7
#define szOID_ECC_CURVE_P256 "1.2.840.10045.3.1.7"
// iso(1) identified-organization(3) certicom(132) curve(0) 34
#define szOID_ECC_CURVE_P384 "1.3.132.0.34"
// iso(1) identified-organization(3) certicom(132) curve(0) 35
#define szOID_ECC_CURVE_P521 "1.3.132.0.35"
// iso(1) member-body(2) us(840) 10045 signatures(4) sha1(1)
#define szOID_ECDSA_SHA1 "1.2.840.10045.4.1"
// iso(1) member-body(2) us(840) 10045 signatures(4) specified(3)
#define szOID_ECDSA_SPECIFIED "1.2.840.10045.4.3"
// iso(1) member-body(2) us(840) 10045 signatures(4) specified(3) 2
#define szOID_ECDSA_SHA256 "1.2.840.10045.4.3.2"
// iso(1) member-body(2) us(840) 10045 signatures(4) specified(3) 3
#define szOID_ECDSA_SHA384 "1.2.840.10045.4.3.3"
// iso(1) member-body(2) us(840) 10045 signatures(4) specified(3) 4
#define szOID_ECDSA_SHA512 "1.2.840.10045.4.3.4"
// NIST AES CBC Algorithms
// joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistA
lgorithms(4) aesAlgs(1) }
#define szOID_NIST_AES128_CBC "2.16.840.1.101.3.4.1.2"
#define szOID_NIST_AES192_CBC "2.16.840.1.101.3.4.1.22"
#define szOID_NIST_AES256_CBC "2.16.840.1.101.3.4.1.42"
// For the above Algorithms, the AlgorithmIdentifier parameters must be
// present and the parameters field MUST contain an AES-IV:
//
// AES-IV ::= OCTET STRING (SIZE(16))
// NIST AES WRAP Algorithms
#define szOID_NIST_AES128_WRAP "2.16.840.1.101.3.4.1.5"
#define szOID_NIST_AES192_WRAP "2.16.840.1.101.3.4.1.25"
#define szOID_NIST_AES256_WRAP "2.16.840.1.101.3.4.1.45"
// x9-63-scheme OBJECT IDENTIFIER ::= { iso(1)
// identified-organization(3) tc68(133) country(16) x9(840)
// x9-63(63) schemes(0) }
// ECDH single pass ephemeral-static KeyAgreement KeyEncryptionAlgorithm
#define szOID_DH_SINGLE_PASS_STDDH_SHA1_KDF "1.3.133.16.840.63.0.2"
// For the above KeyEncryptionAlgorithm the following wrap algorithms are
// supported:
// szOID_RSA_SMIMEalgCMS3DESwrap
// szOID_RSA_SMIMEalgCMSRC2wrap
// szOID_NIST_AES128_WRAP
// szOID_NIST_AES192_WRAP
// szOID_NIST_AES256_WRAP
// ITU-T UsefulDefinitions // ITU-T UsefulDefinitions
#define szOID_DS "2.5" #define szOID_DS "2.5"
#define szOID_DSALG "2.5.8" #define szOID_DSALG "2.5.8"
#define szOID_DSALG_CRPT "2.5.8.1" #define szOID_DSALG_CRPT "2.5.8.1"
#define szOID_DSALG_HASH "2.5.8.2" #define szOID_DSALG_HASH "2.5.8.2"
#define szOID_DSALG_SIGN "2.5.8.3" #define szOID_DSALG_SIGN "2.5.8.3"
#define szOID_DSALG_RSA "2.5.8.1.1" #define szOID_DSALG_RSA "2.5.8.1.1"
// NIST OSE Implementors' Workshop (OIW) // NIST OSE Implementors' Workshop (OIW)
// http://nemo.ncsl.nist.gov/oiw/agreements/stable/OSI/12s_9506.w51 // http://nemo.ncsl.nist.gov/oiw/agreements/stable/OSI/12s_9506.w51
// http://nemo.ncsl.nist.gov/oiw/agreements/working/OSI/12w_9503.w51 // http://nemo.ncsl.nist.gov/oiw/agreements/working/OSI/12w_9503.w51
skipping to change at line 1466 skipping to change at line 2165
#define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13" #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
#define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14" #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
#define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15" #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
#define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16" #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
#define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17" #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
#define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18" #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
#define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19" #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
#define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20" #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
#define szOID_INFOSEC_mosaicUpdatedInteg "2.16.840.1.101.2.1.1.21" #define szOID_INFOSEC_mosaicUpdatedInteg "2.16.840.1.101.2.1.1.21"
// NIST Hash Algorithms
// joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nista
lgorithm(4) hashalgs(2)
#define szOID_NIST_sha256 "2.16.840.1.101.3.4.2.1"
#define szOID_NIST_sha384 "2.16.840.1.101.3.4.2.2"
#define szOID_NIST_sha512 "2.16.840.1.101.3.4.2.3"
typedef struct _CRYPT_OBJID_TABLE { typedef struct _CRYPT_OBJID_TABLE {
DWORD dwAlgId; DWORD dwAlgId;
LPCSTR pszObjId; LPCSTR pszObjId;
} 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;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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
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;
// certenrolls_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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
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;
// certenrolls_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Attributes // Attributes
// //
// Where the Value's PATTR_BLOBs are in their encoded representation. // Where the Value's PATTR_BLOBs are in their encoded representation.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CRYPT_ATTRIBUTE
typedef struct _CRYPT_ATTRIBUTE { typedef struct _CRYPT_ATTRIBUTE {
LPSTR pszObjId; LPSTR pszObjId;
DWORD cValue; DWORD cValue;
PCRYPT_ATTR_BLOB rgValue; PCRYPT_ATTR_BLOB rgValue;
} CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE; } CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;
typedef struct _CRYPT_ATTRIBUTES { typedef struct _CRYPT_ATTRIBUTES {
IN DWORD cAttr; DWORD cAttr;
IN PCRYPT_ATTRIBUTE rgAttr; PCRYPT_ATTRIBUTE rgAttr;
} CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES; } CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES;
// certenrolls_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Attributes making up a Relative Distinguished Name (CERT_RDN) // Attributes making up a Relative Distinguished Name (CERT_RDN)
// //
// The interpretation of the Value depends on the dwValueType. // The interpretation of the Value depends on the dwValueType.
// See below for a list of the types. // See below for a list of the types.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_RDN_ATTR { typedef struct _CERT_RDN_ATTR {
LPSTR pszObjId; LPSTR pszObjId;
DWORD dwValueType; DWORD dwValueType;
skipping to change at line 1608 skipping to change at line 2320
// the information has been added. // the information has been added.
#define szOID_DN_QUALIFIER "2.5.4.46" #define szOID_DN_QUALIFIER "2.5.4.46"
// 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"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_RDN Attribute Value Types // CERT_RDN Attribute Value Types
// //
skipping to change at line 1720 skipping to change at line 2433
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;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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
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
#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
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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;
skipping to change at line 1765 skipping to change at line 2480
// 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)(
CRYPT_ALGORITHM_IDENTIFI __in CRYPT_ALGORITHM_IDENTIFIER Algorithm,
ER Algorithm, __in CRYPT_DATA_BLOB EncryptedPrivateKey,
CRYPT_DATA_BLOB __out_bcount_opt (*pcbClearTextKey) BYTE* pbClearTextKey,
EncryptedPrivateKey, __inout DWORD* pcbClearTextKey,
BYTE __in LPVOID pVoidDecryptFunc);
*pbClearTextKey,
DWORD
*pcbClearTextKey,
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)(
CRYPT_ALGORITHM_IDENTIFI __out CRYPT_ALGORITHM_IDENTIFIER* pAlgorithm,
ER* pAlgorithm, __in CRYPT_DATA_BLOB* pClearTextPrivateKey,
CRYPT_DATA_BLOB* __out_bcount_opt (*pcbEncryptedKey) BYTE* pbEncryptedKey,
pClearTextPrivateKey, __inout DWORD* pcbEncryptedKey,
BYTE __in LPVOID pVoidEncryptFunc);
*pbEncryptedKey,
DWORD
*pcbEncryptedKey,
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 1850 skipping to change at line 2565
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;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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
typedef struct _CERT_INFO { typedef struct _CERT_INFO {
DWORD dwVersion; DWORD dwVersion;
CRYPT_INTEGER_BLOB SerialNumber; CRYPT_INTEGER_BLOB SerialNumber;
CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm; CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
CERT_NAME_BLOB Issuer; CERT_NAME_BLOB Issuer;
FILETIME NotBefore; FILETIME NotBefore;
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
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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 2088 skipping to change at line 2805
// 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 void *pFormatStruct, __in_opt void *pFormatStruct,
IN LPCSTR lpszStructType, __in_opt LPCSTR lpszStructType,
IN const BYTE *pbEncoded, __in_bcount(cbEncoded) const BYTE *pbEncoded,
IN DWORD cbEncoded, __in DWORD cbEncoded,
OUT void *pbFormat, __out_bcount_part_opt(*pcbFormat, *pcbFormat) __typefix(WCHAR *) void *pbFor
IN OUT DWORD *pcbFormat mat,
__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 2166 skipping to change at line 2883
#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 OPTIONAL PCRYPT_ENCODE_PARA pEncodePara, __in_opt PCRYPT_ENCODE_PARA pEncodePara,
OUT void *pvEncoded, __out_opt void *pvEncoded,
IN OUT DWORD *pcbEncoded IN __out 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 BYTE *pbEncoded, __out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
IN OUT 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 2264 skipping to change at line 2981
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 const BYTE *pbEncoded, __in_bcount(cbEncoded) const BYTE *pbEncoded,
IN DWORD cbEncoded, __in DWORD cbEncoded,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL PCRYPT_DECODE_PARA pDecodePara, __in_opt PCRYPT_DECODE_PARA pDecodePara,
OUT OPTIONAL void *pvStructInfo, __out_opt void *pvStructInfo,
IN OUT DWORD *pcbStructInfo IN __out DWORD *pcbStructInfo
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptDecodeObject( CryptDecodeObject(
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN LPCSTR lpszStructType, __in LPCSTR lpszStructType,
IN const BYTE *pbEncoded, __in_bcount(cbEncoded) const BYTE *pbEncoded,
IN DWORD cbEncoded, __in DWORD cbEncoded,
IN DWORD dwFlags, __in DWORD dwFlags,
OUT void *pvStructInfo, __out_bcount_part_opt(*pcbStructInfo, *pcbStructInfo) void *pvStructInfo,
IN OUT 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 2399 skipping to change at line 3116
#define X509_MULTI_BYTE_INTEGER ((LPCSTR) 28) #define X509_MULTI_BYTE_INTEGER ((LPCSTR) 28)
#define X509_ENUMERATED ((LPCSTR) 29) #define X509_ENUMERATED ((LPCSTR) 29)
#define X509_CHOICE_OF_TIME ((LPCSTR) 30) #define X509_CHOICE_OF_TIME ((LPCSTR) 30)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// More predefined X509 certificate extension data structures that can be // More predefined X509 certificate extension data structures that can be
// encoded / decoded. // encoded / decoded.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define X509_AUTHORITY_KEY_ID2 ((LPCSTR) 31) #define X509_AUTHORITY_KEY_ID2 ((LPCSTR) 31)
#define X509_AUTHORITY_INFO_ACCESS ((LPCSTR) 32) #define X509_AUTHORITY_INFO_ACCESS ((LPCSTR) 32)
#define X509_SUBJECT_INFO_ACCESS X509_AUTHORITY_INFO_ACCESS
#define X509_CRL_REASON_CODE X509_ENUMERATED #define X509_CRL_REASON_CODE X509_ENUMERATED
#define PKCS_CONTENT_INFO ((LPCSTR) 33) #define PKCS_CONTENT_INFO ((LPCSTR) 33)
#define X509_SEQUENCE_OF_ANY ((LPCSTR) 34) #define X509_SEQUENCE_OF_ANY ((LPCSTR) 34)
#define X509_CRL_DIST_POINTS ((LPCSTR) 35) #define X509_CRL_DIST_POINTS ((LPCSTR) 35)
#define X509_ENHANCED_KEY_USAGE ((LPCSTR) 36) #define X509_ENHANCED_KEY_USAGE ((LPCSTR) 36)
#define PKCS_CTL ((LPCSTR) 37) #define PKCS_CTL ((LPCSTR) 37)
#define X509_MULTI_BYTE_UINT ((LPCSTR) 38) #define X509_MULTI_BYTE_UINT ((LPCSTR) 38)
#define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT #define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT
#define X509_DSS_PARAMETERS ((LPCSTR) 39) #define X509_DSS_PARAMETERS ((LPCSTR) 39)
#define X509_DSS_SIGNATURE ((LPCSTR) 40) #define X509_DSS_SIGNATURE ((LPCSTR) 40)
#define PKCS_RC2_CBC_PARAMETERS ((LPCSTR) 41) #define PKCS_RC2_CBC_PARAMETERS ((LPCSTR) 41)
#define PKCS_SMIME_CAPABILITIES ((LPCSTR) 42) #define PKCS_SMIME_CAPABILITIES ((LPCSTR) 42)
// Qualified Certificate Statements Extension uses the same encode/decode
// function as PKCS_SMIME_CAPABILITIES. Its data structures are identical
// except for the names of the fields.
#define X509_QC_STATEMENTS_EXT ((LPCSTR) 42)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// data structures for private keys // data structures for private keys
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define PKCS_RSA_PRIVATE_KEY ((LPCSTR) 43) #define PKCS_RSA_PRIVATE_KEY ((LPCSTR) 43)
#define PKCS_PRIVATE_KEY_INFO ((LPCSTR) 44) #define PKCS_PRIVATE_KEY_INFO ((LPCSTR) 44)
#define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR) 45) #define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR) 45)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// certificate policy qualifier // certificate policy qualifier
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 2434 skipping to change at line 3157
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Diffie-Hellman Key Exchange // Diffie-Hellman Key Exchange
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT #define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
#define X509_DH_PARAMETERS ((LPCSTR) 47) #define X509_DH_PARAMETERS ((LPCSTR) 47)
#define PKCS_ATTRIBUTES ((LPCSTR) 48) #define PKCS_ATTRIBUTES ((LPCSTR) 48)
#define PKCS_SORTED_CTL ((LPCSTR) 49) #define PKCS_SORTED_CTL ((LPCSTR) 49)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// ECC Signature
//--------------------------------------------------------------------------
// Uses the same encode/decode function as X509_DH_PARAMETERS. Its data
// structure is identical except for the names of the fields.
#define X509_ECC_SIGNATURE ((LPCSTR) 47)
//+-------------------------------------------------------------------------
// X942 Diffie-Hellman // X942 Diffie-Hellman
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define X942_DH_PARAMETERS ((LPCSTR) 50) #define X942_DH_PARAMETERS ((LPCSTR) 50)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// The following is the same as X509_BITS, except before encoding, // The following is the same as X509_BITS, except before encoding,
// the bit length is decremented to exclude trailing zero bits. // the bit length is decremented to exclude trailing zero bits.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR) 51) #define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR) 51)
skipping to change at line 2471 skipping to change at line 3201
#define CMC_STATUS ((LPCSTR) 61) #define CMC_STATUS ((LPCSTR) 61)
#define CMC_ADD_EXTENSIONS ((LPCSTR) 62) #define CMC_ADD_EXTENSIONS ((LPCSTR) 62)
#define CMC_ADD_ATTRIBUTES ((LPCSTR) 63) #define CMC_ADD_ATTRIBUTES ((LPCSTR) 63)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Template // Certificate Template
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define X509_CERTIFICATE_TEMPLATE ((LPCSTR) 64) #define X509_CERTIFICATE_TEMPLATE ((LPCSTR) 64)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Online Certificate Status Protocol (OCSP) Data Structures
//--------------------------------------------------------------------------
#define OCSP_SIGNED_REQUEST ((LPCSTR) 65)
#define OCSP_REQUEST ((LPCSTR) 66)
#define OCSP_RESPONSE ((LPCSTR) 67)
#define OCSP_BASIC_SIGNED_RESPONSE ((LPCSTR) 68)
#define OCSP_BASIC_RESPONSE ((LPCSTR) 69)
//+-------------------------------------------------------------------------
// Logotype and Biometric Extensions
//--------------------------------------------------------------------------
#define X509_LOGOTYPE_EXT ((LPCSTR) 70)
#define X509_BIOMETRIC_EXT ((LPCSTR) 71)
#define CNG_RSA_PUBLIC_KEY_BLOB ((LPCSTR) 72)
#define X509_OBJECT_IDENTIFIER ((LPCSTR) 73)
#define X509_ALGORITHM_IDENTIFIER ((LPCSTR) 74)
#define PKCS_RSA_SSA_PSS_PARAMETERS ((LPCSTR) 75)
#define PKCS_RSAES_OAEP_PARAMETERS ((LPCSTR) 76)
#define ECC_CMS_SHARED_INFO ((LPCSTR) 77)
//+-------------------------------------------------------------------------
// 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 2505 skipping to change at line 3258
#define szOID_KEY_USAGE_RESTRICTION "2.5.29.4" #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
#define szOID_SUBJECT_ALT_NAME "2.5.29.7" #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
#define szOID_ISSUER_ALT_NAME "2.5.29.8" #define szOID_ISSUER_ALT_NAME "2.5.29.8"
#define szOID_BASIC_CONSTRAINTS "2.5.29.10" #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
#define szOID_KEY_USAGE "2.5.29.15" #define szOID_KEY_USAGE "2.5.29.15"
#define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16" #define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16"
#define szOID_BASIC_CONSTRAINTS2 "2.5.29.19" #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
#define szOID_CERT_POLICIES "2.5.29.32" #define szOID_CERT_POLICIES "2.5.29.32"
#define szOID_ANY_CERT_POLICY "2.5.29.32.0" #define szOID_ANY_CERT_POLICY "2.5.29.32.0"
#define szOID_INHIBIT_ANY_POLICY "2.5.29.54"
#define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35" #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
#define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14" #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
#define szOID_SUBJECT_ALT_NAME2 "2.5.29.17" #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
#define szOID_ISSUER_ALT_NAME2 "2.5.29.18" #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
#define szOID_CRL_REASON_CODE "2.5.29.21" #define szOID_CRL_REASON_CODE "2.5.29.21"
#define szOID_REASON_CODE_HOLD "2.5.29.23" #define szOID_REASON_CODE_HOLD "2.5.29.23"
#define szOID_CRL_DIST_POINTS "2.5.29.31" #define szOID_CRL_DIST_POINTS "2.5.29.31"
#define szOID_ENHANCED_KEY_USAGE "2.5.29.37" #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
#define szOID_ANY_ENHANCED_KEY_USAGE "2.5.29.37.0"
// szOID_CRL_NUMBER -- Base CRLs only. Monotonically increasing sequence // szOID_CRL_NUMBER -- Base CRLs only. Monotonically increasing sequence
// number for each CRL issued by a CA. // number for each CRL issued by a CA.
#define szOID_CRL_NUMBER "2.5.29.20" #define szOID_CRL_NUMBER "2.5.29.20"
// szOID_DELTA_CRL_INDICATOR -- Delta CRLs only. Marked critical. // szOID_DELTA_CRL_INDICATOR -- Delta CRLs only. Marked critical.
// Contains the minimum base CRL Number that can be used with a delta CRL. // Contains the minimum base CRL Number that can be used with a delta CRL.
#define szOID_DELTA_CRL_INDICATOR "2.5.29.27" #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
#define szOID_ISSUING_DIST_POINT "2.5.29.28" #define szOID_ISSUING_DIST_POINT "2.5.29.28"
// szOID_FRESHEST_CRL -- Base CRLs only. Formatted identically to a CDP // szOID_FRESHEST_CRL -- Base CRLs only. Formatted identically to a CDP
// extension that holds URLs to fetch the delta CRL. // extension that holds URLs to fetch the delta CRL.
#define szOID_FRESHEST_CRL "2.5.29.46" #define szOID_FRESHEST_CRL "2.5.29.46"
skipping to change at line 2546 skipping to change at line 3302
#define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3" #define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3"
// //
// Extension contain certificate type // Extension contain certificate type
#define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1" #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
// Internet Public Key Infrastructure (PKIX) // Internet Public Key Infrastructure (PKIX)
#define szOID_PKIX "1.3.6.1.5.5.7" #define szOID_PKIX "1.3.6.1.5.5.7"
#define szOID_PKIX_PE "1.3.6.1.5.5.7.1" #define szOID_PKIX_PE "1.3.6.1.5.5.7.1"
#define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1" #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
#define szOID_SUBJECT_INFO_ACCESS "1.3.6.1.5.5.7.1.11"
#define szOID_BIOMETRIC_EXT "1.3.6.1.5.5.7.1.2"
#define szOID_QC_STATEMENTS_EXT "1.3.6.1.5.5.7.1.3"
#define szOID_LOGOTYPE_EXT "1.3.6.1.5.5.7.1.12"
// Microsoft extensions or attributes // Microsoft extensions or attributes
#define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14" #define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14"
#define szOID_NEXT_UPDATE_LOCATION "1.3.6.1.4.1.311.10.2" #define szOID_NEXT_UPDATE_LOCATION "1.3.6.1.4.1.311.10.2"
#define szOID_REMOVE_CERTIFICATE "1.3.6.1.4.1.311.10.8.1" #define szOID_REMOVE_CERTIFICATE "1.3.6.1.4.1.311.10.8.1"
#define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1" #define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1"
// Microsoft PKCS #7 ContentType Object Identifiers // Microsoft PKCS #7 ContentType Object Identifiers
#define szOID_CTL "1.3.6.1.4.1.311.10.1" #define szOID_CTL "1.3.6.1.4.1.311.10.1"
skipping to change at line 2583 skipping to change at line 3343
// 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
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1" #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
// Extension contain certificate type // Extension contain certificate type
// AKA Certificate template extension (v1)
#define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2" #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
#define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3" #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Object Identifiers for use with the MS Certificate Server // Object Identifiers for use with the MS Certificate Server
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#ifndef szOID_CERTSRV_CA_VERSION #ifndef szOID_CERTSRV_CA_VERSION
#define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1" #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
#endif #endif
skipping to change at line 2690 skipping to change at line 3451
// (KEY_ENCIPHERMENT or KEY_AGREEMENT) // (KEY_ENCIPHERMENT or KEY_AGREEMENT)
#define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6" #define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6"
// Consistent key usage bits: DIGITAL_SIGNATURE and/or // Consistent key usage bits: DIGITAL_SIGNATURE and/or
// (KEY_ENCIPHERMENT or KEY_AGREEMENT) // (KEY_ENCIPHERMENT or KEY_AGREEMENT)
#define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7" #define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7"
// Consistent key usage bits: DIGITAL_SIGNATURE or NON_REPUDIATION // Consistent key usage bits: DIGITAL_SIGNATURE or NON_REPUDIATION
#define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8" #define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8"
// OCSP response signer
#define szOID_PKIX_KP_OCSP_SIGNING "1.3.6.1.5.5.7.3.9"
// Following extension is present to indicate no revocation checking
// for the OCSP signer certificate
#define szOID_PKIX_OCSP_NOCHECK "1.3.6.1.5.5.7.48.1.5"
// OCSP Nonce
#define szOID_PKIX_OCSP_NONCE "1.3.6.1.5.5.7.48.1.2"
// IKE (Internet Key Exchange) Intermediate KP for an IPsec end entity. // IKE (Internet Key Exchange) Intermediate KP for an IPsec end entity.
// Defined in draft-ietf-ipsec-pki-req-04.txt, December 14, 1999. // Defined in draft-ietf-ipsec-pki-req-04.txt, December 14, 1999.
#define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2" #define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2"
// iso (1) org (3) dod (6) internet (1) security (5) kerberosv5 (2) pkinit (3) 5
#define szOID_PKINIT_KP_KDC "1.3.6.1.5.2.3.5"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Microsoft Enhanced Key Usage (Purpose) Object Identifiers // Microsoft Enhanced Key Usage (Purpose) Object Identifiers
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Signer of CTLs // Signer of CTLs
#define szOID_KP_CTL_USAGE_SIGNING "1.3.6.1.4.1.311.10.3.1" #define szOID_KP_CTL_USAGE_SIGNING "1.3.6.1.4.1.311.10.3.1"
// Signer of TimeStamps // Signer of TimeStamps
#define szOID_KP_TIME_STAMP_SIGNING "1.3.6.1.4.1.311.10.3.2" #define szOID_KP_TIME_STAMP_SIGNING "1.3.6.1.4.1.311.10.3.2"
skipping to change at line 2750 skipping to change at line 3524
// The default WinVerifyTrust Authenticode policy is to treat all time stamped // The default WinVerifyTrust Authenticode policy is to treat all time stamped
// signatures as being valid forever. This OID limits the valid lifetime of the // signatures as being valid forever. This OID limits the valid lifetime of the
// signature to the lifetime of the certificate. This allows timestamped // signature to the lifetime of the certificate. This allows timestamped
// signatures to expire. Normally this OID will be used in conjunction with // signatures to expire. Normally this OID will be used in conjunction with
// szOID_PKIX_KP_CODE_SIGNING to indicate new time stamp semantics should be // szOID_PKIX_KP_CODE_SIGNING to indicate new time stamp semantics should be
// used. Support for this OID was added in WXP. // used. Support for this OID was added in WXP.
#define szOID_KP_LIFETIME_SIGNING "1.3.6.1.4.1.311.10.3.13" #define szOID_KP_LIFETIME_SIGNING "1.3.6.1.4.1.311.10.3.13"
#define szOID_KP_MOBILE_DEVICE_SOFTWARE "1.3.6.1.4.1.311.10.3.14" #define szOID_KP_MOBILE_DEVICE_SOFTWARE "1.3.6.1.4.1.311.10.3.14"
#define szOID_KP_SMART_DISPLAY "1.3.6.1.4.1.311.10.3.15"
#define szOID_KP_CSP_SIGNATURE "1.3.6.1.4.1.311.10.3.16"
#ifndef szOID_DRM #ifndef szOID_DRM
#define szOID_DRM "1.3.6.1.4.1.311.10.5.1" #define szOID_DRM "1.3.6.1.4.1.311.10.5.1"
#endif #endif
// Microsoft DRM EKU // Microsoft DRM EKU
#ifndef szOID_DRM_INDIVIDUALIZATION #ifndef szOID_DRM_INDIVIDUALIZATION
#define szOID_DRM_INDIVIDUALIZATION "1.3.6.1.4.1.311.10.5.2" #define szOID_DRM_INDIVIDUALIZATION "1.3.6.1.4.1.311.10.5.2"
#endif #endif
#ifndef szOID_LICENSES #ifndef szOID_LICENSES
skipping to change at line 2771 skipping to change at line 3549
#endif #endif
#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"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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"
#define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2" #define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2"
#define szOID_ROOT_PROGRAM_FLAGS "1.3.6.1.4.1.311.60.1.1"
// 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 "
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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.
skipping to change at line 2836 skipping to change at line 3618
// //
// For CryptEncodeObject(), the pbEncoded is just the "to be signed". // For CryptEncodeObject(), the pbEncoded is just the "to be signed".
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_EXTENSIONS // X509_EXTENSIONS
// szOID_CERT_EXTENSIONS // szOID_CERT_EXTENSIONS
// //
// pvStructInfo points to following CERT_EXTENSIONS. // pvStructInfo points to following CERT_EXTENSIONS.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_CONTEXTS
typedef struct _CERT_EXTENSIONS { typedef struct _CERT_EXTENSIONS {
DWORD cExtension; DWORD cExtension;
PCERT_EXTENSION rgExtension; PCERT_EXTENSION rgExtension;
} CERT_EXTENSIONS, *PCERT_EXTENSIONS; } CERT_EXTENSIONS, *PCERT_EXTENSIONS;
// certenrolls_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_NAME_VALUE // X509_NAME_VALUE
// X509_ANY_STRING // X509_ANY_STRING
// //
// pvStructInfo points to CERT_NAME_VALUE. // pvStructInfo points to CERT_NAME_VALUE.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_UNICODE_NAME_VALUE // X509_UNICODE_NAME_VALUE
skipping to change at line 3024 skipping to change at line 3808
FILETIME NotBefore; FILETIME NotBefore;
FILETIME NotAfter; FILETIME NotAfter;
} CERT_PRIVATE_KEY_VALIDITY, *PCERT_PRIVATE_KEY_VALIDITY; } CERT_PRIVATE_KEY_VALIDITY, *PCERT_PRIVATE_KEY_VALIDITY;
typedef struct _CERT_KEY_ATTRIBUTES_INFO { typedef struct _CERT_KEY_ATTRIBUTES_INFO {
CRYPT_DATA_BLOB KeyId; CRYPT_DATA_BLOB KeyId;
CRYPT_BIT_BLOB IntendedKeyUsage; CRYPT_BIT_BLOB IntendedKeyUsage;
PCERT_PRIVATE_KEY_VALIDITY pPrivateKeyUsagePeriod; // OPTIONAL PCERT_PRIVATE_KEY_VALIDITY pPrivateKeyUsagePeriod; // OPTIONAL
} CERT_KEY_ATTRIBUTES_INFO, *PCERT_KEY_ATTRIBUTES_INFO; } CERT_KEY_ATTRIBUTES_INFO, *PCERT_KEY_ATTRIBUTES_INFO;
// certenrolld_begin -- CERT_*_KEY_USAGE
// Byte[0] // Byte[0]
#define CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80 #define CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80
#define CERT_NON_REPUDIATION_KEY_USAGE 0x40 #define CERT_NON_REPUDIATION_KEY_USAGE 0x40
#define CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20 #define CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20
#define CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10 #define CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10
#define CERT_KEY_AGREEMENT_KEY_USAGE 0x08 #define CERT_KEY_AGREEMENT_KEY_USAGE 0x08
#define CERT_KEY_CERT_SIGN_KEY_USAGE 0x04 #define CERT_KEY_CERT_SIGN_KEY_USAGE 0x04
#define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x02 #define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x02
#define CERT_CRL_SIGN_KEY_USAGE 0x02 #define CERT_CRL_SIGN_KEY_USAGE 0x02
#define CERT_ENCIPHER_ONLY_KEY_USAGE 0x01 #define CERT_ENCIPHER_ONLY_KEY_USAGE 0x01
// Byte[1] // Byte[1]
#define CERT_DECIPHER_ONLY_KEY_USAGE 0x80 #define CERT_DECIPHER_ONLY_KEY_USAGE 0x80
// certenrolld_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_KEY_USAGE_RESTRICTION // X509_KEY_USAGE_RESTRICTION
// szOID_KEY_USAGE_RESTRICTION // szOID_KEY_USAGE_RESTRICTION
// //
// pvStructInfo points to following CERT_KEY_USAGE_RESTRICTION_INFO. // pvStructInfo points to following CERT_KEY_USAGE_RESTRICTION_INFO.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_POLICY_ID { typedef struct _CERT_POLICY_ID {
DWORD cCertPolicyElementId; DWORD cCertPolicyElementId;
LPSTR *rgpszCertPolicyElementId; // pszObjId LPSTR *rgpszCertPolicyElementId; // pszObjId
skipping to change at line 3066 skipping to change at line 3852
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_ALTERNATE_NAME // X509_ALTERNATE_NAME
// szOID_SUBJECT_ALT_NAME // szOID_SUBJECT_ALT_NAME
// szOID_ISSUER_ALT_NAME // szOID_ISSUER_ALT_NAME
// szOID_SUBJECT_ALT_NAME2 // szOID_SUBJECT_ALT_NAME2
// szOID_ISSUER_ALT_NAME2 // szOID_ISSUER_ALT_NAME2
// //
// pvStructInfo points to following CERT_ALT_NAME_INFO. // pvStructInfo points to following CERT_ALT_NAME_INFO.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_ALT_NAME_INFO
typedef struct _CERT_OTHER_NAME { typedef struct _CERT_OTHER_NAME {
LPSTR pszObjId; LPSTR pszObjId;
CRYPT_OBJID_BLOB Value; CRYPT_OBJID_BLOB Value;
} CERT_OTHER_NAME, *PCERT_OTHER_NAME; } CERT_OTHER_NAME, *PCERT_OTHER_NAME;
typedef struct _CERT_ALT_NAME_ENTRY { typedef struct _CERT_ALT_NAME_ENTRY {
DWORD dwAltNameChoice; DWORD dwAltNameChoice;
union { union { // certenrolls_skip
PCERT_OTHER_NAME pOtherName; // 1 PCERT_OTHER_NAME pOtherName; // 1
LPWSTR pwszRfc822Name; // 2 (encoded IA5) LPWSTR pwszRfc822Name; // 2 (encoded IA5)
LPWSTR pwszDNSName; // 3 (encoded IA5) LPWSTR pwszDNSName; // 3 (encoded IA5)
// Not implemented x400Address; // 4 // Not implemented x400Address; // 4
CERT_NAME_BLOB DirectoryName; // 5 CERT_NAME_BLOB DirectoryName; // 5
// Not implemented pEdiPartyName; // 6 // Not implemented pEdiPartyName; // 6
LPWSTR pwszURL; // 7 (encoded IA5) LPWSTR pwszURL; // 7 (encoded IA5)
CRYPT_DATA_BLOB IPAddress; // 8 (Octet String) CRYPT_DATA_BLOB IPAddress; // 8 (Octet String)
LPSTR pszRegisteredID; // 9 (Object Identifer) LPSTR pszRegisteredID; // 9 (Object Identifer)
}; }; // certenrolls_skip
} CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY; } CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY;
// certenrolls_end
// certenrolld_begin -- CERT_ALT_NAME_*
#define CERT_ALT_NAME_OTHER_NAME 1 #define CERT_ALT_NAME_OTHER_NAME 1
#define CERT_ALT_NAME_RFC822_NAME 2 #define CERT_ALT_NAME_RFC822_NAME 2
#define CERT_ALT_NAME_DNS_NAME 3 #define CERT_ALT_NAME_DNS_NAME 3
#define CERT_ALT_NAME_X400_ADDRESS 4 #define CERT_ALT_NAME_X400_ADDRESS 4
#define CERT_ALT_NAME_DIRECTORY_NAME 5 #define CERT_ALT_NAME_DIRECTORY_NAME 5
#define CERT_ALT_NAME_EDI_PARTY_NAME 6 #define CERT_ALT_NAME_EDI_PARTY_NAME 6
#define CERT_ALT_NAME_URL 7 #define CERT_ALT_NAME_URL 7
#define CERT_ALT_NAME_IP_ADDRESS 8 #define CERT_ALT_NAME_IP_ADDRESS 8
#define CERT_ALT_NAME_REGISTERED_ID 9 #define CERT_ALT_NAME_REGISTERED_ID 9
// certenrolld_end
// certenrolls_begin -- CERT_ALT_NAME_INFO
typedef struct _CERT_ALT_NAME_INFO { typedef struct _CERT_ALT_NAME_INFO {
DWORD cAltEntry; DWORD cAltEntry;
PCERT_ALT_NAME_ENTRY rgAltEntry; PCERT_ALT_NAME_ENTRY rgAltEntry;
} CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO; } CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO;
// certenrolls_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Alternate name IA5 Error Location Definitions for // Alternate name IA5 Error Location Definitions for
// CRYPT_E_INVALID_IA5_STRING. // CRYPT_E_INVALID_IA5_STRING.
// //
// Error location is returned in *pcbEncoded by // Error location is returned in *pcbEncoded by
// CryptEncodeObject(X509_ALTERNATE_NAME) // CryptEncodeObject(X509_ALTERNATE_NAME)
// //
// Error location consists of: // Error location consists of:
// ENTRY_INDEX - 8 bits << 16 // ENTRY_INDEX - 8 bits << 16
skipping to change at line 3170 skipping to change at line 3962
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_CERT_POLICIES // X509_CERT_POLICIES
// szOID_CERT_POLICIES // szOID_CERT_POLICIES
// szOID_CERT_POLICIES_95 NOTE--Only allowed for decoding!!! // szOID_CERT_POLICIES_95 NOTE--Only allowed for decoding!!!
// //
// pvStructInfo points to following CERT_POLICIES_INFO. // pvStructInfo points to following CERT_POLICIES_INFO.
// //
// NOTE: when decoding using szOID_CERT_POLICIES_95 the pszPolicyIdentifier // NOTE: when decoding using szOID_CERT_POLICIES_95 the pszPolicyIdentifier
// may contain an empty string // may contain an empty string
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_POLICY_QUALIFIER_INFO
typedef struct _CERT_POLICY_QUALIFIER_INFO { typedef struct _CERT_POLICY_QUALIFIER_INFO {
LPSTR pszPolicyQualifierId; // pszObjId LPSTR pszPolicyQualifierId; // pszObjId
CRYPT_OBJID_BLOB Qualifier; // optional CRYPT_OBJID_BLOB Qualifier; // optional
} CERT_POLICY_QUALIFIER_INFO, *PCERT_POLICY_QUALIFIER_INFO; } CERT_POLICY_QUALIFIER_INFO, *PCERT_POLICY_QUALIFIER_INFO;
typedef struct _CERT_POLICY_INFO { typedef struct _CERT_POLICY_INFO {
LPSTR pszPolicyIdentifier; // pszObjId LPSTR pszPolicyIdentifier; // pszObjId
DWORD cPolicyQualifier; // optional DWORD cPolicyQualifier; // optional
CERT_POLICY_QUALIFIER_INFO *rgPolicyQualifier; CERT_POLICY_QUALIFIER_INFO *rgPolicyQualifier;
} CERT_POLICY_INFO, *PCERT_POLICY_INFO; } CERT_POLICY_INFO, *PCERT_POLICY_INFO;
typedef struct _CERT_POLICIES_INFO { typedef struct _CERT_POLICIES_INFO {
DWORD cPolicyInfo; DWORD cPolicyInfo;
CERT_POLICY_INFO *rgPolicyInfo; CERT_POLICY_INFO *rgPolicyInfo;
} CERT_POLICIES_INFO, *PCERT_POLICIES_INFO; } CERT_POLICIES_INFO, *PCERT_POLICIES_INFO;
// certenrolls_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_PKIX_POLICY_QUALIFIER_USERNOTICE // X509_PKIX_POLICY_QUALIFIER_USERNOTICE
// szOID_PKIX_POLICY_QUALIFIER_USERNOTICE // szOID_PKIX_POLICY_QUALIFIER_USERNOTICE
// //
// pvStructInfo points to following CERT_POLICY_QUALIFIER_USER_NOTICE. // pvStructInfo points to following CERT_POLICY_QUALIFIER_USER_NOTICE.
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE { typedef struct _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE {
LPSTR pszOrganization; LPSTR pszOrganization;
skipping to change at line 3225 skipping to change at line 4019
typedef struct _CERT_POLICY95_QUALIFIER1 { typedef struct _CERT_POLICY95_QUALIFIER1 {
LPWSTR pszPracticesReference; // optional LPWSTR pszPracticesReference; // optional
LPSTR pszNoticeIdentifier; // optional LPSTR pszNoticeIdentifier; // optional
LPSTR pszNSINoticeIdentifier; // optional LPSTR pszNSINoticeIdentifier; // optional
DWORD cCPSURLs; DWORD cCPSURLs;
CPS_URLS *rgCPSURLs; // optional CPS_URLS *rgCPSURLs; // optional
} CERT_POLICY95_QUALIFIER1, *PCERT_POLICY95_QUALIFIER1; } CERT_POLICY95_QUALIFIER1, *PCERT_POLICY95_QUALIFIER1;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// szOID_INHIBIT_ANY_POLICY data structure
//
// pvStructInfo points to an int.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// X509_POLICY_MAPPINGS // X509_POLICY_MAPPINGS
// szOID_POLICY_MAPPINGS // szOID_POLICY_MAPPINGS
// szOID_LEGACY_POLICY_MAPPINGS // szOID_LEGACY_POLICY_MAPPINGS
// //
// pvStructInfo points to following CERT_POLICY_MAPPINGS_INFO. // pvStructInfo points to following CERT_POLICY_MAPPINGS_INFO.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_POLICY_MAPPING { typedef struct _CERT_POLICY_MAPPING {
LPSTR pszIssuerDomainPolicy; // pszObjId LPSTR pszIssuerDomainPolicy; // pszObjId
LPSTR pszSubjectDomainPolicy; // pszObjId LPSTR pszSubjectDomainPolicy; // pszObjId
} CERT_POLICY_MAPPING, *PCERT_POLICY_MAPPING; } CERT_POLICY_MAPPING, *PCERT_POLICY_MAPPING;
skipping to change at line 3277 skipping to change at line 4077
// modulus INTEGER and a publicExponent INTEGER. The modulus is encoded // modulus INTEGER and a publicExponent INTEGER. The modulus is encoded
// as being a unsigned integer. When decoded, if the modulus was encoded // as being a unsigned integer. When decoded, if the modulus was encoded
// as unsigned integer with a leading 0 byte, the 0 byte is removed before // as unsigned integer with a leading 0 byte, the 0 byte is removed before
// converting to the CSP modulus bytes. // converting to the CSP modulus bytes.
// //
// For decode, the aiKeyAlg field of PUBLICKEYSTRUC is always set to // For decode, the aiKeyAlg field of PUBLICKEYSTRUC is always set to
// CALG_RSA_KEYX. // CALG_RSA_KEYX.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CNG_RSA_PUBLIC_KEY_BLOB
//
// pvStructInfo points to a BCRYPT_RSAKEY_BLOB immediately followed by the
// exponent and the modulus bytes. Both the exponent and modulus are
// big endian. The private key fields consisting of cbPrime1 and cbPrime2
// are set to zero.
//
// For dwCertEncodingType = X509_ASN_ENCODING, the CNG_RSA_PUBLIC_KEY_BLOB is
// encoded as a PKCS #1 RSAPublicKey consisting of a SEQUENCE of a
// modulus HUGEINTEGER and a publicExponent HUGEINTEGER.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// X509_KEYGEN_REQUEST_TO_BE_SIGNED // X509_KEYGEN_REQUEST_TO_BE_SIGNED
// //
// pvStructInfo points to CERT_KEYGEN_REQUEST_INFO. // pvStructInfo points to CERT_KEYGEN_REQUEST_INFO.
// //
// For CryptDecodeObject(), the pbEncoded is the "to be signed" plus its // For CryptDecodeObject(), the pbEncoded is the "to be signed" plus its
// signature (output of a X509_CERT CryptEncodeObject()). // signature (output of a X509_CERT CryptEncodeObject()).
// //
// For CryptEncodeObject(), the pbEncoded is just the "to be signed". // For CryptEncodeObject(), the pbEncoded is just the "to be signed".
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 3415 skipping to change at line 4228
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// szOID_SUBJECT_KEY_IDENTIFIER // szOID_SUBJECT_KEY_IDENTIFIER
// //
// pvStructInfo points to a CRYPT_DATA_BLOB. // pvStructInfo points to a CRYPT_DATA_BLOB.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_AUTHORITY_INFO_ACCESS // X509_AUTHORITY_INFO_ACCESS
// szOID_AUTHORITY_INFO_ACCESS // szOID_AUTHORITY_INFO_ACCESS
// //
// X509_SUBJECT_INFO_ACCESS
// szOID_SUBJECT_INFO_ACCESS
//
// pvStructInfo points to following CERT_AUTHORITY_INFO_ACCESS. // pvStructInfo points to following CERT_AUTHORITY_INFO_ACCESS.
// //
// For CRYPT_E_INVALID_IA5_STRING, the error location is returned in // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
// *pcbEncoded by CryptEncodeObject(X509_AUTHORITY_INFO_ACCESS) // *pcbEncoded by CryptEncodeObject(X509_AUTHORITY_INFO_ACCESS)
// //
// Error location consists of: // Error location consists of:
// ENTRY_INDEX - 8 bits << 16 // ENTRY_INDEX - 8 bits << 16
// VALUE_INDEX - 16 bits (unicode character index) // VALUE_INDEX - 16 bits (unicode character index)
// //
// See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location // See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location
// defines. // defines.
//
// Note, the szOID_SUBJECT_INFO_ACCESS extension has the same ASN.1
// encoding as the szOID_AUTHORITY_INFO_ACCESS extension.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_ACCESS_DESCRIPTION { typedef struct _CERT_ACCESS_DESCRIPTION {
LPSTR pszAccessMethod; // pszObjId LPSTR pszAccessMethod; // pszObjId
CERT_ALT_NAME_ENTRY AccessLocation; CERT_ALT_NAME_ENTRY AccessLocation;
} CERT_ACCESS_DESCRIPTION, *PCERT_ACCESS_DESCRIPTION; } CERT_ACCESS_DESCRIPTION, *PCERT_ACCESS_DESCRIPTION;
typedef struct _CERT_AUTHORITY_INFO_ACCESS { typedef struct _CERT_AUTHORITY_INFO_ACCESS {
DWORD cAccDescr; DWORD cAccDescr;
PCERT_ACCESS_DESCRIPTION rgAccDescr; PCERT_ACCESS_DESCRIPTION rgAccDescr;
} CERT_AUTHORITY_INFO_ACCESS, *PCERT_AUTHORITY_INFO_ACCESS; } CERT_AUTHORITY_INFO_ACCESS, *PCERT_AUTHORITY_INFO_ACCESS,
CERT_SUBJECT_INFO_ACCESS, *PCERT_SUBJECT_INFO_ACCESS;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PKIX Access Description: Access Method Object Identifiers // PKIX Access Description: Access Method Object Identifiers
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define szOID_PKIX_ACC_DESCR "1.3.6.1.5.5.7.48" #define szOID_PKIX_ACC_DESCR "1.3.6.1.5.5.7.48"
// For szOID_AUTHORITY_INFO_ACCESS
#define szOID_PKIX_OCSP "1.3.6.1.5.5.7.48.1" #define szOID_PKIX_OCSP "1.3.6.1.5.5.7.48.1"
#define szOID_PKIX_CA_ISSUERS "1.3.6.1.5.5.7.48.2" #define szOID_PKIX_CA_ISSUERS "1.3.6.1.5.5.7.48.2"
// For szOID_SUBJECT_INFO_ACCESS
#define szOID_PKIX_TIME_STAMPING "1.3.6.1.5.5.7.48.3"
#define szOID_PKIX_CA_REPOSITORY "1.3.6.1.5.5.7.48.5"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_CRL_REASON_CODE // X509_CRL_REASON_CODE
// szOID_CRL_REASON_CODE // szOID_CRL_REASON_CODE
// //
// pvStructInfo points to an int which can be set to one of the following // pvStructInfo points to an int which can be set to one of the following
// enumerated values: // enumerated values:
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRL_REASON_UNSPECIFIED 0 #define CRL_REASON_UNSPECIFIED 0
#define CRL_REASON_KEY_COMPROMISE 1 #define CRL_REASON_KEY_COMPROMISE 1
#define CRL_REASON_CA_COMPROMISE 2 #define CRL_REASON_CA_COMPROMISE 2
skipping to change at line 3763 skipping to change at line 4589
// X509_DH_PARAMETERS // X509_DH_PARAMETERS
// //
// pvStructInfo points to following CERT_DH_PARAMETERS data structure. // pvStructInfo points to following CERT_DH_PARAMETERS data structure.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_DH_PARAMETERS { typedef struct _CERT_DH_PARAMETERS {
CRYPT_UINT_BLOB p; CRYPT_UINT_BLOB p;
CRYPT_UINT_BLOB g; CRYPT_UINT_BLOB g;
} CERT_DH_PARAMETERS, *PCERT_DH_PARAMETERS; } CERT_DH_PARAMETERS, *PCERT_DH_PARAMETERS;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// X509_ECC_SIGNATURE
//
// pvStructInfo points to following CERT_ECC_SIGNATURE data structure.
//
// Note, identical to the above except for the names of the fields. Same
// underlying encode/decode functions are used.
//--------------------------------------------------------------------------
typedef struct _CERT_ECC_SIGNATURE {
CRYPT_UINT_BLOB r;
CRYPT_UINT_BLOB s;
} CERT_ECC_SIGNATURE, *PCERT_ECC_SIGNATURE;
//+-------------------------------------------------------------------------
// X942_DH_PARAMETERS // X942_DH_PARAMETERS
// //
// pvStructInfo points to following CERT_X942_DH_PARAMETERS data structure. // pvStructInfo points to following CERT_X942_DH_PARAMETERS data structure.
// //
// If q.cbData == 0, then, the following fields are zero'ed. // If q.cbData == 0, then, the following fields are zero'ed.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_X942_DH_VALIDATION_PARAMS { typedef struct _CERT_X942_DH_VALIDATION_PARAMS {
CRYPT_BIT_BLOB seed; CRYPT_BIT_BLOB seed;
DWORD pgenCounter; DWORD pgenCounter;
} CERT_X942_DH_VALIDATION_PARAMS, *PCERT_X942_DH_VALIDATION_PARAMS; } CERT_X942_DH_VALIDATION_PARAMS, *PCERT_X942_DH_VALIDATION_PARAMS;
skipping to change at line 3800 skipping to change at line 4639
#define CRYPT_X942_KEY_LENGTH_BYTE_LENGTH 4 #define CRYPT_X942_KEY_LENGTH_BYTE_LENGTH 4
#define CRYPT_X942_PUB_INFO_BYTE_LENGTH (512/8) #define CRYPT_X942_PUB_INFO_BYTE_LENGTH (512/8)
typedef struct _CRYPT_X942_OTHER_INFO { typedef struct _CRYPT_X942_OTHER_INFO {
LPSTR pszContentEncryptionObjId; LPSTR pszContentEncryptionObjId;
BYTE rgbCounter[CRYPT_X942_COUNTER_BYTE_LENGTH]; BYTE rgbCounter[CRYPT_X942_COUNTER_BYTE_LENGTH];
BYTE rgbKeyLength[CRYPT_X942_KEY_LENGTH_BYTE_LENGTH]; BYTE rgbKeyLength[CRYPT_X942_KEY_LENGTH_BYTE_LENGTH];
CRYPT_DATA_BLOB PubInfo; // OPTIONAL CRYPT_DATA_BLOB PubInfo; // OPTIONAL
} CRYPT_X942_OTHER_INFO, *PCRYPT_X942_OTHER_INFO; } CRYPT_X942_OTHER_INFO, *PCRYPT_X942_OTHER_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// ECC_CMS_SHARED_INFO
//
// pvStructInfo points to following ECC_CMS_SHARED_INFO data structure.
//
// rgbSuppPubInfo is in Little Endian order.
//--------------------------------------------------------------------------
#define CRYPT_ECC_CMS_SHARED_INFO_SUPPPUBINFO_BYTE_LENGTH 4
typedef struct _CRYPT_ECC_CMS_SHARED_INFO {
CRYPT_ALGORITHM_IDENTIFIER Algorithm;
CRYPT_DATA_BLOB EntityUInfo; // OPTIONAL
BYTE rgbSuppPubInfo[CRYPT_ECC_CMS_SHARED_INFO_SUPPPUB
INFO_BYTE_LENGTH];
} CRYPT_ECC_CMS_SHARED_INFO, *PCRYPT_ECC_CMS_SHARED_INFO;
//+-------------------------------------------------------------------------
// PKCS_RC2_CBC_PARAMETERS // PKCS_RC2_CBC_PARAMETERS
// szOID_RSA_RC2CBC // szOID_RSA_RC2CBC
// //
// pvStructInfo points to following CRYPT_RC2_CBC_PARAMETERS data structure. // pvStructInfo points to following CRYPT_RC2_CBC_PARAMETERS data structure.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_RC2_CBC_PARAMETERS { typedef struct _CRYPT_RC2_CBC_PARAMETERS {
DWORD dwVersion; DWORD dwVersion;
BOOL fIV; // set if has following IV BOOL fIV; // set if has following IV
BYTE rgbIV[8]; BYTE rgbIV[8];
} CRYPT_RC2_CBC_PARAMETERS, *PCRYPT_RC2_CBC_PARAMETERS; } CRYPT_RC2_CBC_PARAMETERS, *PCRYPT_RC2_CBC_PARAMETERS;
skipping to change at line 3827 skipping to change at line 4680
// PKCS_SMIME_CAPABILITIES // PKCS_SMIME_CAPABILITIES
// szOID_RSA_SMIMECapabilities // szOID_RSA_SMIMECapabilities
// //
// pvStructInfo points to following CRYPT_SMIME_CAPABILITIES data structure. // pvStructInfo points to following CRYPT_SMIME_CAPABILITIES data structure.
// //
// Note, for CryptEncodeObject(X509_ASN_ENCODING), Parameters.cbData == 0 // Note, for CryptEncodeObject(X509_ASN_ENCODING), Parameters.cbData == 0
// causes the encoded parameters to be omitted and not encoded as a NULL // causes the encoded parameters to be omitted and not encoded as a NULL
// (05 00) as is done when encoding a CRYPT_ALGORITHM_IDENTIFIER. This // (05 00) as is done when encoding a CRYPT_ALGORITHM_IDENTIFIER. This
// is per the SMIME specification for encoding capabilities. // is per the SMIME specification for encoding capabilities.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CRYPT_SMIME_CAPABILITY
typedef struct _CRYPT_SMIME_CAPABILITY { typedef struct _CRYPT_SMIME_CAPABILITY {
LPSTR pszObjId; LPSTR pszObjId;
CRYPT_OBJID_BLOB Parameters; CRYPT_OBJID_BLOB Parameters;
} CRYPT_SMIME_CAPABILITY, *PCRYPT_SMIME_CAPABILITY; } CRYPT_SMIME_CAPABILITY, *PCRYPT_SMIME_CAPABILITY;
typedef struct _CRYPT_SMIME_CAPABILITIES { typedef struct _CRYPT_SMIME_CAPABILITIES {
DWORD cCapability; DWORD cCapability;
PCRYPT_SMIME_CAPABILITY rgCapability; PCRYPT_SMIME_CAPABILITY rgCapability;
} CRYPT_SMIME_CAPABILITIES, *PCRYPT_SMIME_CAPABILITIES; } CRYPT_SMIME_CAPABILITIES, *PCRYPT_SMIME_CAPABILITIES;
// certenrolls_end
//+-------------------------------------------------------------------------
// Qualified Certificate Statements Extension Data Structures
//
// X509_QC_STATEMENTS_EXT
// szOID_QC_STATEMENTS_EXT
//
// pvStructInfo points to following CERT_QC_STATEMENTS_EXT_INFO
// data structure.
//
// Note, identical to the above except for the names of the fields. Same
// underlying encode/decode functions are used.
//--------------------------------------------------------------------------
typedef struct _CERT_QC_STATEMENT {
LPSTR pszStatementId; // pszObjId
CRYPT_OBJID_BLOB StatementInfo; // OPTIONAL
} CERT_QC_STATEMENT, *PCERT_QC_STATEMENT;
typedef struct _CERT_QC_STATEMENTS_EXT_INFO {
DWORD cStatement;
PCERT_QC_STATEMENT rgStatement;
} CERT_QC_STATEMENTS_EXT_INFO, *PCERT_QC_STATEMENTS_EXT_INFO;
// QC Statment Ids
// European Union
#define szOID_QC_EU_COMPLIANCE "0.4.0.1862.1.1"
// Secure Signature Creation Device
#define szOID_QC_SSCD "0.4.0.1862.1.4"
//+-------------------------------------------------------------------------
// X509_OBJECT_IDENTIFIER
// szOID_ECC_PUBLIC_KEY
//
// pvStructInfo points to a LPSTR of the dot representation.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// X509_ALGORITHM_IDENTIFIER
// szOID_ECDSA_SPECIFIED
//
// pvStructInfo points to a CRYPT_ALGORITHM_IDENTIFIER.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// PKCS_RSA_SSA_PSS_PARAMETERS
// szOID_RSA_SSA_PSS
//
// pvStructInfo points to the following CRYPT_RSA_SSA_PSS_PARAMETERS
// data structure.
//
// For encoding uses the following defaults if the corresponding field
// is set to NULL or 0:
// HashAlgorithm.pszObjId : szOID_OIWSEC_sha1
// MaskGenAlgorithm.pszObjId : szOID_RSA_MGF1
// MaskGenAlgorithm.HashAlgorithm.pszObjId : HashAlgorithm.pszObjId
// dwSaltLength: cbHash
// dwTrailerField : PKCS_RSA_SSA_PSS_TRAILER_FIELD_BC
//
// Normally for encoding, only the HashAlgorithm.pszObjId field will
// need to be set.
//
// For decoding, all of fields are explicitly set.
//--------------------------------------------------------------------------
typedef struct _CRYPT_MASK_GEN_ALGORITHM {
LPSTR pszObjId;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
} CRYPT_MASK_GEN_ALGORITHM, *PCRYPT_MASK_GEN_ALGORITHM;
typedef struct _CRYPT_RSA_SSA_PSS_PARAMETERS {
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
CRYPT_MASK_GEN_ALGORITHM MaskGenAlgorithm;
DWORD dwSaltLength;
DWORD dwTrailerField;
} CRYPT_RSA_SSA_PSS_PARAMETERS, *PCRYPT_RSA_SSA_PSS_PARAMETERS;
#define PKCS_RSA_SSA_PSS_TRAILER_FIELD_BC 1
//+-------------------------------------------------------------------------
// PKCS_RSAES_OAEP_PARAMETERS
// szOID_RSAES_OAEP
//
// pvStructInfo points to the following CRYPT_RSAES_OAEP_PARAMETERS
// data structure.
//
// For encoding uses the following defaults if the corresponding field
// is set to NULL or 0:
// HashAlgorithm.pszObjId : szOID_OIWSEC_sha1
// MaskGenAlgorithm.pszObjId : szOID_RSA_MGF1
// MaskGenAlgorithm.HashAlgorithm.pszObjId : HashAlgorithm.pszObjId
// PSourceAlgorithm.pszObjId : szOID_RSA_PSPECIFIED
// PSourceAlgorithm.EncodingParameters.cbData : 0
// PSourceAlgorithm.EncodingParameters.pbData : NULL
//
// Normally for encoding, only the HashAlgorithm.pszObjId field will
// need to be set.
//
// For decoding, all of fields are explicitly set.
//--------------------------------------------------------------------------
typedef struct _CRYPT_PSOURCE_ALGORITHM {
LPSTR pszObjId;
CRYPT_DATA_BLOB EncodingParameters;
} CRYPT_PSOURCE_ALGORITHM, *PCRYPT_PSOURCE_ALGORITHM;
typedef struct _CRYPT_RSAES_OAEP_PARAMETERS {
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
CRYPT_MASK_GEN_ALGORITHM MaskGenAlgorithm;
CRYPT_PSOURCE_ALGORITHM PSourceAlgorithm;
} CRYPT_RSAES_OAEP_PARAMETERS, *PCRYPT_RSAES_OAEP_PARAMETERS;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PKCS7_SIGNER_INFO // PKCS7_SIGNER_INFO
// //
// pvStructInfo points to CMSG_SIGNER_INFO. // pvStructInfo points to CMSG_SIGNER_INFO.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMS_SIGNER_INFO // CMS_SIGNER_INFO
// //
skipping to change at line 4296 skipping to change at line 5260
// //
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_TEMPLATE_EXT { typedef struct _CERT_TEMPLATE_EXT {
LPSTR pszObjId; LPSTR pszObjId;
DWORD dwMajorVersion; DWORD dwMajorVersion;
BOOL fMinorVersion; // TRUE for a minor version BOOL fMinorVersion; // TRUE for a minor version
DWORD dwMinorVersion; DWORD dwMinorVersion;
} CERT_TEMPLATE_EXT, *PCERT_TEMPLATE_EXT; } CERT_TEMPLATE_EXT, *PCERT_TEMPLATE_EXT;
//+========================================================================= //+=========================================================================
// Logotype Extension Data Structures
//
// X509_LOGOTYPE_EXT
// szOID_LOGOTYPE_EXT
//
// pvStructInfo points to a CERT_LOGOTYPE_EXT_INFO.
//==========================================================================
typedef struct _CERT_HASHED_URL {
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
CRYPT_HASH_BLOB Hash;
LPWSTR pwszUrl; // Encoded as IA5, Optional for
// biometric data
} CERT_HASHED_URL, *PCERT_HASHED_URL;
typedef struct _CERT_LOGOTYPE_DETAILS {
LPWSTR pwszMimeType; // Encoded as IA5
DWORD cHashedUrl;
PCERT_HASHED_URL rgHashedUrl;
} CERT_LOGOTYPE_DETAILS, *PCERT_LOGOTYPE_DETAILS;
typedef struct _CERT_LOGOTYPE_REFERENCE {
DWORD cHashedUrl;
PCERT_HASHED_URL rgHashedUrl;
} CERT_LOGOTYPE_REFERENCE, *PCERT_LOGOTYPE_REFERENCE;
typedef struct _CERT_LOGOTYPE_IMAGE_INFO {
// CERT_LOGOTYPE_GRAY_SCALE_IMAGE_INFO_CHOICE or
// CERT_LOGOTYPE_COLOR_IMAGE_INFO_CHOICE
DWORD dwLogotypeImageInfoChoice;
DWORD dwFileSize; // In octets
DWORD dwXSize; // Horizontal size in pixels
DWORD dwYSize; // Vertical size in pixels
DWORD dwLogotypeImageResolutionChoice;
union {
// CERT_LOGOTYPE_NO_IMAGE_RESOLUTION_CHOICE
// No resolution value
// CERT_LOGOTYPE_BITS_IMAGE_RESOLUTION_CHOICE
DWORD dwNumBits; // Resolution in bits
// CERT_LOGOTYPE_TABLE_SIZE_IMAGE_RESOLUTION_CHOICE
DWORD dwTableSize; // Number of color or grey t
ones
};
LPWSTR pwszLanguage; // Optional. Encoded as IA5.
// RFC 3066 Language Tag
} CERT_LOGOTYPE_IMAGE_INFO, *PCERT_LOGOTYPE_IMAGE_INFO;
#define CERT_LOGOTYPE_GRAY_SCALE_IMAGE_INFO_CHOICE 1
#define CERT_LOGOTYPE_COLOR_IMAGE_INFO_CHOICE 2
#define CERT_LOGOTYPE_NO_IMAGE_RESOLUTION_CHOICE 0
#define CERT_LOGOTYPE_BITS_IMAGE_RESOLUTION_CHOICE 1
#define CERT_LOGOTYPE_TABLE_SIZE_IMAGE_RESOLUTION_CHOICE 2
typedef struct _CERT_LOGOTYPE_IMAGE {
CERT_LOGOTYPE_DETAILS LogotypeDetails;
PCERT_LOGOTYPE_IMAGE_INFO pLogotypeImageInfo; // Optional
} CERT_LOGOTYPE_IMAGE, *PCERT_LOGOTYPE_IMAGE;
typedef struct _CERT_LOGOTYPE_AUDIO_INFO {
DWORD dwFileSize; // In octets
DWORD dwPlayTime; // In milliseconds
DWORD dwChannels; // 1=mono, 2=stereo, 4=quad
DWORD dwSampleRate; // Optional. 0 => not present.
// Samples per second
LPWSTR pwszLanguage; // Optional. Encoded as IA5.
// RFC 3066 Language Tag
} CERT_LOGOTYPE_AUDIO_INFO, *PCERT_LOGOTYPE_AUDIO_INFO;
typedef struct _CERT_LOGOTYPE_AUDIO {
CERT_LOGOTYPE_DETAILS LogotypeDetails;
PCERT_LOGOTYPE_AUDIO_INFO pLogotypeAudioInfo; // Optional
} CERT_LOGOTYPE_AUDIO, *PCERT_LOGOTYPE_AUDIO;
typedef struct _CERT_LOGOTYPE_DATA {
DWORD cLogotypeImage;
PCERT_LOGOTYPE_IMAGE rgLogotypeImage;
DWORD cLogotypeAudio;
PCERT_LOGOTYPE_AUDIO rgLogotypeAudio;
} CERT_LOGOTYPE_DATA, *PCERT_LOGOTYPE_DATA;
typedef struct _CERT_LOGOTYPE_INFO {
DWORD dwLogotypeInfoChoice;
union {
// CERT_LOGOTYPE_DIRECT_INFO_CHOICE
PCERT_LOGOTYPE_DATA pLogotypeDirectInfo;
// CERT_LOGOTYPE_INDIRECT_INFO_CHOICE
PCERT_LOGOTYPE_REFERENCE pLogotypeIndirectInfo;
};
} CERT_LOGOTYPE_INFO, *PCERT_LOGOTYPE_INFO;
#define CERT_LOGOTYPE_DIRECT_INFO_CHOICE 1
#define CERT_LOGOTYPE_INDIRECT_INFO_CHOICE 2
typedef struct _CERT_OTHER_LOGOTYPE_INFO {
LPSTR pszObjId;
CERT_LOGOTYPE_INFO LogotypeInfo;
} CERT_OTHER_LOGOTYPE_INFO, *PCERT_OTHER_LOGOTYPE_INFO;
#define szOID_LOYALTY_OTHER_LOGOTYPE "1.3.6.1.5.5.7.20.1"
#define szOID_BACKGROUND_OTHER_LOGOTYPE "1.3.6.1.5.5.7.20.2"
typedef struct _CERT_LOGOTYPE_EXT_INFO {
DWORD cCommunityLogo;
PCERT_LOGOTYPE_INFO rgCommunityLogo;
PCERT_LOGOTYPE_INFO pIssuerLogo; // Optional
PCERT_LOGOTYPE_INFO pSubjectLogo; // Optional
DWORD cOtherLogo;
PCERT_OTHER_LOGOTYPE_INFO rgOtherLogo;
} CERT_LOGOTYPE_EXT_INFO, *PCERT_LOGOTYPE_EXT_INFO;
//+=========================================================================
// Biometric Extension Data Structures
//
// X509_BIOMETRIC_EXT
// szOID_BIOMETRIC_EXT
//
// pvStructInfo points to following CERT_BIOMETRIC_EXT_INFO data structure.
//==========================================================================
typedef struct _CERT_BIOMETRIC_DATA {
DWORD dwTypeOfBiometricDataChoice;
union {
// CERT_BIOMETRIC_PREDEFINED_DATA_CHOICE
DWORD dwPredefined;
// CERT_BIOMETRIC_OID_DATA_CHOICE
LPSTR pszObjId;
};
CERT_HASHED_URL HashedUrl; // pwszUrl is Optional.
} CERT_BIOMETRIC_DATA, *PCERT_BIOMETRIC_DATA;
#define CERT_BIOMETRIC_PREDEFINED_DATA_CHOICE 1
#define CERT_BIOMETRIC_OID_DATA_CHOICE 2
#define CERT_BIOMETRIC_PICTURE_TYPE 0
#define CERT_BIOMETRIC_SIGNATURE_TYPE 1
typedef struct _CERT_BIOMETRIC_EXT_INFO {
DWORD cBiometricData;
PCERT_BIOMETRIC_DATA rgBiometricData;
} CERT_BIOMETRIC_EXT_INFO, *PCERT_BIOMETRIC_EXT_INFO;
//+=========================================================================
// Online Certificate Status Protocol (OCSP) Data Structures
//==========================================================================
//+-------------------------------------------------------------------------
// OCSP_SIGNED_REQUEST
//
// OCSP signed request.
//
// Note, in most instances, pOptionalSignatureInfo will be NULL indicating
// no signature is present.
//--------------------------------------------------------------------------
typedef struct _OCSP_SIGNATURE_INFO {
CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
CRYPT_BIT_BLOB Signature;
DWORD cCertEncoded;
PCERT_BLOB rgCertEncoded;
} OCSP_SIGNATURE_INFO, *POCSP_SIGNATURE_INFO;
typedef struct _OCSP_SIGNED_REQUEST_INFO {
CRYPT_DER_BLOB ToBeSigned; // Encoded OCSP_REQUEST
POCSP_SIGNATURE_INFO pOptionalSignatureInfo; // NULL, no signature
} OCSP_SIGNED_REQUEST_INFO, *POCSP_SIGNED_REQUEST_INFO;
//+-------------------------------------------------------------------------
// OCSP_REQUEST
//
// ToBeSigned OCSP request.
//--------------------------------------------------------------------------
typedef struct _OCSP_CERT_ID {
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; // Normally SHA1
CRYPT_HASH_BLOB IssuerNameHash; // Hash of encoded name
CRYPT_HASH_BLOB IssuerKeyHash; // Hash of PublicKey bits
CRYPT_INTEGER_BLOB SerialNumber;
} OCSP_CERT_ID, *POCSP_CERT_ID;
typedef struct _OCSP_REQUEST_ENTRY {
OCSP_CERT_ID CertId;
DWORD cExtension;
PCERT_EXTENSION rgExtension;
} OCSP_REQUEST_ENTRY, *POCSP_REQUEST_ENTRY;
typedef struct _OCSP_REQUEST_INFO {
DWORD dwVersion;
PCERT_ALT_NAME_ENTRY pRequestorName; // OPTIONAL
DWORD cRequestEntry;
POCSP_REQUEST_ENTRY rgRequestEntry;
DWORD cExtension;
PCERT_EXTENSION rgExtension;
} OCSP_REQUEST_INFO, *POCSP_REQUEST_INFO;
#define OCSP_REQUEST_V1 0
//+-------------------------------------------------------------------------
// OCSP_RESPONSE
//
// OCSP outer, unsigned response wrapper.
//--------------------------------------------------------------------------
typedef struct _OCSP_RESPONSE_INFO {
DWORD dwStatus;
LPSTR pszObjId; // OPTIONAL, may be NULL
CRYPT_OBJID_BLOB Value; // OPTIONAL
} OCSP_RESPONSE_INFO, *POCSP_RESPONSE_INFO;
#define OCSP_SUCCESSFUL_RESPONSE 0
#define OCSP_MALFORMED_REQUEST_RESPONSE 1
#define OCSP_INTERNAL_ERROR_RESPONSE 2
#define OCSP_TRY_LATER_RESPONSE 3
// 4 is not used
#define OCSP_SIG_REQUIRED_RESPONSE 5
#define OCSP_UNAUTHORIZED_RESPONSE 6
#define szOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE "1.3.6.1.5.5.7.48.1.1"
//+-------------------------------------------------------------------------
// OCSP_BASIC_SIGNED_RESPONSE
// szOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE
//
// OCSP basic signed response.
//--------------------------------------------------------------------------
typedef struct _OCSP_BASIC_SIGNED_RESPONSE_INFO {
CRYPT_DER_BLOB ToBeSigned; // Encoded OCSP_BASIC_RESPONSE
OCSP_SIGNATURE_INFO SignatureInfo;
} OCSP_BASIC_SIGNED_RESPONSE_INFO, *POCSP_BASIC_SIGNED_RESPONSE_INFO;
//+-------------------------------------------------------------------------
// OCSP_BASIC_RESPONSE
//
// ToBeSigned OCSP basic response.
//--------------------------------------------------------------------------
typedef struct _OCSP_BASIC_REVOKED_INFO {
FILETIME RevocationDate;
// See X509_CRL_REASON_CODE for list of reason codes
DWORD dwCrlReasonCode;
} OCSP_BASIC_REVOKED_INFO, *POCSP_BASIC_REVOKED_INFO;
typedef struct _OCSP_BASIC_RESPONSE_ENTRY {
OCSP_CERT_ID CertId;
DWORD dwCertStatus;
union {
// OCSP_BASIC_GOOD_CERT_STATUS
// OCSP_BASIC_UNKNOWN_CERT_STATUS
// No additional information
// OCSP_BASIC_REVOKED_CERT_STATUS
POCSP_BASIC_REVOKED_INFO pRevokedInfo;
};
FILETIME ThisUpdate;
FILETIME NextUpdate; // Optional, zero filetime implies
// never expires
DWORD cExtension;
PCERT_EXTENSION rgExtension;
} OCSP_BASIC_RESPONSE_ENTRY, *POCSP_BASIC_RESPONSE_ENTRY;
#define OCSP_BASIC_GOOD_CERT_STATUS 0
#define OCSP_BASIC_REVOKED_CERT_STATUS 1
#define OCSP_BASIC_UNKNOWN_CERT_STATUS 2
typedef struct _OCSP_BASIC_RESPONSE_INFO {
DWORD dwVersion;
DWORD dwResponderIdChoice;
union {
// OCSP_BASIC_BY_NAME_RESPONDER_ID
CERT_NAME_BLOB ByNameResponderId;
// OCSP_BASIC_BY_KEY_RESPONDER_ID
CRYPT_HASH_BLOB ByKeyResponderId;
};
FILETIME ProducedAt;
DWORD cResponseEntry;
POCSP_BASIC_RESPONSE_ENTRY rgResponseEntry;
DWORD cExtension;
PCERT_EXTENSION rgExtension;
} OCSP_BASIC_RESPONSE_INFO, *POCSP_BASIC_RESPONSE_INFO;
#define OCSP_BASIC_RESPONSE_V1 0
#define OCSP_BASIC_BY_NAME_RESPONDER_ID 1
#define OCSP_BASIC_BY_KEY_RESPONDER_ID 2
//+=========================================================================
// 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 4334 skipping to change at line 5593
// 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,
// OUT void **ppvObj); // __deref_out 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 4401 skipping to change at line 5660
// 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 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 const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], __in_ecount(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 4442 skipping to change at line 5701
// 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)
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,
OUT void **ppvFuncAddr, __deref_out 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
BOOL BOOL
WINAPI WINAPI
CryptGetDefaultOIDDllList( CryptGetDefaultOIDDllList(
IN HCRYPTOIDFUNCSET hFuncSet, __in HCRYPTOIDFUNCSET hFuncSet,
IN DWORD dwEncodingType, __in DWORD dwEncodingType,
OUT LPWSTR pwszDllList, __out_ecount_part_opt(*pcchDllList, *pcchDllList) __nullnullterminated WCHAR
IN OUT DWORD *pcchDllList *pwszDllList,
__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 4497 skipping to change at line 5757
// 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)
BOOL BOOL
WINAPI WINAPI
CryptGetDefaultOIDFunctionAddress( CryptGetDefaultOIDFunctionAddress(
IN HCRYPTOIDFUNCSET hFuncSet, __in HCRYPTOIDFUNCSET hFuncSet,
IN DWORD dwEncodingType, __in DWORD dwEncodingType,
IN OPTIONAL LPCWSTR pwszDll, __in_opt LPCWSTR pwszDll,
IN DWORD dwFlags, __in DWORD dwFlags,
OUT void **ppvFuncAddr, __deref_out void **ppvFuncAddr,
IN OUT 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 OPTIONAL LPCWSTR pwszDll, __in_opt LPCWSTR pwszDll,
IN OPTIONAL 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 LPCWSTR pwszValueName, __in_opt LPCWSTR pwszValueName,
IN DWORD dwValueType, __in DWORD dwValueType,
IN const BYTE *pbValueData, __in_bcount_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 LPCWSTR pwszValueName, __in_opt LPCWSTR pwszValueName,
OUT DWORD *pdwValueType, __out_opt DWORD *pdwValueType,
OUT BYTE *pbValueData, __out_bcount_part_opt(*pcbValueData, *pcbValueData) BYTE *pbValueData,
IN OUT 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 const DWORD rgdwValueType[], __in_ecount(cValue) const DWORD rgdwValueType[],
IN LPCWSTR const rgpwszValueName[], __in_ecount(cValue) LPCWSTR const rgpwszValueName[],
IN const BYTE * const rgpbValueData[], __in_ecount(cValue) const BYTE * const rgpbValueData[],
IN const DWORD rgcbValueData[], __in_ecount(cValue) const DWORD rgcbValueData[],
IN 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 OPTIONAL LPCSTR pszFuncName, __in_opt LPCSTR pszFuncName,
IN OPTIONAL LPCSTR pszOID, __in_opt LPCSTR pszOID,
IN DWORD dwFlags, __in DWORD dwFlags,
IN void *pvArg, __inout_opt void *pvArg,
IN 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
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Special ALG_ID's used in CRYPT_OID_INFO
//--------------------------------------------------------------------------
// Algorithm is only implemented in CNG.
#define CALG_OID_INFO_CNG_ONLY 0xFFFFFFFF
// Algorithm is defined in the encoded parameters. Only supported
// using CNG.
#define CALG_OID_INFO_PARAMETERS 0xFFFFFFFE
// Macro to check for a special ALG_ID used in CRYPT_OID_INFO
#define IS_SPECIAL_OID_INFO_ALGID(Algid) (Algid >= CALG_OID_INFO_PARAMETE
RS)
//+-------------------------------------------------------------------------
// Special CNG Algorithms used in CRYPT_OID_INFO
//--------------------------------------------------------------------------
#define CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM L"CryptOIDInfoHashParameters"
#define CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM L"CryptOIDInfoECCParameters"
#define CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM L"CryptOIDInfoMgf1Parameters"
#define CRYPT_OID_INFO_NO_SIGN_ALGORITHM L"CryptOIDInfoNoSign"
#define CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM L"CryptOIDInfoOAEPParameters"
#define CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM L"CryptOIDInfoECCWrapParame
ters"
//+-------------------------------------------------------------------------
// 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 {
DWORD dwValue; DWORD dwValue;
ALG_ID Algid; ALG_ID Algid;
DWORD dwLength; DWORD dwLength;
}; };
CRYPT_DATA_BLOB ExtraInfo; CRYPT_DATA_BLOB ExtraInfo;
#ifdef CRYPT_OID_INFO_HAS_EXTRA_FIELDS
// Note, if you #define CRYPT_OID_INFO_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 2 fields are set to an empty string, L"", if not defined.
// This is the Algid string passed to the BCrypt* and NCrypt* APIs
// defined in bcrypt.h and ncrypt.h.
//
// Its only applicable to the following groups:
// CRYPT_HASH_ALG_OID_GROUP_ID
// CRYPT_ENCRYPT_ALG_OID_GROUP_ID
// CRYPT_PUBKEY_ALG_OID_GROUP_ID
// CRYPT_SIGN_ALG_OID_GROUP_ID
LPCWSTR pwszCNGAlgid;
// Following is only applicable to the following groups:
// CRYPT_SIGN_ALG_OID_GROUP_ID
// The public key pwszCNGAlgid. For ECC,
// CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM.
// CRYPT_PUBKEY_ALG_OID_GROUP_ID
// For the ECC algorithms, CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM.
LPCWSTR pwszCNGExtraAlgid;
#endif
} CRYPT_OID_INFO, *PCRYPT_OID_INFO; } CRYPT_OID_INFO, *PCRYPT_OID_INFO;
typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO; typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO;
// certenrolld_begin -- CRYPT_*_OID_GROUP_ID
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// OID Group IDs // OID Group IDs
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_HASH_ALG_OID_GROUP_ID 1 #define CRYPT_HASH_ALG_OID_GROUP_ID 1
#define CRYPT_ENCRYPT_ALG_OID_GROUP_ID 2 #define CRYPT_ENCRYPT_ALG_OID_GROUP_ID 2
#define CRYPT_PUBKEY_ALG_OID_GROUP_ID 3 #define CRYPT_PUBKEY_ALG_OID_GROUP_ID 3
#define CRYPT_SIGN_ALG_OID_GROUP_ID 4 #define CRYPT_SIGN_ALG_OID_GROUP_ID 4
#define CRYPT_RDN_ATTR_OID_GROUP_ID 5 #define CRYPT_RDN_ATTR_OID_GROUP_ID 5
#define CRYPT_EXT_OR_ATTR_OID_GROUP_ID 6 #define CRYPT_EXT_OR_ATTR_OID_GROUP_ID 6
#define CRYPT_ENHKEY_USAGE_OID_GROUP_ID 7 #define CRYPT_ENHKEY_USAGE_OID_GROUP_ID 7
#define CRYPT_POLICY_OID_GROUP_ID 8 #define CRYPT_POLICY_OID_GROUP_ID 8
#define CRYPT_TEMPLATE_OID_GROUP_ID 9 #define CRYPT_TEMPLATE_OID_GROUP_ID 9
#define CRYPT_LAST_OID_GROUP_ID 9 #define CRYPT_LAST_OID_GROUP_ID 9
#define CRYPT_FIRST_ALG_OID_GROUP_ID CRYPT_HASH_ALG_OID_GROUP_ID #define CRYPT_FIRST_ALG_OID_GROUP_ID CRYPT_HASH_ALG_OID_GROUP_ID
#define CRYPT_LAST_ALG_OID_GROUP_ID CRYPT_SIGN_ALG_OID_GROUP_ID #define CRYPT_LAST_ALG_OID_GROUP_ID CRYPT_SIGN_ALG_OID_GROUP_ID
// certenrolld_end
// The CRYPT_*_ALG_OID_GROUP_ID's have an Algid. The CRYPT_RDN_ATTR_OID_GROUP_ID // The CRYPT_*_ALG_OID_GROUP_ID's have an Algid. The CRYPT_RDN_ATTR_OID_GROUP_ID
// has a dwLength. The CRYPT_EXT_OR_ATTR_OID_GROUP_ID, // has a dwLength. The CRYPT_EXT_OR_ATTR_OID_GROUP_ID,
// CRYPT_ENHKEY_USAGE_OID_GROUP_ID, CRYPT_POLICY_OID_GROUP_ID or // CRYPT_ENHKEY_USAGE_OID_GROUP_ID, CRYPT_POLICY_OID_GROUP_ID or
// CRYPT_TEMPLATE_OID_GROUP_ID don't have a dwValue. // CRYPT_TEMPLATE_OID_GROUP_ID don't have a dwValue.
// //
// CRYPT_ENCRYPT_ALG_OID_GROUP_ID has the following optional ExtraInfo
// for AES algorithms:
// DWORD[0] - dwBitLength
// CRYPT_PUBKEY_ALG_OID_GROUP_ID has the following optional ExtraInfo: // CRYPT_PUBKEY_ALG_OID_GROUP_ID has the following optional ExtraInfo:
// DWORD[0] - Flags. CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG can be set to // DWORD[0] - Flags. CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG can be set to
// inhibit the reformatting of the signature before // inhibit the reformatting of the signature before
// CryptVerifySignature is called or after CryptSignHash // CryptVerifySignature is called or after CryptSignHash
// is called. CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG can // is called. CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG can
// be set to include the public key algorithm's parameters // be set to include the public key algorithm's parameters
// in the PKCS7's digestEncryptionAlgorithm's parameters. // in the PKCS7's digestEncryptionAlgorithm's parameters.
// CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG can be set to omit // CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG can be set to omit
// NULL parameters when encoding. // NULL parameters when encoding.
//
// For the ECC named curve public keys
// DWORD[1] - BCRYPT_ECCKEY_BLOB dwMagic field value
// DWORD[2] - dwBitLength. Where BCRYPT_ECCKEY_BLOB's
// cbKey = dwBitLength / 8 + ((dwBitLength % 8) ? 1 : 0)
//
#define CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG 0x1 #define CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG 0x00000001
#define CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG 0x2 #define CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG 0x00000002
#define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG 0x4 #define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG 0x00000004
#define CRYPT_OID_PUBKEY_SIGN_ONLY_FLAG 0x80000000
#define CRYPT_OID_PUBKEY_ENCRYPT_ONLY_FLAG 0x40000000
// CRYPT_SIGN_ALG_OID_GROUP_ID has the following optional ExtraInfo: // CRYPT_SIGN_ALG_OID_GROUP_ID has the following optional ExtraInfo:
// DWORD[0] - Public Key Algid. // DWORD[0] - Public Key Algid.
// DWORD[1] - Flags. Same as above for CRYPT_PUBKEY_ALG_OID_GROUP_ID. // DWORD[1] - Flags. Same as above for CRYPT_PUBKEY_ALG_OID_GROUP_ID.
// DWORD[2] - Optional CryptAcquireContext(CRYPT_VERIFYCONTEXT)'s dwProvType. // DWORD[2] - Optional CryptAcquireContext(CRYPT_VERIFYCONTEXT)'s dwProvType.
// If omitted or 0, uses Public Key Algid to select // If omitted or 0, uses Public Key Algid to select
// appropriate dwProvType for signature verification. // appropriate dwProvType for signature verification.
// CRYPT_RDN_ATTR_OID_GROUP_ID has the following optional ExtraInfo: // CRYPT_RDN_ATTR_OID_GROUP_ID has the following optional ExtraInfo:
// Array of DWORDs: // Array of DWORDs:
skipping to change at line 4770 skipping to change at line 6095
// for the specified key and group. Note, returns a pointer to a constant // for the specified key and group. Note, returns a pointer to a constant
// data structure. The returned pointer MUST NOT be freed. // data structure. The returned pointer MUST NOT be freed.
// //
// dwKeyType's: // dwKeyType's:
// CRYPT_OID_INFO_OID_KEY, pvKey points to a szOID // CRYPT_OID_INFO_OID_KEY, pvKey points to a szOID
// CRYPT_OID_INFO_NAME_KEY, pvKey points to a wszName // CRYPT_OID_INFO_NAME_KEY, pvKey points to a wszName
// CRYPT_OID_INFO_ALGID_KEY, pvKey points to an ALG_ID // CRYPT_OID_INFO_ALGID_KEY, pvKey points to an ALG_ID
// CRYPT_OID_INFO_SIGN_KEY, pvKey points to an array of two ALG_ID's: // CRYPT_OID_INFO_SIGN_KEY, pvKey points to an array of two ALG_ID's:
// ALG_ID[0] - Hash Algid // ALG_ID[0] - Hash Algid
// ALG_ID[1] - PubKey Algid // ALG_ID[1] - PubKey Algid
// CRYPT_OID_INFO_CNG_ALGID_KEY, pvKey points to a wszCNGAlgid
// CRYPT_OID_INFO_CNG_SIGN_KEY, pvKey is an array of two
// pwszCNGAlgid's:
// Algid[0] - Hash pwszCNGAlgid
// Algid[1] - PubKey pwszCNGAlgid
//
// 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.
// //
// 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_SIGN_KEY 6
// Set the following in the above dwKeyType parameter to restrict public keys
// valid for signing or encrypting
// certenrolld_begin -- CRYPT_*_KEY_FLAG
#define CRYPT_OID_INFO_OID_KEY_FLAGS_MASK 0xFFFF0000
#define CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG 0x80000000
#define CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG 0x40000000
// The following flag can be set in above dwGroupId parameter to disable
// searching the directory server
#define CRYPT_OID_DISABLE_SEARCH_DS_FLAG 0x80000000
// certenrolld_end -- CRYPT_*_KEY_FLAG
// The bit length shifted left 16 bits can be OR'ed into the above
// dwGroupId parameter. Only applicable to the CRYPT_ENCRYPT_ALG_OID_GROUP_ID.
// Also, only applicable to encryption algorithms having a dwBitLen ExtraInfo.
// Currently, only the AES encryption algorithms have this.
//
// For example, to find the OIDInfo for BCRYPT_AES_ALGORITHM, bit length 192,
// CryptFindOIDInfo would be called as follows:
// PCCRYPT_OID_INFO pOIDInfo =
// CryptFindOIDInfo(
// CRYPT_OID_INFO_CNG_ALGID_KEY,
// (void *) BCRYPT_AES_ALGORITHM,
// CRYPT_ENCRYPT_ALG_OID_GROUP_ID |
// (192 << CRYPT_OID_INFO_OID_GROUP_BIT_LEN_SHIFT)
// );
#define CRYPT_OID_INFO_OID_GROUP_BIT_LEN_MASK 0x0FFF0000
#define CRYPT_OID_INFO_OID_GROUP_BIT_LEN_SHIFT 16
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Register OID information. The OID information specified in the // Register OID information. The OID information specified in the
// CCRYPT_OID_INFO structure is persisted to the registry. // CCRYPT_OID_INFO structure is persisted to the registry.
// //
// crypt32.dll contains information for the commonly known OIDs. This function // crypt32.dll contains information for the commonly known OIDs. This function
// 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,
IN 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,
IN void *pvArg, __inout_opt void *pvArg,
IN 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.
// //
// Localized names for the predefined system stores ("Root", "My") and // Localized names for the predefined system stores ("Root", "My") and
skipping to change at line 4873 skipping to change at line 6239
// 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"
//+========================================================================= //+=========================================================================
// Low Level Cryptographic Message Data Structures and APIs // Low Level Cryptographic Message Data Structures and APIs
//========================================================================== //==========================================================================
typedef void *HCRYPTMSG; typedef void *HCRYPTMSG;
skipping to change at line 4985 skipping to change at line 6351
// == 0, then, defaults to AT_SIGNATURE. // == 0, then, defaults to AT_SIGNATURE.
// //
// If the HashEncryptionAlgorithm is set to szOID_PKIX_NO_SIGNATURE, then, // If the HashEncryptionAlgorithm is set to szOID_PKIX_NO_SIGNATURE, then,
// the signature value only contains the hash octets. hCryptProv must still // the signature value only contains the hash octets. hCryptProv must still
// be specified. However, since a private key isn't used the hCryptProv can be // be specified. However, since a private key isn't used the hCryptProv can be
// acquired using CRYPT_VERIFYCONTEXT. // acquired using CRYPT_VERIFYCONTEXT.
// //
// If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags // If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags
// passed to CryptMsgOpenToEncode(), the signer hCryptProv's are released. // passed to CryptMsgOpenToEncode(), the signer hCryptProv's are released.
// //
// For CNG, this applies to the hNCryptKey.
//
// pvHashAuxInfo currently isn't used and must be set to NULL. // pvHashAuxInfo currently isn't used and must be set to NULL.
// //
// CMS signed messages allow the inclusion of Attribute Certs. // CMS signed messages allow the inclusion of Attribute Certs.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_SIGNER_ENCODE_INFO { typedef struct _CMSG_SIGNER_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
PCERT_INFO pCertInfo; PCERT_INFO pCertInfo;
HCRYPTPROV hCryptProv;
// NCryptIsKeyHandle() is called to determine the union choice.
union {
HCRYPTPROV hCryptProv;
NCRYPT_KEY_HANDLE hNCryptKey;
};
// not applicable for hNCryptKey choice
DWORD dwKeySpec; DWORD dwKeySpec;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
void *pvHashAuxInfo; void *pvHashAuxInfo;
DWORD cAuthAttr; DWORD cAuthAttr;
PCRYPT_ATTRIBUTE rgAuthAttr; PCRYPT_ATTRIBUTE rgAuthAttr;
DWORD cUnauthAttr; DWORD cUnauthAttr;
PCRYPT_ATTRIBUTE rgUnauthAttr; PCRYPT_ATTRIBUTE rgUnauthAttr;
#ifdef CMSG_SIGNER_ENCODE_INFO_HAS_CMS_FIELDS #ifdef CMSG_SIGNER_ENCODE_INFO_HAS_CMS_FIELDS
CERT_ID SignerId; CERT_ID SignerId;
// This is also referred to as the SignatureAlgorithm
CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
void *pvHashEncryptionAuxInfo; void *pvHashEncryptionAuxInfo;
#endif #endif
} CMSG_SIGNER_ENCODE_INFO, *PCMSG_SIGNER_ENCODE_INFO; } CMSG_SIGNER_ENCODE_INFO, *PCMSG_SIGNER_ENCODE_INFO;
typedef struct _CMSG_SIGNED_ENCODE_INFO { typedef struct _CMSG_SIGNED_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
DWORD cSigners; DWORD cSigners;
PCMSG_SIGNER_ENCODE_INFO rgSigners; PCMSG_SIGNER_ENCODE_INFO rgSigners;
DWORD cCertEncoded; DWORD cCertEncoded;
skipping to change at line 5058 skipping to change at line 6436
// //
// To enable SP3 compatible encryption, pvEncryptionAuxInfo should point to // To enable SP3 compatible encryption, pvEncryptionAuxInfo should point to
// a CMSG_SP3_COMPATIBLE_AUX_INFO data structure. // a CMSG_SP3_COMPATIBLE_AUX_INFO data structure.
// //
// To enable the CMS envelope enhancements, rgpRecipients must be set to // To enable the CMS envelope enhancements, rgpRecipients must be set to
// NULL, and rgCmsRecipients updated to point to an array of // NULL, and rgCmsRecipients updated to point to an array of
// CMSG_RECIPIENT_ENCODE_INFO's. // CMSG_RECIPIENT_ENCODE_INFO's.
// //
// Also, CMS envelope enhancements support the inclusion of a bag of // Also, CMS envelope enhancements support the inclusion of a bag of
// Certs, CRLs, Attribute Certs and/or Unprotected Attributes. // Certs, CRLs, Attribute Certs and/or Unprotected Attributes.
//
// AES ContentEncryption and ECC KeyAgreement recipients are only supported
// via CNG. DH KeyAgreement or mail list recipients are only supported via
// CAPI1. SP3 compatible encryption and RC4 are only supported via CAPI1.
//
// For an RSA recipient identified via PCERT_INFO, for AES ContentEncryption,
// szOID_RSAES_OAEP will be implicitly used for the KeyEncryptionAlgorithm.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_RECIPIENT_ENCODE_INFO CMSG_RECIPIENT_ENCODE_INFO, typedef struct _CMSG_RECIPIENT_ENCODE_INFO CMSG_RECIPIENT_ENCODE_INFO,
*PCMSG_RECIPIENT_ENCODE_INFO; *PCMSG_RECIPIENT_ENCODE_INFO;
typedef struct _CMSG_ENVELOPED_ENCODE_INFO { typedef struct _CMSG_ENVELOPED_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
void *pvEncryptionAuxInfo; void *pvEncryptionAuxInfo;
DWORD cRecipients; DWORD cRecipients;
// The following array may only be used for transport recipients identified // The following array may only be used for transport recipients identified
// by their IssuereAndSerialNumber. If rgpRecipients != NULL, then, // by their IssuereAndSerialNumber. If rgpRecipients != NULL, then,
// the rgCmsRecipients must be NULL. // the rgCmsRecipients must be NULL.
PCERT_INFO *rgpRecipients; PCERT_INFO *rgpRecipients;
#ifdef CMSG_ENVELOPED_ENCODE_INFO_HAS_CMS_FIELDS #ifdef CMSG_ENVELOPED_ENCODE_INFO_HAS_CMS_FIELDS
skipping to change at line 5103 skipping to change at line 6488
// and export. The hCryptProv's private keys aren't used. // and export. The hCryptProv's private keys aren't used.
// //
// If hCryptProv is NULL, then, the hCryptProv specified in // If hCryptProv is NULL, then, the hCryptProv specified in
// CMSG_ENVELOPED_ENCODE_INFO is used. // CMSG_ENVELOPED_ENCODE_INFO is used.
// //
// Note, even if CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags // Note, even if CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags
// passed to CryptMsgOpenToEncode(), this hCryptProv isn't released. // passed to CryptMsgOpenToEncode(), this hCryptProv isn't released.
// //
// CMS supports the KEY_IDENTIFIER and ISSUER_SERIAL_NUMBER CERT_IDs. PKCS #7 // CMS supports the KEY_IDENTIFIER and ISSUER_SERIAL_NUMBER CERT_IDs. PKCS #7
// version 1.5 only supports the ISSUER_SERIAL_NUMBER CERT_ID choice. // version 1.5 only supports the ISSUER_SERIAL_NUMBER CERT_ID choice.
//
// For RSA AES, KeyEncryptionAlgorithm.pszObjId should be set to
// szOID_RSAES_OAEP. KeyEncryptionAlgorithm.Parameters should be set
// to the encoded PKCS_RSAES_OAEP_PARAMETERS. If
// KeyEncryptionAlgorithm.Parameters.cbData == 0, then, the default
// parameters are used and encoded.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO { typedef struct _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
void *pvKeyEncryptionAuxInfo; void *pvKeyEncryptionAuxInfo;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
CRYPT_BIT_BLOB RecipientPublicKey; CRYPT_BIT_BLOB RecipientPublicKey;
CERT_ID RecipientId; CERT_ID RecipientId;
} CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO; } CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Key Agreement Recipient Encode Info // Key Agreement Recipient Encode Info
// //
// If hCryptProv is NULL, then, the hCryptProv specified in // If hCryptProv is NULL, then, the hCryptProv specified in
// CMSG_ENVELOPED_ENCODE_INFO is used. // CMSG_ENVELOPED_ENCODE_INFO is used.
// //
skipping to change at line 5148 skipping to change at line 6539
// //
// If KeyEncryptionAlgorithm.Parameters.cbData == 0, then, its Parameters // If KeyEncryptionAlgorithm.Parameters.cbData == 0, then, its Parameters
// are updated with the encoded KeyWrapAlgorithm. // are updated with the encoded KeyWrapAlgorithm.
// //
// Currently, pvKeyWrapAuxInfo is only defined for algorithms with // Currently, pvKeyWrapAuxInfo is only defined for algorithms with
// RC2. Otherwise, its not used and must be set to NULL. // RC2. Otherwise, its not used and must be set to NULL.
// When set for RC2 algorithms, points to a CMSG_RC2_AUX_INFO containing // When set for RC2 algorithms, points to a CMSG_RC2_AUX_INFO containing
// the RC2 effective key length. // the RC2 effective key length.
// //
// Note, key agreement recipients are not supported in PKCS #7 version 1.5. // Note, key agreement recipients are not supported in PKCS #7 version 1.5.
//
// For the ECC szOID_DH_SINGLE_PASS_STDDH_SHA1_KDF KeyEncryptionAlgorithm
// the CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE must be specified.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO { typedef struct _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
CRYPT_BIT_BLOB RecipientPublicKey; CRYPT_BIT_BLOB RecipientPublicKey;
CERT_ID RecipientId; CERT_ID RecipientId;
// Following fields are optional and only applicable to KEY_IDENTIFIER // Following fields are optional and only applicable to KEY_IDENTIFIER
// CERT_IDs. // CERT_IDs.
FILETIME Date; FILETIME Date;
PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr; PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
skipping to change at line 5173 skipping to change at line 6567
CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
void *pvKeyEncryptionAuxInfo; void *pvKeyEncryptionAuxInfo;
CRYPT_ALGORITHM_IDENTIFIER KeyWrapAlgorithm; CRYPT_ALGORITHM_IDENTIFIER KeyWrapAlgorithm;
void *pvKeyWrapAuxInfo; void *pvKeyWrapAuxInfo;
// The following hCryptProv and dwKeySpec must be specified for the // The following hCryptProv and dwKeySpec must be specified for the
// CMSG_KEY_AGREE_STATIC_KEY_CHOICE. // CMSG_KEY_AGREE_STATIC_KEY_CHOICE.
// //
// For CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE, dwKeySpec isn't applicable // For CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE, dwKeySpec isn't applicable
// and hCryptProv is optional. // and hCryptProv is optional.
HCRYPTPROV hCryptProv;
HCRYPTPROV_LEGACY hCryptProv;
DWORD dwKeySpec; DWORD dwKeySpec;
DWORD dwKeyChoice; DWORD dwKeyChoice;
union { union {
// CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE // CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE
// //
// The ephemeral public key algorithm and parameters. // The ephemeral public key algorithm and parameters.
PCRYPT_ALGORITHM_IDENTIFIER pEphemeralAlgorithm; PCRYPT_ALGORITHM_IDENTIFIER pEphemeralAlgorithm;
// CMSG_KEY_AGREE_STATIC_KEY_CHOICE // CMSG_KEY_AGREE_STATIC_KEY_CHOICE
skipping to change at line 5213 skipping to change at line 6608
// //
// Note, even if CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags // Note, even if CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags
// passed to CryptMsgOpenToEncode(), this hCryptProv isn't released. // passed to CryptMsgOpenToEncode(), this hCryptProv isn't released.
// //
// Currently, pvKeyEncryptionAuxInfo is only defined for RC2 key wrap // Currently, pvKeyEncryptionAuxInfo is only defined for RC2 key wrap
// algorithms. Otherwise, its not used and must be set to NULL. // algorithms. Otherwise, its not used and must be set to NULL.
// When set for RC2 algorithms, points to a CMSG_RC2_AUX_INFO containing // When set for RC2 algorithms, points to a CMSG_RC2_AUX_INFO containing
// the RC2 effective key length. // the RC2 effective key length.
// //
// Note, mail list recipients are not supported in PKCS #7 version 1.5. // Note, mail list recipients are not supported in PKCS #7 version 1.5.
//
// Mail list recipients aren't supported using CNG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO { typedef struct _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
void *pvKeyEncryptionAuxInfo; void *pvKeyEncryptionAuxInfo;
HCRYPTPROV hCryptProv; HCRYPTPROV hCryptProv;
DWORD dwKeyChoice; DWORD dwKeyChoice;
union { union {
// CMSG_MAIL_LIST_HANDLE_KEY_CHOICE // CMSG_MAIL_LIST_HANDLE_KEY_CHOICE
HCRYPTKEY hKeyEncryptionKey; HCRYPTKEY hKeyEncryptionKey;
skipping to change at line 5285 skipping to change at line 6682
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_SP3_COMPATIBLE_AUX_INFO // CMSG_SP3_COMPATIBLE_AUX_INFO
// //
// AuxInfo for enabling SP3 compatible encryption. // AuxInfo for enabling SP3 compatible encryption.
// //
// The CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG is set in dwFlags to enable SP3 // The CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG is set in dwFlags to enable SP3
// compatible encryption. When set, uses zero salt instead of no salt, // compatible encryption. When set, uses zero salt instead of no salt,
// the encryption algorithm parameters are NULL instead of containing the // the encryption algorithm parameters are NULL instead of containing the
// encoded RC2 parameters or encoded IV octet string and the encrypted // encoded RC2 parameters or encoded IV octet string and the encrypted
// symmetric key is encoded little endian instead of big endian. // symmetric key is encoded little endian instead of big endian.
//
// SP3 compatible encryption isn't supported using CNG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_SP3_COMPATIBLE_AUX_INFO { typedef struct _CMSG_SP3_COMPATIBLE_AUX_INFO {
DWORD cbSize; DWORD cbSize;
DWORD dwFlags; DWORD dwFlags;
} CMSG_SP3_COMPATIBLE_AUX_INFO, *PCMSG_SP3_COMPATIBLE_AUX_INFO; } CMSG_SP3_COMPATIBLE_AUX_INFO, *PCMSG_SP3_COMPATIBLE_AUX_INFO;
#define CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG 0x80000000 #define CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG 0x80000000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_RC4_AUX_INFO // CMSG_RC4_AUX_INFO
// //
// AuxInfo for RC4 encryption algorithms. The pvEncryptionAuxInfo field // AuxInfo for RC4 encryption algorithms. The pvEncryptionAuxInfo field
// in CMSG_ENCRYPTED_ENCODE_INFO should be updated to point to this // in CMSG_ENCRYPTED_ENCODE_INFO should be updated to point to this
// structure. If not specified, uses the CSP's default bit length with no // structure. If not specified, uses the CSP's default bit length with no
// salt. Note, the base CSP has a 40 bit default and the enhanced CSP has // salt. Note, the base CSP has a 40 bit default and the enhanced CSP has
// a 128 bit default. // a 128 bit default.
// //
// If CMSG_RC4_NO_SALT_FLAG is set in dwBitLen, then, no salt is generated. // If CMSG_RC4_NO_SALT_FLAG is set in dwBitLen, then, no salt is generated.
// Otherwise, (128 - dwBitLen)/8 bytes of salt are generated and encoded // Otherwise, (128 - dwBitLen)/8 bytes of salt are generated and encoded
// as an OCTET STRING in the algorithm parameters field. // as an OCTET STRING in the algorithm parameters field.
//
// RC4 isn't supported using CNG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_RC4_AUX_INFO { typedef struct _CMSG_RC4_AUX_INFO {
DWORD cbSize; DWORD cbSize;
DWORD dwBitLen; DWORD dwBitLen;
} CMSG_RC4_AUX_INFO, *PCMSG_RC4_AUX_INFO; } CMSG_RC4_AUX_INFO, *PCMSG_RC4_AUX_INFO;
#define CMSG_RC4_NO_SALT_FLAG 0x40000000 #define CMSG_RC4_NO_SALT_FLAG 0x40000000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_SIGNED_AND_ENVELOPED // CMSG_SIGNED_AND_ENVELOPED
skipping to change at line 5334 skipping to change at line 6735
} CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO, *PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO ; } CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO, *PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO ;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_HASHED // CMSG_HASHED
// //
// hCryptProv is used to do the hash. Doesn't need to use a private key. // hCryptProv is used to do the hash. Doesn't need to use a private key.
// //
// If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags // If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags
// passed to CryptMsgOpenToEncode(), the hCryptProv is released. // passed to CryptMsgOpenToEncode(), the hCryptProv is released.
// //
// IN LH, the hCryptProv isn't used. However, its still released if the
// above flag is set.
//
// If fDetachedHash is set, then, the encoded message doesn't contain // If fDetachedHash is set, then, the encoded message doesn't contain
// any content (its treated as NULL Data) // any content (its treated as NULL Data)
// //
// pvHashAuxInfo currently isn't used and must be set to NULL. // pvHashAuxInfo currently isn't used and must be set to NULL.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_HASHED_ENCODE_INFO { typedef struct _CMSG_HASHED_ENCODE_INFO {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
void *pvHashAuxInfo; void *pvHashAuxInfo;
} CMSG_HASHED_ENCODE_INFO, *PCMSG_HASHED_ENCODE_INFO; } CMSG_HASHED_ENCODE_INFO, *PCMSG_HASHED_ENCODE_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_ENCRYPTED // CMSG_ENCRYPTED
// //
// The key used to encrypt the message is identified outside of the message // The key used to encrypt the message is identified outside of the message
// content (for example, password). // content (for example, password).
// //
skipping to change at line 5378 skipping to change at line 6782
// 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 const void *pvArg, __in_opt const void *pvArg,
IN BYTE *pbData, __in_bcount_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 5410 skipping to change at line 6814
#define CMSG_MAX_LENGTH_FLAG 0x00000020 #define CMSG_MAX_LENGTH_FLAG 0x00000020
// When set, nonData type inner content is encapsulated within an // When set, nonData type inner content is encapsulated within an
// OCTET STRING. Applicable to both Signed and Enveloped messages. // OCTET STRING. Applicable to both Signed and Enveloped messages.
#define CMSG_CMS_ENCAPSULATED_CONTENT_FLAG 0x00000040 #define CMSG_CMS_ENCAPSULATED_CONTENT_FLAG 0x00000040
// If set, then, the hCryptProv passed to CryptMsgOpenToEncode or // If set, then, the hCryptProv passed to CryptMsgOpenToEncode or
// CryptMsgOpenToDecode is released on the final CryptMsgClose. // CryptMsgOpenToDecode is released on the final CryptMsgClose.
// Not released if CryptMsgOpenToEncode or CryptMsgOpenToDecode fails. // Not released if CryptMsgOpenToEncode or CryptMsgOpenToDecode fails.
// //
// Also applies to hNCryptKey where applicable.
//
// Note, the envelope recipient hCryptProv's aren't released. // Note, the envelope recipient hCryptProv's aren't released.
#define CMSG_CRYPT_RELEASE_CONTEXT_FLAG 0x00008000 #define CMSG_CRYPT_RELEASE_CONTEXT_FLAG 0x00008000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Open a cryptographic message for encoding // Open a cryptographic message for encoding
// //
// If CMSG_BARE_CONTENT_FLAG is specified for a streamed message, // If CMSG_BARE_CONTENT_FLAG is specified for a streamed message,
// 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 OPTIONAL LPSTR pszInnerContentObjID, __in_opt LPSTR pszInnerContentObjID,
IN OPTIONAL 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 OPTIONAL 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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN OPTIONAL PCERT_INFO pRecipientInfo, __reserved PCERT_INFO pRecipientInfo,
IN OPTIONAL 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 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 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 const BYTE *pbData, __in_bcount_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 5548 skipping to change at line 6954
// 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT 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 5684 skipping to change at line 7090
// 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 struct _CMSG_SIGNER_INFO { typedef struct _CMSG_SIGNER_INFO {
DWORD dwVersion; DWORD dwVersion;
CERT_NAME_BLOB Issuer; CERT_NAME_BLOB Issuer;
CRYPT_INTEGER_BLOB SerialNumber; CRYPT_INTEGER_BLOB SerialNumber;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
// This is also referred to as the SignatureAlgorithm
CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
CRYPT_DATA_BLOB EncryptedHash; CRYPT_DATA_BLOB EncryptedHash;
CRYPT_ATTRIBUTES AuthAttrs; CRYPT_ATTRIBUTES AuthAttrs;
CRYPT_ATTRIBUTES UnauthAttrs; CRYPT_ATTRIBUTES UnauthAttrs;
} CMSG_SIGNER_INFO, *PCMSG_SIGNER_INFO; } CMSG_SIGNER_INFO, *PCMSG_SIGNER_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_SIGNER_CERT_ID_PARAM // CMSG_SIGNER_CERT_ID_PARAM
// //
// To get all the signers, repetitively call CryptMsgGetParam, with // To get all the signers, repetitively call CryptMsgGetParam, with
// dwIndex set to 0 .. SignerCount - 1. // dwIndex set to 0 .. SignerCount - 1.
skipping to change at line 5714 skipping to change at line 7123
// //
// To get all the signers, repetitively call CryptMsgGetParam, with // To get all the signers, repetitively call CryptMsgGetParam, with
// dwIndex set to 0 .. SignerCount - 1. // dwIndex set to 0 .. SignerCount - 1.
// //
// pvData points to a CMSG_CMS_SIGNER_INFO struct. // pvData points to a CMSG_CMS_SIGNER_INFO struct.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CMS_SIGNER_INFO { typedef struct _CMSG_CMS_SIGNER_INFO {
DWORD dwVersion; DWORD dwVersion;
CERT_ID SignerId; CERT_ID SignerId;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
// This is also referred to as the SignatureAlgorithm
CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
CRYPT_DATA_BLOB EncryptedHash; CRYPT_DATA_BLOB EncryptedHash;
CRYPT_ATTRIBUTES AuthAttrs; CRYPT_ATTRIBUTES AuthAttrs;
CRYPT_ATTRIBUTES UnauthAttrs; CRYPT_ATTRIBUTES UnauthAttrs;
} CMSG_CMS_SIGNER_INFO, *PCMSG_CMS_SIGNER_INFO; } CMSG_CMS_SIGNER_INFO, *PCMSG_CMS_SIGNER_INFO;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_SIGNER_HASH_ALGORITHM_PARAM // CMSG_SIGNER_HASH_ALGORITHM_PARAM
// //
// This parameter specifies the HashAlgorithm that was used for the signer. // This parameter specifies the HashAlgorithm that was used for the signer.
// //
skipping to change at line 6075 skipping to change at line 7487
// //
// 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 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 6151 skipping to change at line 7563
// The signer can be a pointer to a CERT_PUBLIC_KEY_INFO, certificate // The signer can be a pointer to a CERT_PUBLIC_KEY_INFO, certificate
// context or a chain context. // context or a chain context.
// //
// If the signer's HashEncryptionAlgorithm is szOID_PKIX_NO_SIGNATURE, then, // If the signer's HashEncryptionAlgorithm is szOID_PKIX_NO_SIGNATURE, then,
// the signature is expected to contain the hash octets. Only dwSignerType // the signature is expected to contain the hash octets. Only dwSignerType
// of CMSG_VERIFY_SIGNER_NULL may be specified to verify this no signature // of CMSG_VERIFY_SIGNER_NULL may be specified to verify this no signature
// case. // case.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA { typedef struct _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
DWORD dwSignerIndex; DWORD dwSignerIndex;
DWORD dwSignerType; DWORD dwSignerType;
void *pvSigner; void *pvSigner;
} CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA, *PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA; } CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA, *PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA;
// Signer Types // Signer Types
#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
skipping to change at line 6178 skipping to change at line 7590
// 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.
// //
// hNCryptKey can be set to decrypt using a CNG private key.
//
// If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed // If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed
// to CryptMsgControl, then, the hCryptProv is released on the final // to CryptMsgControl, then, the hCryptProv is released on the final
// CryptMsgClose. Not released if CryptMsgControl fails. // CryptMsgClose. Not released if CryptMsgControl fails. Also applies
// to freeing the hNCryptKey.
// //
// dwRecipientIndex is the index of the recipient in the message associated // dwRecipientIndex is the index of the recipient in the message associated
// with the hCryptProv's private key. // with the hCryptProv's or hNCryptKey's private key.
// //
// The dwRecipientIndex is the index of a key transport recipient. // The dwRecipientIndex is the index of a key transport recipient.
// //
// Note, the message can only be decrypted once. // Note, the message can only be decrypted once.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CTRL_DECRYPT_PARA { typedef struct _CMSG_CTRL_DECRYPT_PARA {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv;
// NCryptIsKeyHandle() is called to determine the union choice.
union {
HCRYPTPROV hCryptProv;
NCRYPT_KEY_HANDLE hNCryptKey;
};
// not applicable for hNCryptKey choice
DWORD dwKeySpec; DWORD dwKeySpec;
DWORD dwRecipientIndex; DWORD dwRecipientIndex;
} CMSG_CTRL_DECRYPT_PARA, *PCMSG_CTRL_DECRYPT_PARA; } CMSG_CTRL_DECRYPT_PARA, *PCMSG_CTRL_DECRYPT_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_KEY_TRANS_DECRYPT // CMSG_CTRL_KEY_TRANS_DECRYPT
// //
// Decrypt an ENVELOPED message after it has been decoded for a key // Decrypt an ENVELOPED message after it has been decoded for a key
// transport recipient. // transport recipient.
// //
// hCryptProv and dwKeySpec specify the private key to use. For dwKeySpec == // hCryptProv and dwKeySpec specify the private key to use. For dwKeySpec ==
skipping to change at line 6205 skipping to change at line 7628
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_KEY_TRANS_DECRYPT // CMSG_CTRL_KEY_TRANS_DECRYPT
// //
// Decrypt an ENVELOPED message after it has been decoded for a key // Decrypt an ENVELOPED message after it has been decoded for a key
// transport recipient. // transport recipient.
// //
// 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.
// //
// hNCryptKey can be set to decrypt using a CNG private key.
//
// If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed // If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed
// to CryptMsgControl, then, the hCryptProv is released on the final // to CryptMsgControl, then, the hCryptProv is released on the final
// CryptMsgClose. Not released if CryptMsgControl fails. // CryptMsgClose. Not released if CryptMsgControl fails. Also applies
// to freeing the hNCryptKey.
// //
// pKeyTrans points to the CMSG_KEY_TRANS_RECIPIENT_INFO obtained via // pKeyTrans points to the CMSG_KEY_TRANS_RECIPIENT_INFO obtained via
// CryptMsgGetParam(CMSG_CMS_RECIPIENT_INFO_PARAM) // CryptMsgGetParam(CMSG_CMS_RECIPIENT_INFO_PARAM)
// //
// dwRecipientIndex is the index of the recipient in the message associated // dwRecipientIndex is the index of the recipient in the message associated
// with the hCryptProv's private key. // with the hCryptProv's or hNCryptKey's private key.
// //
// Note, the message can only be decrypted once. // Note, the message can only be decrypted once.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CTRL_KEY_TRANS_DECRYPT_PARA { typedef struct _CMSG_CTRL_KEY_TRANS_DECRYPT_PARA {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv; // NCryptIsKeyHandle() is called to determine the union choice.
union {
HCRYPTPROV hCryptProv;
NCRYPT_KEY_HANDLE hNCryptKey;
};
// not applicable for hNCryptKey choice
DWORD dwKeySpec; DWORD dwKeySpec;
PCMSG_KEY_TRANS_RECIPIENT_INFO pKeyTrans; PCMSG_KEY_TRANS_RECIPIENT_INFO pKeyTrans;
DWORD dwRecipientIndex; DWORD dwRecipientIndex;
} CMSG_CTRL_KEY_TRANS_DECRYPT_PARA, *PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA; } CMSG_CTRL_KEY_TRANS_DECRYPT_PARA, *PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_KEY_AGREE_DECRYPT // CMSG_CTRL_KEY_AGREE_DECRYPT
// //
// Decrypt an ENVELOPED message after it has been decoded for a key // Decrypt an ENVELOPED message after it has been decoded for a key
// agreement recipient. // agreement recipient.
// //
skipping to change at line 6234 skipping to change at line 7667
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_KEY_AGREE_DECRYPT // CMSG_CTRL_KEY_AGREE_DECRYPT
// //
// Decrypt an ENVELOPED message after it has been decoded for a key // Decrypt an ENVELOPED message after it has been decoded for a key
// agreement recipient. // agreement recipient.
// //
// 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.
// //
// hNCryptKey can be set to decrypt using a CNG private key.
//
// If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed // If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed
// to CryptMsgControl, then, the hCryptProv is released on the final // to CryptMsgControl, then, the hCryptProv is released on the final
// CryptMsgClose. Not released if CryptMsgControl fails. // CryptMsgClose. Not released if CryptMsgControl fails. Also applies
// to freeing the hNCryptKey.
// //
// pKeyAgree points to the CMSG_KEY_AGREE_RECIPIENT_INFO obtained via // pKeyAgree points to the CMSG_KEY_AGREE_RECIPIENT_INFO obtained via
// CryptMsgGetParam(CMSG_CMS_RECIPIENT_INFO_PARAM) for dwRecipientIndex. // CryptMsgGetParam(CMSG_CMS_RECIPIENT_INFO_PARAM) for dwRecipientIndex.
// //
// dwRecipientIndex, dwRecipientEncryptedKeyIndex are the indices of the // dwRecipientIndex, dwRecipientEncryptedKeyIndex are the indices of the
// recipient's encrypted key in the message associated with the hCryptProv's // recipient's encrypted key in the message associated with the hCryptProv's
// private key. // or hNCryptKey's private key.
// //
// OriginatorPublicKey is the originator's public key obtained from either // OriginatorPublicKey is the originator's public key obtained from either
// the originator's certificate or the CMSG_KEY_AGREE_RECIPIENT_INFO obtained // the originator's certificate or the CMSG_KEY_AGREE_RECIPIENT_INFO obtained
// via the CMSG_CMS_RECIPIENT_INFO_PARAM. // via the CMSG_CMS_RECIPIENT_INFO_PARAM.
// //
// Note, the message can only be decrypted once. // Note, the message can only be decrypted once.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CTRL_KEY_AGREE_DECRYPT_PARA { typedef struct _CMSG_CTRL_KEY_AGREE_DECRYPT_PARA {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv;
// NCryptIsKeyHandle() is called to determine the union choice.
union {
HCRYPTPROV hCryptProv;
NCRYPT_KEY_HANDLE hNCryptKey;
};
// not applicable for hNCryptKey choice
DWORD dwKeySpec; DWORD dwKeySpec;
PCMSG_KEY_AGREE_RECIPIENT_INFO pKeyAgree; PCMSG_KEY_AGREE_RECIPIENT_INFO pKeyAgree;
DWORD dwRecipientIndex; DWORD dwRecipientIndex;
DWORD dwRecipientEncryptedKeyIndex; DWORD dwRecipientEncryptedKeyIndex;
CRYPT_BIT_BLOB OriginatorPublicKey; CRYPT_BIT_BLOB OriginatorPublicKey;
} CMSG_CTRL_KEY_AGREE_DECRYPT_PARA, *PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA; } CMSG_CTRL_KEY_AGREE_DECRYPT_PARA, *PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CMSG_CTRL_MAIL_LIST_DECRYPT // CMSG_CTRL_MAIL_LIST_DECRYPT
// //
// Decrypt an ENVELOPED message after it has been decoded for a mail // Decrypt an ENVELOPED message after it has been decoded for a mail
skipping to change at line 6283 skipping to change at line 7727
// //
// If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed // If CMSG_CRYPT_RELEASE_CONTEXT_FLAG is set in the dwFlags passed
// to CryptMsgControl, then, the hCryptProv is released on the final // to CryptMsgControl, then, the hCryptProv is released on the final
// CryptMsgClose. Not released if CryptMsgControl fails. // CryptMsgClose. Not released if CryptMsgControl fails.
// //
// For RC2 wrap, the effective key length is obtained from the // For RC2 wrap, the effective key length is obtained from the
// KeyEncryptionAlgorithm parameters and set on the hKeyEncryptionKey before // KeyEncryptionAlgorithm parameters and set on the hKeyEncryptionKey before
// decrypting. // decrypting.
// //
// Note, the message can only be decrypted once. // Note, the message can only be decrypted once.
//
// Mail list recipients aren't supported using CNG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CTRL_MAIL_LIST_DECRYPT_PARA { typedef struct _CMSG_CTRL_MAIL_LIST_DECRYPT_PARA {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv; HCRYPTPROV hCryptProv;
PCMSG_MAIL_LIST_RECIPIENT_INFO pMailList; PCMSG_MAIL_LIST_RECIPIENT_INFO pMailList;
DWORD dwRecipientIndex; DWORD dwRecipientIndex;
DWORD dwKeyChoice; DWORD dwKeyChoice;
union { union {
// CMSG_MAIL_LIST_HANDLE_KEY_CHOICE // CMSG_MAIL_LIST_HANDLE_KEY_CHOICE
HCRYPTKEY hKeyEncryptionKey; HCRYPTKEY hKeyEncryptionKey;
skipping to change at line 6433 skipping to change at line 7879
// 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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN DWORD dwEncodingType, __in DWORD dwEncodingType,
IN PBYTE pbSignerInfo, __in_bcount(cbSignerInfo) PBYTE pbSignerInfo,
IN DWORD cbSignerInfo, __in DWORD cbSignerInfo,
IN PBYTE pbSignerInfoCountersignature, __in_bcount(cbSignerInfoCountersignature) PBYTE pbSignerInfoCountersignature
IN DWORD cbSignerInfoCountersignature, ,
IN PCERT_INFO pciCountersigner __in DWORD cbSignerInfoCountersignature,
__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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN DWORD dwEncodingType, __in DWORD dwEncodingType,
IN PBYTE pbSignerInfo, __in_bcount(cbSignerInfo) PBYTE pbSignerInfo,
IN DWORD cbSignerInfo, __in DWORD cbSignerInfo,
IN PBYTE pbSignerInfoCountersignature, __in_bcount(cbSignerInfoCountersignature) PBYTE pbSignerInfoCountersignature
IN DWORD cbSignerInfoCountersignature, ,
IN DWORD dwSignerType, __in DWORD cbSignerInfoCountersignature,
IN void *pvSigner, __in DWORD dwSignerType,
IN DWORD dwFlags, __in void *pvSigner,
IN OPTIONAL void *pvReserved __reserved DWORD dwFlags,
__reserved void *pvReserved
); );
// See CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA for dwSignerType definitions // See CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA for dwSignerType definitions
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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 OUT HCRYPTMSG hCryptMsg, __in HCRYPTMSG hCryptMsg,
IN DWORD dwIndex, __in DWORD dwIndex,
IN DWORD cCountersigners, __in DWORD cCountersigners,
IN PCMSG_SIGNER_ENCODE_INFO rgCountersigners __in_ecount(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 PBYTE pbSignerInfo, __in_bcount(cbSignerInfo) PBYTE pbSignerInfo,
IN DWORD cbSignerInfo, __in DWORD cbSignerInfo,
IN DWORD cCountersigners, __in DWORD cCountersigners,
IN PCMSG_SIGNER_ENCODE_INFO rgCountersigners, __in_ecount(cCountersigners) PCMSG_SIGNER_ENCODE_INFO rgCountersigners,
OUT PBYTE pbCountersignature, __out_bcount_part_opt(*pcbCountersignature, *pcbCountersignature) PBYTE pbCo
IN OUT PDWORD pcbCountersignature untersignature,
__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)(
IN 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 BOOL (WINAPI *PFN_CMSG_GEN_ENCRYPT_KEY) ( typedef __success(return == TRUE) BOOL (WINAPI *PFN_CMSG_GEN_ENCRYPT_KEY) (
IN OUT HCRYPTPROV *phCryptProv, __inout HCRYPTPROV *phCryptProv,
IN PCRYPT_ALGORITHM_IDENTIFIER paiEncrypt, __in PCRYPT_ALGORITHM_IDENTIFIER paiEncrypt,
IN PVOID pvEncryptAuxInfo, __in_opt PVOID pvEncryptAuxInfo,
IN PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, __in PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
IN PFN_CMSG_ALLOC pfnAlloc, __callback PFN_CMSG_ALLOC pfnAlloc,
OUT HCRYPTKEY *phEncryptKey, __out HCRYPTKEY *phEncryptKey,
OUT PBYTE *ppbEncryptParameters, __deref_out_bcount(*pcbEncryptParameters) PBYTE *ppbEncryptParameters,
OUT PDWORD pcbEncryptParameters __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 PBYTE pbData, __out_bcount_part_opt(*pcbData, *pcbData) PBYTE pbData,
IN OUT 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 PBYTE pbEncodedKey, __in_bcount(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)
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Content Encrypt Info // Content Encrypt Info
// //
// The following data structure contains the information shared between // The following data structure contains the information shared between
// the GenContentEncryptKey and the ExportKeyTrans, ExportKeyAgree and // the GenContentEncryptKey and the ExportKeyTrans, ExportKeyAgree and
// ExportMailList installable functions. // ExportMailList installable functions.
//
// For a ContentEncryptionAlgorithm.pszObjId having a "Special" algid, only
// supported via CNG, for example, AES, then, fCNG will be set.
// fCNG will also be set to TRUE for any ECC agreement or OAEP RSA transport
// recipients.
//
// When, fCNG is TRUE, the hCNGContentEncryptKey choice is selected and
// pbCNGContentEncryptKeyObject and pbContentEncryptKey will be pfnAlloc'ed.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_CONTENT_ENCRYPT_INFO { typedef struct _CMSG_CONTENT_ENCRYPT_INFO {
DWORD cbSize; DWORD cbSize;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
void *pvEncryptionAuxInfo; void *pvEncryptionAuxInfo;
DWORD cRecipients; DWORD cRecipients;
PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients; PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients;
PFN_CMSG_ALLOC pfnAlloc; PFN_CMSG_ALLOC pfnAlloc;
PFN_CMSG_FREE pfnFree; PFN_CMSG_FREE pfnFree;
DWORD dwEncryptFlags; DWORD dwEncryptFlags;
HCRYPTKEY hContentEncryptKey; union {
// fCNG == FALSE
HCRYPTKEY hContentEncryptKey;
// fCNG == TRUE
BCRYPT_KEY_HANDLE hCNGContentEncryptKey;
};
DWORD dwFlags; DWORD dwFlags;
BOOL fCNG;
// When fCNG == TRUE, pfnAlloc'ed
BYTE *pbCNGContentEncryptKeyObject;
BYTE *pbContentEncryptKey;
DWORD cbContentEncryptKey;
} CMSG_CONTENT_ENCRYPT_INFO, *PCMSG_CONTENT_ENCRYPT_INFO; } CMSG_CONTENT_ENCRYPT_INFO, *PCMSG_CONTENT_ENCRYPT_INFO;
#define CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG 0x00000001 #define CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG 0x00000001
#define CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG 0x00000001 #define CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG 0x00000001
#define CMSG_CONTENT_ENCRYPT_FREE_OBJID_FLAG 0x00000002
#define CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG 0x00008000 #define CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG 0x00008000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Upon input, ContentEncryptInfo has been initialized from the // Upon input, ContentEncryptInfo has been initialized from the
// EnvelopedEncodeInfo. // EnvelopedEncodeInfo.
// //
// Note, if rgpRecipients instead of rgCmsRecipients are set in the // Note, if rgpRecipients instead of rgCmsRecipients are set in the
// EnvelopedEncodeInfo, then, the rgpRecipients have been converted // EnvelopedEncodeInfo, then, the rgpRecipients have been converted
// to rgCmsRecipients in the ContentEncryptInfo. // to rgCmsRecipients in the ContentEncryptInfo.
// //
// The following fields may be changed in ContentEncryptInfo: // For fCNG == FALSE, the following fields may be changed in ContentEncryptInfo:
// hContentEncryptKey // hContentEncryptKey
// hCryptProv // hCryptProv
// ContentEncryptionAlgorithm.pszObjId
// ContentEncryptionAlgorithm.Parameters
// dwFlags
//
// For fCNG == TRUE, the following fields may be changed in ContentEncryptInfo:
// hCNGContentEncryptKey
// pbCNGContentEncryptKeyObject
// pbContentEncryptKey
// cbContentEncryptKey
// ContentEncryptionAlgorithm.pszObjId
// ContentEncryptionAlgorithm.Parameters // ContentEncryptionAlgorithm.Parameters
// dwFlags // dwFlags
// //
// All other fields in the ContentEncryptInfo are READONLY. // All other fields in the ContentEncryptInfo are READONLY.
// //
// If CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG is set upon entry // If CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG is set upon entry
// in dwEncryptFlags, then, any potentially variable length encoded // in dwEncryptFlags, then, any potentially variable length encoded
// output should be padded with zeroes to always obtain the // output should be padded with zeroes to always obtain the
// same maximum encoded length. This is necessary for // same maximum encoded length. This is necessary for
// CryptMsgCalculateEncodedLength() or CryptMsgOpenToEncode() with // CryptMsgCalculateEncodedLength() or CryptMsgOpenToEncode() with
// definite length streaming. // definite length streaming.
// //
// The hContentEncryptKey must be updated. // For fCNG == FALSE:
// The hContentEncryptKey must be updated.
// //
// If hCryptProv is NULL upon input, then, it must be updated. // If hCryptProv is NULL upon input, then, it must be updated.
// If a HCRYPTPROV is acquired that must be released, then, the // If a HCRYPTPROV is acquired that must be released, then, the
// CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG must be set in dwFlags. // CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG must be set in dwFlags.
// Otherwise, for fCNG == TRUE:
// The hCNGContentEncryptKey and cbContentEncryptKey must be updated and
// pbCNGContentEncryptKeyObject and pbContentEncryptKey pfnAlloc'ed.
// This key will be freed and destroyed when hCryptMsg is closed.
// //
// If ContentEncryptionAlgorithm.pszObjId is changed, then, the
// CMSG_CONTENT_ENCRYPT_FREE_OBJID_FLAG must be set in dwFlags.
// If ContentEncryptionAlgorithm.Parameters is updated, then, the // If ContentEncryptionAlgorithm.Parameters is updated, then, the
// CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags. pfnAlloc and // CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags. pfnAlloc and
// 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.
#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
typedef BOOL (WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY) ( typedef BOOL (WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY) (
IN OUT PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, __inout PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved __reserved void *pvReserved
); );
// The following installable function is called when fCNG == TRUE. It has the
// same API signature as for the above
// CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC.
#define CMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllCNGGenContentEncr
yptKey"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Key Transport Encrypt Info // Key Transport Encrypt Info
// //
// The following data structure contains the information updated by the // The following data structure contains the information updated by the
// ExportKeyTrans installable function. // ExportKeyTrans installable function.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_KEY_TRANS_ENCRYPT_INFO { typedef struct _CMSG_KEY_TRANS_ENCRYPT_INFO {
DWORD cbSize; DWORD cbSize;
DWORD dwRecipientIndex; DWORD dwRecipientIndex;
CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
CRYPT_DATA_BLOB EncryptedKey; CRYPT_DATA_BLOB EncryptedKey;
DWORD dwFlags; DWORD dwFlags;
} CMSG_KEY_TRANS_ENCRYPT_INFO, *PCMSG_KEY_TRANS_ENCRYPT_INFO; } CMSG_KEY_TRANS_ENCRYPT_INFO, *PCMSG_KEY_TRANS_ENCRYPT_INFO;
#define CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG 0x00000001 #define CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG 0x00000001
#define CMSG_KEY_TRANS_ENCRYPT_FREE_OBJID_FLAG 0x00000002
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Upon input, KeyTransEncryptInfo has been initialized from the // Upon input, KeyTransEncryptInfo has been initialized from the
// KeyTransEncodeInfo. // KeyTransEncodeInfo.
// //
// The following fields may be changed in KeyTransEncryptInfo: // The following fields may be changed in KeyTransEncryptInfo:
// EncryptedKey // EncryptedKey
// KeyEncryptionAlgorithm.pszObjId
// KeyEncryptionAlgorithm.Parameters // KeyEncryptionAlgorithm.Parameters
// dwFlags // dwFlags
// //
// All other fields in the KeyTransEncryptInfo are READONLY. // All other fields in the KeyTransEncryptInfo are READONLY.
// //
// The EncryptedKey must be updated. The pfnAlloc and pfnFree specified in // The EncryptedKey must be updated. The pfnAlloc and pfnFree specified in
// ContentEncryptInfo must be used for doing the allocation. // ContentEncryptInfo must be used for doing the allocation.
// //
// If the KeyEncryptionAlgorithm.pszObjId is changed, then, the
// CMSG_KEY_TRANS_ENCRYPT_FREE_OBJID_FLAG must be set in dwFlags.
// If the KeyEncryptionAlgorithm.Parameters is updated, then, the // If the KeyEncryptionAlgorithm.Parameters is updated, then, the
// CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags. // CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags.
// The pfnAlloc and pfnFree specified in ContentEncryptInfo must be used // The pfnAlloc and pfnFree specified in ContentEncryptInfo must be used
// 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
// 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
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,
IN OUT PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo, __inout PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved __reserved void *pvReserved
); );
// The following CNG installable function is called when
// pContentEncryptInfo->fCNG == TRUE. It has the same API signature as for
// the above CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC.
#define CMSG_OID_CNG_EXPORT_KEY_TRANS_FUNC "CryptMsgDllCNGExportKeyTrans"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Key Agree Key Encrypt Info // Key Agree Key Encrypt Info
// //
// The following data structure contains the information updated by the // The following data structure contains the information updated by the
// ExportKeyAgree installable function for each encrypted key agree // ExportKeyAgree installable function for each encrypted key agree
// recipient. // recipient.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_KEY_AGREE_KEY_ENCRYPT_INFO { typedef struct _CMSG_KEY_AGREE_KEY_ENCRYPT_INFO {
DWORD cbSize; DWORD cbSize;
CRYPT_DATA_BLOB EncryptedKey; CRYPT_DATA_BLOB EncryptedKey;
skipping to change at line 6718 skipping to change at line 8223
DWORD cKeyAgreeKeyEncryptInfo; DWORD cKeyAgreeKeyEncryptInfo;
PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO *rgpKeyAgreeKeyEncryptInfo; PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO *rgpKeyAgreeKeyEncryptInfo;
DWORD dwFlags; DWORD dwFlags;
} CMSG_KEY_AGREE_ENCRYPT_INFO, *PCMSG_KEY_AGREE_ENCRYPT_INFO; } CMSG_KEY_AGREE_ENCRYPT_INFO, *PCMSG_KEY_AGREE_ENCRYPT_INFO;
#define CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG 0x00000001 #define CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG 0x00000001
#define CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG 0x00000002 #define CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG 0x00000002
#define CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG 0x00000004 #define CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG 0x00000004
#define CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG 0x00000008 #define CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG 0x00000008
#define CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG 0x00000010 #define CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG 0x00000010
#define CMSG_KEY_AGREE_ENCRYPT_FREE_OBJID_FLAG 0x00000020
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Upon input, KeyAgreeEncryptInfo has been initialized from the // Upon input, KeyAgreeEncryptInfo has been initialized from the
// KeyAgreeEncodeInfo. // KeyAgreeEncodeInfo.
// //
// The following fields may be changed in KeyAgreeEncryptInfo: // The following fields may be changed in KeyAgreeEncryptInfo:
// KeyEncryptionAlgorithm.pszObjId
// KeyEncryptionAlgorithm.Parameters // KeyEncryptionAlgorithm.Parameters
// UserKeyingMaterial // UserKeyingMaterial
// dwOriginatorChoice // dwOriginatorChoice
// OriginatorCertId // OriginatorCertId
// OriginatorPublicKeyInfo // OriginatorPublicKeyInfo
// dwFlags // dwFlags
// //
// All other fields in the KeyAgreeEncryptInfo are READONLY. // All other fields in the KeyAgreeEncryptInfo are READONLY.
// //
// If the KeyEncryptionAlgorithm.pszObjId is changed, then, the
// CMSG_KEY_AGREE_ENCRYPT_FREE_OBJID_FLAG must be set in dwFlags.
// If the KeyEncryptionAlgorithm.Parameters is updated, then, the // If the KeyEncryptionAlgorithm.Parameters is updated, then, the
// CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags. // CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags.
// The pfnAlloc and pfnFree specified in ContentEncryptInfo must be used // The pfnAlloc and pfnFree specified in ContentEncryptInfo must be used
// for doing the allocation. // for doing the allocation.
// //
// If the UserKeyingMaterial is updated, then, the // If the UserKeyingMaterial is updated, then, the
// CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG must be set in dwFlags. // CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG must be set in dwFlags.
// pfnAlloc and pfnFree must be used for doing the allocation. // pfnAlloc and pfnFree must be used for doing the allocation.
// //
// The dwOriginatorChoice must be updated to either // The dwOriginatorChoice must be updated to either
skipping to change at line 6762 skipping to change at line 8271
// same maximum encoded length. Note, the length of the generated ephemeral Y // same maximum encoded length. Note, the length of the generated ephemeral Y
// public key can vary depending on the number of leading zero bits. // public key can vary depending on the number of leading zero bits.
// //
// Upon input, the array of *rgpKeyAgreeKeyEncryptInfo has been initialized. // Upon input, the array of *rgpKeyAgreeKeyEncryptInfo has been initialized.
// The EncryptedKey must be updated for each recipient key. // The EncryptedKey must be updated for each recipient key.
// The pfnAlloc and pfnFree specified in // The pfnAlloc and pfnFree specified in
// 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
// 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
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,
IN OUT PCMSG_KEY_AGREE_ENCRYPT_INFO pKeyAgreeEncryptInfo, __inout PCMSG_KEY_AGREE_ENCRYPT_INFO pKeyAgreeEncryptInfo,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved __reserved void *pvReserved
); );
// The following CNG installable function is called when
// pContentEncryptInfo->fCNG == TRUE. It has the same API signature as for
// the above CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC.
#define CMSG_OID_CNG_EXPORT_KEY_AGREE_FUNC "CryptMsgDllCNGExportKeyAgree"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Mail List Encrypt Info // Mail List Encrypt Info
// //
// The following data structure contains the information updated by the // The following data structure contains the information updated by the
// ExportMailList installable function. // ExportMailList installable function.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CMSG_MAIL_LIST_ENCRYPT_INFO { typedef struct _CMSG_MAIL_LIST_ENCRYPT_INFO {
DWORD cbSize; DWORD cbSize;
DWORD dwRecipientIndex; DWORD dwRecipientIndex;
CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
CRYPT_DATA_BLOB EncryptedKey; CRYPT_DATA_BLOB EncryptedKey;
DWORD dwFlags; DWORD dwFlags;
} CMSG_MAIL_LIST_ENCRYPT_INFO, *PCMSG_MAIL_LIST_ENCRYPT_INFO; } CMSG_MAIL_LIST_ENCRYPT_INFO, *PCMSG_MAIL_LIST_ENCRYPT_INFO;
#define CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG 0x00000001 #define CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG 0x00000001
#define CMSG_MAIL_LIST_ENCRYPT_FREE_OBJID_FLAG 0x00000002
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Upon input, MailListEncryptInfo has been initialized from the // Upon input, MailListEncryptInfo has been initialized from the
// MailListEncodeInfo. // MailListEncodeInfo.
// //
// The following fields may be changed in MailListEncryptInfo: // The following fields may be changed in MailListEncryptInfo:
// EncryptedKey // EncryptedKey
// KeyEncryptionAlgorithm.pszObjId
// KeyEncryptionAlgorithm.Parameters // KeyEncryptionAlgorithm.Parameters
// dwFlags // dwFlags
// //
// All other fields in the MailListEncryptInfo are READONLY. // All other fields in the MailListEncryptInfo are READONLY.
// //
// The EncryptedKey must be updated. The pfnAlloc and pfnFree specified in // The EncryptedKey must be updated. The pfnAlloc and pfnFree specified in
// ContentEncryptInfo must be used for doing the allocation. // ContentEncryptInfo must be used for doing the allocation.
// //
// If the KeyEncryptionAlgorithm.pszObjId is changed, then, the
// CMSG_MAIL_LIST_ENCRYPT_FREE_OBJID_FLAG must be set in dwFlags.
// If the KeyEncryptionAlgorithm.Parameters is updated, then, the // If the KeyEncryptionAlgorithm.Parameters is updated, then, the
// CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags. // CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG must be set in dwFlags.
// The pfnAlloc and pfnFree specified in ContentEncryptInfo must be used // The pfnAlloc and pfnFree specified in ContentEncryptInfo must be used
// for doing the allocation. // for doing the allocation.
// //
// 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.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// The following CAPI1 installable function is called when
// 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
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,
IN OUT PCMSG_MAIL_LIST_ENCRYPT_INFO pMailListEncryptInfo, __inout PCMSG_MAIL_LIST_ENCRYPT_INFO pMailListEncryptInfo,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved __reserved void *pvReserved
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// OID Installable functions for importing an encoded and encrypted content // CAPI1 OID Installable functions for importing an encoded and encrypted
// 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
// //
// Iterates through the following OIDs to get the OID installable function: // Iterates through the following OIDs to get the OID installable function:
// KeyEncryptionOID!ContentEncryptionOID // KeyEncryptionOID!ContentEncryptionOID
// 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
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,
IN OPTIONAL 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
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,
IN OPTIONAL 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
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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT HCRYPTKEY *phContentEncryptKey __out HCRYPTKEY *phContentEncryptKey
);
//+-------------------------------------------------------------------------
// CNG Content Decrypt Info
//
// The following data structure contains the information shared between
// CNGImportKeyTrans, CNGImportKeyAgree and CNGImportContentEncryptKey
// installable functions.
//
// pbContentEncryptKey and pbCNGContentEncryptKeyObject are allocated
// and freed via pfnAlloc and pfnFree.
//--------------------------------------------------------------------------
typedef struct _CMSG_CNG_CONTENT_DECRYPT_INFO {
DWORD cbSize;
CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
PFN_CMSG_ALLOC pfnAlloc;
PFN_CMSG_FREE pfnFree;
// This key must be used over the one in the DecryptPara. An
// HCRYPTPROV in the DecryptPara may have been converted to a
// NCRYPT_KEY_HANDLE.
NCRYPT_KEY_HANDLE hNCryptKey;
BYTE *pbContentEncryptKey;
DWORD cbContentEncryptKey;
BCRYPT_KEY_HANDLE hCNGContentEncryptKey;
BYTE *pbCNGContentEncryptKeyObject;
} CMSG_CNG_CONTENT_DECRYPT_INFO, *PCMSG_CNG_CONTENT_DECRYPT_INFO;
//+-------------------------------------------------------------------------
// CNG OID Installable function for importing and decrypting a key transport
// recipient encrypted content encryption key.
//
// Upon input, CNGContentDecryptInfo has been initialized.
//
// The following fields must be updated using hNCryptKey to decrypt
// pKeyTransDecryptPara->pKeyTrans->EncryptedKey.
// pbContentEncryptKey (pfnAlloc'ed)
// cbContentEncryptKey
//
// All other fields in the CNGContentEncryptInfo are READONLY.
//
// pKeyTransDecryptPara->pKeyTrans->KeyEncryptionAlgorithm.pszObjId is used
// to get the OIDFunctionAddress.
//--------------------------------------------------------------------------
#define CMSG_OID_CNG_IMPORT_KEY_TRANS_FUNC "CryptMsgDllCNGImportKeyTrans"
typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_KEY_TRANS) (
__inout PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
__in PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA pKeyTransDecryptPara,
__in DWORD dwFlags,
__reserved void *pvReserved
);
//+-------------------------------------------------------------------------
// CNG OID Installable function for importing and decrypting a key agreement
// recipient encrypted content encryption key.
//
// Upon input, CNGContentDecryptInfo has been initialized.
//
// The following fields must be updated using hNCryptKey to decrypt
// pKeyAgreeDecryptPara->pKeyAgree->rgpRecipientEncryptedKeys[
// pKeyAgreeDecryptPara->dwRecipientEncryptedKeyIndex]->EncryptedKey.
// pbContentEncryptKey (pfnAlloc'ed)
// cbContentEncryptKey
//
// All other fields in the CNGContentEncryptInfo are READONLY.
//
// pKeyAgreeDecryptPara->pKeyAgree->KeyEncryptionAlgorithm.pszObjId is used
// to get the OIDFunctionAddress.
//--------------------------------------------------------------------------
#define CMSG_OID_CNG_IMPORT_KEY_AGREE_FUNC "CryptMsgDllCNGImportKeyAgree"
typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_KEY_AGREE) (
__inout PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
__in PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA pKeyAgreeDecryptPara,
__in DWORD dwFlags,
__reserved void *pvReserved
);
//+-------------------------------------------------------------------------
// CNG OID Installable function for importing an already decrypted
// content encryption key.
//
// Upon input, CNGContentDecryptInfo has been initialized.
//
// The following fields must be updated using pbContentEncryptKey and
// cbContentEncryptKey:
// hCNGContentEncryptKey
// pbCNGContentEncryptKeyObject (pfnAlloc'ed)
//
// The hCNGContentEncryptKey will be destroyed when hCryptMsg is closed.
//
// All other fields in the CNGContentEncryptInfo are READONLY.
//
// ContentEncryptionAlgorithm.pszObjId is used to get the OIDFunctionAddress.
//--------------------------------------------------------------------------
#define CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllCNGImportConte
ntEncryptKey"
typedef BOOL (WINAPI *PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY) (
__inout PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
__in DWORD dwFlags,
__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 6946 skipping to change at line 8577
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolls_begin -- CERT_CONTEXT
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
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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).
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
skipping to change at line 6995 skipping to change at line 8628
BYTE *pbCtlEncoded; BYTE *pbCtlEncoded;
DWORD cbCtlEncoded; DWORD cbCtlEncoded;
PCTL_INFO pCtlInfo; PCTL_INFO pCtlInfo;
HCERTSTORE hCertStore; HCERTSTORE hCertStore;
HCRYPTMSG hCryptMsg; HCRYPTMSG hCryptMsg;
BYTE *pbCtlContent; BYTE *pbCtlContent;
DWORD cbCtlContent; DWORD cbCtlContent;
} CTL_CONTEXT, *PCTL_CONTEXT; } CTL_CONTEXT, *PCTL_CONTEXT;
typedef const CTL_CONTEXT *PCCTL_CONTEXT; typedef const CTL_CONTEXT *PCCTL_CONTEXT;
// certenrolld_begin -- CERT_*_PROP_ID
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate, CRL and CTL property IDs // Certificate, CRL and CTL property IDs
// //
// See CertSetCertificateContextProperty or CertGetCertificateContextProperty // See CertSetCertificateContextProperty or CertGetCertificateContextProperty
// for usage information. // for usage information.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_KEY_PROV_HANDLE_PROP_ID 1 #define CERT_KEY_PROV_HANDLE_PROP_ID 1
#define CERT_KEY_PROV_INFO_PROP_ID 2 #define CERT_KEY_PROV_INFO_PROP_ID 2 // CRYPT_KEY_PROV_INFO
#define CERT_SHA1_HASH_PROP_ID 3 #define CERT_SHA1_HASH_PROP_ID 3
#define CERT_MD5_HASH_PROP_ID 4 #define CERT_MD5_HASH_PROP_ID 4
#define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID #define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID
#define CERT_KEY_CONTEXT_PROP_ID 5 #define CERT_KEY_CONTEXT_PROP_ID 5
#define CERT_KEY_SPEC_PROP_ID 6 #define CERT_KEY_SPEC_PROP_ID 6
#define CERT_IE30_RESERVED_PROP_ID 7 #define CERT_IE30_RESERVED_PROP_ID 7
#define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8 #define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8
#define CERT_ENHKEY_USAGE_PROP_ID 9 #define CERT_ENHKEY_USAGE_PROP_ID 9
#define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID #define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID
#define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10 #define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10
#define CERT_FRIENDLY_NAME_PROP_ID 11 #define CERT_FRIENDLY_NAME_PROP_ID 11 // string
#define CERT_PVK_FILE_PROP_ID 12 #define CERT_PVK_FILE_PROP_ID 12
#define CERT_DESCRIPTION_PROP_ID 13 #define CERT_DESCRIPTION_PROP_ID 13 // string
#define CERT_ACCESS_STATE_PROP_ID 14 #define CERT_ACCESS_STATE_PROP_ID 14
#define CERT_SIGNATURE_HASH_PROP_ID 15 #define CERT_SIGNATURE_HASH_PROP_ID 15
#define CERT_SMART_CARD_DATA_PROP_ID 16 #define CERT_SMART_CARD_DATA_PROP_ID 16
#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 #define CERT_AUTO_ENROLL_PROP_ID 21 // string:machine DNS 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 #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
#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 #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 - 63 are reserved for future element IDs. // 36 - 63 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 #define CERT_ARCHIVED_KEY_HASH_PROP_ID 65 // Encrypted key hash
#define CERT_AUTO_ENROLL_RETRY_PROP_ID 66 #define CERT_AUTO_ENROLL_RETRY_PROP_ID 66 // AE_RETRY_INFO:cb+cRetry+FILETI
ME
#define CERT_AIA_URL_RETRIEVED_PROP_ID 67 #define CERT_AIA_URL_RETRIEVED_PROP_ID 67
// Note, 68 - 70 are reserved for future use. #define CERT_AUTHORITY_INFO_ACCESS_PROP_ID 68
#define CERT_REQUEST_ORIGINATOR_PROP_ID 71 #define CERT_BACKED_UP_PROP_ID 69 // VARIANT_BOOL+FILETIME
#define CERT_FIRST_RESERVED_PROP_ID 72 #define CERT_OCSP_RESPONSE_PROP_ID 70
#define CERT_REQUEST_ORIGINATOR_PROP_ID 71 // string:machine DNS name
#define CERT_SOURCE_LOCATION_PROP_ID 72 // string
#define CERT_SOURCE_URL_PROP_ID 73 // string
#define CERT_NEW_KEY_PROP_ID 74
#define CERT_OCSP_CACHE_PREFIX_PROP_ID 75 // string
#define CERT_SMART_CARD_ROOT_INFO_PROP_ID 76 // CRYPT_SMART_CARD_ROOT_INFO
#define CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID 77
#define CERT_NCRYPT_KEY_HANDLE_PROP_ID 78
#define CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID 79
#define CERT_SUBJECT_INFO_ACCESS_PROP_ID 80
#define CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 81
#define CERT_CA_DISABLE_CRL_PROP_ID 82
#define CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID 83
#define CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID 84
#define CERT_FIRST_RESERVED_PROP_ID 85
#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
#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_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 ))
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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
// Ansi OID string from Property Id:
#define szOID_CERT_PROP_ID(PropId) szOID_CERT_PROP_ID_PREFIX _szPROP_ID(PropId)
// Unicode OID string from Property Id:
#define __CRYPT32WTEXT(quote) L##quote
#define _CRYPT32WTEXT(quote) __CRYPT32WTEXT(quote)
#define wszOID_CERT_PROP_ID(PropId) \
_CRYPT32WTEXT(szOID_CERT_PROP_ID_PREFIX) _CRYPT32WTEXT(_szPROP_ID(PropId
))
// Use szOID_CERT_PROP_ID(CERT_KEY_IDENTIFIER_PROP_ID) instead:
#define szOID_CERT_KEY_IDENTIFIER_PROP_ID "1.3.6.1.4.1.311.10.11.20" #define szOID_CERT_KEY_IDENTIFIER_PROP_ID "1.3.6.1.4.1.311.10.11.20"
// 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:
#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:
#define szOID_CERT_MD5_HASH_PROP_ID "1.3.6.1.4.1.311.10.11.4"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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.
#define CERT_ACCESS_STATE_GP_SYSTEM_STORE_FLAG 0x8
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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 7129 skipping to change at line 8801
// The following flag should be set in the above dwFlags to enable // The following flag should be set in the above dwFlags to enable
// a CertSetCertificateContextProperty(CERT_KEY_CONTEXT_PROP_ID) after a // a CertSetCertificateContextProperty(CERT_KEY_CONTEXT_PROP_ID) after a
// CryptAcquireContext is done in the Sign or Decrypt Message functions. // CryptAcquireContext is done in the Sign or Decrypt Message functions.
// //
// The following define must not collide with any of the // The following define must not collide with any of the
// CryptAcquireContext dwFlag defines. // CryptAcquireContext dwFlag defines.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_SET_KEY_PROV_HANDLE_PROP_ID 0x00000001 #define CERT_SET_KEY_PROV_HANDLE_PROP_ID 0x00000001
#define CERT_SET_KEY_CONTEXT_PROP_ID 0x00000001 #define CERT_SET_KEY_CONTEXT_PROP_ID 0x00000001
// Special dwKeySpec indicating a CNG NCRYPT_KEY_HANDLE instead of a CAPI1
// HCRYPTPROV
#define CERT_NCRYPT_KEY_SPEC 0xFFFFFFFF
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Key Context // Certificate Key Context
// //
// CERT_KEY_CONTEXT defines the CERT_KEY_CONTEXT_PROP_ID's pvData. // CERT_KEY_CONTEXT defines the CERT_KEY_CONTEXT_PROP_ID's pvData.
//
// dwKeySpec is set to the special CERT_NCRYPT_KEY_SPEC to select the
// hNCryptKey choice.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CERT_KEY_CONTEXT { typedef struct _CERT_KEY_CONTEXT {
DWORD cbSize; // sizeof(CERT_KEY_CONTEXT) DWORD cbSize; // sizeof(CERT_KEY_CONTEXT)
HCRYPTPROV hCryptProv; union {
HCRYPTPROV hCryptProv;
// dwKeySpec == CERT_NCRYPT_KEY_SPEC
NCRYPT_KEY_HANDLE hNCryptKey;
};
DWORD dwKeySpec; DWORD dwKeySpec;
} CERT_KEY_CONTEXT, *PCERT_KEY_CONTEXT; } CERT_KEY_CONTEXT, *PCERT_KEY_CONTEXT;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Cryptographic Smart Card Root Information
//
// CRYPT_SMART_CARD_ROOT_INFO defines the
// CERT_SMART_CARD_ROOT_INFO_PROP_ID's pvData.
//--------------------------------------------------------------------------
typedef struct _ROOT_INFO_LUID {
DWORD LowPart;
LONG HighPart;
} ROOT_INFO_LUID, *PROOT_INFO_LUID;
typedef struct _CRYPT_SMART_CARD_ROOT_INFO {
BYTE rgbCardID [16];
ROOT_INFO_LUID luid;
} CRYPT_SMART_CARD_ROOT_INFO, *PCRYPT_SMART_CARD_ROOT_INFO;
//+-------------------------------------------------------------------------
// Certificate Store Provider Types // Certificate Store Provider Types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_STORE_PROV_MSG ((LPCSTR) 1) #define CERT_STORE_PROV_MSG ((LPCSTR) 1)
#define CERT_STORE_PROV_MEMORY ((LPCSTR) 2) #define CERT_STORE_PROV_MEMORY ((LPCSTR) 2)
#define CERT_STORE_PROV_FILE ((LPCSTR) 3) #define CERT_STORE_PROV_FILE ((LPCSTR) 3)
#define CERT_STORE_PROV_REG ((LPCSTR) 4) #define CERT_STORE_PROV_REG ((LPCSTR) 4)
#define CERT_STORE_PROV_PKCS7 ((LPCSTR) 5) #define CERT_STORE_PROV_PKCS7 ((LPCSTR) 5)
#define CERT_STORE_PROV_SERIALIZED ((LPCSTR) 6) #define CERT_STORE_PROV_SERIALIZED ((LPCSTR) 6)
#define CERT_STORE_PROV_FILENAME_A ((LPCSTR) 7) #define CERT_STORE_PROV_FILENAME_A ((LPCSTR) 7)
skipping to change at line 7163 skipping to change at line 8863
#define CERT_STORE_PROV_SYSTEM_A ((LPCSTR) 9) #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR) 9)
#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR) 10) #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR) 10)
#define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
#define CERT_STORE_PROV_COLLECTION ((LPCSTR) 11) #define CERT_STORE_PROV_COLLECTION ((LPCSTR) 11)
#define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR) 12) #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR) 12)
#define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR) 13) #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR) 13)
#define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
#define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR) 14) #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR) 14)
#define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
// SmartCard Store Provider isn't supported
#define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR) 15) #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR) 15)
#define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
#define CERT_STORE_PROV_LDAP_W ((LPCSTR) 16) #define CERT_STORE_PROV_LDAP_W ((LPCSTR) 16)
#define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
#define CERT_STORE_PROV_PKCS12 ((LPCSTR) 17)
#define sz_CERT_STORE_PROV_MEMORY "Memory" #define sz_CERT_STORE_PROV_MEMORY "Memory"
#define sz_CERT_STORE_PROV_FILENAME_W "File" #define sz_CERT_STORE_PROV_FILENAME_W "File"
#define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
#define sz_CERT_STORE_PROV_SYSTEM_W "System" #define sz_CERT_STORE_PROV_SYSTEM_W "System"
#define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
#define sz_CERT_STORE_PROV_PKCS7 "PKCS7" #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
#define sz_CERT_STORE_PROV_PKCS12 "PKCS12"
#define sz_CERT_STORE_PROV_SERIALIZED "Serialized" #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
#define sz_CERT_STORE_PROV_COLLECTION "Collection" #define sz_CERT_STORE_PROV_COLLECTION "Collection"
#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry" #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
#define sz_CERT_STORE_PROV_PHYSICAL_W "Physical" #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
#define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
// SmartCard Store Provider isn't supported
#define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard" #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
#define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
#define sz_CERT_STORE_PROV_LDAP_W "Ldap" #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
#define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate Store verify/results flags // Certificate Store verify/results flags
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_STORE_SIGNATURE_FLAG 0x00000001 #define CERT_STORE_SIGNATURE_FLAG 0x00000001
#define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002 #define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002
#define CERT_STORE_REVOCATION_FLAG 0x00000004 #define CERT_STORE_REVOCATION_FLAG 0x00000004
#define CERT_STORE_NO_CRL_FLAG 0x00010000 #define CERT_STORE_NO_CRL_FLAG 0x00010000
skipping to change at line 7312 skipping to change at line 9020
#define CERT_EFSBLOB_REGPATH \ #define CERT_EFSBLOB_REGPATH \
CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\EFS" CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\EFS"
#define CERT_EFSBLOB_VALUE_NAME L"EFSBlob" #define CERT_EFSBLOB_VALUE_NAME L"EFSBlob"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Protected Root Defines // Protected Root Defines
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Registry path to the Protected Roots Flags SubKey // Registry path to the Protected Roots Flags SubKey
#define CERT_PROT_ROOT_FLAGS_REGPATH \ #define CERT_PROT_ROOT_FLAGS_REGPATH \
CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\Root\\ProtectedRoots" CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\Root\\ProtectedRoots"
// The following is a REG_DWORD. The bit definitions follow.
#define CERT_PROT_ROOT_FLAGS_VALUE_NAME L"Flags" #define CERT_PROT_ROOT_FLAGS_VALUE_NAME L"Flags"
// Set the following flag to inhibit the opening of the CurrentUser's // Set the following flag to inhibit the opening of the CurrentUser's
// .Default physical store when opening the CurrentUser's "Root" system store. // .Default physical store when opening the CurrentUser's "Root" system store.
// The .Default physical store open's the CurrentUser SystemRegistry "Root" // The .Default physical store open's the CurrentUser SystemRegistry "Root"
// store. // store.
#define CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG 0x1 #define CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG 0x1
// Set the following flag to inhibit the adding of roots from the // Set the following flag to inhibit the adding of roots from the
// CurrentUser SystemRegistry "Root" store to the protected root list // CurrentUser SystemRegistry "Root" store to the protected root list
skipping to change at line 7356 skipping to change at line 9066
// When set, CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_NT_AUTH) // When set, CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_NT_AUTH)
// will check that the chain has a valid name constraint for all name // will check that the chain has a valid name constraint for all name
// spaces, including UPN if the issuing CA isn't in the "NTAuth" store. // spaces, including UPN if the issuing CA isn't in the "NTAuth" store.
#define CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG 0x10 #define CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG 0x10
// Set the following flag to disable checking for not defined name // Set the following flag to disable checking for not defined name
// constraints. // constraints.
// //
// When set, CertGetCertificateChain won't check for or set the following // When set, CertGetCertificateChain won't check for or set the following
// dwErrorStatus: CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT. // dwErrorStatus: CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT.
//
// In LH, checking for not defined name constraints is always disabled.
#define CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG 0x20 #define CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG 0x20
// Set the following flag to disallow the users to trust peer-trust
#define CERT_PROT_ROOT_DISABLE_PEER_TRUST 0x10000
// The following is a REG_MULTI_SZ containing the list of user allowed
// Enhanced Key Usages for peer trust.
#define CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME L"PeerUsages"
#define CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME_A "PeerUsages"
// If the above REG_MULTI_SZ isn't defined or is empty, defaults to
// the following multi-string value
#define CERT_PROT_ROOT_PEER_USAGES_DEFAULT_A \
szOID_PKIX_KP_CLIENT_AUTH "\0" \
szOID_PKIX_KP_EMAIL_PROTECTION "\0" \
szOID_KP_EFS "\0"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Trusted Publisher Definitions // Trusted Publisher Definitions
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Registry path to the trusted publisher "Safer" group policy subkey // Registry path to the trusted publisher "Safer" group policy subkey
#define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH \ #define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH \
CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer" CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
// Registry path to the Local Machine system stores // Registry path to the Local Machine system stores
#define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \ #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \
L"Software\\Microsoft\\SystemCertificates" L"Software\\Microsoft\\SystemCertificates"
skipping to change at line 7408 skipping to change at line 9135
// Set the following flag to enable revocation checking of the publisher // Set the following flag to enable revocation checking of the publisher
// chain. // chain.
#define CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG 0x00000100 #define CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG 0x00000100
// Set the following flag to enable revocation checking of the time stamp // Set the following flag to enable revocation checking of the time stamp
// chain. // chain.
#define CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG 0x00000200 #define CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG 0x00000200
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// OCM Subcomponents Definitions // OCM Subcomponents Definitions
//
// Reading of the following registry key has been deprecated on Longhorn.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// 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
//--------------------------------------------------------------------------
// Registry path to the DisableRootAutoUpdate SubKey
#define CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH \
CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\AuthRoot"
// REG_DWORD Value Name, 1 - disables, 0 - enables
#define CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME L"DisableRootAutoUpdate"
//+-------------------------------------------------------------------------
// 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_LOCAL_MACHINE_SYSTEM_STORE_REGPATH L"\\AuthRoot\\AutoUpdate"
// 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
skipping to change at line 7933 skipping to change at line 9672
// 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
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CertOpenStore( CertOpenStore(
IN LPCSTR lpszStoreProvider, __in LPCSTR lpszStoreProvider,
IN DWORD dwEncodingType, __in DWORD dwEncodingType,
IN HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN DWORD dwFlags, __in DWORD dwFlags,
IN 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 7976 skipping to change at line 9716
} 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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN DWORD dwFlags, __in DWORD dwFlags,
IN const void *pvPara, __in_opt const void *pvPara,
IN HCERTSTORE hCertStore, __in HCERTSTORE hCertStore,
IN OUT 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 8005 skipping to change at line 9745
#define CERT_STORE_PROV_NO_PERSIST_FLAG 0x4 #define CERT_STORE_PROV_NO_PERSIST_FLAG 0x4
// 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 system store. // to a system store.
#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
// to a GroupPolicy system store.
#define CERT_STORE_PROV_GP_SYSTEM_STORE_FLAG 0x20
// 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 8037 skipping to change at line 9781
#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)(
IN 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 BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)( typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)(
IN HCERTSTOREPROV hStoreProv, __inout HCERTSTOREPROV hStoreProv,
IN PCCERT_CONTEXT pStoreCertContext, __in PCCERT_CONTEXT pStoreCertContext,
IN DWORD dwFlags, __in DWORD dwFlags,
OUT PCCERT_CONTEXT *ppProvCertContext __deref_out 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)(
IN 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)(
IN 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)(
IN 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 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 BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)( typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)(
IN HCERTSTOREPROV hStoreProv, __inout HCERTSTOREPROV hStoreProv,
IN PCCRL_CONTEXT pStoreCrlContext, __in PCCRL_CONTEXT pStoreCrlContext,
IN DWORD dwFlags, __in DWORD dwFlags,
OUT PCCRL_CONTEXT *ppProvCrlContext __deref_out 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)(
IN 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)(
IN 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)(
IN 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 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 BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)( typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)(
IN HCERTSTOREPROV hStoreProv, __inout HCERTSTOREPROV hStoreProv,
IN PCCTL_CONTEXT pStoreCtlContext, __in PCCTL_CONTEXT pStoreCtlContext,
IN DWORD dwFlags, __in DWORD dwFlags,
OUT PCCTL_CONTEXT *ppProvCtlContext __deref_out 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)(
IN 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)(
IN 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)(
IN 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 const void *pvData __in_opt const void *pvData
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)(
IN HCERTSTOREPROV hStoreProv, __inout HCERTSTOREPROV hStoreProv,
IN DWORD dwFlags, __in DWORD dwFlags,
IN DWORD dwCtrlType, __in DWORD dwCtrlType,
IN 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 BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CERT)( typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CERT)(
IN 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,
IN OUT void **ppvStoreProvFindInfo, __deref_inout void **ppvStoreProvFindInfo,
OUT PCCERT_CONTEXT *ppProvCertContext __deref_out PCCERT_CONTEXT *ppProvCertContext
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CERT)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CERT)(
IN 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)(
IN 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT DWORD *pcbData __inout DWORD *pcbData
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CRL)( typedef __success(return == TRUE) BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CRL)(
IN 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,
IN OUT void **ppvStoreProvFindInfo, __deref_inout void **ppvStoreProvFindInfo,
OUT PCCRL_CONTEXT *ppProvCrlContext __deref_out PCCRL_CONTEXT *ppProvCrlContext
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CRL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CRL)(
IN 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)(
IN 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT DWORD *pcbData __inout DWORD *pcbData
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CTL)( typedef __success(return == TRUE) 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,
IN OUT void **ppvStoreProvFindInfo, __deref_inout void **ppvStoreProvFindInfo,
OUT PCCTL_CONTEXT *ppProvCtlContext __deref_out PCCTL_CONTEXT *ppProvCtlContext
); );
typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CTL)( typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CTL)(
IN 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)(
IN 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT 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_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
#define CERT_STORE_SAVE_TO_FILENAME CERT_STORE_SAVE_TO_FILENAME_W #define CERT_STORE_SAVE_TO_FILENAME CERT_STORE_SAVE_TO_FILENAME_W
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Save the cert store. Extended version with lots of options. // Save the cert store. Extended version with lots of options.
// //
skipping to change at line 8361 skipping to change at line 10106
// 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,
IN OUT 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 8403 skipping to change at line 10148
// 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 HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
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
// can be called to make a duplicate. // can be called to make a duplicate.
skipping to change at line 8449 skipping to change at line 10194
// 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 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 8481 skipping to change at line 10226
// 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 const void *pvFindPara, __in_opt const void *pvFindPara,
IN 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 8517 skipping to change at line 10262
#define CERT_COMPARE_SUBJECT_CERT 11 #define CERT_COMPARE_SUBJECT_CERT 11
#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
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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)
#define CERT_FIND_MD5_HASH (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT) #define CERT_FIND_MD5_HASH (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT)
skipping to change at line 8564 skipping to change at line 10311
#define CERT_FIND_SUBJECT_CERT (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT ) #define CERT_FIND_SUBJECT_CERT (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT )
#define CERT_FIND_ISSUER_OF (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT) #define CERT_FIND_ISSUER_OF (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT)
#define CERT_FIND_EXISTING (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT) #define CERT_FIND_EXISTING (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT)
#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 \
(CERT_COMPARE_SUBJECT_INFO_ACCESS << 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 8755 skipping to change at line 10505
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_FIND_CROSS_CERT_DIST_POINTS // CERT_FIND_CROSS_CERT_DIST_POINTS
// //
// Find a certificate having either a cross certificate distribution // Find a certificate having either a cross certificate distribution
// point extension or property. // point extension or property.
// //
// pvFindPara isn't used. // pvFindPara isn't used.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// CERT_FIND_SUBJECT_INFO_ACCESS
//
// Find a certificate having either a SubjectInfoAccess extension or
// property.
//
// pvFindPara isn't used.
//--------------------------------------------------------------------------
//+-------------------------------------------------------------------------
// 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 8812 skipping to change at line 10571
// 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 OPTIONAL PCCERT_CONTEXT pPrevIssuerContext, __in_opt PCCERT_CONTEXT pPrevIssuerContext,
IN OUT 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 OPTIONAL PCCERT_CONTEXT pIssuer, __in_opt PCCERT_CONTEXT pIssuer,
IN OUT DWORD *pdwFlags __inout DWORD *pdwFlags
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a certificate context // Duplicate a certificate context
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCERT_CONTEXT PCCERT_CONTEXT
WINAPI WINAPI
CertDuplicateCertificateContext( CertDuplicateCertificateContext(
IN 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 const BYTE *pbCertEncoded, __in_bcount(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 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
// doesn't exist, its created with all the other fields zeroed out. If // doesn't exist, its created with all the other fields zeroed out. If
// CERT_STORE_NO_CRYPT_RELEASE_FLAG isn't set, HCRYPTPROV is implicitly // CERT_STORE_NO_CRYPT_RELEASE_FLAG isn't set, HCRYPTPROV is implicitly
// released when either the property is set to NULL or on the final // released when either the property is set to NULL or on the final
// free of the CertContext. // free of the CertContext.
// //
// CERT_NCRYPT_KEY_HANDLE_PROP_ID - a NCRYPT_KEY_HANDLE for the
// certificate's private key is passed in pvData. The dwKeySpec is
// set to CERT_NCRYPT_KEY_SPEC.
//
// CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID - a
// HCRYPTPROV_OR_NCRYPT_KEY_HANDLE for the certificates's private
// key is passed in pvData. NCryptIsKeyHandle()
// is called to determine if this is a CNG NCRYPT_KEY_HANDLE.
// For a NCRYPT_KEY_HANDLE does a CERT_NCRYPT_KEY_HANDLE_PROP_ID set.
// Otherwise, does a CERT_KEY_PROV_HANDLE_PROP_ID set.
//
// CERT_KEY_PROV_INFO_PROP_ID - a PCRYPT_KEY_PROV_INFO for the certificate' s // CERT_KEY_PROV_INFO_PROP_ID - a PCRYPT_KEY_PROV_INFO for the certificate' s
// private key is passed in pvData. // private key is passed in pvData.
// //
// CERT_SHA1_HASH_PROP_ID - // CERT_SHA1_HASH_PROP_ID -
// CERT_MD5_HASH_PROP_ID - // CERT_MD5_HASH_PROP_ID -
// CERT_SIGNATURE_HASH_PROP_ID - normally, a hash property is implicitly // CERT_SIGNATURE_HASH_PROP_ID - normally, a hash property is implicitly
// set by doing a CertGetCertificateContextProperty. pvData points to a // set by doing a CertGetCertificateContextProperty. pvData points to a
// CRYPT_HASH_BLOB. // CRYPT_HASH_BLOB.
// //
// CERT_KEY_CONTEXT_PROP_ID - a PCERT_KEY_CONTEXT for the certificate's // CERT_KEY_CONTEXT_PROP_ID - a PCERT_KEY_CONTEXT for the certificate's
// private key is passed in pvData. The CERT_KEY_CONTEXT contains both the // private key is passed in pvData. The CERT_KEY_CONTEXT contains both the
// hCryptProv and dwKeySpec for the private key. // hCryptProv and dwKeySpec for the private key. A dwKeySpec of
// CERT_NCRYPT_KEY_SPEC selects the hNCryptKey choice.
// See the CERT_KEY_PROV_HANDLE_PROP_ID for more information about // See the CERT_KEY_PROV_HANDLE_PROP_ID for more information about
// the hCryptProv field and dwFlags settings. Note, more fields may // the hCryptProv field and dwFlags settings. Note, more fields may
// be added for this property. The cbSize field value will be adjusted // be added for this property. The cbSize field value will be adjusted
// accordingly. // accordingly.
// //
// CERT_KEY_SPEC_PROP_ID - the dwKeySpec for the private key. pvData // CERT_KEY_SPEC_PROP_ID - the dwKeySpec for the private key. pvData
// points to a DWORD containing the KeySpec // points to a DWORD containing the KeySpec
// //
// CERT_ENHKEY_USAGE_PROP_ID - enhanced key usage definition for the // CERT_ENHKEY_USAGE_PROP_ID - enhanced key usage definition for the
// certificate. pvData points to a CRYPT_DATA_BLOB containing an // certificate. pvData points to a CRYPT_DATA_BLOB containing an
skipping to change at line 8971 skipping to change at line 10742
// followed by CAName string with null-terminator, // followed by CAName string with null-terminator,
// next 4 bytes - FriendlyName size in characters including null-terminator // next 4 bytes - FriendlyName size in characters including null-terminator
// followed by FriendlyName string with null-terminator. // followed by FriendlyName string with null-terminator.
// //
// CERT_DATE_STAMP_PROP_ID - contains the time when added to the store // CERT_DATE_STAMP_PROP_ID - contains the time when added to the store
// by an admin tool. pvData points to a CRYPT_DATA_BLOB containing // by an admin tool. pvData points to a CRYPT_DATA_BLOB containing
// the FILETIME. // the FILETIME.
// //
// CERT_RENEWAL_PROP_ID - contains the hash of renewed certificate // CERT_RENEWAL_PROP_ID - contains the hash of renewed certificate
// //
// CERT_OCSP_RESPONSE_PROP_ID - contains the encoded OCSP response.
// CryptDecodeObject/CryptEncodeObject using
// lpszStructType = OCSP_RESPONSE.
// pvData points to a CRYPT_DATA_BLOB containing the encoded OCSP response.
// If this property is present, CertVerifyRevocation() will first attempt
// to use before doing an URL retrieval.
//
// CERT_SOURCE_LOCATION_PROP_ID - contains source location of the CRL or
// OCSP. pvData points to a CRYPT_DATA_BLOB. pbData is a pointer to a NULL
// terminated unicode, wide character string. Where,
// cbData = (wcslen((LPWSTR) pbData) + 1) * sizeof(WCHAR).
//
// CERT_SOURCE_URL_PROP_ID - contains URL for the CRL or OCSP. pvData
// is the same as for CERT_SOURCE_LOCATION_PROP_ID.
//
// 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 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
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Get the property for the specified certificate context. // Get the property for the specified certificate context.
// //
// For CERT_KEY_PROV_HANDLE_PROP_ID, pvData points to a HCRYPTPROV. // For CERT_KEY_PROV_HANDLE_PROP_ID, pvData points to a HCRYPTPROV.
// The CERT_NCRYPT_KEY_SPEC NCRYPT_KEY_HANDLE choice isn't returned.
//
// For CERT_NCRYPT_KEY_HANDLE_PROP_ID, pvData points to a NCRYPT_KEY_HANDLE.
// Only returned for the CERT_NCRYPT_KEY_SPEC choice.
//
// For CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID, pvData points to a
// HCRYPTPROV_OR_NCRYPT_KEY_HANDLE. Returns either the HCRYPTPROV or
// NCRYPT_KEY_HANDLE choice.
// //
// For CERT_KEY_PROV_INFO_PROP_ID, pvData points to a CRYPT_KEY_PROV_INFO struc ture. // For CERT_KEY_PROV_INFO_PROP_ID, pvData points to a CRYPT_KEY_PROV_INFO struc ture.
// Elements pointed to by fields in the pvData structure follow the // Elements pointed to by fields in the pvData structure follow the
// structure. Therefore, *pcbData may exceed the size of the structure. // structure. Therefore, *pcbData may exceed the size of the structure.
// //
// For CERT_KEY_CONTEXT_PROP_ID, pvData points to a CERT_KEY_CONTEXT structure. // For CERT_KEY_CONTEXT_PROP_ID, pvData points to a CERT_KEY_CONTEXT structure.
// //
// For CERT_KEY_SPEC_PROP_ID, pvData points to a DWORD containing the KeySpec. // For CERT_KEY_SPEC_PROP_ID, pvData points to a DWORD containing the KeySpec.
// If the CERT_KEY_CONTEXT_PROP_ID exists, the KeySpec is obtained from there. // If the CERT_KEY_CONTEXT_PROP_ID exists, the KeySpec is obtained from there.
// Otherwise, if the CERT_KEY_PROV_INFO_PROP_ID exists, its the source // Otherwise, if the CERT_KEY_PROV_INFO_PROP_ID exists, its the source
// of the KeySpec. // of the KeySpec. CERT_NCRYPT_KEY_SPEC is returned if the
// CERT_NCRYPT_KEY_HANDLE_PROP_ID has been set.
// //
// For CERT_SHA1_HASH_PROP_ID or CERT_MD5_HASH_PROP_ID, if the hash // For CERT_SHA1_HASH_PROP_ID or CERT_MD5_HASH_PROP_ID, if the hash
// doesn't already exist, then, its computed via CryptHashCertificate() // doesn't already exist, then, its computed via CryptHashCertificate()
// and then set. pvData points to the computed hash. Normally, the length // and then set. pvData points to the computed hash. Normally, the length
// is 20 bytes for SHA and 16 for MD5. // is 20 bytes for SHA and 16 for MD5.
// //
// For CERT_SIGNATURE_HASH_PROP_ID, if the hash // For CERT_SIGNATURE_HASH_PROP_ID, if the hash
// doesn't already exist, then, its computed via CryptHashToBeSigned() // doesn't already exist, then, its computed via CryptHashToBeSigned()
// and then set. pvData points to the computed hash. Normally, the length // and then set. pvData points to the computed hash. Normally, the length
// is 20 bytes for SHA and 16 for MD5. // is 20 bytes for SHA and 16 for MD5.
skipping to change at line 9040 skipping to change at line 10835
// points to the key identifier bytes. Normally, the length is 20 bytes. // points to the key identifier bytes. Normally, the length is 20 bytes.
// //
// For CERT_PUBKEY_ALG_PARA_PROP_ID, pvPara points to the ASN.1 encoded // For CERT_PUBKEY_ALG_PARA_PROP_ID, pvPara points to the ASN.1 encoded
// PublicKey Algorithm Parameters. This property will only be set // PublicKey Algorithm Parameters. This property will only be set
// for public keys supporting algorithm parameter inheritance and when the // for public keys supporting algorithm parameter inheritance and when the
// parameters have been omitted from the encoded and signed certificate. // parameters have been omitted from the encoded and signed certificate.
// //
// For CERT_DATE_STAMP_PROP_ID, pvPara points to a FILETIME updated by // For CERT_DATE_STAMP_PROP_ID, pvPara points to a FILETIME updated by
// an admin tool to indicate when the certificate was added to the store. // an admin tool to indicate when the certificate was added to the store.
// //
// For CERT_OCSP_RESPONSE_PROP_ID, pvPara points to an encoded OCSP response.
//
// For CERT_SOURCE_LOCATION_PROP_ID and CERT_SOURCE_URL_PROP_ID,
// 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT 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
skipping to change at line 9094 skipping to change at line 10894
// 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
BOOL BOOL
WINAPI WINAPI
CertCreateCTLEntryFromCertificateContextProperties( CertCreateCTLEntryFromCertificateContextProperties(
IN PCCERT_CONTEXT pCertContext, __in PCCERT_CONTEXT pCertContext,
IN DWORD cOptAttr, __in DWORD cOptAttr,
IN OPTIONAL PCRYPT_ATTRIBUTE rgOptAttr, __in_ecount_opt(cOptAttr) PCRYPT_ATTRIBUTE rgOptAttr,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT OPTIONAL PCTL_ENTRY pCtlEntry, __out_bcount_part_opt(*pcbCtlEntry, *pcbCtlEntry) PCTL_ENTRY pCtlEntry,
IN OUT 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 9182 skipping to change at line 10982
// 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 OPTIONAL PCCERT_CONTEXT pIssuerContext, __in_opt PCCERT_CONTEXT pIssuerContext,
IN PCCRL_CONTEXT pPrevCrlContext, __in_opt PCCRL_CONTEXT pPrevCrlContext,
IN OUT 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 9208 skipping to change at line 11008
// 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 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 9239 skipping to change at line 11039
// 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 const void *pvFindPara, __in_opt const void *pvFindPara,
IN 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 9332 skipping to change at line 11132
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;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Duplicate a CRL context // Duplicate a CRL context
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
PCCRL_CONTEXT PCCRL_CONTEXT
WINAPI WINAPI
CertDuplicateCRLContext( CertDuplicateCRLContext(
IN 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 const BYTE *pbCrlEncoded, __in_bcount(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 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 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT 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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT PCRL_ENTRY *ppCrlEntry __deref_out_opt 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,
IN 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 9524 skipping to change at line 11324
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCertificateToStore( CertAddEncodedCertificateToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN const BYTE *pbCertEncoded, __in_bcount(cbCertEncoded) const BYTE *pbCertEncoded,
IN DWORD cbCertEncoded, __in DWORD cbCertEncoded,
IN DWORD dwAddDisposition, __in DWORD dwAddDisposition,
OUT OPTIONAL PCCERT_CONTEXT *ppCertContext __deref_opt_out 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 9593 skipping to change at line 11394
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddCertificateContextToStore( CertAddCertificateContextToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN PCCERT_CONTEXT pCertContext, __in PCCERT_CONTEXT pCertContext,
IN DWORD dwAddDisposition, __in DWORD dwAddDisposition,
OUT OPTIONAL PCCERT_CONTEXT *ppStoreContext __deref_opt_out 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 9646 skipping to change at line 11448
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddSerializedElementToStore( CertAddSerializedElementToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN const BYTE *pbElement, __in_bcount(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 OPTIONAL DWORD *pdwContextType, __out_opt DWORD *pdwContextType,
OUT OPTIONAL const void **ppvContext __deref_opt_out 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 9678 skipping to change at line 11481
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCRLToStore( CertAddEncodedCRLToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN const BYTE *pbCrlEncoded, __in_bcount(cbCrlEncoded) const BYTE *pbCrlEncoded,
IN DWORD cbCrlEncoded, __in DWORD cbCrlEncoded,
IN DWORD dwAddDisposition, __in DWORD dwAddDisposition,
OUT OPTIONAL PCCRL_CONTEXT *ppCrlContext __deref_opt_out 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 9730 skipping to change at line 11534
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddCRLContextToStore( CertAddCRLContextToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN PCCRL_CONTEXT pCrlContext, __in PCCRL_CONTEXT pCrlContext,
IN DWORD dwAddDisposition, __in DWORD dwAddDisposition,
OUT OPTIONAL PCCRL_CONTEXT *ppStoreContext __deref_opt_out 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 BYTE *pbElement, __out_bcount_part_opt(*pcbElement, *pcbElement) BYTE *pbElement,
IN OUT 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 BYTE *pbElement, __out_bcount_part_opt(*pcbElement, *pcbElement) BYTE *pbElement,
IN OUT 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 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 const BYTE *pbCtlEncoded, __in_bcount(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 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 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 void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT 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 9899 skipping to change at line 11704
// 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 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 9925 skipping to change at line 11730
// 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 9970 skipping to change at line 11775
// 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 const void *pvFindPara, __in_opt const void *pvFindPara,
IN 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 10071 skipping to change at line 11876
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCTLToStore( CertAddEncodedCTLToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN DWORD dwMsgAndCertEncodingType, __in DWORD dwMsgAndCertEncodingType,
IN const BYTE *pbCtlEncoded, __in_bcount(cbCtlEncoded) const BYTE *pbCtlEncoded,
IN DWORD cbCtlEncoded, __in DWORD cbCtlEncoded,
IN DWORD dwAddDisposition, __in DWORD dwAddDisposition,
OUT OPTIONAL PCCTL_CONTEXT *ppCtlContext __deref_opt_out 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 10103 skipping to change at line 11909
// 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)
BOOL BOOL
WINAPI WINAPI
CertAddCTLContextToStore( CertAddCTLContextToStore(
IN HCERTSTORE hCertStore, __in_opt HCERTSTORE hCertStore,
IN PCCTL_CONTEXT pCtlContext, __in PCCTL_CONTEXT pCtlContext,
IN DWORD dwAddDisposition, __in DWORD dwAddDisposition,
OUT OPTIONAL PCCTL_CONTEXT *ppStoreContext __deref_opt_out 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 BYTE *pbElement, __out_bcount_part_opt(*pcbElement, *pcbElement) BYTE *pbElement,
IN OUT 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)
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,
OUT OPTIONAL PCCERT_CONTEXT *ppStoreContext __deref_opt_out PCCERT_CONTEXT *ppStoreContext
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE)
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,
OUT OPTIONAL PCCRL_CONTEXT *ppStoreContext __deref_opt_out PCCRL_CONTEXT *ppStoreContext
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE)
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,
OUT OPTIONAL PCCTL_CONTEXT *ppStoreContext __deref_opt_out PCCTL_CONTEXT *ppStoreContext
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertAddStoreToCollection( CertAddStoreToCollection(
IN HCERTSTORE hCollectionStore, __in HCERTSTORE hCollectionStore,
IN OPTIONAL 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 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 10309 skipping to change at line 12119
// Its not a property on an individual certificate, CRL or CTL context. // Its not a property on an individual certificate, CRL or CTL context.
// //
// Currently, no store properties are persisted. (This differs from // Currently, no store properties are persisted. (This differs from
// most context properties which are persisted.) // most context properties which are persisted.)
// //
// See CertSetStoreProperty or CertGetStoreProperty for usage information. // See CertSetStoreProperty or CertGetStoreProperty for usage information.
// //
// Note, the range for predefined store properties should be outside // Note, the range for predefined store properties should be outside
// the range of predefined context properties. We will start at 4096. // the range of predefined context properties. We will start at 4096.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// certenrolld_begin -- CERT_*_PROP_ID
#define CERT_STORE_LOCALIZED_NAME_PROP_ID 0x1000 #define CERT_STORE_LOCALIZED_NAME_PROP_ID 0x1000
// certenrolld_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Set a store property. // Set 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 CRYPT_DATA_BLOB. pbData is a pointer to a NULL // pvData points to a CRYPT_DATA_BLOB. pbData is a pointer to a NULL
// terminated unicode, wide character string. // terminated unicode, wide character string.
// cbData = (wcslen((LPWSTR) pbData) + 1) * sizeof(WCHAR). // cbData = (wcslen((LPWSTR) pbData) + 1) * sizeof(WCHAR).
// //
// 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 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
BOOL BOOL
WINAPI WINAPI
CertGetStoreProperty( CertGetStoreProperty(
IN HCERTSTORE hCertStore, __in HCERTSTORE hCertStore,
IN DWORD dwPropId, __in DWORD dwPropId,
OUT void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT DWORD *pcbData __inout DWORD *pcbData
);
//+-------------------------------------------------------------------------
// If the callback returns FALSE, stops the sort. CertCreateContext
// will return FALSE and set last error to ERROR_CANCELLED if the sort
// was stopped.
//
// Where:
// cbTotalEncoded - total byte count of the encoded entries.
// cbRemainEncoded - remaining byte count of the encoded entries.
// cEntry - running count of sorted entries
// pvSort - value passed in pCreatePara
//--------------------------------------------------------------------------
typedef BOOL (WINAPI *PFN_CERT_CREATE_CONTEXT_SORT_FUNC)(
__in DWORD cbTotalEncoded,
__in DWORD cbRemainEncoded,
__in DWORD cEntry,
__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
// CERT_CREATE_CONTEXT_SORTED_FLAG is set in dwFlags.
PFN_CERT_CREATE_CONTEXT_SORT_FUNC pfnSort; // OPTIONAL
void *pvSort; // OPTIONAL
} CERT_CREATE_CONTEXT_PARA, *PCERT_CREATE_CONTEXT_PARA; } CERT_CREATE_CONTEXT_PARA, *PCERT_CREATE_CONTEXT_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Creates the specified context from the encoded bytes. The created // Creates the specified context from the encoded bytes. The created
// context isn't put in a store. // context isn't put in a store.
// //
// dwContextType values: // dwContextType values:
// CERT_STORE_CERTIFICATE_CONTEXT // CERT_STORE_CERTIFICATE_CONTEXT
// CERT_STORE_CRL_CONTEXT // CERT_STORE_CRL_CONTEXT
// CERT_STORE_CTL_CONTEXT // CERT_STORE_CTL_CONTEXT
skipping to change at line 10401 skipping to change at line 12236
// 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 const BYTE *pbEncoded, __in_bcount(cbEncoded) const BYTE *pbEncoded,
IN DWORD cbEncoded, __in DWORD cbEncoded,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL 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 10428 skipping to change at line 12263
// When the following flag is set, a context with sorted entries is created. // When the following flag is set, a context with sorted entries is created.
// Currently only applicable to a CTL context. // Currently only applicable to a CTL context.
// //
// For CTLs: the cCTLEntry in the returned CTL_INFO is always // For CTLs: the cCTLEntry in the returned CTL_INFO is always
// 0. CertFindSubjectInSortedCTL and CertEnumSubjectInSortedCTL must be called // 0. CertFindSubjectInSortedCTL and CertEnumSubjectInSortedCTL must be called
// to find or enumerate the CTL entries. // to find or enumerate the CTL entries.
// //
// The Sorted CTL TrustedSubjects extension isn't returned in the created // The Sorted CTL TrustedSubjects extension isn't returned in the created
// context's CTL_INFO. // context's CTL_INFO.
//
// pfnSort and pvSort can be set in the pCreatePara parameter to be called for
// each sorted entry. pfnSort can return FALSE to stop the sorting.
#define CERT_CREATE_CONTEXT_SORTED_FLAG 0x2 #define CERT_CREATE_CONTEXT_SORTED_FLAG 0x2
// By default when a CTL context is created, a HCRYPTMSG handle to its // By default when a CTL context is created, a HCRYPTMSG handle to its
// SignedData message is created. This flag can be set to improve performance // SignedData message is created. This flag can be set to improve performance
// by not creating the HCRYPTMSG handle. // by not creating the HCRYPTMSG handle.
// //
// This flag is only applicable to a CTL context. // This flag is only applicable to a CTL context.
#define CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG 0x4 #define CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG 0x4
// By default when a CTL context is created, its entries are decoded. // By default when a CTL context is created, its entries are decoded.
skipping to change at line 10548 skipping to change at line 12386
// "\\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 PCERT_SYSTEM_STORE_INFO pStoreInfo, __in_opt PCERT_SYSTEM_STORE_INFO pStoreInfo,
IN OPTIONAL 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 10574 skipping to change at line 12412
// 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,
IN OPTIONAL 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 10600 skipping to change at line 12438
// //
// 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 10623 skipping to change at line 12461
// //
// 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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
IN OPTIONAL 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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
IN OPTIONAL 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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
IN OPTIONAL 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"
#define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME L".LocalMachine" #define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME L".LocalMachine"
#define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME L".UserCertificate" #define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME L".UserCertificate"
#define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \ #define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
L".LocalMachineGroupPolicy" L".LocalMachineGroupPolicy"
#define CERT_PHYSICAL_STORE_ENTERPRISE_NAME L".Enterprise" #define CERT_PHYSICAL_STORE_ENTERPRISE_NAME L".Enterprise"
#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"
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Enumerate the system store locations. // Enumerate the system store locations.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertEnumSystemStoreLocation( CertEnumSystemStoreLocation(
IN DWORD dwFlags, __in DWORD dwFlags,
IN void *pvArg, __inout_opt void *pvArg,
IN 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,
// pvSystemStoreLocationPara points to a CERT_SYSTEM_STORE_RELOCATE_PARA // pvSystemStoreLocationPara points to a CERT_SYSTEM_STORE_RELOCATE_PARA
skipping to change at line 10731 skipping to change at line 12570
// "\\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 OPTIONAL void *pvSystemStoreLocationPara, __in_opt void *pvSystemStoreLocationPara,
IN void *pvArg, __inout_opt void *pvArg,
IN 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
// 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 10757 skipping to change at line 12596
// 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,
IN void *pvArg, __inout_opt void *pvArg,
IN 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,
// CertUnregisterPhysicalStore and CertEnumPhysicalStore APIs is used as the // CertUnregisterPhysicalStore and CertEnumPhysicalStore APIs is used as the
skipping to change at line 10818 skipping to change at line 12657
// 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 PCERT_ENHKEY_USAGE pUsage, __out_bcount_part_opt(*pcbUsage, *pcbUsage) PCERT_ENHKEY_USAGE pUsage,
IN OUT 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 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
BOOL BOOL
WINAPI WINAPI
CertGetValidUsages( CertGetValidUsages(
IN DWORD cCerts, __in DWORD cCerts,
IN PCCERT_CONTEXT *rghCerts, __in_ecount(cCerts) PCCERT_CONTEXT *rghCerts,
OUT int *cNumOIDs, __out int *cNumOIDs,
OUT LPSTR *rghOIDs, __out_bcount_part_opt(*pcbOIDs, *pcbOIDs) LPSTR *rghOIDs,
IN OUT 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 10905 skipping to change at line 12744
// 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)
BOOL BOOL
WINAPI WINAPI
CryptMsgGetAndVerifySigner( CryptMsgGetAndVerifySigner(
IN HCRYPTMSG hCryptMsg, __in HCRYPTMSG hCryptMsg,
IN DWORD cSignerStore, __in DWORD cSignerStore,
IN OPTIONAL HCERTSTORE *rghSignerStore, __in_ecount_opt(cSignerStore) HCERTSTORE *rghSignerStore,
IN DWORD dwFlags, __in DWORD dwFlags,
OUT OPTIONAL PCCERT_CONTEXT *ppSigner, __deref_opt_out PCCERT_CONTEXT *ppSigner,
IN OUT OPTIONAL 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 BYTE *pbCtlContent, __in_bcount(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 BYTE *pbEncoded, __out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
IN OUT 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 10962 skipping to change at line 12802
// 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 BYTE *pbEncoded, __out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
IN OUT 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,
IN void *pvReserved, __reserved void *pvReserved,
OUT OPTIONAL 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,
IN OUT void **ppvNextSubject, __deref_inout_opt void **ppvNextSubject,
OUT OPTIONAL PCRYPT_DER_BLOB pSubjectIdentifier, __out_opt PCRYPT_DER_BLOB pSubjectIdentifier,
OUT OPTIONAL 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 11101 skipping to change at line 12941
// 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 OPTIONAL PCTL_VERIFY_USAGE_PARA pVerifyUsagePara, __in_opt PCTL_VERIFY_USAGE_PARA pVerifyUsagePara,
IN OUT 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 11180 skipping to change at line 13020
// If nonNULL, a CRL revocation type handler updates with the base and // If nonNULL, a CRL revocation type handler updates with the base and
// possibly the delta CRL used. Note, *pCrlInfo must be initialized // possibly the delta CRL used. Note, *pCrlInfo must be initialized
// by the caller. Any nonNULL CRL contexts are freed. Any updated // by the caller. Any nonNULL CRL contexts are freed. Any updated
// CRL contexts must be freed by the caller. // CRL contexts must be freed by the caller.
// //
// The CRL info is only applicable to the last context checked. If // The CRL info is only applicable to the last context checked. If
// interested in this information, then, CertVerifyRevocation should be // interested in this information, then, CertVerifyRevocation should be
// called with cContext = 1. // called with cContext = 1.
PCERT_REVOCATION_CRL_INFO pCrlInfo; PCERT_REVOCATION_CRL_INFO pCrlInfo;
// If nonNULL, any cached information before this time is considered
// time invalid and forces a wire retrieval.
LPFILETIME pftCacheResync;
#endif #endif
} CERT_REVOCATION_PARA, *PCERT_REVOCATION_PARA; } CERT_REVOCATION_PARA, *PCERT_REVOCATION_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// The following data structure is returned by CertVerifyRevocation to // The following data structure is returned by CertVerifyRevocation to
// specify the status of the revoked or unchecked context. Review the // specify the status of the revoked or unchecked context. Review the
// following CertVerifyRevocation comments for details. // following CertVerifyRevocation comments for details.
// //
// Upon input to CertVerifyRevocation, cbSize must be set to a size // Upon input to CertVerifyRevocation, cbSize must be set to a size
// >= (offsetof(CERT_REVOCATION_STATUS, dwReason) + sizeof(DWORD) ). // >= (offsetof(CERT_REVOCATION_STATUS, dwReason) + sizeof(DWORD) ).
skipping to change at line 11296 skipping to change at line 13140
// 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 PVOID rgpvContext[], __in_ecount(cContext) PVOID rgpvContext[],
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL PCERT_REVOCATION_PARA pRevPara, __in_opt PCERT_REVOCATION_PARA pRevPara,
IN OUT 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
// doing revocation checking. If the certificate doesn't have any
// OCSP AIA URLs, dwError is set to CRYPT_E_NOT_IN_REVOCATION_DATABASE.
//--------------------------------------------------------------------------
#define CERT_VERIFY_REV_SERVER_OCSP_FLAG 0x00000008
//+-------------------------------------------------------------------------
// 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 11357 skipping to change at line 13208
// 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 11414 skipping to change at line 13265
// 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
BOOL BOOL
WINAPI WINAPI
CryptVerifyCertificateSignature( CryptVerifyCertificateSignature(
IN HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN const BYTE * pbEncoded, __in_bcount(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 11496 skipping to change at line 13348
// 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
BOOL BOOL
WINAPI WINAPI
CryptVerifyCertificateSignatureEx( CryptVerifyCertificateSignatureEx(
IN OPTIONAL HCRYPTPROV 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 void *pvIssuer, __in_opt void *pvIssuer,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved __reserved void *pvReserved
); );
// 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
// pvSubject :: POCSP_BASIC_SIGNED_RESPONSE_INFO
// 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
skipping to change at line 11538 skipping to change at line 13393
// 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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN const BYTE *pbEncoded, __in_bcount(cbEncoded) const BYTE *pbEncoded,
IN DWORD cbEncoded, __in DWORD cbEncoded,
OUT BYTE *pbComputedHash, __out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
IN OUT DWORD *pcbComputedHash sh,
__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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_LEGACY hCryptProv,
IN ALG_ID Algid, __in ALG_ID Algid,
IN DWORD dwFlags, __in DWORD dwFlags,
IN const BYTE *pbEncoded, __in_bcount_opt(cbEncoded) const BYTE *pbEncoded,
IN DWORD cbEncoded, __in DWORD cbEncoded,
OUT BYTE *pbComputedHash, __out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
IN OUT DWORD *pcbComputedHash sh,
__inout DWORD *pcbComputedHash
);
//+-------------------------------------------------------------------------
// Hash the encoded content using the CNG hash algorithm provider.
//--------------------------------------------------------------------------
WINCRYPT32API
BOOL
WINAPI
CryptHashCertificate2(
__in LPCWSTR pwszCNGHashAlgid,
__in DWORD dwFlags,
__reserved void *pvReserved,
__in_bcount_opt(cbEncoded) const BYTE *pbEncoded,
__in DWORD cbEncoded,
__out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
sh,
__inout DWORD *pcbComputedHash
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Sign the "to be signed" information in the encoded signed content. // Sign the "to be signed" information in the encoded signed content.
// //
// hCryptProv specifies the crypto provider to use to do the signature. // hCryptProvOrNCryptKey specifies the crypto provider to use to do the
// 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 hCryptProv can be NULL where an appropriate // dwKeySpec isn't used and hCryptProvOrNCryptKey can be NULL where an
// default provider will be used for hashing. // appropriate default provider will be used for hashing.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptSignCertificate( CryptSignCertificate(
IN HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
IN DWORD dwKeySpec, __in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN const BYTE *pbEncodedToBeSigned, __in_bcount(cbEncodedToBeSigned) const BYTE *pbEncodedToBeSigned,
IN DWORD cbEncodedToBeSigned, __in DWORD cbEncodedToBeSigned,
IN PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, __in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
IN OPTIONAL const void *pvHashAuxInfo, __in_opt const void *pvHashAuxInfo,
OUT BYTE *pbSignature, __out_bcount_part_opt(*pcbSignature, *pcbSignature) BYTE *pbSignature,
IN OUT 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 HCRYPTPROV hCryptProv, __in_opt HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
IN DWORD dwKeySpec, __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 OPTIONAL const void *pvHashAuxInfo, __in_opt const void *pvHashAuxInfo,
OUT PBYTE pbEncoded, __out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
IN OUT DWORD *pcbEncoded __inout DWORD *pcbEncoded
);
//+-------------------------------------------------------------------------
// Certificate and CryptMsg encoded signature OID installable functions
//--------------------------------------------------------------------------
// The dwCertEncodingType and pSignatureAlgorithm->pszObjId are used
// to call the signature OID installable functions.
//
// If the OID installable function doesn't support the signature,
// it should return FALSE with LastError set to ERROR_NOT_SUPPORTED.
// Called if the signature has encoded parameters. Returns the CNG
// hash algorithm identifier string. Optionally returns the decoded
// signature parameters passed to either the SignAndEncodeHash or
// VerifyEncodedSignature OID installable function.
//
// Returned allocated parameters are freed via LocalFree().
#define CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC \
"CryptDllExtractEncodedSignatureParameters"
typedef BOOL (WINAPI *PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC)(
__in DWORD dwCertEncodingType,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__deref_out_opt void **ppvDecodedSignPara, // LocalFree()
__deref_out LPWSTR *ppwszCNGHashAlgid // LocalFree()
);
// Called to sign the computed hash and encode it.
#define CRYPT_OID_SIGN_AND_ENCODE_HASH_FUNC \
"CryptDllSignAndEncodeHash"
typedef BOOL (WINAPI *PFN_CRYPT_SIGN_AND_ENCODE_HASH_FUNC)(
__in NCRYPT_KEY_HANDLE hKey,
__in DWORD dwCertEncodingType,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt void *pvDecodedSignPara,
__in LPCWSTR pwszCNGPubKeyAlgid, // obtained from signature OID
__in LPCWSTR pwszCNGHashAlgid,
__in_bcount(cbComputedHash) BYTE *pbComputedHash,
__in DWORD cbComputedHash,
__out_bcount_part_opt(*pcbSignature, *pcbSignature) BYTE *pbSignature,
__inout DWORD *pcbSignature
);
// Called to decode and decrypt the encoded signature and compare it with the
// computed hash.
#define CRYPT_OID_VERIFY_ENCODED_SIGNATURE_FUNC \
"CryptDllVerifyEncodedSignature"
typedef BOOL (WINAPI *PFN_CRYPT_VERIFY_ENCODED_SIGNATURE_FUNC)(
__in DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pPubKeyInfo,
__in PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
__in_opt void *pvDecodedSignPara,
__in LPCWSTR pwszCNGPubKeyAlgid, // obtained from signature OID
__in LPCWSTR pwszCNGHashAlgid,
__in_bcount(cbComputedHash) BYTE *pbComputedHash,
__in DWORD cbComputedHash,
__in_bcount(cbSignature) BYTE *pbSignature,
__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 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 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 PCRL_INFO rgpCrlInfo[] __in_ecount(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 CERT_EXTENSION rgExtensions[] __in_ecount(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 CRYPT_ATTRIBUTE rgAttr[] __in_ecount(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 BYTE *pbKeyUsage, __out_bcount_full(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 11800 skipping to change at line 13729
// //
// 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 const void *pvDefaultPara, __in_opt const void *pvDefaultPara,
IN DWORD dwFlags, __in DWORD dwFlags,
IN 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 11853 skipping to change at line 13782
// 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(
HCRYPTDEFAULTCONTEXT hDefaultContext, __in_opt HCRYPTDEFAULTCONTEXT hDefaultContext,
IN DWORD dwFlags, __in DWORD dwFlags,
IN 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 hCryptProv, __in HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
IN DWORD dwKeySpec, __in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
OUT PCERT_PUBLIC_KEY_INFO pInfo, __out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
IN OUT 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.
// //
// If unable to find an installable OID function for the pszPublicKeyObjId, // If unable to find an installable OID function for the pszPublicKeyObjId,
// attempts to export as a RSA Public Key (szOID_RSA_RSA). // attempts to export as a RSA Public Key (szOID_RSA_RSA).
// //
// The dwFlags and pvAuxInfo aren't used for szOID_RSA_RSA. // The dwFlags and pvAuxInfo aren't used for szOID_RSA_RSA.
//
// dwFlags can be set with the following 2 flags passed directly to
// CryptFindOIDInfo:
// CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG
// CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptExportPublicKeyInfoEx( CryptExportPublicKeyInfoEx(
IN HCRYPTPROV hCryptProv, __in HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
IN DWORD dwKeySpec, __in_opt DWORD dwKeySpec, // not applicable for NCRYPT_KEY_HANDLE
IN DWORD dwCertEncodingType, __in DWORD dwCertEncodingType,
IN LPSTR pszPublicKeyObjId, __in_opt LPSTR pszPublicKeyObjId,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvAuxInfo, __in_opt void *pvAuxInfo,
OUT PCERT_PUBLIC_KEY_INFO pInfo, __out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
IN OUT DWORD *pcbInfo __inout DWORD *pcbInfo
);
// Legacy define used for exporting CAPI1 HCRYPTPROV public keys.
#define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
//+-------------------------------------------------------------------------
// Export CNG PublicKeyInfo OID installable function. Note, not called
// for a HCRYPTPROV choice.
//--------------------------------------------------------------------------
#define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC \
"CryptDllExportPublicKeyInfoEx2"
typedef BOOL (WINAPI *PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC) (
__in NCRYPT_KEY_HANDLE hNCryptKey,
__in DWORD dwCertEncodingType,
__in LPSTR pszPublicKeyObjId,
__in DWORD dwFlags,
__in_opt void *pvAuxInfo,
__out_bcount_part_opt(*pcbInfo, *pcbInfo) PCERT_PUBLIC_KEY_INFO pInfo,
__inout DWORD *pcbInfo
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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 11942 skipping to change at line 13894
// //
// 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 OPTIONAL void *pvAuxInfo, __in_opt void *pvAuxInfo,
OUT HCRYPTKEY *phKey __out HCRYPTKEY *phKey
); );
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Acquire a HCRYPTPROV handle and dwKeySpec for the specified certificate // Convert and import the public key info into the CNG asymmetric or
// context. Uses the certificate's CERT_KEY_PROV_INFO_PROP_ID property. // signature algorithm provider and return a BCRYPT_KEY_HANDLE to it.
// The returned HCRYPTPROV handle may optionally be cached using the //
// certificate's CERT_KEY_CONTEXT_PROP_ID property. // Uses the dwCertEncodingType and pInfo->Algorithm.pszObjId to call the
// installable CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC. The called function
// has the same signature as CryptImportPublicKeyInfoEx2.
//
// dwFlags can be set with the following 2 flags passed directly to
// CryptFindOIDInfo:
// CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG
// CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG
//--------------------------------------------------------------------------
WINCRYPT32API
BOOL
WINAPI
CryptImportPublicKeyInfoEx2(
__in DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo,
__in DWORD dwFlags,
__in_opt void *pvAuxInfo,
__out BCRYPT_KEY_HANDLE *phKey
);
//+-------------------------------------------------------------------------
// Import CNG PublicKeyInfo OID installable function
//--------------------------------------------------------------------------
#define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC \
"CryptDllImportPublicKeyInfoEx2"
typedef BOOL (WINAPI *PFN_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC) (
__in DWORD dwCertEncodingType,
__in PCERT_PUBLIC_KEY_INFO pInfo,
__in DWORD dwFlags,
__in_opt void *pvAuxInfo,
__out BCRYPT_KEY_HANDLE *phKey
);
//+-------------------------------------------------------------------------
// Acquire a HCRYPTPROV and dwKeySpec or NCRYPT_KEY_HANDLE for the
// specified certificate context. Uses the certificate's
// CERT_KEY_PROV_INFO_PROP_ID property.
// The returned HCRYPTPROV or NCRYPT_KEY_HANDLE handle may optionally be
// 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 exists for the certificate, its returned. Otherwise, // cached HCRYPTPROV or NCRYPT_KEY_HANDLE exists for the certificate, its
// a HCRYPTPROV is acquired and then cached via the certificate's // returned. Otherwise, a HCRYPTPROV or NCRYPT_KEY_HANDLE is acquired and
// CERT_KEY_CONTEXT_PROP_ID. // then cached via the certificate's CERT_KEY_CONTEXT_PROP_ID.
// //
// The CRYPT_ACQUIRE_USE_PROV_INFO_FLAG can be set to use the dwFlags field of // The CRYPT_ACQUIRE_USE_PROV_INFO_FLAG can be set to use the dwFlags field of
// the certificate's CERT_KEY_PROV_INFO_PROP_ID property's CRYPT_KEY_PROV_INFO // the certificate's CERT_KEY_PROV_INFO_PROP_ID property's CRYPT_KEY_PROV_INFO
// data structure to determine if the returned HCRYPTPROV should be cached. // data structure to determine if the returned HCRYPTPROV or
// HCRYPTPROV caching is enabled if the CERT_SET_KEY_CONTEXT_PROP_ID flag was // NCRYPT_KEY_HANDLE should be cached.
// Caching is enabled if the CERT_SET_KEY_CONTEXT_PROP_ID flag was
// set. // set.
// //
// If CRYPT_ACQUIRE_COMPARE_KEY_FLAG is set, then, // If CRYPT_ACQUIRE_COMPARE_KEY_FLAG is set, then,
// the public key in the certificate is compared with the public // the public key in the certificate is compared with the public
// key returned by the cryptographic provider. If the keys don't match, the // key returned by the cryptographic provider. If the keys don't match, the
// acquire fails and LastError is set to NTE_BAD_PUBLIC_KEY. Note, if // acquire fails and LastError is set to NTE_BAD_PUBLIC_KEY. Note, if
// a cached HCRYPTPROV is returned, the comparison isn't done. We assume the // a cached HCRYPTPROV or NCRYPT_KEY_HANDLE is returned, the comparison isn't
// 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
// attempting to recreate the CERT_KEY_PROV_INFO_PROP_ID in the certificate
// 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.
// //
// *pfCallerFreeProv is returned set to FALSE for: // The following flags can be set to optionally open and return a CNG
// NCRYPT_KEY_HANDLE instead of a HCRYPTPROV. *pdwKeySpec is set to
// CERT_NCRYPT_KEY_SPEC when a NCRYPT_KEY_HANDLE is returned.
// CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG - if the CryptAcquireContext
// fails, then, an NCryptOpenKey is attempted.
//
// CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG - the NCryptOpenKey is
// first attempted and its handle returned for success.
//
// CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG - only the NCryptOpenKey is
// attempted.
//
// *pfCallerFreeProvOrNCryptKey is returned set to FALSE for:
// - Acquire or public key comparison fails. // - Acquire or public key comparison fails.
// - CRYPT_ACQUIRE_CACHE_FLAG is set. // - CRYPT_ACQUIRE_CACHE_FLAG is set.
// - CRYPT_ACQUIRE_USE_PROV_INFO_FLAG is set AND // - CRYPT_ACQUIRE_USE_PROV_INFO_FLAG is set AND
// CERT_SET_KEY_CONTEXT_PROP_ID flag is set in the dwFlags field of the // CERT_SET_KEY_CONTEXT_PROP_ID flag is set in the dwFlags field of the
// certificate's CERT_KEY_PROV_INFO_PROP_ID property's // certificate's CERT_KEY_PROV_INFO_PROP_ID property's
// CRYPT_KEY_PROV_INFO data structure. // CRYPT_KEY_PROV_INFO data structure.
// When *pfCallerFreeProv is FALSE, the caller must not release. The // When *pfCallerFreeProvOrNCryptKey is FALSE, the caller must not release. The
// returned HCRYPTPROV will be released on the last free of the certificate // returned HCRYPTPROV or NCRYPT_KEY_HANDLE will be released on the last
// context. // free of the certificate context.
//
// Otherwise, *pfCallerFreeProvOrNCryptKey is TRUE and a returned
// HCRYPTPROV must be released by the caller by calling CryptReleaseContext.
// A returned NCRYPT_KEY_HANDLE is freed by calling NCryptFreeObject.
// *pdwKeySpec MUST be checked when CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG
// or CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG is set.
// //
// Otherwise, *pfCallerFreeProv is TRUE and the returned HCRYPTPROV must
// be released by the caller by calling CryptReleaseContext.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptAcquireCertificatePrivateKey( CryptAcquireCertificatePrivateKey(
IN PCCERT_CONTEXT pCert, __in PCCERT_CONTEXT pCert,
IN DWORD dwFlags, __in DWORD dwFlags,
IN void *pvReserved, __reserved void *pvReserved,
OUT HCRYPTPROV *phCryptProv, __out HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProvOrNCryptKey,
OUT OPTIONAL DWORD *pdwKeySpec, __out_opt DWORD *pdwKeySpec,
OUT OPTIONAL BOOL *pfCallerFreeProv __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_SILENT_FLAG 0x00000040 #define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040
#define CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK 0x00070000
#define CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG 0x00010000
#define CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG 0x00020000
#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.
// //
// If the CERT_KEY_PROV_INFO_PROP_ID is already set, then, its checked to // If the CERT_KEY_PROV_INFO_PROP_ID is already set, then, its checked to
// see if it matches the provider's public key. For a match, the above // see if it matches the provider's public key. For a match, the above
// enumeration is skipped. // enumeration is skipped.
// //
// By default both the user and machine key containers are searched. // By default both the user and machine key containers are searched.
// The CRYPT_FIND_USER_KEYSET_FLAG or CRYPT_FIND_MACHINE_KEYSET_FLAG // The CRYPT_FIND_USER_KEYSET_FLAG or CRYPT_FIND_MACHINE_KEYSET_FLAG
// can be set in dwFlags to restrict the search to either of the containers. // can be set in dwFlags to restrict the search to either of the containers.
// //
// The CRYPT_FIND_SILENT_KEYSET_FLAG can be set to suppress any UI by the CSP. // The CRYPT_FIND_SILENT_KEYSET_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.
// //
// 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
// 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,
IN 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 12057 skipping to change at line 14077
// //
// 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) (
HCRYPTPROV hCryptProv, // in __in HCRYPTPROV hCryptProv, // in
CRYPT_PRIVATE_KEY_INFO *pPrivateKeyInfo, // in __in CRYPT_PRIVATE_KEY_INFO* pPrivateKeyInfo, // in
DWORD dwFlags, // in, optional __in DWORD dwFlags, // in
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 12087 skipping to change at line 14107
// 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(
CRYPT_PKCS8_IMPORT_PARAMS sImportParams, // in __in CRYPT_PKCS8_IMPORT_PARAMS sPrivateKeyAndParams, // in
DWORD dwFlags, // in, optional __in DWORD dwFlags, // in
HCRYPTPROV *phCryptProv, // out, optional __out_opt HCRYPTPROV *phCryptProv, // out, optional
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) (
HCRYPTPROV hCryptProv, // in __in HCRYPTPROV hCryptProv, // in
DWORD dwKeySpec, // in __in DWORD dwKeySpec, // in
LPSTR pszPrivateKeyObjId, // in __in LPSTR pszPrivateKeyObjId, // in
DWORD dwFlags, // in __in DWORD dwFlags, // in
void *pvAuxInfo, // in __in_opt void* pvAuxInfo, // in
CRYPT_PRIVATE_KEY_INFO *pPrivateKeyInfo, // out __out_bcount_opt (*pcbPrivateKeyInfo) CRYPT_PRIVATE_KEY_INFO* pPrivateKeyInf
DWORD *pcbPrivateKeyBlob // in, out o, // 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 0x0001 #define CRYPT_DELETE_KEYSET 0x0001
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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(
HCRYPTPROV hCryptProv, // in __in HCRYPTPROV hCryptProv, // in
DWORD dwKeySpec, // in __in DWORD dwKeySpec, // in
LPSTR pszPrivateKeyObjId, // in __in LPSTR pszPrivateKeyObjId, // in
DWORD dwFlags, // in __in DWORD dwFlags, // in
void *pvAuxInfo, // in __in_opt void* pvAuxInfo, // in
BYTE *pbPrivateKeyBlob, // out __out_bcount_opt (*pcbPrivateKeyBlob) BYTE* pbPrivateKeyBlob, // out
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 12153 skipping to change at line 14173
// 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(
CRYPT_PKCS8_EXPORT_PARAMS* psExportParams, // in __in CRYPT_PKCS8_EXPORT_PARAMS* psExportParams, // in
DWORD dwFlags, // in __in DWORD dwFlags, // in
void *pvAuxInfo, // in __in_opt void* pvAuxInfo, // in
BYTE *pbPrivateKeyBlob, // out __out_bcount_opt (*pcbPrivateKeyBlob) BYTE* pbPrivateKeyBlob, // out
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 HCRYPTPROV 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 BYTE *pbComputedHash, __out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
IN OUT DWORD *pcbComputedHash sh,
__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 OPTIONAL LPSTR psz, __out_ecount_part_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 OPTIONAL LPWSTR psz, __out_ecount_part_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 12250 skipping to change at line 14270
// The object identifiers are included with a "=" separator from their // The object identifiers are included with a "=" separator from their
// attribute value. CERT_RDN entries are separated by ", ". // attribute value. CERT_RDN entries are separated by ", ".
// Multiple attributes per CERT_RDN are separated by " + ". For example: // Multiple attributes per CERT_RDN are separated by " + ". For example:
// 2.5.4.11=Microsoft, 2.5.4.3=Joe Cool + 2.5.4.12=Programmer // 2.5.4.11=Microsoft, 2.5.4.3=Joe Cool + 2.5.4.12=Programmer
// CERT_X500_NAME_STR // CERT_X500_NAME_STR
// The object identifiers are converted to their X500 key name. Otherwise, // The object identifiers are converted to their X500 key name. Otherwise,
// same as CERT_OID_NAME_STR. If the object identifier doesn't have // same as CERT_OID_NAME_STR. If the object identifier doesn't have
// a corresponding X500 key name, then, the object identifier is used with // a corresponding X500 key name, then, the object identifier is used with
// a "OID." prefix. For example: // a "OID." prefix. For example:
// OU=Microsoft, CN=Joe Cool + T=Programmer, OID.1.2.3.4.5.6=Unknown // OU=Microsoft, CN=Joe Cool + T=Programmer, OID.1.2.3.4.5.6=Unknown
// CERT_XML_NAME_STR
// The object identifiers are converted the same as the above
// CERT_X500_NAME_STR. However, formatted as sequence of XML elements.
// Here's an example:
// <CN>cart.barnesandnoble.com</CN>
// <OU>Terms of use at www.verisign.com/rpa (c)00</OU>
// <OU rDNAttribute="true">IT Operations</OU>
// <O>Barnesandnoble.com</O>
// <L>New York</L>
// <S>New York</S>
// <C>US</C>
// <RDN oid="1.2.3.4" type="string">name</RDN>
// <RDN rDNAttribute="true" oid="1.2.1.3" type="encoded">0500</RDN>
// <RDN oid="1.2.1.4" type="encoded">020135</RDN>
// <RDN oid="1.2.2.5.3" type="octet">01FF7F</RDN>
// Where:
// Any XML markup characters are escaped:
// L'&' - L"&amp;"
// L'<' - L"&lt;"
// L'>' - L"&gt;"
// L'\'' - L"&apos;"
// L'\"' - L"&quot;"
// Will escape characters > 0x7F via chararacter references,
// L"&#xXXXX;"
//
// CERT_NAME_STR_REVERSE_FLAG and CERT_NAME_STR_CRLF_FLAG can be set.
// The following quoting, semicolon and plus semantics aren't
// applicable. The "+" is replaced with rDNAttribute="true".
//
// //
// We quote the RDN value if it contains leading or trailing whitespace // We quote the RDN value if it contains leading or trailing whitespace
// or one of the following characters: ",", "+", "=", """, "\n", "<", ">", // or one of the following characters: ",", "+", "=", """, "\n", "<", ">",
// "#" or ";". The quoting character is ". If the the RDN Value contains // "#" or ";". The quoting character is ". If the the RDN Value contains
// a " it is double quoted (""). For example: // a " it is double quoted (""). For example:
// OU=" Microsoft", CN="Joe ""Cool""" + T="Programmer, Manager" // OU=" Microsoft", CN="Joe ""Cool""" + T="Programmer, Manager"
// //
// CERT_NAME_STR_SEMICOLON_FLAG can be or'ed into dwStrType to replace // CERT_NAME_STR_SEMICOLON_FLAG can be or'ed into dwStrType to replace
// the ", " separator with a "; " separator. // the ", " separator with a "; " separator.
// //
skipping to change at line 12292 skipping to change at line 14341
// //
// 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 OPTIONAL LPSTR psz, __out_ecount_part_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 OPTIONAL LPWSTR psz, __out_ecount_part_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
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate name string types // Certificate name string types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_SIMPLE_NAME_STR 1 #define CERT_SIMPLE_NAME_STR 1
#define CERT_OID_NAME_STR 2 #define CERT_OID_NAME_STR 2
#define CERT_X500_NAME_STR 3 #define CERT_X500_NAME_STR 3
#define CERT_XML_NAME_STR 4
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Certificate name string type flags OR'ed with the above types // Certificate name string type flags OR'ed with the above types
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#define CERT_NAME_STR_SEMICOLON_FLAG 0x40000000 #define CERT_NAME_STR_SEMICOLON_FLAG 0x40000000
#define CERT_NAME_STR_NO_PLUS_FLAG 0x20000000 #define CERT_NAME_STR_NO_PLUS_FLAG 0x20000000
#define CERT_NAME_STR_NO_QUOTING_FLAG 0x10000000 #define CERT_NAME_STR_NO_QUOTING_FLAG 0x10000000
#define CERT_NAME_STR_CRLF_FLAG 0x08000000 #define CERT_NAME_STR_CRLF_FLAG 0x08000000
#define CERT_NAME_STR_COMMA_FLAG 0x04000000 #define CERT_NAME_STR_COMMA_FLAG 0x04000000
#define CERT_NAME_STR_REVERSE_FLAG 0x02000000 #define CERT_NAME_STR_REVERSE_FLAG 0x02000000
#define CERT_NAME_STR_FORWARD_FLAG 0x01000000
#define CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG 0x00010000 #define CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG 0x00010000
#define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 0x00020000 #define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 0x00020000
#define CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG 0x00040000 #define CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG 0x00040000
#define CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG 0x00080000 #define CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG 0x00080000
#define CERT_NAME_STR_DISABLE_UTF8_DIR_STR_FLAG 0x00100000
// certenrolld_end
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Convert the null terminated X500 string to an encoded certificate name. // Convert the null terminated X500 string to an encoded certificate name.
// //
// The input string is expected to be formatted the same as the output // The input string is expected to be formatted the same as the output
// from the above CertNameToStr API. // from the above CertNameToStr API.
// //
// The CERT_SIMPLE_NAME_STR type isn't supported. Otherwise, when dwStrType // The CERT_SIMPLE_NAME_STR type and CERT_XML_NAME_STR aren't supported.
// Otherwise, when dwStrType
// is set to 0, CERT_OID_NAME_STR or CERT_X500_NAME_STR, allow either a // is set to 0, CERT_OID_NAME_STR or CERT_X500_NAME_STR, allow either a
// case insensitive X500 key (CN=), case insensitive "OID." prefixed // case insensitive X500 key (CN=), case insensitive "OID." prefixed
// object identifier (OID.1.2.3.4.5.6=) or an object identifier (1.2.3.4=). // object identifier (OID.1.2.3.4.5.6=) or an object identifier (1.2.3.4=).
// //
// If no flags are OR'ed into dwStrType, then, allow "," or ";" as RDN // If no flags are OR'ed into dwStrType, then, allow "," or ";" as RDN
// separators and "+" as the multiple RDN value separator. Quoting is // separators and "+" as the multiple RDN value separator. Quoting is
// supported. A quote may be included in a quoted value by double quoting, // supported. A quote may be included in a quoted value by double quoting,
// for example (CN="Joe ""Cool"""). A value starting with a "#" is treated // for example (CN="Joe ""Cool"""). A value starting with a "#" is treated
// as ascii hex and converted to a CERT_RDN_OCTET_STRING. Embedded whitespace // as ascii hex and converted to a CERT_RDN_OCTET_STRING. Embedded whitespace
// is skipped (1.2.3 = # AB CD 01 is the same as 1.2.3=#ABCD01). // is skipped (1.2.3 = # AB CD 01 is the same as 1.2.3=#ABCD01).
skipping to change at line 12376 skipping to change at line 14431
// //
// CERT_NAME_STR_NO_PLUS_FLAG can be or'ed into dwStrType to ignore "+" // CERT_NAME_STR_NO_PLUS_FLAG can be or'ed into dwStrType to ignore "+"
// as a separator and not allow multiple values per RDN. // as a separator and not allow multiple values per RDN.
// //
// CERT_NAME_STR_NO_QUOTING_FLAG can be or'ed into dwStrType to inhibit // CERT_NAME_STR_NO_QUOTING_FLAG can be or'ed into dwStrType to inhibit
// quoting. // quoting.
// //
// CERT_NAME_STR_REVERSE_FLAG can be or'ed into dwStrType to reverse the // CERT_NAME_STR_REVERSE_FLAG can be or'ed into dwStrType to reverse the
// order of the RDNs after converting from the string and before encoding. // order of the RDNs after converting from the string and before encoding.
// //
// CERT_NAME_STR_FORWARD_FLAG can be or'ed into dwStrType to defeat setting
// CERT_NAME_STR_REVERSE_FLAG, if reverse order becomes the default.
//
// CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG can be or'ed into dwStrType to // CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG can be or'ed into dwStrType to
// to select the CERT_RDN_T61_STRING encoded value type instead of // to select the CERT_RDN_T61_STRING encoded value type instead of
// CERT_RDN_UNICODE_STRING if all the UNICODE characters are <= 0xFF. // CERT_RDN_UNICODE_STRING if all the UNICODE characters are <= 0xFF.
// //
// CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG can be or'ed into dwStrType to // CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG can be or'ed into dwStrType to
// to select the CERT_RDN_UTF8_STRING encoded value type instead of // to select the CERT_RDN_UTF8_STRING encoded value type instead of
// CERT_RDN_UNICODE_STRING. // CERT_RDN_UNICODE_STRING.
// //
// CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG can be or'ed into dwStrType // CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG can be or'ed into dwStrType
// to force the CERT_RDN_UTF8_STRING encoded value type instead of // to force the CERT_RDN_UTF8_STRING encoded value type instead of
// allowing CERT_RDN_PRINTABLE_STRING for DirectoryString types. // allowing CERT_RDN_PRINTABLE_STRING for DirectoryString types.
// Applies to the X500 Keys below which allow "Printable, Unicode". // Applies to the X500 Keys below which allow "Printable, Unicode".
// Also, enables CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG. // Also, enables CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG.
// //
// CERT_NAME_STR_DISABLE_UTF8_DIR_STR_FLAG can be or'ed into dwStrType to
// defeat setting CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG, if forcing UTF-8
// becomes the default.
//
// Support the following X500 Keys: // Support the following X500 Keys:
// //
// Key Object Identifier RDN Value Type(s) // Key Object Identifier RDN Value Type(s)
// --- ----------------- ----------------- // --- ----------------- -----------------
// CN szOID_COMMON_NAME Printable, Unicode // CN szOID_COMMON_NAME Printable, Unicode
// L szOID_LOCALITY_NAME Printable, Unicode // L szOID_LOCALITY_NAME Printable, Unicode
// O szOID_ORGANIZATION_NAME Printable, Unicode // O szOID_ORGANIZATION_NAME Printable, Unicode
// OU szOID_ORGANIZATIONAL_UNIT_NAME Printable, Unicode // OU szOID_ORGANIZATIONAL_UNIT_NAME Printable, Unicode
// E szOID_RSA_emailAddr Only IA5 // E szOID_RSA_emailAddr Only IA5
// Email szOID_RSA_emailAddr Only IA5 // Email szOID_RSA_emailAddr Only IA5
skipping to change at line 12444 skipping to change at line 14506
// 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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT BYTE *pbEncoded, __out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
IN OUT DWORD *pcbEncoded, __inout DWORD *pcbEncoded,
OUT OPTIONAL LPCSTR *ppszError __deref_opt_out_opt 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,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT BYTE *pbEncoded, __out_bcount_part_opt(*pcbEncoded, *pcbEncoded) BYTE *pbEncoded,
IN OUT DWORD *pcbEncoded, __inout DWORD *pcbEncoded,
OUT OPTIONAL LPCWSTR *ppszError __deref_opt_out_opt 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 12568 skipping to change at line 14630
// //
// 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 void *pvTypePara, __in_opt void *pvTypePara,
OUT OPTIONAL LPSTR pszNameString, __out_ecount_part_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 void *pvTypePara, __in_opt void *pvTypePara,
OUT OPTIONAL LPWSTR pszNameString, __out_ecount_part_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 12664 skipping to change at line 14726
// //
// 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)(
IN 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 12740 skipping to change at line 14802
DWORD cMsgCrl; DWORD cMsgCrl;
PCCRL_CONTEXT *rgpMsgCrl; PCCRL_CONTEXT *rgpMsgCrl;
DWORD cAuthAttr; DWORD cAuthAttr;
PCRYPT_ATTRIBUTE rgAuthAttr; PCRYPT_ATTRIBUTE rgAuthAttr;
DWORD cUnauthAttr; DWORD cUnauthAttr;
PCRYPT_ATTRIBUTE rgUnauthAttr; PCRYPT_ATTRIBUTE rgUnauthAttr;
DWORD dwFlags; DWORD dwFlags;
DWORD dwInnerContentType; DWORD dwInnerContentType;
#ifdef CRYPT_SIGN_MESSAGE_PARA_HAS_CMS_FIELDS #ifdef CRYPT_SIGN_MESSAGE_PARA_HAS_CMS_FIELDS
// This is also referred to as the SignatureAlgorithm
CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
void *pvHashEncryptionAuxInfo; void *pvHashEncryptionAuxInfo;
#endif #endif
} CRYPT_SIGN_MESSAGE_PARA, *PCRYPT_SIGN_MESSAGE_PARA; } CRYPT_SIGN_MESSAGE_PARA, *PCRYPT_SIGN_MESSAGE_PARA;
#define CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG 0x00000001 #define CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG 0x00000001
// When set, nonData type inner content is encapsulated within an // When set, nonData type inner content is encapsulated within an
// OCTET STRING // OCTET STRING
#define CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG 0x00000002 #define CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG 0x00000002
skipping to change at line 12776 skipping to change at line 14839
// //
// pfnGetSignerCertificate is called to get and verify the message signer's // pfnGetSignerCertificate is called to get and verify the message signer's
// certificate. // certificate.
// //
// 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 hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate; PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate;
void *pvGetArg; void *pvGetArg;
} 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.
skipping to change at line 12823 skipping to change at line 14886
// For CMS messages, CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG may be // For CMS messages, CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG may be
// set to encapsulate nonData inner content within an OCTET STRING before // set to encapsulate nonData inner content within an OCTET STRING before
// encrypting. // encrypting.
// //
// For CMS messages, CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG may be set to identify // For CMS messages, CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG may be set to identify
// recipients by their Key Identifier and not their Issuer and Serial Number. // recipients by their Key Identifier and not their Issuer and Serial Number.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA { typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA {
DWORD cbSize; DWORD cbSize;
DWORD dwMsgEncodingType; DWORD dwMsgEncodingType;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm; CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
void *pvEncryptionAuxInfo; void *pvEncryptionAuxInfo;
DWORD dwFlags; DWORD dwFlags;
DWORD dwInnerContentType; DWORD dwInnerContentType;
} CRYPT_ENCRYPT_MESSAGE_PARA, *PCRYPT_ENCRYPT_MESSAGE_PARA; } CRYPT_ENCRYPT_MESSAGE_PARA, *PCRYPT_ENCRYPT_MESSAGE_PARA;
// When set, recipients are identified by their Key Identifier and not // When set, recipients are identified by their Key Identifier and not
// their Issuer and Serial Number. // their Issuer and Serial Number.
#define CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG 0x4 #define CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG 0x4
skipping to change at line 12884 skipping to change at line 14947
// hCryptProv is used to compute the hash. // hCryptProv is used to compute the hash.
// //
// pvHashAuxInfo currently isn't used and must be set to NULL. // pvHashAuxInfo currently isn't used and must be set to NULL.
// //
// cbSize must be set to the sizeof(CRYPT_HASH_MESSAGE_PARA) or else // cbSize must be set to the sizeof(CRYPT_HASH_MESSAGE_PARA) or else
// LastError will be updated with E_INVALIDARG. // LastError will be updated with E_INVALIDARG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_HASH_MESSAGE_PARA { typedef struct _CRYPT_HASH_MESSAGE_PARA {
DWORD cbSize; DWORD cbSize;
DWORD dwMsgEncodingType; DWORD dwMsgEncodingType;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
void *pvHashAuxInfo; void *pvHashAuxInfo;
} CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA; } CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// The CRYPT_KEY_SIGN_MESSAGE_PARA are used for signing messages until a // The CRYPT_KEY_SIGN_MESSAGE_PARA are used for signing messages until a
// certificate has been created for the signature key. // certificate has been created for the signature key.
// //
// pvHashAuxInfo currently isn't used and must be set to NULL. // pvHashAuxInfo currently isn't used and must be set to NULL.
// //
// If PubKeyAlgorithm isn't set, defaults to szOID_RSA_RSA. // If PubKeyAlgorithm isn't set, defaults to szOID_RSA_RSA.
// //
// cbSize must be set to the sizeof(CRYPT_KEY_SIGN_MESSAGE_PARA) or else // cbSize must be set to the sizeof(CRYPT_KEY_SIGN_MESSAGE_PARA) or else
// LastError will be updated with E_INVALIDARG. // LastError will be updated with E_INVALIDARG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_KEY_SIGN_MESSAGE_PARA { typedef struct _CRYPT_KEY_SIGN_MESSAGE_PARA {
DWORD cbSize; DWORD cbSize;
DWORD dwMsgAndCertEncodingType; DWORD dwMsgAndCertEncodingType;
HCRYPTPROV hCryptProv;
// NCryptIsKeyHandle() is called to determine the union choice.
union {
HCRYPTPROV hCryptProv;
NCRYPT_KEY_HANDLE hNCryptKey;
};
// not applicable for hNCryptKey choice
DWORD dwKeySpec; DWORD dwKeySpec;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm; CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
void *pvHashAuxInfo; void *pvHashAuxInfo;
// This is also referred to as the SignatureAlgorithm
CRYPT_ALGORITHM_IDENTIFIER PubKeyAlgorithm; CRYPT_ALGORITHM_IDENTIFIER PubKeyAlgorithm;
} CRYPT_KEY_SIGN_MESSAGE_PARA, *PCRYPT_KEY_SIGN_MESSAGE_PARA; } CRYPT_KEY_SIGN_MESSAGE_PARA, *PCRYPT_KEY_SIGN_MESSAGE_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// The CRYPT_KEY_VERIFY_MESSAGE_PARA are used to verify signed messages without // The CRYPT_KEY_VERIFY_MESSAGE_PARA are used to verify signed messages without
// a certificate for the signer. // a certificate for the signer.
// //
// Normally used until a certificate has been created for the key. // Normally used until a certificate has been created for the key.
// //
// hCryptProv is used to do hashing and signature verification. // hCryptProv is used to do hashing and signature verification.
// //
// cbSize must be set to the sizeof(CRYPT_KEY_VERIFY_MESSAGE_PARA) or else // cbSize must be set to the sizeof(CRYPT_KEY_VERIFY_MESSAGE_PARA) or else
// LastError will be updated with E_INVALIDARG. // LastError will be updated with E_INVALIDARG.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
typedef struct _CRYPT_KEY_VERIFY_MESSAGE_PARA { typedef struct _CRYPT_KEY_VERIFY_MESSAGE_PARA {
DWORD cbSize; DWORD cbSize;
DWORD dwMsgEncodingType; DWORD dwMsgEncodingType;
HCRYPTPROV hCryptProv; HCRYPTPROV_LEGACY hCryptProv;
} CRYPT_KEY_VERIFY_MESSAGE_PARA, *PCRYPT_KEY_VERIFY_MESSAGE_PARA; } CRYPT_KEY_VERIFY_MESSAGE_PARA, *PCRYPT_KEY_VERIFY_MESSAGE_PARA;
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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 const BYTE *rgpbToBeSigned[], __in_ecount_opt(cToBeSigned) const BYTE *rgpbToBeSigned[],
IN DWORD rgcbToBeSigned[], __in_ecount(cToBeSigned) DWORD rgcbToBeSigned[],
OUT BYTE *pbSignedBlob, __out_bcount_part_opt(*pcbSignedBlob, *pcbSignedBlob) BYTE *pbSignedBlob,
IN OUT 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 12986 skipping to change at line 15058
// 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 const BYTE *pbSignedBlob, __in_bcount(cbSignedBlob) const BYTE *pbSignedBlob,
IN DWORD cbSignedBlob, __in DWORD cbSignedBlob,
OUT BYTE OPTIONAL *pbDecoded, __out_bcount_part_opt(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded,
IN OUT OPTIONAL DWORD *pcbDecoded, __inout_opt DWORD *pcbDecoded,
OUT OPTIONAL PCCERT_CONTEXT *ppSignerCert __deref_opt_out_opt 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 const BYTE *pbSignedBlob, __in_bcount(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 HCRYPTPROV 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 const BYTE *pbSignedBlob, __in_bcount(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 const BYTE *pbDetachedSignBlob, __in_bcount(cbDetachedSignBlob) const BYTE *pbDetachedSignBlob,
IN DWORD cbDetachedSignBlob, __in DWORD cbDetachedSignBlob,
IN DWORD cToBeSigned, __in DWORD cToBeSigned,
IN const BYTE *rgpbToBeSigned[], __in_ecount(cToBeSigned) const BYTE *rgpbToBeSigned[],
IN DWORD rgcbToBeSigned[], __in_ecount(cToBeSigned) DWORD rgcbToBeSigned[],
OUT OPTIONAL PCCERT_CONTEXT *ppSignerCert __deref_opt_out_opt 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 PCCERT_CONTEXT rgpRecipientCert[], __in_ecount(cRecipientCert) PCCERT_CONTEXT rgpRecipientCert[],
IN const BYTE *pbToBeEncrypted, __in_bcount_opt(cbToBeEncrypted) const BYTE *pbToBeEncrypted,
IN DWORD cbToBeEncrypted, __in DWORD cbToBeEncrypted,
OUT BYTE *pbEncryptedBlob, __out_bcount_part_opt(*pcbEncryptedBlob, *pcbEncryptedBlob) BYTE *pbEncrypte
IN OUT DWORD *pcbEncryptedBlob dBlob,
__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 const BYTE *pbEncryptedBlob, __in_bcount(cbEncryptedBlob) const BYTE *pbEncryptedBlob,
IN DWORD cbEncryptedBlob, __in DWORD cbEncryptedBlob,
OUT OPTIONAL BYTE *pbDecrypted, __out_bcount_part_opt(*pcbDecrypted, *pcbDecrypted) BYTE *pbDecrypted,
IN OUT OPTIONAL DWORD *pcbDecrypted, __inout_opt DWORD *pcbDecrypted,
OUT OPTIONAL PCCERT_CONTEXT *ppXchgCert __deref_opt_out_opt 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 PCCERT_CONTEXT rgpRecipientCert[], __in_ecount(cRecipientCert) PCCERT_CONTEXT rgpRecipientCert[],
IN const BYTE *pbToBeSignedAndEncrypted, __in_bcount(cbToBeSignedAndEncrypted) const BYTE *pbToBeSignedAndEncrypted,
IN DWORD cbToBeSignedAndEncrypted, __in DWORD cbToBeSignedAndEncrypted,
OUT BYTE *pbSignedAndEncryptedBlob, __out_bcount_part_opt(*pcbSignedAndEncryptedBlob, *pcbSignedAndEncryptedBlob
IN OUT DWORD *pcbSignedAndEncryptedBlob ) 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 13136 skipping to change at line 15208
// 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 const BYTE *pbEncryptedBlob, __in_bcount(cbEncryptedBlob) const BYTE *pbEncryptedBlob,
IN DWORD cbEncryptedBlob, __in DWORD cbEncryptedBlob,
OUT OPTIONAL BYTE *pbDecrypted, __out_bcount_part_opt(*pcbDecrypted, *pcbDecrypted) BYTE *pbDecrypted,
IN OUT OPTIONAL DWORD *pcbDecrypted, __inout_opt DWORD *pcbDecrypted,
OUT OPTIONAL PCCERT_CONTEXT *ppXchgCert, __deref_opt_out_opt PCCERT_CONTEXT *ppXchgCert,
OUT OPTIONAL PCCERT_CONTEXT *ppSignerCert __deref_opt_out_opt 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 13183 skipping to change at line 15255
// 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 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara, __in_opt PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
IN PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, __in_opt PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
IN DWORD dwSignerIndex, __in DWORD dwSignerIndex,
IN const BYTE *pbEncodedBlob, __in_bcount(cbEncodedBlob) const BYTE *pbEncodedBlob,
IN DWORD cbEncodedBlob, __in DWORD cbEncodedBlob,
IN DWORD dwPrevInnerContentType, __in DWORD dwPrevInnerContentType,
OUT OPTIONAL DWORD *pdwMsgType, __out_opt DWORD *pdwMsgType,
OUT OPTIONAL DWORD *pdwInnerContentType, __out_opt DWORD *pdwInnerContentType,
OUT OPTIONAL BYTE *pbDecoded, __out_bcount_part_opt(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded,
IN OUT OPTIONAL DWORD *pcbDecoded, __inout_opt DWORD *pcbDecoded,
OUT OPTIONAL PCCERT_CONTEXT *ppXchgCert, __deref_opt_out_opt PCCERT_CONTEXT *ppXchgCert,
OUT OPTIONAL PCCERT_CONTEXT *ppSignerCert __deref_opt_out_opt 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 const BYTE *rgpbToBeHashed[], __in_ecount(cToBeHashed) const BYTE *rgpbToBeHashed[],
IN DWORD rgcbToBeHashed[], __in_ecount(cToBeHashed) DWORD rgcbToBeHashed[],
OUT OPTIONAL BYTE *pbHashedBlob, __out_bcount_part_opt(*pcbHashedBlob, *pcbHashedBlob) BYTE *pbHashedBlob,
IN OUT OPTIONAL DWORD *pcbHashedBlob, __inout_opt DWORD *pcbHashedBlob,
OUT OPTIONAL BYTE *pbComputedHash, __out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
IN OUT OPTIONAL DWORD *pcbComputedHash sh,
__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 BYTE *pbHashedBlob, __in_bcount(cbHashedBlob) BYTE *pbHashedBlob,
IN DWORD cbHashedBlob, __in DWORD cbHashedBlob,
OUT OPTIONAL BYTE *pbToBeHashed, __out_bcount_part_opt(*pcbToBeHashed, *pcbToBeHashed) BYTE *pbToBeHashed,
IN OUT OPTIONAL DWORD *pcbToBeHashed, __inout_opt DWORD *pcbToBeHashed,
OUT OPTIONAL BYTE *pbComputedHash, __out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
IN OUT OPTIONAL DWORD *pcbComputedHash sh,
__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 BYTE *pbDetachedHashBlob, __in_bcount(cbDetachedHashBlob) BYTE *pbDetachedHashBlob,
IN DWORD cbDetachedHashBlob, __in DWORD cbDetachedHashBlob,
IN DWORD cToBeHashed, __in DWORD cToBeHashed,
IN const BYTE *rgpbToBeHashed[], __in_ecount(cToBeHashed) const BYTE *rgpbToBeHashed[],
IN DWORD rgcbToBeHashed[], __in_ecount(cToBeHashed) DWORD rgcbToBeHashed[],
OUT OPTIONAL BYTE *pbComputedHash, __out_bcount_part_opt(*pcbComputedHash, *pcbComputedHash) BYTE *pbComputedHa
IN OUT OPTIONAL DWORD *pcbComputedHash sh,
__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 const BYTE *pbToBeSigned, __in_bcount(cbToBeSigned) const BYTE *pbToBeSigned,
IN DWORD cbToBeSigned, __in DWORD cbToBeSigned,
OUT BYTE *pbSignedBlob, __out_bcount_part_opt(*pcbSignedBlob, *pcbSignedBlob) BYTE *pbSignedBlob,
IN OUT 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 OPTIONAL PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, __in_opt PCERT_PUBLIC_KEY_INFO pPublicKeyInfo,
IN const BYTE *pbSignedBlob, __in_bcount(cbSignedBlob) const BYTE *pbSignedBlob,
IN DWORD cbSignedBlob, __in DWORD cbSignedBlob,
OUT OPTIONAL BYTE *pbDecoded, __out_bcount_part_opt(*pcbDecoded, *pcbDecoded) BYTE *pbDecoded,
IN OUT OPTIONAL 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 13334 skipping to change at line 15406
// 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(
HCRYPTPROV hProv, __in_opt HCRYPTPROV_LEGACY hProv,
LPCSTR szSubsystemProtocol __in LPCSTR szSubsystemProtocol
); );
WINCRYPT32API WINCRYPT32API
HCERTSTORE HCERTSTORE
WINAPI WINAPI
CertOpenSystemStoreW( CertOpenSystemStoreW(
HCRYPTPROV hProv, __in_opt HCRYPTPROV_LEGACY hProv,
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(
LPCSTR szCertStoreName, __in LPCSTR szCertStoreName,
const BYTE * pbCertEncoded, __in_bcount(cbCertEncoded) const BYTE * pbCertEncoded,
DWORD cbCertEncoded __in DWORD cbCertEncoded
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CertAddEncodedCertificateToSystemStoreW( CertAddEncodedCertificateToSystemStoreW(
LPCWSTR szCertStoreName, __in LPCWSTR szCertStoreName,
const BYTE * pbCertEncoded, __in_bcount(cbCertEncoded) const BYTE * pbCertEncoded,
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 13394 skipping to change at line 15466
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 PCERT_CHAIN pCertChains, __out_bcount_part_opt(*pcbCertChains, *pcbCertChains) PCERT_CHAIN pCertChain
IN OUT DWORD *pcbCertChains, s,
OUT DWORD *pcCertChains, // count of certificates chains returned __inout DWORD *pcbCertChains,
IN BYTE* pbEncodedIssuerName, // DER encoded issuer name __out DWORD *pcCertChains, // count of certificates chains returned
IN DWORD cbEncodedIssuerName, // count in bytes of encoded issuer name __in_bcount_opt(cbEncodedIssuerName) BYTE* pbEncodedIssuerName, // DER enc
IN LPCWSTR pwszPurpose, // "ClientAuth" or "CodeSigning" oded issuer name
IN DWORD dwKeySpec // only return signers supporting this __in DWORD cbEncodedIssuerName, // count in bytes of encoded issuer name
// keyspec __in_opt LPCWSTR pwszPurpose, // "ClientAuth" or "CodeSigning"
__in DWORD dwKeySpec // only return signers supporting this
// 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:
// Indicate the type of the object. Should be one of the // Indicate the type of the object. Should be one of the
skipping to change at line 13439 skipping to change at line 15511
// CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE // CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE
// 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
// CERT_QUERY_CONTENT_FLAG_PFX_AND_LOAD
// //
// INPUT dwExpectedFormatTypeFlags: // INPUT dwExpectedFormatTypeFlags:
// Indicate the expected format type. // Indicate the expected format type.
// Can be one of the following: // Can be one of the following:
// CERT_QUERY_FORMAT_FLAG_ALL (the content can be a ny format) // CERT_QUERY_FORMAT_FLAG_ALL (the content can be a ny format)
// CERT_QUERY_FORMAT_FLAG_BINARY // CERT_QUERY_FORMAT_FLAG_BINARY
// CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED // CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED
// CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED // CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED
// //
// //
skipping to change at line 13475 skipping to change at line 15548
// CERT_QUERY_CONTENT_SERIALIZED_STORE // CERT_QUERY_CONTENT_SERIALIZED_STORE
// CERT_QUERY_CONTENT_SERIALIZED_CERT // CERT_QUERY_CONTENT_SERIALIZED_CERT
// CERT_QUERY_CONTENT_SERIALIZED_CTL // CERT_QUERY_CONTENT_SERIALIZED_CTL
// CERT_QUERY_CONTENT_SERIALIZED_CRL // CERT_QUERY_CONTENT_SERIALIZED_CRL
// CERT_QUERY_CONTENT_PKCS7_SIGNED // CERT_QUERY_CONTENT_PKCS7_SIGNED
// CERT_QUERY_CONTENT_PKCS7_UNSIGNED // CERT_QUERY_CONTENT_PKCS7_UNSIGNED
// CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED // CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED
// CERT_QUERY_CONTENT_PKCS10 // CERT_QUERY_CONTENT_PKCS10
// CERT_QUERY_CONTENT_PFX // CERT_QUERY_CONTENT_PFX
// CERT_QUERY_CONTENT_CERT_PAIR // CERT_QUERY_CONTENT_CERT_PAIR
// CERT_QUERY_CONTENT_PFX_AND_LOAD
// //
// OUTPUT pdwFormatType // OUTPUT pdwFormatType
// Optional output. If NULL !=pdwFormatType, it // Optional output. If NULL !=pdwFormatType, it
// contains the format type of the content as one of the // contains the format type of the content as one of the
// following: // following:
// CERT_QUERY_FORMAT_BINARY // CERT_QUERY_FORMAT_BINARY
// CERT_QUERY_FORMAT_BASE64_ENCODED // CERT_QUERY_FORMAT_BASE64_ENCODED
// CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED // CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED
// //
// //
skipping to change at line 13536 skipping to change at line 15610
// 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(
DWORD dwObjectType, __in DWORD dwObjectType,
const void *pvObject, __in const void *pvObject,
DWORD dwExpectedContentTypeFlags, __in DWORD dwExpectedContentTypeFlags,
DWORD dwExpectedFormatTypeFlags, __in DWORD dwExpectedFormatTypeFlags,
DWORD dwFlags, __in DWORD dwFlags,
DWORD *pdwMsgAndCertEncodingType, __out_opt DWORD *pdwMsgAndCertEncodingType,
DWORD *pdwContentType, __out_opt DWORD *pdwContentType,
DWORD *pdwFormatType, __out_opt DWORD *pdwFormatType,
HCERTSTORE *phCertStore, __out_opt HCERTSTORE *phCertStore,
HCRYPTMSG *phMsg, __out_opt HCRYPTMSG *phMsg,
const void **ppvContext __deref_opt_out_opt 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 13580 skipping to change at line 15654
//serialized single CRL //serialized single CRL
#define CERT_QUERY_CONTENT_SERIALIZED_CRL 7 #define CERT_QUERY_CONTENT_SERIALIZED_CRL 7
//a PKCS#7 signed message //a PKCS#7 signed message
#define CERT_QUERY_CONTENT_PKCS7_SIGNED 8 #define CERT_QUERY_CONTENT_PKCS7_SIGNED 8
//a PKCS#7 message, such as enveloped message. But it is not a signed message, //a PKCS#7 message, such as enveloped message. But it is not a signed message,
#define CERT_QUERY_CONTENT_PKCS7_UNSIGNED 9 #define CERT_QUERY_CONTENT_PKCS7_UNSIGNED 9
//a PKCS7 signed message embedded in a file //a PKCS7 signed message embedded in a file
#define CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED 10 #define CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED 10
//an encoded PKCS#10 //an encoded PKCS#10
#define CERT_QUERY_CONTENT_PKCS10 11 #define CERT_QUERY_CONTENT_PKCS10 11
//an encoded PKX BLOB //an encoded PFX BLOB
#define CERT_QUERY_CONTENT_PFX 12 #define CERT_QUERY_CONTENT_PFX 12
//an encoded CertificatePair (contains forward and/or reverse cross certs) //an encoded CertificatePair (contains forward and/or reverse cross certs)
#define CERT_QUERY_CONTENT_CERT_PAIR 13 #define CERT_QUERY_CONTENT_CERT_PAIR 13
//an encoded PFX BLOB, which was loaded to phCertStore
#define CERT_QUERY_CONTENT_PFX_AND_LOAD 14
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//dwExpectedConentTypeFlags for CryptQueryObject //dwExpectedConentTypeFlags for CryptQueryObject
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//encoded single certificate //encoded single certificate
#define CERT_QUERY_CONTENT_FLAG_CERT \ #define CERT_QUERY_CONTENT_FLAG_CERT \
( 1 << CERT_QUERY_CONTENT_CERT) ( 1 << CERT_QUERY_CONTENT_CERT)
//encoded single CTL //encoded single CTL
skipping to change at line 13641 skipping to change at line 15717
( 1 << CERT_QUERY_CONTENT_PKCS10) ( 1 << CERT_QUERY_CONTENT_PKCS10)
//an encoded PFX BLOB //an encoded PFX BLOB
#define CERT_QUERY_CONTENT_FLAG_PFX \ #define CERT_QUERY_CONTENT_FLAG_PFX \
( 1 << CERT_QUERY_CONTENT_PFX) ( 1 << CERT_QUERY_CONTENT_PFX)
//an encoded CertificatePair (contains forward and/or reverse cross certs) //an encoded CertificatePair (contains forward and/or reverse cross certs)
#define CERT_QUERY_CONTENT_FLAG_CERT_PAIR \ #define CERT_QUERY_CONTENT_FLAG_CERT_PAIR \
( 1 << CERT_QUERY_CONTENT_CERT_PAIR) ( 1 << CERT_QUERY_CONTENT_CERT_PAIR)
//an encoded PFX BLOB, and we do want to load it (not included in
//CERT_QUERY_CONTENT_FLAG_ALL)
#define CERT_QUERY_CONTENT_FLAG_PFX_AND_LOAD \
( 1 << CERT_QUERY_CONTENT_PFX_AND_LOAD)
//content can be any type //content can be any type
#define CERT_QUERY_CONTENT_FLAG_ALL \ #define CERT_QUERY_CONTENT_FLAG_ALL \
CERT_QUERY_CONTENT_FLAG_CERT | \ ( CERT_QUERY_CONTENT_FLAG_CERT | \
CERT_QUERY_CONTENT_FLAG_CTL | \ CERT_QUERY_CONTENT_FLAG_CTL | \
CERT_QUERY_CONTENT_FLAG_CRL | \ CERT_QUERY_CONTENT_FLAG_CRL | \
CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \ CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \
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 )
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//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
skipping to change at line 13685 skipping to change at line 15766
//the content is base64 encoded //the content is base64 encoded
#define CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED \ #define CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED \
( 1 << CERT_QUERY_FORMAT_BASE64_ENCODED) ( 1 << CERT_QUERY_FORMAT_BASE64_ENCODED)
//the content is ascii hex encoded with "{ASN}" prefix //the content is ascii hex encoded with "{ASN}" prefix
#define CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \ #define CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
( 1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED) ( 1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
//the content can be of any format //the content can be of any format
#define CERT_QUERY_FORMAT_FLAG_ALL \ #define CERT_QUERY_FORMAT_FLAG_ALL \
CERT_QUERY_FORMAT_FLAG_BINARY | \ ( CERT_QUERY_FORMAT_FLAG_BINARY | \
CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | \ CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | \
CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED )
// //
// 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 LPVOID pv, __in_opt LPVOID pv,
IN ULONG cbSize __in ULONG cbSize
); );
WINCRYPT32API WINCRYPT32API
VOID VOID
WINAPI WINAPI
CryptMemFree ( CryptMemFree (
IN 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
// 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) (
LPSTR pszParamOid, __in LPSTR pszParamOid,
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 LPVOID pvParam, __in_opt LPVOID pvParam,
IN OPTIONAL 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,
OUT LPVOID* ppvParam, __deref_opt_out_opt LPVOID* ppvParam,
OUT OPTIONAL PFN_CRYPT_ASYNC_PARAM_FREE_FUNC* ppfnFree __deref_opt_out_opt __callback PFN_CRYPT_ASYNC_PARAM_FREE_FUNC* ppfnFree
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptCloseAsyncHandle ( CryptCloseAsyncHandle (
IN 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 13830 skipping to change at line 15914
// //
// 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) (
LPCSTR pszObjectOid, __in_opt LPCSTR pszObjectOid,
PCRYPT_BLOB_ARRAY pObject, __inout PCRYPT_BLOB_ARRAY pObject,
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)
// BOOL WINAPI SchemeDllRetrieveEncodedObjectW ( // BOOL WINAPI SchemeDllRetrieveEncodedObjectW (
// IN LPCWSTR pwszUrl, // __in LPCWSTR pwszUrl,
// IN 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,
// OUT PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFreeObject, // __deref_out __callback PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFr
// OUT LPVOID* ppvFreeContext, eeObject,
// IN HCRYPTASYNC hAsyncRetrieve, // __deref_out_opt LPVOID* ppvFreeContext,
// IN PCRYPT_CREDENTIALS pCredentials, // __in_opt HCRYPTASYNC hAsyncRetrieve,
// IN PCRYPT_RETRIEVE_AUX_INFO pAuxInfo // __in_opt PCRYPT_CREDENTIALS pCredentials,
// __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)
// //
// ContextDllCreateObjectContext has the following signature: // ContextDllCreateObjectContext has the following signature:
// //
// __success(return == TRUE)
// BOOL WINAPI ContextDllCreateObjectContext ( // BOOL WINAPI ContextDllCreateObjectContext (
// IN LPCSTR pszObjectOid, // __in_opt LPCSTR pszObjectOid,
// IN DWORD dwRetrievalFlags, // __in DWORD dwRetrievalFlags,
// IN PCRYPT_BLOB_ARRAY pObject, // __in PCRYPT_BLOB_ARRAY pObject,
// OUT LPVOID* ppvContext // __deref_out LPVOID* ppvContext
// ) // )
// //
// //
// Remote Object Retrieval API // Remote Object Retrieval API
// //
// //
// Retrieval flags // Retrieval flags
// //
skipping to change at line 13927 skipping to change at line 16014
// names. Use this flag whenever passing a hostname as opposed to a // names. Use this flag whenever passing a hostname as opposed to a
// domain name for the hostname parameter. // domain name for the hostname parameter.
// //
// See LDAP_OPT_AREC_EXCLUSIVE defined in winldap.h for more details. // See LDAP_OPT_AREC_EXCLUSIVE defined in winldap.h for more details.
#define CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL 0x00040000 #define CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL 0x00040000
// Apply AIA URL restrictions, such as, validate retrieved content before // Apply AIA URL restrictions, such as, validate retrieved content before
// writing to cache. // writing to cache.
#define CRYPT_AIA_RETRIEVAL 0x00080000 #define CRYPT_AIA_RETRIEVAL 0x00080000
// For HTTP: use POST instead of the default GET
//
// The POST additional binary data and header strings are appended to
// the host name and path URL as follows:
// + L'/'<Optional url escaped and base64 encoded additional data>
// + L'?'<Optional additional headers>
//
// Here's an example of an OCSP POST URL:
// http://ocsp.openvalidation.org/MEIwQDA%2BMDwwOjAJBgUrDgMCGgUABBQdKNE
// wjytjKBQADcgM61jfflNpyQQUv1NDgnjQnsOA5RtnygUA37lIg6UCA
// QI%3D?Content-Type: application/ocsp-request
//
//
// When this flag is set, CryptRetrieveObjectByUrl, searches for the
// last L'/' and L'?' POST marker characters in the URL string.
// These are removed from the URL before it is passed to the WinHttp
// APIs. The L'?' string is passed as the AdditionHeaders to
// WinHttpSendRequest. The L'/' string is url unescaped (%xx converted
// to appropriate character) and base64 decoded into binary. This
// decoded binary is passed as the additional data to WinHttpSendRequest.
#define CRYPT_HTTP_POST_RETRIEVAL 0x00100000
// When this flag is set we won't attempt to bypass any potential proxy caches.
// If a proxy cache wasn't explicitly bypassed, fProxyCacheRetrieval will be
// set in pAuxInfo. Only applicable to http URL retrievals.
#define CRYPT_PROXY_CACHE_RETRIEVAL 0x00200000
// 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,
// dwHttpStatusCode is set to winhttp.h's HTTP_STATUS_NOT_MODIFIED. Otherwise,
// *ppvObject is updated for a successful retrieval. Only applicable to
// http URL retrievals.
#define CRYPT_NOT_MODIFIED_RETRIEVAL 0x00400000
// //
// 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)
skipping to change at line 13956 skipping to change at line 16077
#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.
#define CRYPT_OCSP_ONLY_RETRIEVAL 0x01000000
//
// Cryptnet URL Cache Pre-Fetch Info
//
typedef struct _CRYPTNET_URL_CACHE_PRE_FETCH_INFO {
DWORD cbSize;
DWORD dwObjectType;
// Possible errors:
// S_OK - Pending
// ERROR_MEDIA_OFFLINE - CRL pre-fetch disabled due to OCSP offline.
// ERROR_FILE_OFFLINE - Unchanged pre-fetch content
// ERROR_INVALID_DATA - Invalid pre-fetch content
// Other errors - Unable to retrieve pre-fetch content
DWORD dwError;
DWORD dwReserved;
FILETIME ThisUpdateTime;
FILETIME NextUpdateTime;
FILETIME PublishTime; // May be zero
} CRYPTNET_URL_CACHE_PRE_FETCH_INFO, *PCRYPTNET_URL_CACHE_PRE_FETCH_INFO;
// Pre-fetch ObjectTypes
#define CRYPTNET_URL_CACHE_PRE_FETCH_NONE 0
#define CRYPTNET_URL_CACHE_PRE_FETCH_BLOB 1
#define CRYPTNET_URL_CACHE_PRE_FETCH_CRL 2
#define CRYPTNET_URL_CACHE_PRE_FETCH_OCSP 3
#define CRYPTNET_URL_CACHE_PRE_FETCH_AUTOROOT_CAB 5
//
// Cryptnet URL Cache Flush Info
//
typedef struct _CRYPTNET_URL_CACHE_FLUSH_INFO {
DWORD cbSize;
// If pre-fetching is enabled, following is ignored
//
// 0 - use default flush exempt seconds (2 weeks)
// 0xFFFFFFFF - disable flushing
DWORD dwExemptSeconds;
// Time the object expires. The above dwExemptSeconds is added to
// to determine the flush time. The LastSyncTime is used if
// after this time.
FILETIME ExpireTime;
} CRYPTNET_URL_CACHE_FLUSH_INFO, *PCRYPTNET_URL_CACHE_FLUSH_INFO;
#define CRYPTNET_URL_CACHE_DEFAULT_FLUSH 0
#define CRYPTNET_URL_CACHE_DISABLE_FLUSH 0xFFFFFFFF
//
// Cryptnet URL Cache Response Info
//
typedef struct _CRYPTNET_URL_CACHE_RESPONSE_INFO {
DWORD cbSize;
WORD wResponseType;
WORD wResponseFlags;
// The following are zero if not present
FILETIME LastModifiedTime;
DWORD dwMaxAge;
LPCWSTR pwszETag;
DWORD dwProxyId;
} CRYPTNET_URL_CACHE_RESPONSE_INFO, *PCRYPTNET_URL_CACHE_RESPONSE_INFO;
// ResponseTypes
#define CRYPTNET_URL_CACHE_RESPONSE_NONE 0
#define CRYPTNET_URL_CACHE_RESPONSE_HTTP 1
// ResponseFlags
#define CRYPTNET_URL_CACHE_RESPONSE_VALIDATED 0x8000
//
// CryptRetrieveObjectByUrl Auxilliary Info
//
//
// All unused fields in this data structure must be zeroed. More fields
// could be added in a future release.
//
typedef struct _CRYPT_RETRIEVE_AUX_INFO { typedef struct _CRYPT_RETRIEVE_AUX_INFO {
DWORD cbSize; DWORD cbSize;
FILETIME *pLastSyncTime; FILETIME *pLastSyncTime;
DWORD dwMaxUrlRetrievalByteCount; // 0 => implies no limit
// 0 => implies no limit
DWORD dwMaxUrlRetrievalByteCount;
// To get any PreFetchInfo, set the following pointer to a
// CRYPTNET_URL_CACHE_PRE_FETCH_INFO structure with its cbSize set
// upon input. For no PreFetchInfo, except for cbSize, the data
// structure is zeroed upon return.
PCRYPTNET_URL_CACHE_PRE_FETCH_INFO pPreFetchInfo;
// To get any FlushInfo, set the following pointer to a
// CRYPTNET_URL_CACHE_FLUSH_INFO structure with its cbSize set
// upon input. For no FlushInfo, except for cbSize, the data structure
// is zeroed upon return.
PCRYPTNET_URL_CACHE_FLUSH_INFO pFlushInfo;
// To get any ResponseInfo, set the following pointer to the address
// of a PCRYPTNET_URL_CACHE_RESPONSE_INFO pointer updated with
// the allocated structure. For no ResponseInfo, *ppResponseInfo is set
// to NULL. Otherwise, *ppResponseInfo must be free via CryptMemFree().
PCRYPTNET_URL_CACHE_RESPONSE_INFO *ppResponseInfo;
// If nonNULL, the specified prefix string is prepended to the
// cached filename.
LPWSTR pwszCacheFileNamePrefix;
// If nonNULL, any cached information before this time is considered
// time invalid. For CRYPT_CACHE_ONLY_RETRIEVAL, if there is a
// cached entry before this time, LastError is set to ERROR_INVALID_TIME.
// Also used to set max-age for http retrievals.
LPFILETIME pftCacheResync;
// The following flag is set upon return if CRYPT_PROXY_CACHE_RETRIEVAL
// was set in dwRetrievalFlags and the proxy cache wasn't explicitly
// bypassed for the retrieval. This flag won't be explicitly cleared.
// This flag will only be set for http URL retrievals.
BOOL fProxyCacheRetrieval;
// This value is only updated upon return for a nonSuccessful status code
// returned in a HTTP response header. This value won't be explicitly
// cleared. This value will only be updated for http or https URL
// retrievals.
//
// 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
// this case TRUE is returned with *ppvObject set to NULL.
DWORD dwHttpStatusCode;
} CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO; } CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO;
WINCRYPT32API WINCRYPT32API
__success(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptRetrieveObjectByUrlA ( CryptRetrieveObjectByUrlA (
IN LPCSTR pszUrl, __in LPCSTR pszUrl,
IN LPCSTR pszObjectOid, __in_opt LPCSTR pszObjectOid,
IN DWORD dwRetrievalFlags, __in DWORD dwRetrievalFlags,
IN DWORD dwTimeout, // milliseconds __in DWORD dwTimeout, // milliseconds
OUT LPVOID* ppvObject, __deref_out LPVOID* ppvObject,
IN HCRYPTASYNC hAsyncRetrieve, __in_opt HCRYPTASYNC hAsyncRetrieve,
IN OPTIONAL PCRYPT_CREDENTIALS pCredentials, __in_opt PCRYPT_CREDENTIALS pCredentials,
IN OPTIONAL LPVOID pvVerify, __in_opt LPVOID pvVerify,
IN OPTIONAL PCRYPT_RETRIEVE_AUX_INFO pAuxInfo __inout_opt PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
); );
WINCRYPT32API WINCRYPT32API
__success(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CryptRetrieveObjectByUrlW ( CryptRetrieveObjectByUrlW (
IN LPCWSTR pszUrl, __in LPCWSTR pszUrl,
IN LPCSTR pszObjectOid, __in_opt LPCSTR pszObjectOid,
IN DWORD dwRetrievalFlags, __in DWORD dwRetrievalFlags,
IN DWORD dwTimeout, // milliseconds __in DWORD dwTimeout, // milliseconds
OUT LPVOID* ppvObject, __deref_out LPVOID* ppvObject,
IN HCRYPTASYNC hAsyncRetrieve, __in_opt HCRYPTASYNC hAsyncRetrieve,
IN OPTIONAL PCRYPT_CREDENTIALS pCredentials, __in_opt PCRYPT_CREDENTIALS pCredentials,
IN OPTIONAL LPVOID pvVerify, __in_opt LPVOID pvVerify,
IN OPTIONAL 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,
IN 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(
IN PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel, __callback PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel,
IN const void *pvArg, __in_opt const void *pvArg,
IN DWORD dwFlags, __in DWORD dwFlags,
IN void *pvReserved __reserved void *pvReserved
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUninstallCancelRetrieval( CryptUninstallCancelRetrieval(
IN DWORD dwFlags, __in DWORD dwFlags,
IN void *pvReserved __reserved void *pvReserved
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptCancelAsyncRetrieval ( CryptCancelAsyncRetrieval (
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) (
IN LPVOID pvCompletion, __inout_opt LPVOID pvCompletion,
IN DWORD dwCompletionCode, __in DWORD dwCompletionCode,
IN LPCSTR pszUrl, __in LPCSTR pszUrl,
IN LPSTR pszObjectOid, __in_opt LPSTR pszObjectOid,
IN LPVOID pvObject __in LPVOID pvObject
); );
typedef struct _CRYPT_ASYNC_RETRIEVAL_COMPLETION { typedef struct _CRYPT_ASYNC_RETRIEVAL_COMPLETION {
PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC pfnCompletion; __callback PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC pfnCompletion;
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) (
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 14109 skipping to change at line 16358
// 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 OPTIONAL PCRYPT_URL_ARRAY pUrlArray, __out_bcount_part_opt(*pcbUrlArray, *pcbUrlArray) PCRYPT_URL_ARRAY pUrlArray
IN OUT DWORD* pcbUrlArray, ,
OUT OPTIONAL PCRYPT_URL_INFO pUrlInfo, __inout DWORD* pcbUrlArray,
IN OUT OPTIONAL DWORD* pcbUrlInfo, __out_bcount_part_opt(*pcbUrlInfo, *pcbUrlInfo) PCRYPT_URL_INFO pUrlInfo,
IN OPTIONAL 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 14191 skipping to change at line 16440
// on the CRL // on the CRL
// //
// URL_OID_CROSS_CERT_DIST_POINT // URL_OID_CROSS_CERT_DIST_POINT
// //
// pvPara == PCCERT_CONTEXT, certificate whose cross certificate distribution // pvPara == PCCERT_CONTEXT, certificate whose cross certificate distribution
// point is being requested // point is being requested
// //
// This will be retrieved from the cross certificate distribution point // This will be retrieved from the cross certificate distribution point
// extension or property on the certificate // extension or property on the certificate
// //
// URL_OID_CERTIFICATE_OCSP
//
// pvPara == PCCERT_CONTEXT, certificate whose OCSP URL is being requested
//
// This will be retrieved from the authority info access extension or property
// on the certificate
//
// URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT
//
// pvPara == PCCERT_CONTEXT, certificate whose OCSP URL and
// CRL distribution point are being requested
//
// This will be retrieved from the authority info access and
// CRL distribution point extension or property on the certificate.
// If any OCSP URLs are present, they will be first with each URL prefixed
// with L"ocsp:". The L"ocsp:" prefix should be removed before using.
//
// URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP
//
// Same as URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT, except,
// the CRL URLs will be first
//
// URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS
//
// pvPara == PCCERT_CONTEXT, certificate whose cross certificates
// are being requested
//
// This will be retrieved from the Authority Info Access
// extension or property on the certificate. Only access methods
// matching szOID_PKIX_CA_REPOSITORY will be returned.
#define URL_OID_CERTIFICATE_ISSUER ((LPCSTR)1) #define URL_OID_CERTIFICATE_ISSUER ((LPCSTR)1)
#define URL_OID_CERTIFICATE_CRL_DIST_POINT ((LPCSTR)2) #define URL_OID_CERTIFICATE_CRL_DIST_POINT ((LPCSTR)2)
#define URL_OID_CTL_ISSUER ((LPCSTR)3) #define URL_OID_CTL_ISSUER ((LPCSTR)3)
#define URL_OID_CTL_NEXT_UPDATE ((LPCSTR)4) #define URL_OID_CTL_NEXT_UPDATE ((LPCSTR)4)
#define URL_OID_CRL_ISSUER ((LPCSTR)5) #define URL_OID_CRL_ISSUER ((LPCSTR)5)
#define URL_OID_CERTIFICATE_FRESHEST_CRL ((LPCSTR)6) #define URL_OID_CERTIFICATE_FRESHEST_CRL ((LPCSTR)6)
#define URL_OID_CRL_FRESHEST_CRL ((LPCSTR)7) #define URL_OID_CRL_FRESHEST_CRL ((LPCSTR)7)
#define URL_OID_CROSS_CERT_DIST_POINT ((LPCSTR)8) #define URL_OID_CROSS_CERT_DIST_POINT ((LPCSTR)8)
#define URL_OID_CERTIFICATE_OCSP ((LPCSTR)9)
#define URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT ((LPCSTR)10)
#define URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP ((LPCSTR)11)
#define URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS ((LPCSTR)12)
typedef struct _CERT_CRL_CONTEXT_PAIR { typedef struct _CERT_CRL_CONTEXT_PAIR {
PCCERT_CONTEXT pCertContext; PCCERT_CONTEXT pCertContext;
PCCRL_CONTEXT pCrlContext; PCCRL_CONTEXT pCrlContext;
} CERT_CRL_CONTEXT_PAIR, *PCERT_CRL_CONTEXT_PAIR; } CERT_CRL_CONTEXT_PAIR, *PCERT_CRL_CONTEXT_PAIR;
typedef const CERT_CRL_CONTEXT_PAIR *PCCERT_CRL_CONTEXT_PAIR; typedef const CERT_CRL_CONTEXT_PAIR *PCCERT_CRL_CONTEXT_PAIR;
// //
// Get a time valid CAPI2 object // Get a time valid CAPI2 object
// //
//+-------------------------------------------------------------------------
// The following optional Extra Info may be passed to
// CryptGetTimeValidObject().
//
// All unused fields in this data structure must be zeroed. More fields
// could be added in a future release.
//--------------------------------------------------------------------------
typedef struct _CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO {
DWORD cbSize;
// If > 0, check that the CRL's number is >=
int iDeltaCrlIndicator;
// If nonNULL, any cached information before this time is considered
// time invalid and forces a wire retrieval.
LPFILETIME pftCacheResync;
// If nonNull, returns the cache's LastSyncTime
LPFILETIME pLastSyncTime;
// If nonNull, returns the internal MaxAge expiration time
// for the object. If the object doesn't have a MaxAge expiration, set
// to zero.
LPFILETIME pMaxAgeTime;
} CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO,
*PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO;
WINCRYPT32API WINCRYPT32API
__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 OPTIONAL LPFILETIME pftValidFor, __in_opt LPFILETIME pftValidFor,
IN DWORD dwFlags, __in DWORD dwFlags,
IN DWORD dwTimeout, // milliseconds __in DWORD dwTimeout, // milliseconds
OUT OPTIONAL LPVOID* ppvObject, __deref_opt_out LPVOID* ppvObject,
IN OPTIONAL PCRYPT_CREDENTIALS pCredentials, __in_opt PCRYPT_CREDENTIALS pCredentials,
IN OPTIONAL LPVOID pvReserved __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 14265 skipping to change at line 16576
#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,
IN 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 14408 skipping to change at line 16719
// //
// flags specific to base provider // flags specific to base provider
// //
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptProtectData( CryptProtectData(
IN DATA_BLOB* pDataIn, IN DATA_BLOB* pDataIn,
IN LPCWSTR szDataDescr, __in_opt LPCWSTR szDataDescr,
IN OPTIONAL DATA_BLOB* pOptionalEntropy, IN OPTIONAL DATA_BLOB* pOptionalEntropy,
IN PVOID pvReserved, __reserved PVOID pvReserved,
IN OPTIONAL CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, IN OPTIONAL CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct,
IN DWORD dwFlags, IN DWORD dwFlags,
OUT DATA_BLOB* pDataOut // out encr blob OUT DATA_BLOB* pDataOut // out encr blob
); );
WINCRYPT32API WINCRYPT32API
BOOL BOOL
WINAPI WINAPI
CryptUnprotectData( CryptUnprotectData(
IN DATA_BLOB* pDataIn, // in encr blob IN DATA_BLOB* pDataIn, // in encr blob
OUT OPTIONAL LPWSTR* ppszDataDescr, // out __deref_opt_out_opt LPWSTR* ppszDataDescr, // out
IN OPTIONAL DATA_BLOB* pOptionalEntropy, IN OPTIONAL DATA_BLOB* pOptionalEntropy,
IN PVOID pvReserved, __reserved PVOID pvReserved,
IN OPTIONAL CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, IN OPTIONAL CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct,
IN DWORD dwFlags, IN DWORD dwFlags,
OUT DATA_BLOB* pDataOut OUT DATA_BLOB* pDataOut
); );
WINCRYPT32API
BOOL
WINAPI
CryptUpdateProtectedState(
__in_opt PSID pOldSid,
__in_opt LPCWSTR pwszOldPassword,
__in DWORD dwFlags,
__out_opt DWORD *pdwSuccessCount,
__out_opt DWORD *pdwFailureCount);
// //
// The buffer length passed into CryptProtectMemory and CryptUnprotectMemory // The buffer length passed into CryptProtectMemory and CryptUnprotectMemory
// must be a multiple of this length (or zero). // must be a multiple of this length (or zero).
// //
#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16 #define CRYPTPROTECTMEMORY_BLOCK_SIZE 16
// //
// CryptProtectMemory/CryptUnprotectMemory dwFlags // CryptProtectMemory/CryptUnprotectMemory dwFlags
// //
skipping to change at line 14485 skipping to change at line 16806
IN DWORD dwFlags 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 must 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
// name is desired it must be specified as an extension in the pExtensions // name is desired it must be specified as an extension in the pExtensions
// parameter. pSubjectIssuerBlob can NOT be NULL, so minimually an empty DN // parameter. pSubjectIssuerBlob can NOT be NULL, so minimually an empty DN
// must be specified. // must be specified.
// //
// By default: // By default:
// pKeyProvInfo - The CSP is queried for the KeyProvInfo parameters. Only the Pr ovider, // pKeyProvInfo - The CSP is queried for the KeyProvInfo parameters. Only the Pr ovider,
// Provider Type and Container is queried. Many CSPs don't support these // Provider Type and Container is queried. Many CSPs don't support these
// queries and will cause a failure. In such cases the pKeyProvInfo // queries and will cause a failure. In such cases the pKeyProvInfo
skipping to change at line 14516 skipping to change at line 16837
// //
// 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 HCRYPTPROV hProv, __in_opt HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
IN PCERT_NAME_BLOB pSubjectIssuerBlob, __in PCERT_NAME_BLOB pSubjectIssuerBlob,
IN DWORD dwFlags, __in DWORD dwFlags,
OPTIONAL PCRYPT_KEY_PROV_INFO pKeyProvInfo, __in_opt PCRYPT_KEY_PROV_INFO pKeyProvInfo,
OPTIONAL PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, __in_opt PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
OPTIONAL PSYSTEMTIME pStartTime, __in_opt PSYSTEMTIME pStartTime,
OPTIONAL PSYSTEMTIME pEndTime, __in_opt PSYSTEMTIME pEndTime,
OPTIONAL 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 14562 skipping to change at line 16883
// 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 OPTIONAL LPCWSTR pwszComputerName, __in_opt LPCWSTR pwszComputerName,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT void *pvData, __out_bcount_part_opt(*pcbData, *pcbData) void *pvData,
IN OUT 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 14602 skipping to change at line 16923
// 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 OPTIONAL LPCWSTR pwszComputerName, __in_opt LPCWSTR pwszComputerName,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
IN 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,
IN void *pvReserved, __reserved void *pvReserved,
IN void *pvArg, __inout_opt void *pvArg,
IN DWORD cProp, __in DWORD cProp,
IN DWORD *rgdwPropId, __in_ecount(cProp) DWORD *rgdwPropId,
IN void **rgpvData, __in_ecount(cProp) void **rgpvData,
IN DWORD *rgcbData __in_ecount(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 OPTIONAL 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 OPTIONAL LPCWSTR pwszComputerName, __in_opt LPCWSTR pwszComputerName,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
IN OPTIONAL void *pvArg, __inout_opt void *pvArg,
IN 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 OPTIONAL LPCSTR pszPubKeyOID, __in_opt LPCSTR pszPubKeyOID,
IN const PUBLICKEYSTRUC *pPubKeyStruc, __in_bcount(cbPubKeyStruc) const PUBLICKEYSTRUC *pPubKeyStruc,
IN DWORD cbPubKeyStruc, __in DWORD cbPubKeyStruc,
IN DWORD dwFlags, __in DWORD dwFlags,
IN OPTIONAL void *pvReserved, __reserved void *pvReserved,
OUT BYTE *pbHash, __out_bcount_part_opt(*pcbHash, *pcbHash) BYTE *pbHash,
IN OUT 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"
// The following is a REG_BINARY. It contains the cache resync FILETIME.
// Any cached information before this time is considered time invalid
// and forces a wire retrieval. By default this is disabled.
#define CERT_CHAIN_CACHE_RESYNC_FILETIME_VALUE_NAME \
L"ChainCacheResyncFiletime"
// The following are REG_DWORD's. These configuration parameters are used // The following are REG_DWORD's. These configuration parameters are used
// to restrict Authority Info Access (AIA) URL retrieval. // to disable different chain building semantics enabled by default. Set
// the appropriate registry value to nonzero to disable.
#define CERT_CHAIN_DISABLE_AIA_URL_RETRIEVAL_VALUE_NAME \ #define CERT_CHAIN_DISABLE_MANDATORY_BASIC_CONSTRAINTS_VALUE_NAME \
L"DisableAIAUrlRetrieval" L"DisableMandatoryBasicConstraints"
// By default AIA Url Retrieval is enabled. Set this registry value to nonzero // By default the BasicConstraints extension must be present with CA enabled
// to disable // for non-Root intermediate CA certificates.
#define CERT_CHAIN_DISABLE_CA_NAME_CONSTRAINTS_VALUE_NAME \
L"DisableCANameConstraints"
// By default the NameConstraints extension is applied to the intermediate
// CA certificates in addition to the end entity certificate.
#define CERT_CHAIN_DISABLE_UNSUPPORTED_CRITICAL_EXTENSIONS_VALUE_NAME \
L"DisableUnsupportedCriticalExtensions"
// By default any unsupported extension marked critical sets the following
// dwErrorStatus bit: CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT.
// The following are REG_DWORD's. These configuration parameters are used
// to restrict Authority Info Access (AIA) URL retrieval.
#define CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_VALUE_NAME \ #define CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_VALUE_NAME \
L"MaxAIAUrlCountInCert" L"MaxAIAUrlCountInCert"
#define CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT 5 #define CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT 5
#define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_VALUE_NAME \ #define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_VALUE_NAME \
L"MaxAIAUrlRetrievalCountPerChain" L"MaxAIAUrlRetrievalCountPerChain"
#define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT 10 #define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT 10
#define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_VALUE_NAME \ #define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_VALUE_NAME \
L"MaxAIAUrlRetrievalByteCount" L"MaxAIAUrlRetrievalByteCount"
#define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT 100000 #define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT 100000
#define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_VALUE_NAME \ #define CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_VALUE_NAME \
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,
// this value is added to the ThisUpdate to get a nonzero NextUpdate.
#define CERT_CHAIN_OCSP_VALIDITY_SECONDS_VALUE_NAME \
L"OcspValiditySeconds"
// 12 hours
#define CERT_CHAIN_OCSP_VALIDITY_SECONDS_DEFAULT (12 * 60 * 60)
// The following are REG_DWORD's. These configuration parameters are
// used by the following APIs to get a non-blocking, time valid OCSP
// response for a server certificate chain:
// CertOpenServerOcspResponse
// CertAddRefServerOcspResponse
// CertCloseServerOcspResponse
// CertGetServerOcspResponseContext
// CertAddRefServerOcspResponseContext
// CertFreeServerOcspResponseContext
// This is the minimum validity of the server OCSP response to be
// returned by CertGetServerOcspResponseContext(). Since this OCSP
// response will be returned to the client, it must be sufficiently long
// so that the client will treat it as being time valid.
#define CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_VALUE_NAME \
L"SrvOcspRespMinValiditySeconds"
// 10 minutes
#define CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_DEFAULT \
(10 * 60)
// This is the maximum number of milliseconds for each server OCSP response
// pre-fetch wire URL retrieval.
#define CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME \
L"SrvOcspRespUrlRetrievalTimeoutMilliseconds"
// 15 seconds
#define CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT \
(15 * 1000)
// This is the maximum number of seconds to do a server OCSP response
// pre-fetch retrieval before the OCSP response's NextUpdate. The
// server OCSP response pre-fetch thread will wait until CurrentTime >=
// NextUpdate - MaxBeforeNextUpdateSeconds before doing the next retrieval.
#define CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME \
L"SrvOcspRespMaxBeforeNextUpdateSeconds"
// 4 hours
#define CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT \
(4 * 60 * 60)
// This is the minimum number of seconds to do a server OCSP response
// pre-fetch retrieval before the OCSP response's NextUpdate.
// If CurrentTime >= NextUpdate - MinBeforeNextUpdateSeconds, will wait until
// after NextUpdate + MinAfterNextUpdateSeconds.
#define CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME \
L"SrvOcspRespMinBeforeNextUpdateSeconds"
// 2 minutes
#define CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT \
(2 * 60)
// This is the minimum number of seconds to do a server OCSP response
// pre-fetch retrieval after the OCSP response's NextUpdate when
// (NextUpdate - MinBeforeNextUpdateSeconds) < CurrentTime < NextUpdate.
#define CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_VALUE_NAME\
L"SrvOcspRespMinAfterNextUpdateSeconds"
// 1 minute
#define CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT \
(1 * 60)
// The following are REG_DWORD's. These configuration parameters are used
// in the ordering of the revocation retrieval URLs.
// When the number of cached OCSP URLs associated with the same CDP extension
// equal or exceed this number, the OCSP AIA URLs aren't used.
#define CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_VALUE_NAME \
L"CryptnetMaxCachedOcspPerCrlCount"
#define CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_DEFAULT \
500
// The above registry value can be set to this value, to disable OCSP
// when a CDP extension is present. Note, a registry value of 0, uses the
// above default value.
#define CRYPTNET_OCSP_AFTER_CRL_DISABLE \
0xFFFFFFFF
// The following are REG_DWORD's. These configuration parameters are
// used by the Cryptnet Url Cache Service (CUCS).
// The following parameter is used as the default flush exempt seconds
#define CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_VALUE_NAME \
L"CryptnetDefaultFlushExemptSeconds"
// 4 Weeks : 28 days * 24 hours * 60 minutes * 60 seconds
#define CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_DEFAULT \
(28 * 24 * 60 * 60)
// Following 2 parameters are used to set the lower and upper limit
// on the max-age retrievals done before the Publish and NextUpdate times.
#define CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_VALUE_NAME \
L"CryptnetPreFetchMinMaxAgeSeconds"
// 1 hour
#define CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_DEFAULT \
(1 * 60 * 60)
#define CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_VALUE_NAME \
L"CryptnetPreFetchMaxMaxAgeSeconds"
// 2 Weeks : 14 days * 24 hours * 60 minutes * 60 seconds
#define CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_DEFAULT \
(14 * 24 * 60 * 60)
// Following 3 parameters are used to calculate the PreFetch start before
// the NextUpdate
//
// Where PreFetchStartTime = PublishTime +
// PublishPeriod / AfterPublishPreFetchDivisor
// PreFetchEndTime = NextUpdate -
// PublishPeriod / BeforeNextUpdatePreFetchDivisor
//
// PreFetchPeriod = PreFetchEndTime - PreFetchStartTime
//
// if (PreFetchPeriod < MinBeforeNextUpdatePreFetchPeriodSeconds)
// - No PreFetch is done before NextUpdate
// else
// - PreFetch starts are randomized over this period
// The start of the PreFetch period is delayed after the start of the
// Publish period by dividing the PublishPeriod (NextUpdate - PublishTime)
// by this integer divisor.
#define CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_VALUE_NAME \
L"CryptnetPreFetchAfterPublishPreFetchDivisor"
// 10, where 12 hours / 10 = 72 minutes or 1.2 hours / 10 = 7.2 minutes
#define CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_DEFAULT \
10
// The finish of the PreFetch period occurs before NextUpdate
// by dividing the PublishPeriod (NextUpdate - PublishTime)
// by this integer divisor.
#define CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_VALUE_NAME \
L"CryptnetPreFetchBeforeNextUpdatePreFetchDivisor"
// 20, where 12 hours / 20 = 36 minutes or 1.2 hours / 10 = 3.6 minutes
#define CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT \
20
// The PreFetch period must exceed this minimum duration in seconds
// to do a PreFetch before NextUpdate
#define CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE
_NAME \
L"CryptnetPreFetchMinBeforeNextUpdatePreFetchSeconds"
// 1 hour
//
// For the default OCSP period of 12 hours using above defaults,
// PreFetchPeriod = 72 minutes - 7.2 minutes - 3.6 mintes = 61.2 minutes
#define CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAU
LT \
(1 * 60 * 60)
// Following 4 parameters are used to calculate the PreFetch start after
// the NextUpdate
//
// ValidityPeriod = NextUpdate - ThisUpdate
//
// PreFetchPeriod = ValidityPeriod / AfterNextUpdatePreFetchDivisor
//
// Where PreFetchPeriod is decreased to MaxAfterNextUpdatePreFetchPeriodSeconds
// or increased to MinAfterNextUpdatePreFetchPeriodSeconds;
//
// PreFetchStartTime = NextUpdate
// PreFetchEndTime = PreFetchStartTime + PreFetchPeriod
//
// PreFetch starts are randomized over the above PreFetchPeriod
//
// If CurrentTime > RandomPreFetchStartTime, then, the
// AfterCurrentTimePreFetchPeriodSeconds is randomized and added to
// CurrentTime for the RandomPreFetchStartTime
// The PreFetch period after NextUpdate is initially calculated by
// dividing the ValidityPeriod (NextUpdate - ThisUpdate) by this integer
// divisor.
#define CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_V
ALUE_NAME \
L"CryptnetPreFetchValidityPeriodAfterNextUpdatePreFetchDivisor"
// 10, where 1 week / 10 = 16.8 hours
#define CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_D
EFAULT \
10
// If necessary, the above PreFetch period will be decreased
// to this maximum duration in seconds.
#define CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_
NAME \
L"CryptnetPreFetchMaxAfterNextUpdatePreFetchPeriodSeconds"
// 4 hours
#define CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAUL
T \
(4 * 60 * 60)
// If necessary, the above PreFetch period will be increased
// to this minimum duration in seconds.
#define CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_
NAME \
L"CryptnetPreFetchMinAfterNextUpdatePreFetchPeriodSeconds"
// 30 minutes
#define CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAUL
T \
(30 * 60)
// If the CurrentTime is after the above randomized start time, the following
// parameter will be randomized and added to the CurrentTime.
#define CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_VALUE_NAM
E \
L"CryptnetPreFetchAfterCurrentTimePreFetchPeriodSeconds"
// 30 minutes
#define CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_DEFAULT \
(30 * 60)
// Following parameter specifies the minimum time period between sending
// trigger URL cache PreFetch LRPC messages to cryptsvc after doing online
// revocation enabled chain builds.
#define CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_VALUE_NAME \
L"CryptnetPreFetchTriggerPeriodSeconds"
// 10 minutes
#define CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_DEFAULT \
(10 * 60)
// The above registry value can be set to this value, to disable the
// sending of trigger URL cache PreFetch LRPC messages. Note, a registry
// value of 0, uses the above default value.
#define CRYPTNET_PRE_FETCH_TRIGGER_DISABLE \
0xFFFFFFFF
// Following parameter specifies the delay time to wait to scan the
// URL cache directory after receiving a trigger LRPC message request.
#define CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_VALUE_NAME \
L"CryptnetPreFetchScanAfterTriggerDelaySeconds"
// 30 seconds
#define CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_DEFAULT \
30
// Following parameter specifies the maximum amount of time to wait for any
// PreFetch retrieval to complete
#define CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_VALUE_NAME \
L"CryptnetPreFetchRetrievalTimeoutSeconds"
// 5 minutes
#define CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_DEFAULT \
(5 * 60)
//+-------------------------------------------------------------------------
// The following configuration parameters are store in HKLM group policy
//--------------------------------------------------------------------------
#define CERT_GROUP_POLICY_CHAIN_CONFIG_REGPATH \
CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\ChainEngine\\Config"
// In Longhorn, the following have been moved from the above HKLM
// configuration parameters:
// The following are REG_DWORD's. These configuration parameters are used
// to override the default URL timeouts in chain building
// This is the default URL timeout in milliseconds
#define CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME \
L"ChainUrlRetrievalTimeoutMilliseconds"
// 15 seconds
#define CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT \
(15 * 1000)
// This is the default revocation accumulative URL timeout in milliseconds
// The first revocation URL retrieval uses half of this timeout
#define CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAM
E \
L"ChainRevAccumulativeUrlRetrievalTimeoutMilliseconds"
// 20 seconds
#define CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT \
(20 * 1000)
// Note, will allow the machine setting to be used if this value isn't
// defined.
// By default AIA OCSP URLs are before CDP CRL URLs. When the number of cached
// OCSP URLs associated with the same CDP extension equal or exceed this
// number, the CRL URLs are placed before the OCSP URLs.
#define CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_VALUE_NAME \
L"CryptnetCachedOcspSwitchToCrlCount"
#define CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_DEFAULT \
50
// The above registry value can be set to this value, to always place
// the CRL URLs before the OCSP URLs. Note, a registry value of 0, uses the
// above default value.
#define CRYPTNET_CRL_BEFORE_OCSP_ENABLE \
0xFFFFFFFF
// Support for the following was removed in Longhorn. Changed to use
// the following OPTIONS flags in HKLM Group Policy
#define CERT_CHAIN_DISABLE_AIA_URL_RETRIEVAL_VALUE_NAME \
L"DisableAIAUrlRetrieval"
// By default AIA Url Retrieval is enabled. Set this registry value to nonzero
// to disable
// This is the name of the REG_DWORD for chain engine Options
#define CERT_CHAIN_OPTIONS_VALUE_NAME \
L"Options"
// Disable AIA URL retrieval when this bit is set in the Options
#define CERT_CHAIN_OPTION_DISABLE_AIA_URL_RETRIEVAL 0x2
#define CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_VALUE_NAME \
L"CrossCertDownloadIntervalHours"
// 7 days
#define CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_DEFAULT (24 * 7)
// When not defined or zero, the CRL validity isn't extended
#define CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_VALUE_NAME \
L"CRLValidityExtensionPeriod"
// 12 hour
#define CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_DEFAULT 12
// //
// The chain engine defines the store namespace and cache partitioning for // The chain engine defines the store namespace and cache partitioning for
// the Certificate Chaining infrastructure. A default chain engine // the Certificate Chaining infrastructure. A default chain engine
// is defined for the process which uses all default system stores e.g. // is defined for the process which uses all default system stores e.g.
// Root, CA, Trust, for chain building and caching. If an application // Root, CA, Trust, for chain building and caching. If an application
// wishes to define its own store namespace or have its own partitioned // wishes to define its own store namespace or have its own partitioned
// cache then it can create its own chain engine. It is advisable to create // cache then it can create its own chain engine. It is advisable to create
// a chain engine at application startup and use it throughout the lifetime // a chain engine at application startup and use it throughout the lifetime
// of the application in order to get optimal caching behavior // of the application in order to get optimal caching behavior
// //
skipping to change at line 14800 skipping to change at line 17443
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;
} CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG; } CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
WINCRYPT32API WINCRYPT32API
__success(return == TRUE)
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 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 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 14872 skipping to change at line 17516
#define CERT_TRUST_IS_NOT_VALID_FOR_USAGE 0x00000010 #define CERT_TRUST_IS_NOT_VALID_FOR_USAGE 0x00000010
#define CERT_TRUST_IS_UNTRUSTED_ROOT 0x00000020 #define CERT_TRUST_IS_UNTRUSTED_ROOT 0x00000020
#define CERT_TRUST_REVOCATION_STATUS_UNKNOWN 0x00000040 #define CERT_TRUST_REVOCATION_STATUS_UNKNOWN 0x00000040
#define CERT_TRUST_IS_CYCLIC 0x00000080 #define CERT_TRUST_IS_CYCLIC 0x00000080
#define CERT_TRUST_INVALID_EXTENSION 0x00000100 #define CERT_TRUST_INVALID_EXTENSION 0x00000100
#define CERT_TRUST_INVALID_POLICY_CONSTRAINTS 0x00000200 #define CERT_TRUST_INVALID_POLICY_CONSTRAINTS 0x00000200
#define CERT_TRUST_INVALID_BASIC_CONSTRAINTS 0x00000400 #define CERT_TRUST_INVALID_BASIC_CONSTRAINTS 0x00000400
#define CERT_TRUST_INVALID_NAME_CONSTRAINTS 0x00000800 #define CERT_TRUST_INVALID_NAME_CONSTRAINTS 0x00000800
#define CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT 0x00001000 #define CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT 0x00001000
// 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_HAS_NOT_SUPPORTED_CRITICAL_EXT 0x08000000
// 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
skipping to change at line 14902 skipping to change at line 17551
#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
// 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_HAS_CRL_VALIDITY_EXTENDED 0x00001000
// 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
skipping to change at line 15031 skipping to change at line 17681
PCCERT_CHAIN_CONTEXT* rgpLowerQualityChainContext; PCCERT_CHAIN_CONTEXT* rgpLowerQualityChainContext;
// fHasRevocationFreshnessTime is only set if we are able to retrieve // fHasRevocationFreshnessTime is only set if we are able to retrieve
// revocation information for all elements checked for revocation. // revocation information for all elements checked for revocation.
// For a CRL its CurrentTime - ThisUpdate. // For a CRL its CurrentTime - ThisUpdate.
// //
// dwRevocationFreshnessTime is the largest time across all elements // dwRevocationFreshnessTime is the largest time across all elements
// checked. // checked.
BOOL fHasRevocationFreshnessTime; BOOL fHasRevocationFreshnessTime;
DWORD dwRevocationFreshnessTime; // seconds DWORD dwRevocationFreshnessTime; // seconds
// Flags passed when created via CertGetCertificateChain
DWORD dwCreateFlags;
// Following is updated with unique Id when the chain context is logged.
GUID ChainId;
}; };
// //
// When building a chain, the there are various parameters used for finding // When building a chain, the there are various parameters used for finding
// issuing certificates and trust lists. They are identified in the // issuing certificates and trust lists. They are identified in the
// following structure // following structure
// //
// Default usage match type is AND with value zero // Default usage match type is AND with value zero
#define USAGE_MATCH_TYPE_AND 0x00000000 #define USAGE_MATCH_TYPE_AND 0x00000000
skipping to change at line 15073 skipping to change at line 17729
// Note, if you #define CERT_CHAIN_PARA_HAS_EXTRA_FIELDS, then, you // Note, if you #define CERT_CHAIN_PARA_HAS_EXTRA_FIELDS, then, you
// must zero all unused fields in this data structure. // must zero all unused fields in this data structure.
// More fields could be added in a future release. // More fields could be added in a future release.
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
// time invalid and forces a wire retrieval. When set overrides
// the registry configuration CacheResync time.
LPFILETIME pftCacheResync;
#endif #endif
} CERT_CHAIN_PARA, *PCERT_CHAIN_PARA; } CERT_CHAIN_PARA, *PCERT_CHAIN_PARA;
// //
// 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
skipping to change at line 15139 skipping to change at line 17800
// When this flag is set, pTime will be used as the timestamp time. // When this flag is set, pTime will be used as the timestamp time.
// pTime will be used to determine if the end certificate was valid at this // pTime will be used to determine if the end certificate was valid at this
// time. Revocation checking will be relative to pTime. // time. Revocation checking will be relative to pTime.
// In addition, current time will also be used // In addition, current time will also be used
// to determine if the certificate is still time valid. All remaining // to determine if the certificate is still time valid. All remaining
// CA and root certificates will be checked using current time and not pTime. // CA and root certificates will be checked using current time and not pTime.
// //
// This flag was added 4/5/01 in WXP. // This flag was added 4/5/01 in WXP.
#define CERT_CHAIN_TIMESTAMP_TIME 0x00000200 #define CERT_CHAIN_TIMESTAMP_TIME 0x00000200
// When this flag is set, "My" certificates having a private key or end
// entity certificates in the "TrustedPeople" store are trusted without
// doing any chain building. Neither the CERT_TRUST_IS_PARTIAL_CHAIN or
// CERT_TRUST_IS_UNTRUSTED_ROOT dwErrorStatus bits will be set for
// such certificates.
//
// This flag was added 6/9/03 in LH.
#define CERT_CHAIN_ENABLE_PEER_TRUST 0x00000400
// When this flag is set, "My" certificates aren't considered for
// PEER_TRUST.
//
// This flag was added 11/12/04 in LH.
//
// On 8-05-05 changed to never consider "My" certificates for PEER_TRUST.
#define CERT_CHAIN_DISABLE_MY_PEER_TRUST 0x00000800
WINCRYPT32API WINCRYPT32API
__success(return == TRUE)
BOOL BOOL
WINAPI WINAPI
CertGetCertificateChain ( CertGetCertificateChain (
IN OPTIONAL HCERTCHAINENGINE hChainEngine, __in_opt HCERTCHAINENGINE hChainEngine,
IN PCCERT_CONTEXT pCertContext, __in PCCERT_CONTEXT pCertContext,
IN OPTIONAL LPFILETIME pTime, __in_opt LPFILETIME pTime,
IN OPTIONAL HCERTSTORE hAdditionalStore, __in_opt HCERTSTORE hAdditionalStore,
IN PCERT_CHAIN_PARA pChainPara, __in PCERT_CHAIN_PARA pChainPara,
IN DWORD dwFlags, __in DWORD dwFlags,
IN 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
); );
// //
// Specific Revocation Type OID and structure definitions // Specific Revocation Type OID and structure definitions
// //
// //
// CRL Revocation OID // CRL Revocation OID
// //
skipping to change at line 15226 skipping to change at line 17905
// 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 const void *pvFindPara, __in_opt const void *pvFindPara,
IN 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 15281 skipping to change at line 17960
// 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,
IN 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 15420 skipping to change at line 18099
#define CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS ( \ #define CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS ( \
CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG | \ CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG | \
CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG | \ CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG | \
CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG | \ CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG | \
CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG \ CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG \
) )
#define CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG 0x00008000 #define CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG 0x00008000
#define CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG 0x00004000 #define CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG 0x00004000
#define CERT_CHAIN_POLICY_IGNORE_NOT_SUPPORTED_CRITICAL_EXT_FLAG 0x00002000
#define CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG 0x00001000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// Verify that the certificate chain satisfies the specified policy // Verify that the certificate chain satisfies the specified policy
// requirements. If we were able to verify the chain policy, TRUE is returned // requirements. If we were able to verify the chain policy, TRUE is returned
// and the dwError field of the pPolicyStatus is updated. A dwError of 0 // and the dwError field of the pPolicyStatus is updated. A dwError of 0
// (ERROR_SUCCESS, S_OK) indicates the chain satisfies the specified policy. // (ERROR_SUCCESS, S_OK) indicates the chain satisfies the specified policy.
// //
// If dwError applies to the entire chain context, both lChainIndex and // If dwError applies to the entire chain context, both lChainIndex and
// lElementIndex are set to -1. If dwError applies to a simple chain, // lElementIndex are set to -1. If dwError applies to a simple chain,
// lElementIndex is set to -1 and lChainIndex is set to the index of the // lElementIndex is set to -1 and lChainIndex is set to the index of the
// first offending chain having the error. If dwError applies to a // first offending chain having the error. If dwError applies to a
skipping to change at line 15446 skipping to change at line 18128
// 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,
IN OUT 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 15639 skipping to change at line 18321
// 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 LPCSTR pszString, __in_ecount(cchString) LPCSTR pszString,
IN DWORD cchString, __in DWORD cchString,
IN DWORD dwFlags, __in DWORD dwFlags,
IN BYTE *pbBinary, __out_bcount_part_opt(*pcbBinary, *pcbBinary) BYTE *pbBinary,
IN OUT DWORD *pcbBinary, __inout DWORD *pcbBinary,
OUT DWORD *pdwSkip, //OPTIONAL __out_opt DWORD *pdwSkip,
OUT DWORD *pdwFlags //OPTIONAL __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 LPCWSTR pszString, __in_ecount(cchString) LPCWSTR pszString,
IN DWORD cchString, __in DWORD cchString,
IN DWORD dwFlags, __in DWORD dwFlags,
IN BYTE *pbBinary, __out_bcount_part_opt(*pcbBinary, *pcbBinary) BYTE *pbBinary,
IN OUT DWORD *pcbBinary, __inout DWORD *pcbBinary,
OUT DWORD *pdwSkip, //OPTIONAL __out_opt DWORD *pdwSkip,
OUT DWORD *pdwFlags //OPTIONAL __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
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32STRINGAPI WINCRYPT32STRINGAPI
BOOL BOOL
WINAPI WINAPI
CryptBinaryToStringA( CryptBinaryToStringA(
IN CONST BYTE *pbBinary, __in_bcount(cbBinary) CONST BYTE *pbBinary,
IN DWORD cbBinary, __in DWORD cbBinary,
IN DWORD dwFlags, __in DWORD dwFlags,
IN LPSTR pszString, __out_ecount_part_opt(*pcchString, *pcchString) LPSTR pszString,
IN OUT 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
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
WINCRYPT32STRINGAPI WINCRYPT32STRINGAPI
BOOL BOOL
WINAPI WINAPI
CryptBinaryToStringW( CryptBinaryToStringW(
IN CONST BYTE *pbBinary, __in_bcount(cbBinary) CONST BYTE *pbBinary,
IN DWORD cbBinary, __in DWORD cbBinary,
IN DWORD dwFlags, __in DWORD dwFlags,
IN LPWSTR pszString, __out_ecount_part_opt(*pcchString, *pcchString) LPWSTR pszString,
IN OUT 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_*
#define CRYPT_STRING_BASE64HEADER 0x00000000 #define CRYPT_STRING_BASE64HEADER 0x00000000
#define CRYPT_STRING_BASE64 0x00000001 #define CRYPT_STRING_BASE64 0x00000001
#define CRYPT_STRING_BINARY 0x00000002 #define CRYPT_STRING_BINARY 0x00000002
#define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003 #define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003
#define CRYPT_STRING_HEX 0x00000004 #define CRYPT_STRING_HEX 0x00000004
#define CRYPT_STRING_HEXASCII 0x00000005 #define CRYPT_STRING_HEXASCII 0x00000005
#define CRYPT_STRING_BASE64_ANY 0x00000006 #define CRYPT_STRING_BASE64_ANY 0x00000006
#define CRYPT_STRING_ANY 0x00000007 #define CRYPT_STRING_ANY 0x00000007
#define CRYPT_STRING_HEX_ANY 0x00000008 #define CRYPT_STRING_HEX_ANY 0x00000008
#define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009 #define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009
#define CRYPT_STRING_HEXADDR 0x0000000a #define CRYPT_STRING_HEXADDR 0x0000000a
#define CRYPT_STRING_HEXASCIIADDR 0x0000000b #define CRYPT_STRING_HEXASCIIADDR 0x0000000b
#define CRYPT_STRING_HEXRAW 0x0000000c
#define CRYPT_STRING_NOCRLF 0x40000000
#define CRYPT_STRING_NOCR 0x80000000 #define CRYPT_STRING_NOCR 0x80000000
// certenrolld_end
// CryptBinaryToString uses the following flags // CryptBinaryToString uses the following flags
// CRYPT_STRING_BASE64HEADER - base64 format with certificate begin // CRYPT_STRING_BASE64HEADER - base64 format with certificate begin
// and end headers // and end headers
// CRYPT_STRING_BASE64 - only base64 without headers // CRYPT_STRING_BASE64 - only base64 without headers
// CRYPT_STRING_BINARY - pure binary copy // CRYPT_STRING_BINARY - pure binary copy
// CRYPT_STRING_BASE64REQUESTHEADER - base64 format with request begin // CRYPT_STRING_BASE64REQUESTHEADER - base64 format with request begin
// and end headers // and end headers
// CRYPT_STRING_BASE64X509CRLHEADER - base64 format with x509 crl begin // CRYPT_STRING_BASE64X509CRLHEADER - base64 format with x509 crl begin
// and end headers // and end headers
skipping to change at line 15759 skipping to change at line 18445
// CRYPT_STRING_ANY tries the following, in order: // CRYPT_STRING_ANY tries the following, in order:
// CRYPT_STRING_BASE64_ANY // CRYPT_STRING_BASE64_ANY
// CRYPT_STRING_BINARY -- should always succeed // CRYPT_STRING_BINARY -- should always succeed
// CRYPT_STRING_HEX_ANY tries the following, in order: // CRYPT_STRING_HEX_ANY tries the following, in order:
// CRYPT_STRING_HEXADDR // CRYPT_STRING_HEXADDR
// CRYPT_STRING_HEXASCIIADDR // CRYPT_STRING_HEXASCIIADDR
// CRYPT_STRING_HEXASCII // CRYPT_STRING_HEXASCII
// CRYPT_STRING_HEX // CRYPT_STRING_HEX
//+========================================================================= //+=========================================================================
// PFX (PKCS #12) function defintions and types // PFX (PKCS #12) function definitions and types
//========================================================================== //==========================================================================
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// PKCS#12 OIDs
//--------------------------------------------------------------------------
#define szOID_PKCS_12_PbeIds "1.2.840.113549.1.12.1"
#define szOID_PKCS_12_pbeWithSHA1And128BitRC4 "1.2.840.113549.1.12.1.1"
#define szOID_PKCS_12_pbeWithSHA1And40BitRC4 "1.2.840.113549.1.12.1.2"
#define szOID_PKCS_12_pbeWithSHA1And3KeyTripleDES "1.2.840.113549.1.12.1.3"
#define szOID_PKCS_12_pbeWithSHA1And2KeyTripleDES "1.2.840.113549.1.12.1.4"
#define szOID_PKCS_12_pbeWithSHA1And128BitRC2 "1.2.840.113549.1.12.1.5"
#define szOID_PKCS_12_pbeWithSHA1And40BitRC2 "1.2.840.113549.1.12.1.6"
//+-------------------------------------------------------------------------
// PBE parameters as defined in PKCS#12 as pkcs-12PbeParams.
//
// NOTE that the salt bytes will immediately follow this structure.
// we avoid using pointers in this structure for easy of passing
// it into NCryptExportKey() as a NCryptBuffer (may be sent via RPC
// to the key isolation process).
//--------------------------------------------------------------------------
typedef struct _CRYPT_PKCS12_PBE_PARAMS
{
int iIterations; /* iteration count */
ULONG cbSalt; /* byte size of the salt */
}
CRYPT_PKCS12_PBE_PARAMS;
//+-------------------------------------------------------------------------
// 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:
// 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
// properties that were saved with CertExportCertStore()
// 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 CRYPT_USER_KEYSET 0x00001000 #define CRYPT_USER_KEYSET 0x00001000
#define PKCS12_PREFER_CNG_KSP 0x00000100 // prefer using CNG KSP
#define PKCS12_IMPORT_RESERVED_MASK 0xffff0000 #define PKCS12_ALWAYS_CNG_KSP 0x00000200 // always use CNG KSP
#define PKCS12_ALLOW_OVERWRITE_KEY 0x00004000 // allow overwrite existing key
#define PKCS12_NO_PERSIST_KEY 0x00008000 // key will not be persisted
#define PKCS12_IMPORT_RESERVED_MASK 0xffff0000
//+------------------------------------------------------------------------- //+-------------------------------------------------------------------------
// 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 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_INCLUDE_EXTENDED_PROPERTIES
// //
// 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,
IN OUT CRYPT_DATA_BLOB* pPFX, __inout CRYPT_DATA_BLOB* pPFX,
IN LPCWSTR szPassword, __in LPCWSTR szPassword,
IN void* pvReserved, __reserved void* pvReserved,
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_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,
IN OUT 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
// a server certificate chain.
//
// Normally, this OCSP response will be included along with the server
// 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 OCSP response handle.
//--------------------------------------------------------------------------
typedef VOID *HCERT_SERVER_OCSP_RESPONSE;
//+-------------------------------------------------------------------------
// 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
// returned with LastError set to CRYPT_E_NOT_IN_REVOCATION_DATABASE. NULL
// will also be returned if unable to allocate memory or create system
// objects.
//
// This API will try to retrieve an initial OCSP response before returning.
// This API will block during the retrieval. If unable to successfully
// retrieve the first OCSP response, a non-NULL handle will still be returned
// if not one of the error cases mentioned above.
//
// A background thread is created that will pre-fetch time valid
// OCSP responses.
//
// The input chain context will be AddRef'ed and not freed until
// the returned handle is closed.
//
// CertCloseServerOcspResponse() must be called to close the returned
// handle.
//
// dwFlags and pvReserved aren't currently used and must be set to 0
// and NULL.
//--------------------------------------------------------------------------
WINCRYPT32API
HCERT_SERVER_OCSP_RESPONSE
WINAPI
CertOpenServerOcspResponse(
__in PCCERT_CHAIN_CONTEXT pChainContext,
__in DWORD dwFlags,
__reserved LPVOID pvReserved
);
//+-------------------------------------------------------------------------
// AddRef a HCERT_SERVER_OCSP_RESPONSE returned by
// CertOpenServerOcspResponse(). Each Open and AddRef requires a
// corresponding CertCloseServerOcspResponse().
//--------------------------------------------------------------------------
WINCRYPT32API
VOID
WINAPI
CertAddRefServerOcspResponse(
__in_opt HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse
);
//+-------------------------------------------------------------------------
// Close the handle returned by CertOpenServerOcspResponse() or AddRef'ed
// by CertAddRefServerOcspResponse().
//
// dwFlags isn't currently used and must be set to 0.
//--------------------------------------------------------------------------
WINCRYPT32API
VOID
WINAPI
CertCloseServerOcspResponse(
__in_opt HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse,
__in DWORD dwFlags
);
//+-------------------------------------------------------------------------
// Server OCSP response context.
//--------------------------------------------------------------------------
typedef struct _CERT_SERVER_OCSP_RESPONSE_CONTEXT
CERT_SERVER_OCSP_RESPONSE_CONTEXT,
*PCERT_SERVER_OCSP_RESPONSE_CONTEXT;
typedef const CERT_SERVER_OCSP_RESPONSE_CONTEXT
*PCCERT_SERVER_OCSP_RESPONSE_CONTEXT;
struct _CERT_SERVER_OCSP_RESPONSE_CONTEXT {
DWORD cbSize;
BYTE *pbEncodedOcspResponse;
DWORD cbEncodedOcspResponse;
};
//+-------------------------------------------------------------------------
// Get a time valid OCSP response context for the handle created for
// the server certificate chain.
//
// This API won't block to retrieve the OCSP response. It will return
// the current pre-fetched OCSP response. If a time valid OCSP response
// isn't available, NULL will be returned with LAST_ERROR set to
// CRYPT_E_REVOCATION_OFFLINE.
//
// CertFreeServerOcspResponseContext() must be called to free the
// returned OCSP response context.
//--------------------------------------------------------------------------
WINCRYPT32API
PCCERT_SERVER_OCSP_RESPONSE_CONTEXT
WINAPI
CertGetServerOcspResponseContext(
__in HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse,
__in DWORD dwFlags,
__reserved LPVOID pvReserved
);
//+-------------------------------------------------------------------------
// AddRef a PCCERT_SERVER_OCSP_RESPONSE_CONTEXT returned by
// CertGetServerOcspResponseContext(). Each Get and AddRef requires a
// corresponding CertFreeServerOcspResponseContext().
//--------------------------------------------------------------------------
WINCRYPT32API
VOID
WINAPI
CertAddRefServerOcspResponseContext(
__in_opt PCCERT_SERVER_OCSP_RESPONSE_CONTEXT pServerOcspResponseContext
);
//+-------------------------------------------------------------------------
// Free the OCSP response context returned by
// CertGetServerOcspResponseContext().
//--------------------------------------------------------------------------
WINCRYPT32API
VOID
WINAPI
CertFreeServerOcspResponseContext(
__in_opt PCCERT_SERVER_OCSP_RESPONSE_CONTEXT pServerOcspResponseContext
);
//+-------------------------------------------------------------------------
// Helper function to do URL retrieval of logo or biometric information
// specified in either the szOID_LOGOTYPE_EXT or szOID_BIOMETRIC_EXT
// certificate extension.
//
// Only the first hashed URL matching lpszLogoOrBiometricType is used
// to do the URL retrieval. Only direct logotypes are supported.
// The bytes at the first URL are retrieved via
// CryptRetrieveObjectByUrlW and hashed. The computed hash is compared
// against the hash in the certificate. For success, ppbData, pcbData
// and optionally ppwszMimeType are updated with
// CryptMemAlloc'ed memory which must be freed by calling CryptMemFree().
// For failure, *ppbData, *pcbData and optionally *ppwszMimeType are
// zero'ed.
//
// For failure, the following errors may be set in LastError:
// E_INVALIDARG - invalid lpszLogoOrBiometricType, not one of the
// acceptable predefined types.
// CRYPT_E_NOT_FOUND - certificate doesn't have the
// szOID_LOGOTYPE_EXT or szOID_BIOMETRIC_EXT extension or a matching
// lpszLogoOrBiometricType wasn't found with a non-empty
// hashed URL.
// ERROR_NOT_SUPPORTED - matched the unsupported indirect logotype
// NTE_BAD_ALGID - unknown hash algorithm OID
// ERROR_INVALID_DATA - no bytes were retrieved at the specified URL
// in the certificate extension
// CRYPT_E_HASH_VALUE - the computed hash doesn't match the hash
// in the certificate
// CertRetrieveLogoOrBiometricInfo calls the following functions which
// will set LastError for failure:
// CryptDecodeObjectEx(szOID_LOGOTYPE_EXT or szOID_BIOMETRIC_EXT)
// CryptRetrieveObjectByUrlW
// CryptHashCertificate
// CryptMemAlloc
//
// lpszLogoOrBiometricType is one of the predefined logotype or biometric
// types, an other logotype OID or a biometric OID.
//
// dwRetrievalFlags - see CryptRetrieveObjectByUrlW
// dwTimeout - see CryptRetrieveObjectByUrlW
//
// dwFlags - reserved, must be set to 0
// pvReserved - reserved, must be set to NULL
//
// *ppwszMimeType is always NULL for the biometric types. For success,
// the caller must always check if non-NULL before dereferencing.
//--------------------------------------------------------------------------
WINCRYPT32API
__success(return == TRUE)
BOOL
WINAPI
CertRetrieveLogoOrBiometricInfo(
__in PCCERT_CONTEXT pCertContext,
__in LPCSTR lpszLogoOrBiometricType,
__in DWORD dwRetrievalFlags,
__in DWORD dwTimeout, // milliseconds
__in DWORD dwFlags,
__reserved void *pvReserved,
__deref_out_bcount_opt(*pcbData) BYTE **ppbData, // CryptMemFree()
__out DWORD *pcbData,
__deref_opt_out_opt LPWSTR *ppwszMimeType // CryptMemFree()
);
// Predefined Logotypes
#define CERT_RETRIEVE_ISSUER_LOGO ((LPCSTR) 1)
#define CERT_RETRIEVE_SUBJECT_LOGO ((LPCSTR) 2)
#define CERT_RETRIEVE_COMMUNITY_LOGO ((LPCSTR) 3)
// Predefined Biometric types
#define CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE ((LPCSTR) 1000)
#define CERT_RETRIEVE_BIOMETRIC_PICTURE_TYPE \
(CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE + CERT_BIOMETRIC_PICTURE_TYPE)
#define CERT_RETRIEVE_BIOMETRIC_SIGNATURE_TYPE \
(CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE + CERT_BIOMETRIC_SIGNATURE_TYP
E)
#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)
 End of changes. 685 change blocks. 
1435 lines changed or deleted 4403 lines changed or added


 winefs.h (5.2.3790.3959-Windows 5.0)   winefs.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 15 skipping to change at line 15
// //
// File: winefs.h // File: winefs.h
// //
// Contents: EFS Data and prototypes. // Contents: EFS Data and prototypes.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#ifndef __WINEFS_H__ #ifndef __WINEFS_H__
#define __WINEFS_H__ #define __WINEFS_H__
// winefs.h was not available at all pre-W2K
#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
#define WINEFS_SETUSERKEY_SET_CAPABILITIES 0x00000001
#define WINEFS_SETUSERKEY_BLOCK_CACHE_FLUSH 0x00000002
//+----------------------------------------------------------------------------- ----/ //+----------------------------------------------------------------------------- ----/
// / // /
// / // /
// Data Structures / // Data Structures /
// / // /
// / // /
//------------------------------------------------------------------------------ ----/ //------------------------------------------------------------------------------ ----/
// ALG_ID define is used as part of EFS_KEY_INFO (not available pre-WXP)
#if (NTDDI_VERSION >= NTDDI_WINXP)
#ifndef ALGIDDEF #ifndef ALGIDDEF
#define ALGIDDEF #define ALGIDDEF
typedef unsigned int ALG_ID; typedef unsigned int ALG_ID;
#endif #endif
#endif
// //
// Encoded Certificate // Encoded Certificate
// //
typedef struct _CERTIFICATE_BLOB { typedef struct _CERTIFICATE_BLOB {
DWORD dwCertEncodingType; DWORD dwCertEncodingType;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0,32768)] [range(0,32768)]
skipping to change at line 75 skipping to change at line 86
#endif // MIDL_PASS #endif // MIDL_PASS
DWORD cbData; DWORD cbData;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[size_is(cbData)] [size_is(cbData)]
#endif // MIDL_PASS #endif // MIDL_PASS
PBYTE pbData; PBYTE pbData;
} EFS_HASH_BLOB, *PEFS_HASH_BLOB; } EFS_HASH_BLOB, *PEFS_HASH_BLOB;
// EFS_RPC_BLOB was not available pre-WXP
#if (NTDDI_VERSION >= NTDDI_WINXP)
// //
// RPC blob // RPC blob
// //
typedef struct _EFS_RPC_BLOB { typedef struct _EFS_RPC_BLOB {
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0,266240)] [range(0,266240)]
#endif // MIDL_PASS #endif // MIDL_PASS
DWORD cbData; DWORD cbData;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[size_is(cbData)] [size_is(cbData)]
#endif // MIDL_PASS #endif // MIDL_PASS
PBYTE pbData; PBYTE pbData;
} EFS_RPC_BLOB, *PEFS_RPC_BLOB; } EFS_RPC_BLOB, *PEFS_RPC_BLOB;
#endif // #if (NTDDI_VERSION >= NTDDI_WINXP)
// EFS_PIN_BLOB was not available pre-LH
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
typedef struct _EFS_PIN_BLOB {
#ifdef MIDL_PASS
[range(0,8)]
#endif // MIDL_PASS
DWORD cbPadding;
#ifdef MIDL_PASS
[range(0,300)]
#endif // MIDL_PASS
DWORD cbData;
#ifdef MIDL_PASS
[size_is(cbData+cbPadding)]
#endif // MIDL_PASS
PBYTE pbData;
} EFS_PIN_BLOB, *PEFS_PIN_BLOB;
#endif // #if (NTDDI_VERSION >= NTDDI_LONGHORN)
// EFS_KEY_INFO was not available pre-WXP
#if (NTDDI_VERSION >= NTDDI_WINXP)
typedef struct _EFS_KEY_INFO { typedef struct _EFS_KEY_INFO {
DWORD dwVersion; DWORD dwVersion;
ULONG Entropy; ULONG Entropy;
ALG_ID Algorithm; ALG_ID Algorithm;
ULONG KeyLength; ULONG KeyLength;
} EFS_KEY_INFO, *PEFS_KEY_INFO; } EFS_KEY_INFO, *PEFS_KEY_INFO;
#endif // #if (NTDDI_VERSION >= NTDDI_WINXP)
// EFS_(EN/DE)CRYPTION_STATUS_INFO was not available pre-LH
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
typedef struct _EFS_DECRYPTION_STATUS_INFO {
DWORD dwDecryptionError;
DWORD dwHashOffset;
DWORD cbHash;
} EFS_DECRYPTION_STATUS_INFO, *PEFS_DECRYPTION_STATUS_INFO;
typedef struct _EFS_ENCRYPTION_STATUS_INFO {
BOOL bHasCurrentKey;
DWORD dwEncryptionError;
} EFS_ENCRYPTION_STATUS_INFO, *PEFS_ENCRYPTION_STATUS_INFO;
#endif // #if (NTDDI_VERSION >= NTDDI_LONGHORN)
// //
// Input to add a user to an encrypted file // Input to add a user to an encrypted file
// //
typedef struct _ENCRYPTION_CERTIFICATE { typedef struct _ENCRYPTION_CERTIFICATE {
DWORD cbTotalLength; DWORD cbTotalLength;
SID * pUserSid; SID * pUserSid;
PEFS_CERTIFICATE_BLOB pCertBlob; PEFS_CERTIFICATE_BLOB pCertBlob;
} ENCRYPTION_CERTIFICATE, *PENCRYPTION_CERTIFICATE; } ENCRYPTION_CERTIFICATE, *PENCRYPTION_CERTIFICATE;
skipping to change at line 147 skipping to change at line 212
typedef struct _ENCRYPTION_CERTIFICATE_LIST { typedef struct _ENCRYPTION_CERTIFICATE_LIST {
#ifdef MIDL_PASS #ifdef MIDL_PASS
[range(0,500)] [range(0,500)]
#endif // MIDL_PASS #endif // MIDL_PASS
DWORD nUsers; DWORD nUsers;
#ifdef MIDL_PASS #ifdef MIDL_PASS
[size_is(nUsers)] [size_is(nUsers)]
#endif // MIDL_PASS #endif // MIDL_PASS
PENCRYPTION_CERTIFICATE * pUsers; PENCRYPTION_CERTIFICATE * pUsers;
} ENCRYPTION_CERTIFICATE_LIST, *PENCRYPTION_CERTIFICATE_LIST; } ENCRYPTION_CERTIFICATE_LIST, *PENCRYPTION_CERTIFICATE_LIST;
// ENCRYPTED_FILE_METADATA_SIGNATURE was not available pre-LH
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
#define EFS_METADATA_ADD_USER 0x00000001
#define EFS_METADATA_REMOVE_USER 0x00000002
#define EFS_METADATA_REPLACE_USER 0x00000004
#define EFS_METADATA_GENERAL_OP 0x00000008
typedef struct _ENCRYPTED_FILE_METADATA_SIGNATURE {
DWORD dwEfsAcce
ssType;
PENCRYPTION_CERTIFICATE_HASH_LIST pCertificatesAdded;
PENCRYPTION_CERTIFICATE pEncryptionCertificate;
PEFS_RPC_BLOB pEfsStreamSignatu
re;
} ENCRYPTED_FILE_METADATA_SIGNATURE, *PENCRYPTED_FILE_METADATA_SIGNATURE;
#endif // #if (NTDDI_VERSION >= NTDDI_LONGHORN)
//+----------------------------------------------------------------------------- ----/ //+----------------------------------------------------------------------------- ----/
// / // /
// / // /
// Prototypes / // Prototypes /
// / // /
// / // /
//------------------------------------------------------------------------------ ----/ //------------------------------------------------------------------------------ ----/
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
QueryUsersOnEncryptedFile( QueryUsersOnEncryptedFile(
__in LPCWSTR lpFileName, __in LPCWSTR lpFileName,
__out PENCRYPTION_CERTIFICATE_HASH_LIST * pUsers __deref_out PENCRYPTION_CERTIFICATE_HASH_LIST *pUsers
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
QueryRecoveryAgentsOnEncryptedFile( QueryRecoveryAgentsOnEncryptedFile(
__in LPCWSTR lpFileName, __in LPCWSTR lpFileName,
__out PENCRYPTION_CERTIFICATE_HASH_LIST * pRecoveryAgents __deref_out 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 pUsers __in PENCRYPTION_CERTIFICATE_LIST pEncryptionCertificates
); );
WINADVAPI WINADVAPI
DWORD DWORD
WINAPI WINAPI
SetUserFileEncryptionKey( SetUserFileEncryptionKey(
__in_opt PENCRYPTION_CERTIFICATE pEncryptionCertificate __in PENCRYPTION_CERTIFICATE pEncryptionCertificate
);
// SetUserFileEncryptionKeyEx was not available pre-LH
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
WINADVAPI
DWORD
WINAPI
SetUserFileEncryptionKeyEx(
__in PENCRYPTION_CERTIFICATE pEncryptionCertificate,
DWORD dwCapabilities,
DWORD dwFlags,
__reserved LPVOID pvReserved
); );
#endif // #if (NTDDI_VERSION >= NTDDI_LONGHORN)
WINADVAPI WINADVAPI
VOID VOID
WINAPI WINAPI
FreeEncryptionCertificateHashList( FreeEncryptionCertificateHashList(
__in_opt PENCRYPTION_CERTIFICATE_HASH_LIST pHashes __in PENCRYPTION_CERTIFICATE_HASH_LIST pUsers
); );
WINADVAPI WINADVAPI
BOOL BOOL
WINAPI WINAPI
EncryptionDisable( EncryptionDisable(
__in LPCWSTR DirPath, __in LPCWSTR DirPath,
__in BOOL Disable BOOL Disable
); );
// DuplicateEncryptionInfoFile signature changed
// in WS03 to use a CONST SECURITY_ATTRIBUTES structure
#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,
__in DWORD dwCreationDistribution, DWORD dwCreationDistribution,
__in DWORD dwAttributes, DWORD dwAttributes,
__in CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes __in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
// DuplicateEncryptionInfoFile didn't exist pre-WXP
#elif (NTDDI_VERSION >= NTDDI_WINXP)
WINADVAPI
DWORD
WINAPI
DuplicateEncryptionInfoFile(
__in LPCWSTR SrcFileName,
__in LPCWSTR DstFileName,
DWORD dwCreationDistribution,
DWORD dwAttributes,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
#endif
// *EncryptedFileMetadata routines were not available pre-LH
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
WINADVAPI
DWORD
WINAPI
GetEncryptedFileMetadata(
__in LPCWSTR lpFileName,
__out PDWORD pcbMetadata,
__deref_out_bcount(*pcbMetadata) PBYTE *ppbMetadata
);
WINADVAPI
DWORD
WINAPI
SetEncryptedFileMetadata(
__in LPCWSTR lpFileName,
__in_opt PBYTE pbOldMetadata,
__in PBYTE pbNewMetadata,
__in PENCRYPTION_CERTIFICATE_HASH pOwnerHash,
DWORD dwOperation,
__in_opt PENCRYPTION_CERTIFICATE_HASH_LIST pCertificatesAdded
);
WINADVAPI
VOID
WINAPI
FreeEncryptedFileMetadata(
__in PBYTE pbMetadata
);
#endif // #if (NTDDI_VERSION >= NTDDI_LONGHORN)
#ifdef __cplusplus #ifdef __cplusplus
} // Balance extern "C" above } // Balance extern "C" above
#endif #endif
#endif // #if (NTDDI_VERSION >= NTDDI_WIN2K)
#endif // __WINEFS_H__ #endif // __WINEFS_H__
 End of changes. 20 change blocks. 
16 lines changed or deleted 173 lines changed or added


 winreg.h (5.2.3790.3959-Windows 5.0)   winreg.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 51 skipping to change at line 51
#define RRF_RT_REG_QWORD 0x00000040 // restrict type to REG_QWORD (ot her data types will not return ERROR_SUCCESS) #define RRF_RT_REG_QWORD 0x00000040 // restrict type to REG_QWORD (ot her data types will not return ERROR_SUCCESS)
#define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD) // restric t type to *32-bit* RRF_RT_REG_BINARY or RRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS) #define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD) // restric t type to *32-bit* RRF_RT_REG_BINARY or RRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS)
#define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD) // restric t type to *64-bit* RRF_RT_REG_BINARY or RRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS) #define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD) // restric t type to *64-bit* RRF_RT_REG_BINARY or RRF_RT_REG_DWORD (other data types will not return ERROR_SUCCESS)
#define RRF_RT_ANY 0x0000ffff // no type restriction #define RRF_RT_ANY 0x0000ffff // no type restriction
#define RRF_NOEXPAND 0x10000000 // do not automatically expand enviro nment strings if value is of type REG_EXPAND_SZ #define RRF_NOEXPAND 0x10000000 // do not automatically expand enviro nment strings if value is of type REG_EXPAND_SZ
#define RRF_ZEROONFAILURE 0x20000000 // if pvData is not NULL, set content to all zeros on failure #define RRF_ZEROONFAILURE 0x20000000 // if pvData is not NULL, set content to all zeros on failure
// //
// Flags for RegLoadAppKey
//
#define REG_PROCESS_APPKEY 0x00000001
//
// Flags for RegLoadMUIString
//
#define REG_MUI_STRING_TRUNCATE 0x00000001
//
// Requested Key access mask type. // Requested Key access mask type.
// //
typedef ACCESS_MASK REGSAM; typedef ACCESS_MASK REGSAM;
// //
// Reserved Key Handles. // Reserved Key Handles.
// //
#define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) ) #define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x800000
#define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x80000001) ) 00) )
#define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x80000002) ) #define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x800000
#define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x80000003) ) 01) )
#define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000004) ) #define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x800000
#define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000050) ) 02) )
#define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000060) ) #define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x800000
03) )
#define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x800000
04) )
#define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x800000
50) )
#define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x800000
60) )
#if(WINVER >= 0x0400) #if(WINVER >= 0x0400)
#define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x80000005) ) #define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x800000
#define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000006) ) 05) )
#define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x800000
06) )
// //
// RegConnectRegistryEx supported flags // RegConnectRegistryEx supported flags
// //
#define REG_SECURE_CONNECTION 1 #define REG_SECURE_CONNECTION 1
/*NOINC*/ /*NOINC*/
#ifndef _PROVIDER_STRUCTS_DEFINED #ifndef _PROVIDER_STRUCTS_DEFINED
#define _PROVIDER_STRUCTS_DEFINED #define _PROVIDER_STRUCTS_DEFINED
skipping to change at line 163 skipping to change at line 173
// 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;
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegCloseKey ( RegCloseKey (
__in HKEY hKey __in HKEY hKey
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegOverridePredefKey ( RegOverridePredefKey (
__in HKEY hKey, __in HKEY hKey,
__in_opt HKEY hNewHKey __in_opt HKEY hNewHKey
); );
WINADVAPI WINADVAPI
LONG 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
LONG LSTATUS
APIENTRY APIENTRY
RegOpenCurrentUser( RegOpenCurrentUser(
__in REGSAM samDesired, __in REGSAM samDesired,
__out PHKEY phkResult __out PHKEY phkResult
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegDisablePredefinedCache( RegDisablePredefinedCache(
VOID
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY
RegDisablePredefinedCacheEx(
VOID
);
WINADVAPI
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
LONG 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
LONG 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
LONG 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
LONG 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
LONG 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
LONG 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 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
LONG 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 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
LONG LSTATUS
APIENTRY
RegCreateKeyTransactedA (
__in HKEY hKey,
__in LPCSTR lpSubKey,
__reserved DWORD Reserved,
__in_opt LPSTR lpClass,
__in DWORD dwOptions,
__in REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParemeter
);
WINADVAPI
LSTATUS
APIENTRY
RegCreateKeyTransactedW (
__in HKEY hKey,
__in LPCWSTR lpSubKey,
__reserved DWORD Reserved,
__in_opt LPWSTR lpClass,
__in DWORD dwOptions,
__in REGSAM samDesired,
__in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__out PHKEY phkResult,
__out_opt LPDWORD lpdwDisposition,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParemeter
);
#ifdef UNICODE
#define RegCreateKeyTransacted RegCreateKeyTransactedW
#else
#define RegCreateKeyTransacted RegCreateKeyTransactedA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY APIENTRY
RegDeleteKeyA ( RegDeleteKeyA (
__in HKEY hKey, __in HKEY hKey,
__in LPCSTR lpSubKey __in LPCSTR lpSubKey
); );
WINADVAPI WINADVAPI
LONG 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
LONG 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
LONG 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
APIENTRY
RegDeleteKeyTransactedA (
__in HKEY hKey,
__in LPCSTR lpSubKey,
__in REGSAM samDesired,
__reserved DWORD Reserved,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParameter
);
WINADVAPI
LSTATUS
APIENTRY
RegDeleteKeyTransactedW (
__in HKEY hKey,
__in LPCWSTR lpSubKey,
__in REGSAM samDesired,
__reserved DWORD Reserved,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParameter
);
#ifdef UNICODE
#define RegDeleteKeyTransacted RegDeleteKeyTransactedW
#else
#define RegDeleteKeyTransacted RegDeleteKeyTransactedA
#endif // !UNICODE
WINADVAPI
LONG LONG
APIENTRY APIENTRY
RegDisableReflectionKey ( RegDisableReflectionKey (
__in HKEY hBase __in HKEY hBase
); );
WINADVAPI WINADVAPI
LONG LONG
APIENTRY APIENTRY
RegEnableReflectionKey ( RegEnableReflectionKey (
skipping to change at line 371 skipping to change at line 457
WINADVAPI WINADVAPI
LONG LONG
APIENTRY APIENTRY
RegQueryReflectionKey ( RegQueryReflectionKey (
__in HKEY hBase, __in HKEY hBase,
__out BOOL *bIsReflectionDisabled __out BOOL *bIsReflectionDisabled
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegDeleteValueA ( RegDeleteValueA (
__in HKEY hKey, __in HKEY hKey,
__in_opt LPCSTR lpValueName __in_opt LPCSTR lpValueName
); );
WINADVAPI WINADVAPI
LONG 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
LONG LSTATUS
APIENTRY APIENTRY
RegEnumKeyA ( RegEnumKeyA (
__in HKEY hKey, __in HKEY hKey,
__in DWORD dwIndex, __in DWORD dwIndex,
__out_ecount_opt(cchName) LPSTR lpName, __out_ecount_part_opt(cchName,cchName + 1) LPSTR lpName,
__in DWORD cchName __in DWORD cchName
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegEnumKeyW ( RegEnumKeyW (
__in HKEY hKey, __in HKEY hKey,
__in DWORD dwIndex, __in DWORD dwIndex,
__out_ecount_opt(cchName) LPWSTR lpName, __out_ecount_part_opt(cchName,cchName + 1) 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
LONG LSTATUS
APIENTRY APIENTRY
RegEnumKeyExA ( RegEnumKeyExA (
__in HKEY hKey, __in HKEY hKey,
__in DWORD dwIndex, __in DWORD dwIndex,
__out_ecount_opt(*lpcchName) LPSTR lpName, __out_ecount_part_opt(*lpcchName, *lpcchName + 1) LPSTR lpName,
__inout LPDWORD lpcchName, __inout LPDWORD lpcchName,
__reserved LPDWORD lpReserved, __reserved LPDWORD lpReserved,
__inout_ecount_opt(*lpcchClass) LPSTR lpClass, __out_ecount_part_opt(*lpcchClass,*lpcchClass + 1) LPSTR lpClass,
__inout_opt LPDWORD lpcchClass, __inout_opt LPDWORD lpcchClass,
__out_opt PFILETIME lpftLastWriteTime __out_opt PFILETIME lpftLastWriteTime
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegEnumKeyExW ( RegEnumKeyExW (
__in HKEY hKey, __in HKEY hKey,
__in DWORD dwIndex, __in DWORD dwIndex,
__out_ecount_opt(*lpcchName) LPWSTR lpName, __out_ecount_part_opt(*lpcchName, *lpcchName + 1) LPWSTR lpName,
__inout LPDWORD lpcchName, __inout LPDWORD lpcchName,
__reserved LPDWORD lpReserved, __reserved LPDWORD lpReserved,
__inout_ecount_opt(*lpcchClass) LPWSTR lpClass, __out_ecount_part_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
LONG LSTATUS
APIENTRY APIENTRY
RegEnumValueA ( RegEnumValueA (
__in HKEY hKey, __in HKEY hKey,
__in DWORD dwIndex, __in DWORD dwIndex,
__out_ecount_opt(*lpcchValueName) LPSTR lpValueName, __out_ecount_part_opt(*lpcchValueName, *lpcchValueName + 1) LPSTR lpValueNam e,
__inout LPDWORD lpcchValueName, __inout LPDWORD lpcchValueName,
__reserved LPDWORD lpReserved, __reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType, __out_opt LPDWORD lpType,
__out_bcount_opt(*lpcbData) LPBYTE lpData, __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY TE lpData,
__inout_opt LPDWORD lpcbData __inout_opt LPDWORD lpcbData
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegEnumValueW ( RegEnumValueW (
__in HKEY hKey, __in HKEY hKey,
__in DWORD dwIndex, __in DWORD dwIndex,
__out_ecount_opt(*lpcchValueName) LPWSTR lpValueName, __out_ecount_part_opt(*lpcchValueName, *lpcchValueName + 1) LPWSTR lpValueNa me,
__inout LPDWORD lpcchValueName, __inout LPDWORD lpcchValueName,
__reserved LPDWORD lpReserved, __reserved LPDWORD lpReserved,
__out_opt LPDWORD lpType, __out_opt LPDWORD lpType,
__out_bcount_opt(*lpcbData) LPBYTE lpData, __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY TE 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
LONG LSTATUS
APIENTRY APIENTRY
RegFlushKey ( RegFlushKey (
__in HKEY hKey __in HKEY hKey
); );
WINADVAPI WINADVAPI
LONG 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 riptor, __out_bcount_opt(*lpcbSecurityDescriptor) PSECURITY_DESCRIPTOR pSecurityDesc riptor,
__inout LPDWORD lpcbSecurityDescriptor __inout LPDWORD lpcbSecurityDescriptor
); );
WINADVAPI WINADVAPI
LONG 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
LONG 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
LONG 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
LONG 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
LONG 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
LONG LSTATUS
APIENTRY APIENTRY
RegOpenKeyExA ( RegOpenKeyExA (
__in HKEY hKey, __in HKEY hKey,
__in_opt LPCSTR lpSubKey, __in_opt LPCSTR lpSubKey,
__reserved DWORD ulOptions, __reserved DWORD ulOptions,
__in REGSAM samDesired, __in REGSAM samDesired,
__out PHKEY phkResult __out PHKEY phkResult
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegOpenKeyExW ( RegOpenKeyExW (
__in HKEY hKey, __in HKEY hKey,
__in_opt LPCWSTR lpSubKey, __in_opt LPCWSTR lpSubKey,
__reserved DWORD ulOptions, __reserved 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
LONG LSTATUS
APIENTRY
RegOpenKeyTransactedA (
__in HKEY hKey,
__in_opt LPCSTR lpSubKey,
__in DWORD ulOptions,
__in REGSAM samDesired,
__out PHKEY phkResult,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParemeter
);
WINADVAPI
LSTATUS
APIENTRY
RegOpenKeyTransactedW (
__in HKEY hKey,
__in_opt LPCWSTR lpSubKey,
__in DWORD ulOptions,
__in REGSAM samDesired,
__out PHKEY phkResult,
__in HANDLE hTransaction,
__reserved PVOID pExtendedParemeter
);
#ifdef UNICODE
#define RegOpenKeyTransacted RegOpenKeyTransactedW
#else
#define RegOpenKeyTransacted RegOpenKeyTransactedA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY APIENTRY
RegQueryInfoKeyA ( RegQueryInfoKeyA (
__in HKEY hKey, __in HKEY hKey,
__out_ecount_opt(*lpcchClass) LPSTR lpClass, __out_ecount_part_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
LONG LSTATUS
APIENTRY APIENTRY
RegQueryInfoKeyW ( RegQueryInfoKeyW (
__in HKEY hKey, __in HKEY hKey,
__out_ecount_opt(*lpcchClass) LPWSTR lpClass, __out_ecount_part_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
LONG LSTATUS
APIENTRY APIENTRY
RegQueryValueA ( RegQueryValueA (
__in HKEY hKey, __in HKEY hKey,
__in_opt LPCSTR lpSubKey, __in_opt LPCSTR lpSubKey,
__out_bcount_opt(*lpcbData) LPSTR lpData, __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPST R lpData,
__inout_opt PLONG lpcbData __inout_opt PLONG lpcbData
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegQueryValueW ( RegQueryValueW (
__in HKEY hKey, __in HKEY hKey,
__in_opt LPCWSTR lpSubKey, __in_opt LPCWSTR lpSubKey,
__out_bcount_opt(*lpcbData) LPWSTR lpData, __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPWS TR 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
LONG LSTATUS
APIENTRY APIENTRY
RegQueryMultipleValuesA ( RegQueryMultipleValuesA (
__in HKEY hKey, __in HKEY hKey,
__out_ecount(num_vals) PVALENTA val_list, __out_ecount(num_vals) PVALENTA val_list,
__in DWORD num_vals, __in DWORD num_vals,
__out_bcount_opt(*ldwTotsize) LPSTR lpValueBuf, __out_bcount_part_opt(*ldwTotsize, *ldwTotsize) __out_data_source(REGISTRY) LPSTR lpValueBuf,
__inout_opt LPDWORD ldwTotsize __inout_opt LPDWORD ldwTotsize
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegQueryMultipleValuesW ( RegQueryMultipleValuesW (
__in HKEY hKey, __in HKEY hKey,
__out_ecount(num_vals) PVALENTW val_list, __out_ecount(num_vals) PVALENTW val_list,
__in DWORD num_vals, __in DWORD num_vals,
__out_bcount_opt(*ldwTotsize) LPWSTR lpValueBuf, __out_bcount_part_opt(*ldwTotsize, *ldwTotsize) __out_data_source(REGISTRY) 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
LONG 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_opt(*lpcbData) LPBYTE lpData, __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY TE lpData,
__inout_opt LPDWORD lpcbData __inout_opt LPDWORD lpcbData
); );
WINADVAPI WINADVAPI
LONG 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_opt(*lpcbData) LPBYTE lpData, __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBY TE lpData,
__inout_opt LPDWORD lpcbData __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
LONG 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
LONG 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
LONG 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
LONG 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
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegSaveKeyA ( RegSaveKeyA (
__in HKEY hKey, __in HKEY hKey,
__in LPCSTR lpFile, __in LPCSTR lpFile,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes __in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegSaveKeyW ( RegSaveKeyW (
__in HKEY hKey, __in HKEY hKey,
__in LPCWSTR lpFile, __in LPCWSTR lpFile,
__in_opt 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
LONG 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
LONG 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_bcount_opt(cbData) LPCSTR lpData,
__in DWORD cbData __in DWORD cbData
); );
WINADVAPI WINADVAPI
LONG 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_bcount_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
LONG 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_bcount_opt(cbData) CONST BYTE* lpData,
__in DWORD cbData __in DWORD cbData
); );
WINADVAPI WINADVAPI
LONG 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_bcount_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
LONG LSTATUS
APIENTRY APIENTRY
RegUnLoadKeyA ( RegUnLoadKeyA (
__in HKEY hKey, __in HKEY hKey,
__in_opt LPCSTR lpSubKey __in_opt LPCSTR lpSubKey
); );
WINADVAPI WINADVAPI
LONG 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
//
#if _WIN32_WINNT >= 0x0600
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY
RegDeleteKeyValueA (
__in HKEY hKey,
__in_opt LPCSTR lpSubKey,
__in_opt LPCSTR lpValueName
);
WINADVAPI
LSTATUS
APIENTRY
RegDeleteKeyValueW (
__in HKEY hKey,
__in_opt LPCWSTR lpSubKey,
__in_opt LPCWSTR lpValueName
);
#ifdef UNICODE
#define RegDeleteKeyValue RegDeleteKeyValueW
#else
#define RegDeleteKeyValue RegDeleteKeyValueA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY
RegSetKeyValueA (
__in HKEY hKey,
__in_opt LPCSTR lpSubKey,
__in_opt LPCSTR lpValueName,
__in DWORD dwType,
__in_bcount_opt(cbData) LPCVOID lpData,
__in DWORD cbData
);
WINADVAPI
LSTATUS
APIENTRY
RegSetKeyValueW (
__in HKEY hKey,
__in_opt LPCWSTR lpSubKey,
__in_opt LPCWSTR lpValueName,
__in DWORD dwType,
__in_bcount_opt(cbData) LPCVOID lpData,
__in DWORD cbData
);
#ifdef UNICODE
#define RegSetKeyValue RegSetKeyValueW
#else
#define RegSetKeyValue RegSetKeyValueA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY
RegDeleteTreeA (
__in HKEY hKey,
__in_opt LPCSTR lpSubKey
);
WINADVAPI
LSTATUS
APIENTRY
RegDeleteTreeW (
__in HKEY hKey,
__in_opt LPCWSTR lpSubKey
);
#ifdef UNICODE
#define RegDeleteTree RegDeleteTreeW
#else
#define RegDeleteTree RegDeleteTreeA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY
RegCopyTreeA (
__in HKEY hKeySrc,
__in_opt LPCSTR lpSubKey,
__in HKEY hKeyDest
);
WINADVAPI
LSTATUS
APIENTRY
RegCopyTreeW (
__in HKEY hKeySrc,
__in_opt LPCWSTR lpSubKey,
__in HKEY hKeyDest
);
#ifdef UNICODE
#define RegCopyTree RegCopyTreeW
#else
#define RegCopyTree RegCopyTreeA
#endif // !UNICODE
WINADVAPI
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_opt DWORD dwFlags,
__out_opt LPDWORD pdwType, __out_opt LPDWORD pdwType,
__out_bcount_opt(*pcbData) PVOID pvData, __out_bcount_part_opt(*pcbData,*pcbData) PVOID pvData,
__inout_opt LPDWORD pcbData __inout_opt LPDWORD pcbData
); );
WINADVAPI WINADVAPI
LONG 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_opt DWORD dwFlags,
__out_opt LPDWORD pdwType, __out_opt LPDWORD pdwType,
__out_bcount_opt(*pcbData) PVOID pvData, __out_bcount_part_opt(*pcbData,*pcbData) PVOID pvData,
__inout_opt LPDWORD pcbData __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
WINADVAPI
LSTATUS
APIENTRY
RegLoadMUIStringA (
__in HKEY hKey,
__in_opt LPCSTR pszValue,
__out_bcount_opt(cbOutBuf) LPSTR pszOutBuf,
__in DWORD cbOutBuf,
__out_opt LPDWORD pcbData,
__in DWORD Flags,
__in_opt LPCSTR pszDirectory
);
WINADVAPI
LSTATUS
APIENTRY
RegLoadMUIStringW (
__in HKEY hKey,
__in_opt LPCWSTR pszValue,
__out_bcount_opt(cbOutBuf) LPWSTR pszOutBuf,
__in DWORD cbOutBuf,
__out_opt LPDWORD pcbData,
__in DWORD Flags,
__in_opt LPCWSTR pszDirectory
);
#ifdef UNICODE
#define RegLoadMUIString RegLoadMUIStringW
#else
#define RegLoadMUIString RegLoadMUIStringA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY
RegLoadAppKeyA (
__in LPCSTR lpFile,
__out PHKEY phkResult,
__in REGSAM samDesired,
__in DWORD dwOptions,
__reserved DWORD Reserved
);
WINADVAPI
LSTATUS
APIENTRY
RegLoadAppKeyW (
__in LPCWSTR lpFile,
__out PHKEY phkResult,
__in REGSAM samDesired,
__in DWORD dwOptions,
__reserved DWORD Reserved
);
#ifdef UNICODE
#define RegLoadAppKey RegLoadAppKeyW
#else
#define RegLoadAppKey RegLoadAppKeyA
#endif // !UNICODE
#endif // _WIN32_WINNT >= 0x0600
// //
// Remoteable System Shutdown APIs // Remoteable System Shutdown APIs
// //
WINADVAPI WINADVAPI
BOOL BOOL
APIENTRY APIENTRY
InitiateSystemShutdownA( InitiateSystemShutdownA(
__in_opt LPSTR lpMachineName, __in_opt LPSTR lpMachineName,
__in_opt LPSTR lpMessage, __in_opt LPSTR lpMessage,
skipping to change at line 933 skipping to change at line 1205
#endif // !UNICODE #endif // !UNICODE
// //
// defines for InitiateSystemShutdownEx reason codes // defines for InitiateSystemShutdownEx reason codes
// //
#include <reason.h> // get the public reasons #include <reason.h> // get the public reasons
// //
// Then for Historical reasons support some old symbols, internal only // Then for Historical reasons support some old symbols, internal only
#define REASON_SWINSTALL SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_INSTA #define REASON_SWINSTALL (SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_INST
LLATION ALLATION)
#define REASON_HWINSTALL SHTDN_REASON_MAJOR_HARDWARE|SHTDN_REASON_MINOR_INSTA #define REASON_HWINSTALL (SHTDN_REASON_MAJOR_HARDWARE|SHTDN_REASON_MINOR_INST
LLATION ALLATION)
#define REASON_SERVICEHANG SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_HUNG #define REASON_SERVICEHANG (SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_HUNG
#define REASON_UNSTABLE SHTDN_REASON_MAJOR_SYSTEM|SHTDN_REASON_MINOR_UNSTABL )
E #define REASON_UNSTABLE (SHTDN_REASON_MAJOR_SYSTEM|SHTDN_REASON_MINOR_UNSTAB
#define REASON_SWHWRECONF SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_RECON LE)
FIG #define REASON_SWHWRECONF (SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_RECO
#define REASON_OTHER SHTDN_REASON_MAJOR_OTHER|SHTDN_REASON_MINOR_OTHER NFIG)
#define REASON_OTHER (SHTDN_REASON_MAJOR_OTHER|SHTDN_REASON_MINOR_OTHER)
#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)
WINADVAPI WINADVAPI
skipping to change at line 976 skipping to change at line 1248
__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
//
#define SHUTDOWN_FORCE_OTHERS 0x00000001
#define SHUTDOWN_FORCE_SELF 0x00000002
#define SHUTDOWN_RESTART 0x00000004
#define SHUTDOWN_POWEROFF 0x00000008
#define SHUTDOWN_NOREBOOT 0x00000010
#define SHUTDOWN_GRACE_OVERRIDE 0x00000020
#define SHUTDOWN_INSTALL_UPDATES 0x00000040
#define SHUTDOWN_RESTARTAPPS 0x00000080
WINADVAPI WINADVAPI
LONG DWORD
APIENTRY
InitiateShutdownA(
__in_opt LPSTR lpMachineName,
__in_opt LPSTR lpMessage,
__in DWORD dwGracePeriod,
__in DWORD dwShutdownFlags,
__in DWORD dwReason
);
WINADVAPI
DWORD
APIENTRY
InitiateShutdownW(
__in_opt LPWSTR lpMachineName,
__in_opt LPWSTR lpMessage,
__in DWORD dwGracePeriod,
__in DWORD dwShutdownFlags,
__in DWORD dwReason
);
#ifdef UNICODE
#define InitiateShutdown InitiateShutdownW
#else
#define InitiateShutdown InitiateShutdownA
#endif // !UNICODE
WINADVAPI
LSTATUS
APIENTRY APIENTRY
RegSaveKeyExA ( RegSaveKeyExA (
__in HKEY hKey, __in HKEY hKey,
__in LPCSTR lpFile, __in LPCSTR lpFile,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes, __in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD Flags __in DWORD Flags
); );
WINADVAPI WINADVAPI
LONG LSTATUS
APIENTRY APIENTRY
RegSaveKeyExW ( RegSaveKeyExW (
__in HKEY hKey, __in HKEY hKey,
__in LPCWSTR lpFile, __in LPCWSTR lpFile,
__in_opt 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
WINADVAPI WINADVAPI
LONG LONG
 End of changes. 96 change blocks. 
104 lines changed or deleted 425 lines changed or added


 winsafer.h (5.2.3790.3959-Windows 5.0)   winsafer.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 191 skipping to change at line 191
// //
// 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
#define SAFER_POLICY_ONLY_EXES 0x00010000 #define SAFER_POLICY_ONLY_EXES 0x00010000
#define SAFER_POLICY_SANDBOX_INERT 0x00020000 #define SAFER_POLICY_SANDBOX_INERT 0x00020000
#define SAFER_POLICY_HASH_DUPLICATE 0x00040000 #define SAFER_POLICY_HASH_DUPLICATE 0x00040000
#define SAFER_POLICY_ONLY_AUDIT 0x00001000
#define SAFER_POLICY_BLOCK_CLIENT_UI 0x00002000
#define SAFER_POLICY_UIFLAGS_MASK 0x000000FF #define SAFER_POLICY_UIFLAGS_MASK 0x000000FF
#define SAFER_POLICY_UIFLAGS_INFORMATION_PROMPT 0x00000001 #define SAFER_POLICY_UIFLAGS_INFORMATION_PROMPT 0x00000001
#define SAFER_POLICY_UIFLAGS_OPTION_PROMPT 0x00000002 #define SAFER_POLICY_UIFLAGS_OPTION_PROMPT 0x00000002
#define SAFER_POLICY_UIFLAGS_HIDDEN 0x00000004 #define SAFER_POLICY_UIFLAGS_HIDDEN 0x00000004
// //
// Information classes on the overall policy that can be queried // Information classes on the overall policy that can be queried
// with SaferSet/GetPolicyInformation and set at different // with SaferSet/GetPolicyInformation and set at different
// policy scopes based on access of the caller. // policy scopes based on access of the caller.
// //
skipping to change at line 243 skipping to change at line 245
SaferPolicyDefaultLevel, SaferPolicyDefaultLevel,
// //
// Returns whether Code Identities or Default Level within the // Returns whether Code Identities or Default Level within the
// user scope can be considered during identification. // user scope can be considered during identification.
// //
SaferPolicyEvaluateUserScope, SaferPolicyEvaluateUserScope,
// //
// Control Flags for for safer policy scope. // Control Flags for safer policy scope.
// //
SaferPolicyScopeFlags SaferPolicyScopeFlags,
//
// Flags which indicate "audit" or "block client UI" rules
//
SaferPolicyDefaultLevelFlags,
//
// Flag which indicates if certificate rules are applied in CreateProcess
//
SaferPolicyAuthenticodeEnabled
} SAFER_POLICY_INFO_CLASS; } SAFER_POLICY_INFO_CLASS;
// //
// Enumerations used for retrieving specific information about a // Enumerations used for retrieving specific information about a
// single authorization Level via SaferGet/SetInformationFromLevel. // single authorization Level via SaferGet/SetInformationFromLevel.
// //
typedef enum _SAFER_OBJECT_INFO_CLASS typedef enum _SAFER_OBJECT_INFO_CLASS
{ {
skipping to change at line 427 skipping to change at line 439
LARGE_INTEGER ImageSize; LARGE_INTEGER ImageSize;
// //
// any combo of SAFER_POLICY_* flags // any combo of SAFER_POLICY_* flags
// //
DWORD dwSaferFlags; DWORD dwSaferFlags;
} SAFER_HASH_IDENTIFICATION, *PSAFER_HASH_IDENTIFICATION; } SAFER_HASH_IDENTIFICATION, *PSAFER_HASH_IDENTIFICATION;
typedef struct _SAFER_URLZONE_IDENTIFICATION typedef struct _SAFER_HASH_IDENTIFICATION2
{ {
//
// Start by including the original structure. It contains number of bytes
// in this particular structure.
//
SAFER_HASH_IDENTIFICATION hashIdentification;
//
// amount of ImageHash actually used, in bytes (SHA256 is 32 bytes).
//
DWORD HashSize;
//
// computed hash data itself.
//
BYTE ImageHash[SAFER_MAX_HASH_SIZE];
//
// algorithm in which the hash was computed (CALG_SHA256).
//
ALG_ID HashAlgorithm;
} SAFER_HASH_IDENTIFICATION2, *PSAFER_HASH_IDENTIFICATION2;
typedef struct _SAFER_URLZONE_IDENTIFICATION
{
// //
// header.dwIdentificationType must be SaferIdentityTypeUrlZone // header.dwIdentificationType must be SaferIdentityTypeUrlZone
// header.cbStructSize must be sizeof(SAFER_URLZONE_IDENTIFICATION) // header.cbStructSize must be sizeof(SAFER_URLZONE_IDENTIFICATION)
// //
SAFER_IDENTIFICATION_HEADER header; SAFER_IDENTIFICATION_HEADER header;
// //
// any single URLZONE_* from urlmon.h // any single URLZONE_* from urlmon.h
// //
 End of changes. 6 change blocks. 
3 lines changed or deleted 45 lines changed or added


 winsvc.h (5.2.3790.3959-Windows 5.0)   winsvc.h (6.0.6002.18005-Windows 6.0) 
skipping to change at line 103 skipping to change at line 103
#define SERVICE_CONTROL_SHUTDOWN 0x00000005 #define SERVICE_CONTROL_SHUTDOWN 0x00000005
#define SERVICE_CONTROL_PARAMCHANGE 0x00000006 #define SERVICE_CONTROL_PARAMCHANGE 0x00000006
#define SERVICE_CONTROL_NETBINDADD 0x00000007 #define SERVICE_CONTROL_NETBINDADD 0x00000007
#define SERVICE_CONTROL_NETBINDREMOVE 0x00000008 #define SERVICE_CONTROL_NETBINDREMOVE 0x00000008
#define SERVICE_CONTROL_NETBINDENABLE 0x00000009 #define SERVICE_CONTROL_NETBINDENABLE 0x00000009
#define SERVICE_CONTROL_NETBINDDISABLE 0x0000000A #define SERVICE_CONTROL_NETBINDDISABLE 0x0000000A
#define SERVICE_CONTROL_DEVICEEVENT 0x0000000B #define SERVICE_CONTROL_DEVICEEVENT 0x0000000B
#define SERVICE_CONTROL_HARDWAREPROFILECHANGE 0x0000000C #define SERVICE_CONTROL_HARDWAREPROFILECHANGE 0x0000000C
#define SERVICE_CONTROL_POWEREVENT 0x0000000D #define SERVICE_CONTROL_POWEREVENT 0x0000000D
#define SERVICE_CONTROL_SESSIONCHANGE 0x0000000E #define SERVICE_CONTROL_SESSIONCHANGE 0x0000000E
#define SERVICE_CONTROL_PRESHUTDOWN 0x0000000F
// //
// Service State -- for CurrentState // Service State -- for CurrentState
// //
#define SERVICE_STOPPED 0x00000001 #define SERVICE_STOPPED 0x00000001
#define SERVICE_START_PENDING 0x00000002 #define SERVICE_START_PENDING 0x00000002
#define SERVICE_STOP_PENDING 0x00000003 #define SERVICE_STOP_PENDING 0x00000003
#define SERVICE_RUNNING 0x00000004 #define SERVICE_RUNNING 0x00000004
#define SERVICE_CONTINUE_PENDING 0x00000005 #define SERVICE_CONTINUE_PENDING 0x00000005
#define SERVICE_PAUSE_PENDING 0x00000006 #define SERVICE_PAUSE_PENDING 0x00000006
skipping to change at line 126 skipping to change at line 127
// Controls Accepted (Bit Mask) // Controls Accepted (Bit Mask)
// //
#define SERVICE_ACCEPT_STOP 0x00000001 #define SERVICE_ACCEPT_STOP 0x00000001
#define SERVICE_ACCEPT_PAUSE_CONTINUE 0x00000002 #define SERVICE_ACCEPT_PAUSE_CONTINUE 0x00000002
#define SERVICE_ACCEPT_SHUTDOWN 0x00000004 #define SERVICE_ACCEPT_SHUTDOWN 0x00000004
#define SERVICE_ACCEPT_PARAMCHANGE 0x00000008 #define SERVICE_ACCEPT_PARAMCHANGE 0x00000008
#define SERVICE_ACCEPT_NETBINDCHANGE 0x00000010 #define SERVICE_ACCEPT_NETBINDCHANGE 0x00000010
#define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 0x00000020 #define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 0x00000020
#define SERVICE_ACCEPT_POWEREVENT 0x00000040 #define SERVICE_ACCEPT_POWEREVENT 0x00000040
#define SERVICE_ACCEPT_SESSIONCHANGE 0x00000080 #define SERVICE_ACCEPT_SESSIONCHANGE 0x00000080
#define SERVICE_ACCEPT_PRESHUTDOWN 0x00000100
// //
// Service Control Manager object specific access types // Service Control Manager object specific access types
// //
#define SC_MANAGER_CONNECT 0x0001 #define SC_MANAGER_CONNECT 0x0001
#define SC_MANAGER_CREATE_SERVICE 0x0002 #define SC_MANAGER_CREATE_SERVICE 0x0002
#define SC_MANAGER_ENUMERATE_SERVICE 0x0004 #define SC_MANAGER_ENUMERATE_SERVICE 0x0004
#define SC_MANAGER_LOCK 0x0008 #define SC_MANAGER_LOCK 0x0008
#define SC_MANAGER_QUERY_LOCK_STATUS 0x0010 #define SC_MANAGER_QUERY_LOCK_STATUS 0x0010
#define SC_MANAGER_MODIFY_BOOT_CONFIG 0x0020 #define SC_MANAGER_MODIFY_BOOT_CONFIG 0x0020
skipping to change at line 177 skipping to change at line 179
SERVICE_USER_DEFINED_CONTROL) SERVICE_USER_DEFINED_CONTROL)
// //
// Service flags for QueryServiceStatusEx // Service flags for QueryServiceStatusEx
// //
#define SERVICE_RUNS_IN_SYSTEM_PROCESS 0x00000001 #define SERVICE_RUNS_IN_SYSTEM_PROCESS 0x00000001
// //
// Info levels for ChangeServiceConfig2 and QueryServiceConfig2 // Info levels for ChangeServiceConfig2 and QueryServiceConfig2
// //
#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_FAILURE_ACTIONS_FLAG 4
#define SERVICE_CONFIG_SERVICE_SID_INFO 5
#define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6
#define SERVICE_CONFIG_PRESHUTDOWN_INFO 7
//
// Info levels for NotifyServiceStatusChange
//
#define SERVICE_NOTIFY_STATUS_CHANGE_1 1
#define SERVICE_NOTIFY_STATUS_CHANGE_2 2
#define SERVICE_NOTIFY_STATUS_CHANGE SERVICE_NOTIFY_STATUS_CHANGE_2
//
// Service notification masks
//
#define SERVICE_NOTIFY_STOPPED 0x00000001
#define SERVICE_NOTIFY_START_PENDING 0x00000002
#define SERVICE_NOTIFY_STOP_PENDING 0x00000004
#define SERVICE_NOTIFY_RUNNING 0x00000008
#define SERVICE_NOTIFY_CONTINUE_PENDING 0x00000010
#define SERVICE_NOTIFY_PAUSE_PENDING 0x00000020
#define SERVICE_NOTIFY_PAUSED 0x00000040
#define SERVICE_NOTIFY_CREATED 0x00000080
#define SERVICE_NOTIFY_DELETED 0x00000100
#define SERVICE_NOTIFY_DELETE_PENDING 0x00000200
//
// The following defines are for service stop reason codes
//
//
// Stop reason flags. Update SERVICE_STOP_REASON_FLAG_MAX when
// new flags are added.
//
#define SERVICE_STOP_REASON_FLAG_MIN 0x00000000
#define SERVICE_STOP_REASON_FLAG_UNPLANNED 0x10000000
#define SERVICE_STOP_REASON_FLAG_CUSTOM 0x20000000
#define SERVICE_STOP_REASON_FLAG_PLANNED 0x40000000
#define SERVICE_STOP_REASON_FLAG_MAX 0x80000000
//
// Microsoft major reasons. Update SERVICE_STOP_REASON_MAJOR_MAX when
// new codes are added.
//
#define SERVICE_STOP_REASON_MAJOR_MIN 0x00000000
#define SERVICE_STOP_REASON_MAJOR_OTHER 0x00010000
#define SERVICE_STOP_REASON_MAJOR_HARDWARE 0x00020000
#define SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM 0x00030000
#define SERVICE_STOP_REASON_MAJOR_SOFTWARE 0x00040000
#define SERVICE_STOP_REASON_MAJOR_APPLICATION 0x00050000
#define SERVICE_STOP_REASON_MAJOR_NONE 0x00060000
#define SERVICE_STOP_REASON_MAJOR_MAX 0x00070000
#define SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM 0x00400000
#define SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM 0x00ff0000
//
// Microsoft minor reasons. Update SERVICE_STOP_REASON_MINOR_MAX when
// new codes are added.
//
#define SERVICE_STOP_REASON_MINOR_MIN 0x00000000
#define SERVICE_STOP_REASON_MINOR_OTHER 0x00000001
#define SERVICE_STOP_REASON_MINOR_MAINTENANCE 0x00000002
#define SERVICE_STOP_REASON_MINOR_INSTALLATION 0x00000003
#define SERVICE_STOP_REASON_MINOR_UPGRADE 0x00000004
#define SERVICE_STOP_REASON_MINOR_RECONFIG 0x00000005
#define SERVICE_STOP_REASON_MINOR_HUNG 0x00000006
#define SERVICE_STOP_REASON_MINOR_UNSTABLE 0x00000007
#define SERVICE_STOP_REASON_MINOR_DISK 0x00000008
#define SERVICE_STOP_REASON_MINOR_NETWORKCARD 0x00000009
#define SERVICE_STOP_REASON_MINOR_ENVIRONMENT 0x0000000a
#define SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER 0x0000000b
#define SERVICE_STOP_REASON_MINOR_OTHERDRIVER 0x0000000c
#define SERVICE_STOP_REASON_MINOR_SERVICEPACK 0x0000000d
#define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE 0x0000000e
#define SERVICE_STOP_REASON_MINOR_SECURITYFIX 0x0000000f
#define SERVICE_STOP_REASON_MINOR_SECURITY 0x00000010
#define SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY 0x00000011
#define SERVICE_STOP_REASON_MINOR_WMI 0x00000012
#define SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL 0x00000013
#define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL 0x00000014
#define SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL 0x00000015
#define SERVICE_STOP_REASON_MINOR_MMC 0x00000016
#define SERVICE_STOP_REASON_MINOR_NONE 0x00000017
#define SERVICE_STOP_REASON_MINOR_MAX 0x00000018
#define SERVICE_STOP_REASON_MINOR_MIN_CUSTOM 0x00000100
#define SERVICE_STOP_REASON_MINOR_MAX_CUSTOM 0x0000FFFF
//
// Info levels for ControlServiceEx
//
#define SERVICE_CONTROL_STATUS_REASON_INFO 1
//
// Service SID types supported
//
#define SERVICE_SID_TYPE_NONE 0x00000000
#define SERVICE_SID_TYPE_UNRESTRICTED 0x00000001
#define SERVICE_SID_TYPE_RESTRICTED ( 0x00000002 | S
ERVICE_SID_TYPE_UNRESTRICTED )
// //
// Service description string // Service description string
// //
typedef struct _SERVICE_DESCRIPTIONA { typedef struct _SERVICE_DESCRIPTIONA {
LPSTR lpDescription; LPSTR lpDescription;
} SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA; } SERVICE_DESCRIPTIONA, *LPSERVICE_DESCRIPTIONA;
// //
// Service description string // Service description string
// //
skipping to change at line 219 skipping to change at line 321
typedef struct _SC_ACTION { typedef struct _SC_ACTION {
SC_ACTION_TYPE Type; SC_ACTION_TYPE Type;
DWORD Delay; DWORD Delay;
} SC_ACTION, *LPSC_ACTION; } SC_ACTION, *LPSC_ACTION;
typedef struct _SERVICE_FAILURE_ACTIONSA { typedef struct _SERVICE_FAILURE_ACTIONSA {
DWORD dwResetPeriod; DWORD dwResetPeriod;
LPSTR lpRebootMsg; LPSTR lpRebootMsg;
LPSTR lpCommand; LPSTR lpCommand;
#ifdef __midl
[range(0, 1024)]
#endif
DWORD cActions; DWORD cActions;
#ifdef MIDL_PASS #ifdef __midl
[size_is(cActions)] [size_is(cActions)]
#endif #endif
SC_ACTION * lpsaActions; SC_ACTION * lpsaActions;
} SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA; } SERVICE_FAILURE_ACTIONSA, *LPSERVICE_FAILURE_ACTIONSA;
typedef struct _SERVICE_FAILURE_ACTIONSW { typedef struct _SERVICE_FAILURE_ACTIONSW {
DWORD dwResetPeriod; DWORD dwResetPeriod;
LPWSTR lpRebootMsg; LPWSTR lpRebootMsg;
LPWSTR lpCommand; LPWSTR lpCommand;
#ifdef __midl
[range(0, 1024)]
#endif
DWORD cActions; DWORD cActions;
#ifdef MIDL_PASS #ifdef __midl
[size_is(cActions)] [size_is(cActions)]
#endif #endif
SC_ACTION * lpsaActions; SC_ACTION * lpsaActions;
} SERVICE_FAILURE_ACTIONSW, *LPSERVICE_FAILURE_ACTIONSW; } SERVICE_FAILURE_ACTIONSW, *LPSERVICE_FAILURE_ACTIONSW;
#ifdef UNICODE #ifdef UNICODE
typedef SERVICE_FAILURE_ACTIONSW SERVICE_FAILURE_ACTIONS; typedef SERVICE_FAILURE_ACTIONSW SERVICE_FAILURE_ACTIONS;
typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS; typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS;
#else #else
typedef SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONS; typedef SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONS;
typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS; typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS;
#endif // UNICODE #endif // UNICODE
// //
// Service delayed autostart info setting
//
typedef struct _SERVICE_DELAYED_AUTO_START_INFO {
BOOL fDelayedAutostart; // Delayed autostart flag
} SERVICE_DELAYED_AUTO_START_INFO, *LPSERVICE_DELAYED_AUTO_START_INFO;
//
// Service failure actions flag setting
//
typedef struct _SERVICE_FAILURE_ACTIONS_FLAG {
BOOL fFailureActionsOnNonCrashFailures; // Failure actions flag
} SERVICE_FAILURE_ACTIONS_FLAG, *LPSERVICE_FAILURE_ACTIONS_FLAG;
//
// Service SID info setting
//
typedef struct _SERVICE_SID_INFO {
DWORD dwServiceSidType; // Service SID type
} SERVICE_SID_INFO, *LPSERVICE_SID_INFO;
//
// Service required privileges information
//
typedef struct _SERVICE_REQUIRED_PRIVILEGES_INFOA {
LPSTR pmszRequiredPrivileges; // Required privileges multi
-sz
} SERVICE_REQUIRED_PRIVILEGES_INFOA, *LPSERVICE_REQUIRED_PRIVILEGES_INFOA;
//
// Service required privileges information
//
typedef struct _SERVICE_REQUIRED_PRIVILEGES_INFOW {
LPWSTR pmszRequiredPrivileges; // Required privileges multi
-sz
} SERVICE_REQUIRED_PRIVILEGES_INFOW, *LPSERVICE_REQUIRED_PRIVILEGES_INFOW;
#ifdef UNICODE
typedef SERVICE_REQUIRED_PRIVILEGES_INFOW SERVICE_REQUIRED_PRIVILEGES_INFO;
typedef LPSERVICE_REQUIRED_PRIVILEGES_INFOW LPSERVICE_REQUIRED_PRIVILEGES_INFO;
#else
typedef SERVICE_REQUIRED_PRIVILEGES_INFOA SERVICE_REQUIRED_PRIVILEGES_INFO;
typedef LPSERVICE_REQUIRED_PRIVILEGES_INFOA LPSERVICE_REQUIRED_PRIVILEGES_INFO;
#endif // UNICODE
//
// Service preshutdown timeout setting
//
typedef struct _SERVICE_PRESHUTDOWN_INFO {
DWORD dwPreshutdownTimeout; // Timeout in msecs
} SERVICE_PRESHUTDOWN_INFO, *LPSERVICE_PRESHUTDOWN_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
// //
typedef enum _SC_STATUS_TYPE { typedef enum _SC_STATUS_TYPE {
SC_STATUS_PROCESS_INFO = 0 SC_STATUS_PROCESS_INFO = 0
} SC_STATUS_TYPE; } SC_STATUS_TYPE;
// //
// Info levels for EnumServicesStatusEx // Info levels for EnumServicesStatusEx
// //
typedef enum _SC_ENUM_TYPE { typedef enum _SC_ENUM_TYPE {
SC_ENUM_PROCESS_INFO = 0 SC_ENUM_PROCESS_INFO = 0
} SC_ENUM_TYPE; } SC_ENUM_TYPE;
// //
// Service Status Structures // Service Status Structures
// //
typedef struct _SERVICE_STATUS { typedef struct _SERVICE_STATUS {
DWORD dwServiceType; DWORD dwServiceType;
DWORD dwCurrentState; DWORD dwCurrentState;
DWORD dwControlsAccepted; DWORD dwControlsAccepted;
skipping to change at line 446 skipping to change at line 602
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
//
typedef
VOID
( CALLBACK * PFN_SC_NOTIFY_CALLBACK ) (
IN PVOID pParameter
);
//
// Each new notify structure is a superset of the older version
//
typedef struct _SERVICE_NOTIFY_1 {
DWORD dwVersion;
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback;
PVOID pContext;
DWORD dwNotificationStatus;
SERVICE_STATUS_PROCESS ServiceStatus;
} SERVICE_NOTIFY_1, *PSERVICE_NOTIFY_1;
typedef struct _SERVICE_NOTIFY_2A {
DWORD dwVersion;
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback;
PVOID pContext;
DWORD dwNotificationStatus;
SERVICE_STATUS_PROCESS ServiceStatus;
DWORD dwNotificationTriggered;
LPSTR pszServiceNames;
} SERVICE_NOTIFY_2A, *PSERVICE_NOTIFY_2A;
typedef struct _SERVICE_NOTIFY_2W {
DWORD dwVersion;
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback;
PVOID pContext;
DWORD dwNotificationStatus;
SERVICE_STATUS_PROCESS ServiceStatus;
DWORD dwNotificationTriggered;
LPWSTR pszServiceNames;
} SERVICE_NOTIFY_2W, *PSERVICE_NOTIFY_2W;
#ifdef UNICODE
typedef SERVICE_NOTIFY_2W SERVICE_NOTIFY_2;
typedef PSERVICE_NOTIFY_2W PSERVICE_NOTIFY_2;
#else
typedef SERVICE_NOTIFY_2A SERVICE_NOTIFY_2;
typedef PSERVICE_NOTIFY_2A PSERVICE_NOTIFY_2;
#endif // UNICODE
typedef SERVICE_NOTIFY_2A SERVICE_NOTIFYA, *PSERVICE_NOTIFYA;
typedef SERVICE_NOTIFY_2W SERVICE_NOTIFYW, *PSERVICE_NOTIFYW;
#ifdef UNICODE
typedef SERVICE_NOTIFYW SERVICE_NOTIFY;
typedef PSERVICE_NOTIFYW PSERVICE_NOTIFY;
#else
typedef SERVICE_NOTIFYA SERVICE_NOTIFY;
typedef PSERVICE_NOTIFYA PSERVICE_NOTIFY;
#endif // UNICODE
//
// Service control status reason parameters
//
typedef struct _SERVICE_CONTROL_STATUS_REASON_PARAMSA {
DWORD dwReason;
LPSTR pszComment;
SERVICE_STATUS_PROCESS ServiceStatus;
} SERVICE_CONTROL_STATUS_REASON_PARAMSA, *PSERVICE_CONTROL_STATUS_REASON_PARAMSA
;
//
// Service control status reason parameters
//
typedef struct _SERVICE_CONTROL_STATUS_REASON_PARAMSW {
DWORD dwReason;
LPWSTR pszComment;
SERVICE_STATUS_PROCESS ServiceStatus;
} SERVICE_CONTROL_STATUS_REASON_PARAMSW, *PSERVICE_CONTROL_STATUS_REASON_PARAMSW
;
#ifdef UNICODE
typedef SERVICE_CONTROL_STATUS_REASON_PARAMSW SERVICE_CONTROL_STATUS_REASON_PARA
MS;
typedef PSERVICE_CONTROL_STATUS_REASON_PARAMSW PSERVICE_CONTROL_STATUS_REASON_PA
RAMS;
#else
typedef SERVICE_CONTROL_STATUS_REASON_PARAMSA SERVICE_CONTROL_STATUS_REASON_PARA
MS;
typedef PSERVICE_CONTROL_STATUS_REASON_PARAMSA PSERVICE_CONTROL_STATUS_REASON_PA
RAMS;
#endif // UNICODE
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// 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,
skipping to change at line 1040 skipping to change at line 1276
#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
); );
WINADVAPI
DWORD
WINAPI
NotifyServiceStatusChangeA (
__in SC_HANDLE hService,
__in DWORD dwNotifyMask,
__in PSERVICE_NOTIFYA pNotifyBuffer
);
WINADVAPI
DWORD
WINAPI
NotifyServiceStatusChangeW (
__in SC_HANDLE hService,
__in DWORD dwNotifyMask,
__in PSERVICE_NOTIFYW pNotifyBuffer
);
#ifdef UNICODE
#define NotifyServiceStatusChange NotifyServiceStatusChangeW
#else
#define NotifyServiceStatusChange NotifyServiceStatusChangeA
#endif // !UNICODE
WINADVAPI
BOOL
WINAPI
ControlServiceExA(
__in SC_HANDLE hService,
__in DWORD dwControl,
__in DWORD dwInfoLevel,
__inout PVOID pControlParams
);
WINADVAPI
BOOL
WINAPI
ControlServiceExW(
__in SC_HANDLE hService,
__in DWORD dwControl,
__in DWORD dwInfoLevel,
__inout PVOID pControlParams
);
#ifdef UNICODE
#define ControlServiceEx ControlServiceExW
#else
#define ControlServiceEx ControlServiceExA
#endif // !UNICODE
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // _WINSVC_ #endif // _WINSVC_
 End of changes. 12 change blocks. 
6 lines changed or deleted 297 lines changed or added

This html diff was produced by rfcdiff 1.41.