On September 11, 2002 11:07 am, Patrik Stridvall wrote:
Well as I said a lot of API use LPSTR when it really should use LPCSTR so the potential IO/OUT cases are quite a few.
I don't think it's "lot". Can you give a count where LPSTR/LPWSTR is used for a IN parameter only?
I don't know how to do that automatically. You will have to look in the documentation and sometimes the documention is wrong...
And those we can fix in our sources, as you said.
Yes.
You mean just add a OUT before the type. That is quite easy
to parse.
Even better -- encode it in the typeinfo.
/* M = modifiable */ typedef LPSTR LPMSTR; typedef LPWSTR LPMWSTR;
Use LPM{,W}STR instead of LP{,W}STR where the parameter is an IO one. The type are equivalent, so no one will notice a difference except our parsing tool.
I personally like the OUT better since it is official defined by Microsoft.
BTW, how many are IO? I would suspect most are O only...
For strings, not that many. Can't think of any right now. However there are quite a few LPDWORD that specifies the allocated length of the output buffer and the function is should write the used length (or needed length, if the function faild) in the pointed to DWORD.
Other than that it is quite uncommon IIRC.
On September 11, 2002 11:24 am, Patrik Stridvall wrote:
BTW, how many are IO? I would suspect most are O only...
For strings, not that many. Can't think of any right now. However there are quite a few LPDWORD that specifies the allocated length of the output buffer and the function is should write the used length (or needed length, if the function faild) in the pointed to DWORD.
Dude, you're killing me!
We care to distinguish I/O for strings _only_. And since we don't have any, we have no problem!!! For LPDWORD, print them always, they are fixed length, you (as the guy looking at the traces) know if you care about them or not...
Dimitrie O. Paun wrote:
Dude, you're killing me!
We care to distinguish I/O for strings _only_. And since we don't have any, we have no problem!!! For LPDWORD, print them always, they are fixed length, you (as the guy looking at the traces) know if you care about them or not...
Ok, how about the "lpClasses" array for GetCharacterPlacement? It's not a fixed value, it's an array, and it's (based on flags) in/out.
Shachar