Annotate eng/mapping.c

svn path=/trunk/; revision=66650
This commit is contained in:
Timo Kreuzer 2015-03-10 00:13:43 +00:00
parent eebc6ac87d
commit 475a0d5255
3 changed files with 66 additions and 44 deletions

View file

@ -1842,7 +1842,7 @@ ENGAPI
VOID
APIENTRY
EngFreeModule(
_In_ HANDLE h);
_In_ _Post_invalid_ HANDLE h);
ENGAPI
@ -2089,6 +2089,8 @@ EngMapFile(
_Out_ ULONG_PTR *piFile);
__drv_preferredFunction("EngMapFontFileFD", "Obsolete")
_Check_return_
_Success_(return!=FALSE)
ENGAPI
BOOL
APIENTRY
@ -2097,6 +2099,8 @@ EngMapFontFile(
_Outptr_result_bytebuffer_(*pcjBuf) PULONG *ppjBuf,
_Out_ ULONG *pcjBuf);
_Check_return_
_Success_(return!=FALSE)
ENGAPI
BOOL
APIENTRY
@ -2105,12 +2109,15 @@ EngMapFontFileFD(
_Outptr_result_bytebuffer_(*pcjBuf) PULONG *ppjBuf,
_Out_ ULONG *pcjBuf);
_Check_return_
_Success_(return!=NULL)
_Post_writable_byte_size_(*pulSize)
ENGAPI
PVOID
APIENTRY
EngMapModule(
_In_ HANDLE h,
_Out_ PULONG pSize);
_In_ HANDLE h,
_Out_ PULONG pulSize);
ENGAPI
BOOL

View file

@ -86,13 +86,12 @@ EngUnmapSectionView(
ASSERT(NT_SUCCESS(Status));
}
PVOID
NTAPI
EngCreateSection(
IN ULONG fl,
IN SIZE_T cjSize,
IN ULONG ulTag)
_In_ ULONG fl,
_In_ SIZE_T cjSize,
_In_ ULONG ulTag)
{
NTSTATUS Status;
PENGSECTION pSection;
@ -131,9 +130,9 @@ EngCreateSection(
PVOID
NTAPI
EngCreateSectionHack(
IN ULONG fl,
IN SIZE_T cjSize,
IN ULONG ulTag)
_In_ ULONG fl,
_In_ SIZE_T cjSize,
_In_ ULONG ulTag)
{
NTSTATUS Status;
PENGSECTION pSection;
@ -169,15 +168,14 @@ EngCreateSectionHack(
return pSection;
}
_Success_(return!=FALSE)
BOOL
APIENTRY
EngMapSection(
IN PVOID pvSection,
IN BOOL bMap,
IN HANDLE hProcess,
OUT PVOID* pvBaseAddress)
_In_ PVOID pvSection,
_In_ BOOL bMap,
_In_ HANDLE hProcess,
_When_(bMap, _Outptr_) PVOID* pvBaseAddress)
{
NTSTATUS Status;
PENGSECTION pSection = pvSection;
@ -246,8 +244,8 @@ EngMapSection(
BOOL
APIENTRY
EngFreeSectionMem(
IN PVOID pvSection OPTIONAL,
IN PVOID pvMappedBase OPTIONAL)
_In_opt_ PVOID pvSection,
_In_opt_ PVOID pvMappedBase)
{
NTSTATUS Status;
PENGSECTION pSection = pvSection;
@ -277,13 +275,17 @@ EngFreeSectionMem(
return bResult;
}
_Check_return_
_Success_(return!=NULL)
__drv_allocatesMem(Mem)
_Post_writable_byte_size_(cjSize)
PVOID
APIENTRY
EngAllocSectionMem(
OUT PVOID *ppvSection,
IN ULONG fl,
IN SIZE_T cjSize,
IN ULONG ulTag)
_Outptr_ PVOID *ppvSection,
_In_ ULONG fl,
_In_ SIZE_T cjSize,
_In_ ULONG ulTag)
{
NTSTATUS Status;
PENGSECTION pSection;
@ -321,13 +323,13 @@ EngAllocSectionMem(
return pSection->pvMappedBase;
}
_Check_return_
PFILEVIEW
NTAPI
EngLoadModuleEx(
LPWSTR pwsz,
ULONG cjSizeOfModule,
FLONG fl)
_In_z_ LPWSTR pwsz,
_In_ ULONG cjSizeOfModule,
_In_ FLONG fl)
{
PFILEVIEW pFileView = NULL;
OBJECT_ATTRIBUTES ObjectAttributes;
@ -446,6 +448,9 @@ EngLoadModuleForWrite(
return (HANDLE)EngLoadModuleEx(pwsz, cjSizeOfModule, FVF_SYSTEMROOT);
}
_Check_return_
_Success_(return!=NULL)
_Post_writable_byte_size_(*pulSize)
PVOID
APIENTRY
EngMapModule(
@ -475,7 +480,7 @@ EngMapModule(
VOID
APIENTRY
EngFreeModule(
_In_ HANDLE h)
_In_ _Post_invalid_ HANDLE h)
{
PFILEVIEW pFileView = (PFILEVIEW)h;
NTSTATUS Status;
@ -540,7 +545,8 @@ EngUnmapFile(
return TRUE;
}
_Check_return_
_Success_(return!=FALSE)
BOOL
APIENTRY
EngMapFontFileFD(
@ -562,6 +568,9 @@ EngUnmapFontFileFD(
UNIMPLEMENTED;
}
__drv_preferredFunction("EngMapFontFileFD", "Obsolete")
_Check_return_
_Success_(return!=FALSE)
BOOL
APIENTRY
EngMapFontFile(

View file

@ -53,36 +53,42 @@ EngUnmapSectionView(
PVOID
NTAPI
EngCreateSection(
IN ULONG fl,
IN SIZE_T cjSize,
IN ULONG ulTag);
_In_ ULONG fl,
_In_ SIZE_T cjSize,
_In_ ULONG ulTag);
_Success_(return!=FALSE)
BOOL
APIENTRY
EngMapSection(
IN PVOID pvSection,
IN BOOL bMap,
IN HANDLE hProcess,
OUT PVOID* pvBaseAddress);
_In_ PVOID pvSection,
_In_ BOOL bMap,
_In_ HANDLE hProcess,
_When_(bMap, _Outptr_) PVOID* pvBaseAddress);
_Check_return_
_Success_(return!=NULL)
__drv_allocatesMem(Mem)
_Post_writable_byte_size_(cjSize)
PVOID
APIENTRY
EngAllocSectionMem(
OUT PVOID *ppvSection,
IN ULONG fl,
IN SIZE_T cjSize,
IN ULONG ulTag);
_Outptr_ PVOID *ppvSection,
_In_ ULONG fl,
_In_ SIZE_T cjSize,
_In_ ULONG ulTag);
BOOL
APIENTRY
EngFreeSectionMem(
IN PVOID pvSection OPTIONAL,
IN PVOID pvMappedBase OPTIONAL);
_In_opt_ PVOID pvSection,
_In_opt_ PVOID pvMappedBase);
_Check_return_
PFILEVIEW
NTAPI
EngLoadModuleEx(
LPWSTR pwsz,
ULONG cjSizeOfModule,
FLONG fl);
_In_z_ LPWSTR pwsz,
_In_ ULONG cjSizeOfModule,
_In_ FLONG fl);