Hi again,
isspace(0) is false so you don't need the *p
check.
Thanks, I was hesitating about this when I wrote this code.
> + KeyValue = wcstoul(p, (PWSTR*)&p, 10);
> + ASSERT(p);
This assert seems superfluous, you just dereferenced
the pointer. Also, you incremented it just above and also (rightly) assumed it was larger
than ArcPath.
If I'm 200% sure wcstoul can never ever ever return a NULL pointer via its second
argument, then yes I can remove the assert.
> + /*
> + * We can directly cast the HRESULTs into NTSTATUS since the error codes
> + * returned by StringCbPrintfW:
> + * STRSAFE_E_INVALID_PARAMETER == 0x80070057,
> + * STRSAFE_E_INSUFFICIENT_BUFFER == 0x8007007a,
> + * do not have assigned values in the NTSTATUS space.
> + */
> + return (NTSTATUS)hr;
To me that sounds like an argument of why you
_can't_ do that.
(You know the Rtl versions of these functions give you an NTSTATUS btw, right?)
Oh great! We do have the RtlStringC(b/ch)* functions! But the header:
"ddk/ntstrsafe.h" : in the ddk : lol ...
OK I know that for the purposes of giving a DDK to the users, Microsoft put this header in
"ddk", but it doesn't really make sense for us to have them there, when you
know it can be used also for user-mode applications that just want to rely on NT Rtl*
functions...
Wine's test framework works okay for unit tests.
You can make this an apitest by just #include'ing the C source file, then it can run
on Testbot.
Noted :)