1

How much can I rely on SAL? Do I need to do

NSTATUS my_func(_In_ int *p)
{
    if (NULL == p) {
        return STATUS_INVALID_PARAMETER;
    }
    *p = 1;
    return STATUS_SUCCESS;
}

or can I just do

NTSTATUS my_func(_In_ int *p)
{
    *p = 1;
    return STATUS_SUCCESS;
}
Thomas
  • 13
  • 2

1 Answers1

2

SAL only provides static checks at compile time. This assumes that all code involved has the appropriate annotations and has also been checked. This is okay internal to your application or module but be careful at boundaries with other libraries.

Reilly Grant
  • 5,590
  • 1
  • 13
  • 23
  • Wow I just now saw that this question got answered! Clicked the checkmark for you, sorry for super long delay. Would upvote you, too, but it looks like I need 15 reputation for that. – Thomas Mar 05 '15 at 01:03