[INCLUDE]

- Remove duplicate dllimport attributes CORE-6917 #resolve
- Add annotations for wcslen
- Add kernelspecs.h (complete)
- Add some more entries in driverspecs.h
- Fix a number of annotations

svn path=/trunk/; revision=58204
This commit is contained in:
Timo Kreuzer 2013-01-22 22:51:51 +00:00
parent 9ba418e493
commit 062d16ac10
17 changed files with 313 additions and 150 deletions

View file

@ -118,7 +118,14 @@ extern "C" {
_CRTIMP _CRT_INSECURE_DEPRECATE(wcscpy_s) wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
_CRTIMP size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
_CRTIMP wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
_CRTIMP size_t __cdecl wcslen(const wchar_t *_Str);
_Ret_range_(==,_String_length_(_Str))
_CRTIMP
size_t
__cdecl
wcslen(
_In_z_ const wchar_t *_Str);
_CRTIMP _CRT_INSECURE_DEPRECATE(wcsnlen_s) size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
_CRTIMP int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
_CRTIMP _CRT_INSECURE_DEPRECATE(wcsncpy_s) wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);

View file

@ -0,0 +1,109 @@
/*
* kernelspecs.h
*
* SAL 2 annotations for kernel mode drivers
*
* This file is part of the ReactOS DDK package.
*
* Contributor:
* Timo Kreuzer (timo.kreuzer@reactos.org)
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#pragma once
#define KERNELSPECS_H
#include "driverspecs.h"
#ifdef _PREFAST_
#undef _IRQL_always_function_max_
#undef _IRQL_always_function_min_
#undef _IRQL_raises_
#undef _IRQL_requires_
#undef _IRQL_requires_max_
#undef _IRQL_requires_min_
#undef _IRQL_requires_same_
#undef _IRQL_restores_
#undef _IRQL_restores_global_
#undef _IRQL_saves_
#undef _IRQL_saves_global_
#undef _IRQL_uses_cancel_
#undef _IRQL_is_cancel_
#undef __drv_setsIRQL
#undef __drv_raisesIRQL
#undef __drv_requiresIRQL
#undef __drv_maxIRQL
#undef __drv_minIRQL
#undef __drv_savesIRQL
#undef __drv_savesIRQLGlobal
#undef __drv_restoresIRQL
#undef __drv_restoresIRQLGlobal
#undef __drv_minFunctionIRQL
#undef __drv_maxFunctionIRQL
#undef __drv_sameIRQL
#undef __drv_useCancelIRQL
#undef __drv_isCancelIRQL
#define _IRQL_always_function_max_(irql) _Pre_ _SA_annotes1(SAL_maxFunctionIrql,irql)
#define _IRQL_always_function_min_(irql) _Pre_ _SA_annotes1(SAL_minFunctionIrql,irql)
#define _IRQL_raises_(irql) _Post_ _SA_annotes1(SAL_raiseIRQL,irql)
#define _IRQL_requires_(irql) _Pre_ _SA_annotes1(SAL_IRQL,irql)
#define _IRQL_requires_max_(irql) _Pre_ _SA_annotes1(SAL_maxIRQL,irql)
#define _IRQL_requires_min_(irql) _Pre_ _SA_annotes1(SAL_minIRQL,irql)
#define _IRQL_requires_same_ _Post_ _SA_annotes0(SAL_sameIRQL)
#define _IRQL_restores_ _Post_ _SA_annotes0(SAL_restoreIRQL)
#define _IRQL_restores_global_(kind,param) _Post_ _SA_annotes2(SAL_restoreIRQLGlobal, #kind, param\t)
#define _IRQL_saves_ _Post_ _SA_annotes0(SAL_saveIRQL)
#define _IRQL_saves_global_(kind,param) _Post_ _SA_annotes2(SAL_saveIRQLGlobal,#kind, param\t)
#define _IRQL_uses_cancel_ _Post_ _SA_annotes0(SAL_UseCancelIrql)
#define _IRQL_is_cancel_ _IRQL_uses_cancel_ _Releases_nonreentrant_lock_(_Global_cancel_spin_lock_) \
_At_(return, _IRQL_always_function_min_(2 /*DISPATCH_LEVEL*/) _IRQL_requires_(2 /*DISPATCH_LEVEL*/))
#define __drv_setsIRQL(irql) _Post_ _SA_annotes1(SAL_IRQL,irql)
#define __drv_raisesIRQL _IRQL_raises_
#define __drv_requiresIRQL _IRQL_requires_
#define __drv_maxIRQL _IRQL_requires_max_
#define __drv_minIRQL _IRQL_requires_min_
#define __drv_savesIRQL _IRQL_saves_
#define __drv_savesIRQLGlobal _IRQL_saves_global_
#define __drv_restoresIRQL _IRQL_restores_
#define __drv_restoresIRQLGlobal _IRQL_restores_global_
#define __drv_minFunctionIRQL _IRQL_always_function_min_
#define __drv_maxFunctionIRQL _IRQL_always_function_max_
#define __drv_sameIRQL _IRQL_requires_same_
#define __drv_useCancelIRQL _IRQL_uses_cancel_
#define __drv_isCancelIRQL _IRQL_is_cancel_
#ifdef __cplusplus
extern "C" {
#endif
__ANNOTATION(SAL_IRQL(__int64);)
__ANNOTATION(SAL_raiseIRQL(__int64);)
__ANNOTATION(SAL_IRQL(__int64);)
__ANNOTATION(SAL_maxIRQL(__int64);)
__ANNOTATION(SAL_minIRQL(__int64);)
__ANNOTATION(SAL_saveIRQL(void);)
__ANNOTATION(SAL_saveIRQLGlobal(_In_ char *, ...);)
__ANNOTATION(SAL_restoreIRQL(void);)
__ANNOTATION(SAL_restoreIRQLGlobal(_In_ char *, ...);)
__ANNOTATION(SAL_minFunctionIrql(__int64);)
__ANNOTATION(SAL_maxFunctionIrql(__int64);)
__ANNOTATION(SAL_sameIRQL(void);)
__ANNOTATION(SAL_UseCancelIrql(void);)
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* _PREFAST_ */

View file

@ -1344,12 +1344,13 @@ RtlSecondsSince1980ToTime(
_Out_ PLARGE_INTEGER Time);
_Success_(return != 0)
_Must_inspect_result_
NTSYSAPI
BOOLEAN
NTAPI
RtlTimeToSecondsSince1970(
_In_ PLARGE_INTEGER Time,
_Out_ PULONG ElapsedSeconds);
_In_ PLARGE_INTEGER Time,
_Out_ PULONG ElapsedSeconds);
NTSYSAPI
VOID
@ -9165,7 +9166,7 @@ ZwOpenDirectoryObject(
_Must_inspect_result_
_At_(*BaseAddress, __drv_allocatesMem(Mem))
__kernel_entry NTSYSCALLAPI
__kernel_entry
NTSYSAPI
NTSTATUS
NTAPI

View file

@ -41,6 +41,7 @@
#include <excpt.h>
#include <ntdef.h>
#include <ntstatus.h>
#include <kernelspecs.h>
#include <ntiologc.h>
#ifndef GUID_DEFINED
@ -8742,14 +8743,18 @@ RtlGUIDFromString(
_IRQL_requires_max_(DISPATCH_LEVEL)
_At_(DestinationString->Buffer, _Post_equal_to_(SourceString))
_When_(SourceString != NULL,
_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
_At_(DestinationString->MaximumLength, _Post_equal_to_((_String_length_(SourceString)+1) * sizeof(WCHAR)))
_At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length + sizeof(WCHAR))))
_When_(SourceString == NULL,
_At_(DestinationString->Length, _Post_equal_to_(0))
_At_(DestinationString->MaximumLength, _Post_equal_to_(0)))
NTSYSAPI
VOID
NTAPI
RtlInitUnicodeString(
_Out_ PUNICODE_STRING DestinationString,
_In_opt_z_ __drv_aliasesMem PCWSTR SourceString);
_Out_ PUNICODE_STRING DestinationString,
_In_opt_z_ __drv_aliasesMem PCWSTR SourceString);
/* VOID
* RtlMoveMemory(
@ -9328,13 +9333,14 @@ RtlSetDaclSecurityDescriptor(
#define RtlStoreUlongPtr(Address,Value) RtlStoreUlong(Address,Value)
#endif /* _WIN64 */
_Success_(return != 0)
_Success_(return!=FALSE)
_Must_inspect_result_
NTSYSAPI
BOOLEAN
NTAPI
RtlTimeFieldsToTime(
_In_ PTIME_FIELDS TimeFields,
_Out_ PLARGE_INTEGER Time);
_In_ PTIME_FIELDS TimeFields,
_Out_ PLARGE_INTEGER Time);
NTSYSAPI
VOID
@ -16669,17 +16675,18 @@ NTSYSAPI
NTSTATUS
NTAPI
ZwCreateFile(
_Out_ PHANDLE FileHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_opt_ PLARGE_INTEGER AllocationSize,
_In_ ULONG FileAttributes,
_In_ ULONG ShareAccess,
_In_ ULONG CreateDisposition,
_In_ ULONG CreateOptions,
_In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
_In_ ULONG EaLength);
_Out_ PHANDLE FileHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_opt_ PLARGE_INTEGER AllocationSize,
_In_ ULONG FileAttributes,
_In_ ULONG ShareAccess,
_In_ ULONG CreateDisposition,
_In_ ULONG CreateOptions,
_In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
_In_ ULONG EaLength
);
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSYSAPI
@ -17310,8 +17317,8 @@ NTSYSCALLAPI
NTSTATUS
NTAPI
ZwRollbackComplete(
IN HANDLE EnlistmentHandle,
IN PLARGE_INTEGER TmVirtualClock OPTIONAL);
_In_ HANDLE EnlistmentHandle,
_In_opt_ PLARGE_INTEGER TmVirtualClock);
NTSYSCALLAPI
NTSTATUS
@ -17347,29 +17354,29 @@ NTSYSAPI
NTSTATUS
NTAPI
ZwNotifyChangeMultipleKeys(
IN HANDLE MasterKeyHandle,
IN ULONG Count OPTIONAL,
IN OBJECT_ATTRIBUTES SubordinateObjects[] OPTIONAL,
IN HANDLE Event OPTIONAL,
IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
IN PVOID ApcContext OPTIONAL,
OUT PIO_STATUS_BLOCK IoStatusBlock,
IN ULONG CompletionFilter,
IN BOOLEAN WatchTree,
OUT PVOID Buffer OPTIONAL,
IN ULONG BufferSize,
IN BOOLEAN Asynchronous);
_In_ HANDLE MasterKeyHandle,
_In_opt_ ULONG Count,
_In_opt_ OBJECT_ATTRIBUTES SubordinateObjects[],
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_ ULONG CompletionFilter,
_In_ BOOLEAN WatchTree,
_Out_opt_ PVOID Buffer,
_In_ ULONG BufferSize,
_In_ BOOLEAN Asynchronous);
NTSYSAPI
NTSTATUS
NTAPI
ZwQueryMultipleValueKey(
IN HANDLE KeyHandle,
IN OUT PKEY_VALUE_ENTRY ValueEntries,
IN ULONG EntryCount,
OUT PVOID ValueBuffer,
IN OUT PULONG BufferLength,
OUT PULONG RequiredBufferLength OPTIONAL);
_In_ HANDLE KeyHandle,
_Inout_ PKEY_VALUE_ENTRY ValueEntries,
_In_ ULONG EntryCount,
_Out_ PVOID ValueBuffer,
_Inout_ PULONG BufferLength,
_Out_opt_ PULONG RequiredBufferLength);
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSYSAPI

