Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread James Hawkins
I have compiled crypt and run the tests with no failures. This latest patch removes all changes to the pointer arithmetic. On Tue, 03 Aug 2004 07:55:51 +0300, Shachar Shemesh <[EMAIL PROTECTED]> wrote: > James Hawkins wrote: > > >>- strcpy(keyname + strlen(KEYSTR), pProvName); > >> >

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread Shachar Shemesh
James Hawkins wrote: - strcpy(keyname + strlen(KEYSTR), pProvName); I changed that line to strcatW(keyname, pProvName). That makes a lot more sense Mike, thanks for the tip. I'm wasn't exactly sure on this one so it would be great if you could help me on this one. When using poin

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > ptr = keyname + strlenW(keyname); > > I guess it holds true here as well because keyname is a pointer and > we're adding ot it. If that is the case, the included patch fixes the > two things mentioned. You have to look for other similar, not mentione

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread Jeroen Janssen
James Hawkins wrote: I'm wasn't exactly sure on this one so it would be great if you could help me on this one. When using pointer arithmetic, do the operations such as --, ++... increment or decrement by the size of the pointer type? Yes, if you have a char (1byte) pointer and you ++, you'll ge

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread James Hawkins
> - strcpy(keyname + strlen(KEYSTR), pProvName); I changed that line to strcatW(keyname, pProvName). That makes a lot more sense Mike, thanks for the tip. I'm wasn't exactly sure on this one so it would be great if you could help me on this one. When using pointer arithmetic, do the

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread Mike McCormack
James Hawkins wrote: +PWSTR keyname; - keyname = CRYPT_Alloc(strlen(KEYSTR) + strlen(pProvName) +1); +keyname = CRYPT_Alloc((strlenW(KEYSTR) + strlenW(pProvName) + 1) * sizeof(WCHAR)); if (keyname) { - strcpy(keyname, KEYSTR); - str

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-02 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > Full rewrite. If you have any questions, I'll be happy to answer them. > > Changelog > * clean up cross-call functions > - strcpy(keyname, KEYSTR); > - strcpy(keyname + strlen(KEYSTR), pProvName); > + strcpyW(keyname, KEYSTR); > + strcpyW(key

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-01 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > What is left to change? > - DWORD keytype, type, len; > + DWORD keytype, type, len, size; Why do you need new 'size' variable? 'len' works fine. > - CRYPT_Free(keyname); > - r = RegQueryValueExA(key, "Name", NULL, &keytype, NULL, &len); > - if( r

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-01 Thread James Hawkins
What is left to change? On Sun, 1 Aug 2004 20:14:58 +0900, Dmitry Timoshkov <[EMAIL PROTECTED]> wrote: > "James Hawkins" <[EMAIL PROTECTED]> wrote: > > > Fixed even more bugs spotted by Dmitry. > > > > Changelog > > * cleanup cross-call functions > > The quality of the patch still is not good

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-01 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > Fixed even more bugs spotted by Dmitry. > > Changelog > * cleanup cross-call functions The quality of the patch still is not good enough. -- Dmitry.

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-08-01 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > Fixed more bugs spotted by Dmitry. > > Changelog >* cleanup cross-call functions If you could use 'static const' as everywhere else and not 'const static' that would be nice. > + size = sizeof(DWORD); > + r = RegQueryValueExW(key, nameW, NULL, &k

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-07-31 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > Fixed bugs spotted by Dmitry > > Changelog > * cleanup cross-call functions Still there are bugs in the patch. 1. RegQueryValueExW/RegSetValueExW take bytes in the last parameter 2. Do not use 'strlen' as a name of the variable, that at least ver

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-07-29 Thread Dmitry Timoshkov
"James Hawkins" <[EMAIL PROTECTED]> wrote: > This is a resubmit of my original patch that cleans up a->w cross > calls in crypt. > > Changelog > * cleanup a->w cross calls in advapi32/crypt.c > + static const WCHAR KEYSTR[] = { > + 'S',

Re: cleanup a->w cross calls in advapi32/crypt.c

2004-07-21 Thread Alexandre Julliard
James Hawkins <[EMAIL PROTECTED]> writes: > - PCSTR KEYSTR = "Software\\Microsoft\\Cryptography\\Defaults\\Provider\\"; > - PSTR keyname; > + PCWSTR KEYSTR = > (PCWSTR)"Software\\Microsoft\\Cryptography\\Defaults\\Provider\\"; > + PWSTR keyname; This is wrong, you need to declare