Skip to content

Commit

Permalink
Add a few SAL annotations on internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Oct 7, 2021
1 parent ae0f886 commit 13fe4cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packetWin7/Dll/AdInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ static BOOLEAN PacketGetAdaptersAirpcap()
\param AdapterName Name of the adapter whose information has to be retrieved.
\return If the function succeeds, the return value is non-null.
*/
_Use_decl_annotations_
PADAPTER_INFO PacketFindAdInfo(PCCH AdapterName)
{
//this function should NOT acquire the g_AdaptersInfoMutex, since it does return an ADAPTER_INFO structure
Expand Down Expand Up @@ -721,6 +722,7 @@ PADAPTER_INFO PacketFindAdInfo(PCCH AdapterName)
\return If the function succeeds, the return value is TRUE. A false value means that the adapter is no
more valid or that it is disconnected.
*/
_Use_decl_annotations_
BOOLEAN PacketUpdateAdInfo(PCCH AdapterName)
{
//this function should acquire the g_AdaptersInfoMutex, since it's NOT called with an ADAPTER_INFO as parameter
Expand Down
16 changes: 12 additions & 4 deletions packetWin7/Dll/Packet32-Int.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ ADAPTER_INFO, *PADAPTER_INFO;
// Internal functions
//
void PacketPopulateAdaptersInfoList();
BOOL PacketGetFileVersion(LPCTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen);
PADAPTER_INFO PacketFindAdInfo(PCCH AdapterName);
BOOLEAN PacketUpdateAdInfo(PCCH AdapterName);
LPADAPTER PacketOpenAdapterNPF(PCCH AdapterName);

_Success_(return != 0)
BOOL PacketGetFileVersion(_In_ LPCTSTR FileName, _Out_writes_(VersionBuffLen) PCHAR VersionBuff, _In_ UINT VersionBuffLen);

_Ret_maybenull_
PADAPTER_INFO PacketFindAdInfo(_In_ PCCH AdapterName);

_Success_(return != 0)
BOOLEAN PacketUpdateAdInfo(_In_ PCCH AdapterName);

_Ret_maybenull_
LPADAPTER PacketOpenAdapterNPF(_In_ PCCH AdapterName);

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 2 additions & 0 deletions packetWin7/Dll/Packet32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,7 @@ LONG PacketDumpRegistryKey(PCHAR KeyName, PCHAR FileName)
\note uses the GetFileVersionInfoSize() and GetFileVersionInfo() WIN32 API functions
*/
_Use_decl_annotations_
BOOL PacketGetFileVersion(LPCTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen)
{
DWORD dwVerInfoSize; // Size of version information block
Expand Down Expand Up @@ -1582,6 +1583,7 @@ BOOL PacketStartService()
\note internal function used by PacketOpenAdapter() and AddAdapter()
*/
_Use_decl_annotations_
LPADAPTER PacketOpenAdapterNPF(PCCH AdapterNameA)
{
DWORD error;
Expand Down

0 comments on commit 13fe4cc

Please sign in to comment.