View file

@ -41,17 +41,18 @@ NtCompressKey(
_In_ HANDLE Key
);
NTSYSCALLAPI
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSYSAPI
NTSTATUS
NTAPI
NtCreateKey(
_Out_ PHANDLE KeyHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ ULONG TitleIndex,
_Reserved_ ULONG TitleIndex,
_In_opt_ PUNICODE_STRING Class,
_In_ ULONG CreateOptions,
_In_opt_ PULONG Disposition
_Out_opt_ PULONG Disposition
);
NTSYSCALLAPI
@ -81,14 +82,17 @@ NtEnumerateKey(
_Out_ PULONG ResultLength
);
NTSYSCALLAPI
_IRQL_requires_max_(PASSIVE_LEVEL)
_When_(Length == 0, _Post_satisfies_(return < 0))
_When_(Length > 0, _Post_satisfies_(return <= 0))
NTSYSAPI
NTSTATUS
NTAPI
NtEnumerateValueKey(
_In_ HANDLE KeyHandle,
_In_ ULONG Index,
_In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
_Out_bytecap_(Length) PVOID KeyValueInformation,
_Out_writes_bytes_opt_(Length) PVOID KeyValueInformation,
_In_ ULONG Length,
_Out_ PULONG ResultLength
);
@ -246,14 +250,17 @@ NtQueryOpenSubKeysEx(
_In_ PULONG RequiredSize
);
NTSYSCALLAPI
_IRQL_requires_max_(PASSIVE_LEVEL)
_When_(Length == 0, _Post_satisfies_(return < 0))
_When_(Length > 0, _Post_satisfies_(return <= 0))
NTSYSAPI
NTSTATUS
NTAPI
NtQueryValueKey(
_In_ HANDLE KeyHandle,
_In_ PUNICODE_STRING ValueName,
_In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
_Out_bytecap_(Length) PVOID KeyValueInformation,
_Out_writes_bytes_opt_(Length) PVOID KeyValueInformation,
_In_ ULONG Length,
_Out_ PULONG ResultLength
);
@ -354,6 +361,7 @@ NtUnloadKeyEx(
);
#ifdef NTOS_MODE_USER
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSYSAPI
NTSTATUS
NTAPI
@ -361,10 +369,10 @@ ZwCreateKey(
_Out_ PHANDLE KeyHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ ULONG TitleIndex,
_Reserved_ ULONG TitleIndex,
_In_opt_ PUNICODE_STRING Class,
_In_ ULONG CreateOptions,
_In_opt_ PULONG Disposition
_Out_opt_ PULONG Disposition
);
NTSYSAPI
@ -394,6 +402,9 @@ ZwEnumerateKey(
_Out_ PULONG ResultLength
);
_IRQL_requires_max_(PASSIVE_LEVEL)
_When_(Length == 0, _Post_satisfies_(return < 0))
_When_(Length > 0, _Post_satisfies_(return <= 0))
NTSYSAPI
NTSTATUS
NTAPI
@ -401,7 +412,7 @@ ZwEnumerateValueKey(
_In_ HANDLE KeyHandle,
_In_ ULONG Index,
_In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
_Out_bytecap_(Length) PVOID KeyValueInformation,
_Out_writes_bytes_opt_(Length) PVOID KeyValueInformation,
_In_ ULONG Length,
_Out_ PULONG ResultLength
);
@ -497,6 +508,9 @@ ZwQueryMultipleValueKey(
_Out_ PULONG ReturnLength
);
_IRQL_requires_max_(PASSIVE_LEVEL)
_When_(Length == 0, _Post_satisfies_(return < 0))
_When_(Length > 0, _Post_satisfies_(return <= 0))
NTSYSAPI
NTSTATUS
NTAPI
@ -504,7 +518,7 @@ ZwQueryValueKey(
_In_ HANDLE KeyHandle,
_In_ PUNICODE_STRING ValueName,
_In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
_Out_bytecap_(Length) PVOID KeyValueInformation,
_Out_writes_bytes_opt_(Length) PVOID KeyValueInformation,
_In_ ULONG Length,
_Out_ PULONG ResultLength
);

View file

@ -459,7 +459,7 @@ NTAPI
NtReleaseSemaphore(
_In_ HANDLE SemaphoreHandle,
_In_ LONG ReleaseCount,
_Out_ PLONG PreviousCount
_Out_opt_ PLONG PreviousCount
);
NTSYSCALLAPI
@ -903,7 +903,7 @@ NTAPI
ZwReleaseSemaphore(
_In_ HANDLE SemaphoreHandle,
_In_ LONG ReleaseCount,
_Out_ PLONG PreviousCount
_Out_opt_ PLONG PreviousCount
);
NTSYSAPI

View file

@ -113,7 +113,7 @@ NTAPI
NtCreateIoCompletion(
_Out_ PHANDLE IoCompletionHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ ULONG NumberOfConcurrentThreads
);
@ -653,7 +653,7 @@ NTAPI
ZwCreateIoCompletion(
_Out_ PHANDLE IoCompletionHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ ULONG NumberOfConcurrentThreads
);

View file

@ -437,9 +437,9 @@ NTAPI
NtQueueApcThread(
_In_ HANDLE ThreadHandle,
_In_ PKNORMAL_ROUTINE ApcRoutine,
_In_ PVOID NormalContext,
_In_ PVOID SystemArgument1,
_In_ PVOID SystemArgument2
_In_opt_ PVOID NormalContext,
_In_opt_ PVOID SystemArgument1,
_In_opt_ PVOID SystemArgument2
);
NTSYSCALLAPI
@ -643,9 +643,9 @@ NTAPI
ZwQueueApcThread(
_In_ HANDLE ThreadHandle,
_In_ PKNORMAL_ROUTINE ApcRoutine,
_In_ PVOID NormalContext,
_In_ PVOID SystemArgument1,
_In_ PVOID SystemArgument2
_In_opt_ PVOID NormalContext,
_In_opt_ PVOID SystemArgument1,
_In_opt_ PVOID SystemArgument2
);
NTSYSAPI

View file

@ -56,7 +56,7 @@ LdrEnumResources(
_In_ PLDR_RESOURCE_INFO ResourceInfo,
_In_ ULONG Level,
_Inout_ ULONG *ResourceCount,
_Out_opt_ PLDR_ENUM_RESOURCE_INFO Resources
_Out_writes_to_(*ResourceCount,*ResourceCount) LDR_ENUM_RESOURCE_INFO *Resources
);

View file

@ -319,7 +319,7 @@ ZwAreMappedFilesTheSame(
_Must_inspect_result_
_At_(*BaseAddress, __drv_allocatesMem(Mem))
__kernel_entry NTSYSCALLAPI
__kernel_entry
NTSYSAPI
NTSTATUS
NTAPI

View file

@ -284,7 +284,7 @@ NTSTATUS
NTAPI
NtAlertResumeThread(
_In_ HANDLE ThreadHandle,
_Out_ PULONG SuspendCount
_Out_opt_ PULONG SuspendCount
);
typedef ULONG APPHELPCACHESERVICECLASS;
@ -488,7 +488,7 @@ NtQueryInformationThread(
_In_ THREADINFOCLASS ThreadInformationClass,
_Out_ PVOID ThreadInformation,
_In_ ULONG ThreadInformationLength,
_Out_ PULONG ReturnLength
_Out_opt_ PULONG ReturnLength
);
NTSYSCALLAPI
@ -503,7 +503,7 @@ NTSTATUS
NTAPI
NtResumeThread(
_In_ HANDLE ThreadHandle,
_Out_ PULONG SuspendCount
_Out_opt_ PULONG SuspendCount
);
NTSYSCALLAPI
@ -588,7 +588,7 @@ NTSTATUS
NTAPI
ZwAlertResumeThread(
_In_ HANDLE ThreadHandle,
_Out_ PULONG SuspendCount
_Out_opt_ PULONG SuspendCount
);
NTSYSAPI
@ -734,7 +734,7 @@ ZwQueryInformationThread(
_In_ THREADINFOCLASS ThreadInformationClass,
_Out_ PVOID ThreadInformation,
_In_ ULONG ThreadInformationLength,
_Out_ PULONG ReturnLength
_Out_opt_ PULONG ReturnLength
);
NTSYSAPI
@ -749,7 +749,7 @@ NTSTATUS
NTAPI
ZwResumeThread(
_In_ HANDLE ThreadHandle,
_Out_ PULONG SuspendCount
_Out_opt_ PULONG SuspendCount
);
NTSYSAPI

View file

@ -1667,7 +1667,7 @@ RtlLargeIntegerToChar(
_In_ PLARGE_INTEGER Value,
_In_ ULONG Base,
_In_ ULONG Length,
_Inout_ PCHAR String
_Out_ PCHAR String
);
NTSYSAPI
@ -2129,8 +2129,12 @@ RtlHashUnicodeString(
_IRQL_requires_max_(DISPATCH_LEVEL)
_At_(DestinationString->Buffer, _Post_equal_to_(SourceString))
_When_(SourceString != NULL,
_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
_At_(DestinationString->MaximumLength, _Post_equal_to_((_String_length_(SourceString)+1) * sizeof(WCHAR)))
_At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length + sizeof(WCHAR))))
_When_(SourceString == NULL,
_At_(DestinationString->Length, _Post_equal_to_(0))
_At_(DestinationString->MaximumLength, _Post_equal_to_(0)))
NTSYSAPI
VOID
NTAPI
@ -2411,8 +2415,8 @@ RtlCreateUserThread(
_In_ SIZE_T StackCommit,
_In_ PTHREAD_START_ROUTINE StartAddress,
_In_ PVOID Parameter,
_Inout_ PHANDLE ThreadHandle,
_Inout_ PCLIENT_ID ClientId
_Out_opt_ PHANDLE ThreadHandle,
_Out_opt_ PCLIENT_ID ClientId
);
#endif
@ -2538,7 +2542,7 @@ NTSTATUS
NTAPI
RtlDeregisterWaitEx(
_In_ HANDLE hWaitHandle,
_In_ HANDLE hCompletionEvent
_In_opt_ HANDLE hCompletionEvent
);
NTSYSAPI
@ -2682,7 +2686,7 @@ ULONG
NTAPI
RtlGetCurrentDirectory_U(
_In_ ULONG MaximumLength,
_Out_z_bytecap_(MaximumLength) PWSTR Buffer
_Out_bytecap_(MaximumLength) PWSTR Buffer
);
NTSYSAPI
@ -3176,7 +3180,7 @@ NTSTATUS
NTAPI
RtlDeleteTimerQueueEx(
_In_ HANDLE TimerQueue,
_In_ HANDLE CompletionEvent
_In_opt_ HANDLE CompletionEvent
);
NTSYSAPI
@ -3645,7 +3649,8 @@ NTSYSAPI
NTSTATUS
NTAPI
RtlFormatCurrentUserKeyPath(
_Inout_ PUNICODE_STRING KeyPath
_Out_ _At_(KeyPath->Buffer, __drv_allocatesMem(Mem) _Post_bytecap_(KeyPath->MaximumLength) _Post_bytecount_(KeyPath->Length))
PUNICODE_STRING KeyPath
);
NTSYSAPI
@ -3700,7 +3705,7 @@ NTSTATUS
NTAPI
RtlpNtEnumerateSubKey(
_In_ HANDLE KeyHandle,
_Out_ PUNICODE_STRING SubKeyName,
_Inout_ PUNICODE_STRING SubKeyName,
_In_ ULONG Index,
_In_ ULONG Unused
);
@ -3974,6 +3979,8 @@ NTAPI
RtlSetTimeZoneInformation(
_In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
_Success_(return!=FALSE)
_Must_inspect_result_
NTSYSAPI
BOOLEAN
NTAPI
@ -3982,12 +3989,14 @@ RtlTimeFieldsToTime(
_Out_ PLARGE_INTEGER Time
);
_Success_(return != 0)
_Must_inspect_result_
NTSYSAPI
BOOLEAN
NTAPI
RtlTimeToSecondsSince1970(
PLARGE_INTEGER Time,
_Out_ PULONG SecondsSince1970
_In_ PLARGE_INTEGER Time,
_Out_ PULONG ElapsedSeconds
);
NTSYSAPI

View file

@ -17,12 +17,34 @@
#ifdef _PREFAST_
// Stubs
#define ___drv_unit_internal_kernel_driver
#define ___drv_unit_kernel_code
#define ___drv_unit_kernel_driver
#define ___drv_unit_user_code
#define ___drv_unit_user_driver
/* IRQL annotations are only valid when included from kernelspecs.h */
#define _IRQL_always_function_max_(irql)
#define _IRQL_always_function_min_(irql)
#define _IRQL_is_cancel_
#define _IRQL_raises_(irql)
#define _IRQL_requires_(irql)
#define _IRQL_requires_max_(irql)
#define _IRQL_requires_max_defined
#define _IRQL_requires_min_(irql)
#define _IRQL_requires_same_
#define _IRQL_restores_
#define _IRQL_restores_global_(kind,param)
#define _IRQL_saves_
#define _IRQL_saves_global_(kind,param)
#define _IRQL_uses_cancel_
#define __drv_setsIRQL(irql)
#define _Dispatch_type_ _Function_class_
#define _Kernel_clear_do_init_(yesNo) _Post_ _SA_annotes1(SAL_clearDoInit,yesNo)
#define _Kernel_float_restored_ _Post_ _SA_annotes0(SAL_floatRestored)
#define _Kernel_float_saved_ _Post_ _SA_annotes0(SAL_floatSaved)
#define _Kernel_float_used_ _Post_ _SA_annotes0(SAL_floatUsed)
#define _Kernel_IoGetDmaAdapter_ _Post_ _SA_annotes0(SAL_IoGetDmaAdapter)
#define _Kernel_releases_resource_(kind) _Post_ _SA_annotes1(SAL_release, #kind)
#define _Kernel_requires_resource_held_(kind) _Pre_ _SA_annotes1(SAL_mustHold, #kind)
#define _Kernel_requires_resource_not_held_(kind) _Pre_ _SA_annotes1(SAL_neverHold, #kind)
#define _Kernel_acquires_resource_(kind) _Post_ _SA_annotes1(SAL_acquire, #kind)
#define __drv_acquiresCancelSpinLock
#define __drv_acquiresCriticalRegion
#define __drv_acquiresExclusiveResource(kind)
@ -30,11 +52,11 @@
#define __drv_acquiresPriorityRegion
#define __drv_acquiresResource(kind)
#define __drv_acquiresResourceGlobal(kind,param)
#define __drv_aliasesMem _Post_ _SA_annotes0(SAL_IsAliased)
#define __drv_allocatesMem(kind) _Post_ _SA_annotes1(SAL_NeedsRelease,__yes)
#define __drv_arg(expr,annotes)
#define __drv_at(expr,annotes)
#define __drv_callbackType(kind)
#define __drv_aliasesMem _Post_ _SA_annotes0(SAL_IsAliased)
#define __drv_allocatesMem(kind) _Post_ _SA_annotes1(SAL_NeedsRelease,__yes)
#define __drv_arg(expr,annotes) _At_(expr,annotes)
#define __drv_at(expr,annotes) _At_(expr,annotes)
#define __drv_callbackType(kind) _SA_annotes1(SAL_callbackType, #kind)
#define __drv_clearDoInit
#define __drv_completionType(kindlist)
#define __drv_constant
@ -46,12 +68,12 @@
#define __drv_floatSaved
#define __drv_floatUsed
#define __drv_formatString(kind)
#define __drv_freesMem(kind) _Post_ _SA_annotes1(SAL_NeedsRelease,__no)
#define __drv_freesMem(kind) _Post_ _SA_annotes1(SAL_NeedsRelease,__no)
#define __drv_fun(annotes)
#define __drv_functionClass
#define __drv_holdsCancelSpinLock()
#define __drv_holdsCriticalRegion()
#define __drv_holdsPriorityRegion()
#define __drv_holdsCancelSpinLock() _Holds_resource_global_("CancelSpinLock",)
#define __drv_holdsCriticalRegion() _Holds_resource_global_("CriticalRegion",)
#define __drv_holdsPriorityRegion() _Holds_resource_global_("PriorityRegion",)
#define __drv_in_deref(annotes)
#define __drv_in(annotes)
#define __drv_innerAcquiresGlobal(kind,param)
@ -60,7 +82,7 @@
#define __drv_innerReleasesGlobal(kind,param)
#define __drv_interlocked
#define __drv_IoGetDmaAdapter
#define __drv_isCancelIRQL
#define __drv_isCancelIRQL _IRQL_is_cancel_
#define __drv_isObjectPointer
#define __drv_KMDF
#define __drv_maxFunctionIRQL
@ -101,7 +123,6 @@
#define __drv_sameIRQL
#define __drv_savesIRQL
#define __drv_savesIRQLGlobal
#define __drv_setsIRQL(irql)
#define __drv_strictType(typename,mode)
#define __drv_strictTypeMatch(mode)
#define __drv_unit(p)
@ -116,14 +137,35 @@
#define __prefast_operator_new_throws
#define __user_code
#define __user_driver
#define ___drv_unit_internal_kernel_driver
#define ___drv_unit_kernel_code
#define ___drv_unit_kernel_driver
#define ___drv_unit_user_code
#define ___drv_unit_user_driver
__ANNOTATION(SAL_neverHold(_In_ char *);)
__ANNOTATION(SAL_acquire(_In_ char *);)
__ANNOTATION(SAL_floatUsed(void);)
__ANNOTATION(SAL_floatSaved(void);)
__ANNOTATION(SAL_floatRestored(void);)
__ANNOTATION(SAL_clearDoInit(enum __SAL_YesNo);)
__ANNOTATION(SAL_maxIRQL(__int64);)
__ANNOTATION(SAL_IsAliased(void);)
__ANNOTATION(SAL_NeedsRelease(enum __SAL_YesNo);)
__ANNOTATION(SAL_mustHold(_In_ char *);)
__ANNOTATION(SAL_release(_In_ char *);)
__ANNOTATION(SAL_IoGetDmaAdapter(void);)
#else
/* Dummys */
#define _Dispatch_type_
#define _IRQL_always_function_max_(irql)
#define _IRQL_always_function_min_(irql)
#define _IRQL_is_cancel_
#define _IRQL_raises_(irql)
#define _IRQL_requires_(irql)
#define _IRQL_requires_max_(irql) _Pre_ _SA_annotes1(SAL_maxIRQL,irql)
#define _IRQL_requires_max_defined
#define _IRQL_requires_max_(irql)
#define _IRQL_requires_min_(irql)
#define _IRQL_requires_same_
#define _IRQL_restores_
@ -138,23 +180,8 @@
#define _Kernel_IoGetDmaAdapter_
#define _Kernel_releases_resource_(kind)
#define _Kernel_requires_resource_held_(kind)
#define _Kernel_requires_resource_not_held_(kind) _Pre_ _SA_annotes1(SAL_neverHold, #kind)
#define _Kernel_acquires_resource_(kind) _Post_ _SA_annotes1(SAL_acquire, #kind)
__ANNOTATION(SAL_maxIRQL(__int64);)
__ANNOTATION(SAL_IsAliased(void);)
__ANNOTATION(SAL_NeedsRelease(enum __SAL_YesNo);)
__ANNOTATION(SAL_neverHold(__In_impl_ char *);)
__ANNOTATION(SAL_acquire(__In_impl_ char *);)
#else
/* Dummys */
#define ___drv_unit_internal_kernel_driver
#define ___drv_unit_kernel_code
#define ___drv_unit_kernel_driver
#define ___drv_unit_user_code
#define ___drv_unit_user_driver
#define _Kernel_requires_resource_not_held_(kind)
#define _Kernel_acquires_resource_(kind)
#define __drv_acquiresCancelSpinLock
#define __drv_acquiresCriticalRegion
#define __drv_acquiresExclusiveResource(kind)
@ -248,29 +275,11 @@ __ANNOTATION(SAL_acquire(__In_impl_ char *);)
#define __prefast_operator_new_throws
#define __user_code
#define __user_driver
#define _Dispatch_type_
#define _IRQL_always_function_max_(irql)
#define _IRQL_always_function_min_(irql)
#define _IRQL_is_cancel_
#define _IRQL_raises_(irql)
#define _IRQL_requires_(irql)
#define _IRQL_requires_max_(irql)
#define _IRQL_requires_min_(irql)
#define _IRQL_requires_same_
#define _IRQL_restores_
#define _IRQL_restores_global_(kind,param)
#define _IRQL_saves_
#define _IRQL_saves_global_(kind,param)
#define _IRQL_uses_cancel_
#define _Kernel_clear_do_init_(yesNo)
#define _Kernel_float_restored_
#define _Kernel_float_saved_
#define _Kernel_float_used_
#define _Kernel_IoGetDmaAdapter_
#define _Kernel_releases_resource_(kind)
#define _Kernel_requires_resource_held_(kind)
#define _Kernel_requires_resource_not_held_(kind)
#define _Kernel_acquires_resource_(kind)
#define ___drv_unit_internal_kernel_driver
#define ___drv_unit_kernel_code
#define ___drv_unit_kernel_driver
#define ___drv_unit_user_code
#define ___drv_unit_user_driver
#endif

View file

@ -855,7 +855,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default};
//#define _Outref_result_maybenull_
//#define _Outref_result_nullonfailure_
#define _Points_to_data_ _SAL2_NAME(_Points_to_data_) _Group_([SAL_pre] [SAL_at(p1="*_Curr_")] _Group_([SAL_annotes(Name="SAL_mayBePointer", p1="__no")]) )
//#define _Post_bytecap_(size)
#define _Post_bytecap_(size) _SAL11_NAME(_Post_bytecap_) _Group_([SA_Post(WritableBytes="\n" _SA_SPECSTRIZE(size))])
#define _Post_bytecount_(size) _SAL11_NAME(_Post_bytecount_) _Group_([SA_Post(ValidBytes="\n" _SA_SPECSTRIZE(size))] [SA_Post(Valid=SA_Yes)])
//#define _Post_bytecount_c_(size)
//#define _Post_bytecount_x_(size)

View file

@ -217,14 +217,18 @@ RtlGUIDFromString(
_IRQL_requires_max_(DISPATCH_LEVEL)
_At_(DestinationString->Buffer, _Post_equal_to_(SourceString))
_When_(SourceString != NULL,
_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
_At_(DestinationString->MaximumLength, _Post_equal_to_((_String_length_(SourceString)+1) * sizeof(WCHAR)))
_At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length + sizeof(WCHAR))))
_When_(SourceString == NULL,
_At_(DestinationString->Length, _Post_equal_to_(0))
_At_(DestinationString->MaximumLength, _Post_equal_to_(0)))
NTSYSAPI
VOID
NTAPI
RtlInitUnicodeString(
_Out_ PUNICODE_STRING DestinationString,
_In_opt_z_ __drv_aliasesMem PCWSTR SourceString);
_Out_ PUNICODE_STRING DestinationString,
_In_opt_z_ __drv_aliasesMem PCWSTR SourceString);
/* VOID
* RtlMoveMemory(
@ -805,13 +809,14 @@ RtlSetDaclSecurityDescriptor(
#define RtlStoreUlongPtr(Address,Value) RtlStoreUlong(Address,Value)
#endif /* _WIN64 */
_Success_(return != 0)
_Success_(return!=FALSE)
_Must_inspect_result_
NTSYSAPI
BOOLEAN
NTAPI
RtlTimeFieldsToTime(
_In_ PTIME_FIELDS TimeFields,
_Out_ PLARGE_INTEGER Time);
_In_ PTIME_FIELDS TimeFields,
_Out_ PLARGE_INTEGER Time);
NTSYSAPI
VOID
@ -1566,12 +1571,13 @@ RtlSecondsSince1980ToTime(
_Out_ PLARGE_INTEGER Time);
_Success_(return != 0)
_Must_inspect_result_
NTSYSAPI
BOOLEAN
NTAPI
RtlTimeToSecondsSince1970(
_In_ PLARGE_INTEGER Time,
_Out_ PULONG ElapsedSeconds);
_In_ PLARGE_INTEGER Time,
_Out_ PULONG ElapsedSeconds);
NTSYSAPI
VOID

View file

@ -41,6 +41,7 @@
#include <excpt.h>
#include <ntdef.h>
#include <ntstatus.h>
#include <kernelspecs.h>
#include <ntiologc.h>
#ifndef GUID_DEFINED

View file

@ -593,7 +593,7 @@ ZwOpenDirectoryObject(
_Must_inspect_result_
_At_(*BaseAddress, __drv_allocatesMem(Mem))
__kernel_entry NTSYSCALLAPI
__kernel_entry
NTSYSAPI
NTSTATUS
NTAPI