RE: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (resend)

2009-04-09 Thread Andreas Rosenberg
Thanks for the clarification about todo_wine, Paul Paul Vriens wrote: Well I don't think it will be accepted as is. We usually don't add functions that are not used anywhere especially when the comments say that there is a bug elsewhere that should be fixed first. Well, I was thinking about

RE: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (resend)

2009-04-08 Thread Andreas Rosenberg
Thanks for your hints, Paul. I added some tests for the Ansi variant of the function and fixed the problem you mentioned. I also think that your addition of _GetAccountNameFromTokenW is holding the committing of this patch back, especially because you don't seem to use that function. I also

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (resend)

2009-04-08 Thread Paul Vriens
Andreas Rosenberg wrote: Thanks for your hints, Paul. I added some tests for the Ansi variant of the function and fixed the problem you mentioned. I also think that your addition of _GetAccountNameFromTokenW is holding the committing of this patch back, especially because you don't seem to

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (resend)

2009-04-06 Thread Paul Vriens
Andreas Rosenberg wrote: Just had a look again on your resend: this doesn't seem correct: +if ( lpcchSize lpcchSize ) I also think that your addition of _GetAccountNameFromTokenW is holding the committing of

dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (resend)

2009-03-30 Thread Andreas Rosenberg
From acb4bf2dc4ecbd56fa54dfcbd8be2b270929d865 Mon Sep 17 00:00:00 2001 From: Andreas.Rosenberg andreas.rosenb...@apis.de Date: Mon, 30 Mar 2009 10:19:50 +0200 Subject: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A --- dlls/userenv/Makefile.in |2 +- dlls/userenv/tests/userenv.c

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A

2009-03-27 Thread Paul Vriens
Andreas Rosenberg wrote: There is no need for that GetVersionExA call/test. Just do an if (0) and leave that comment about NT4 crashing in. -- Cheers, Paul.

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (7)

2009-03-10 Thread Andreas Rosenberg
Vitaliy Margolen wrote: +res = RegOpenKeyExW( HKEY_LOCAL_MACHINE, profile_pathname, 0L, KEY_QUERY_VALUE, keyProfileDir ); +res = RegGetValueW( keyProfileDir, profile_subkey, profile_keyname, RRF_RT_ANY, + NULL, buffer, sizePath ); /* RegGetValue

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (7)

2009-03-07 Thread Vitaliy Margolen
Andreas Rosenberg wrote: Almost there, just few small things left. +TRACE(%p %s %p\n, hToken, lpProfileDir, lpcchSize); Don't print output parameters[lpProfileDir] as string only as a point. Unless it's used as

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (6)

2009-03-06 Thread Paul Vriens
Andreas Rosenberg wrote: Hi, Error during compilation: userenv_main.c:181: warning: passing argument 1 of ‘GetUserNameW’ from incompatible pointer type Shouldn't that line be: res = GetUserNameW( userName,

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (6)

2009-03-06 Thread Paul Vriens
Paul Vriens wrote: Paul Vriens wrote: Andreas Rosenberg wrote: Hi, Error during compilation: userenv_main.c:181: warning: passing argument 1 of ‘GetUserNameW’ from incompatible pointer type Shouldn't that line

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-06 Thread Andreas Rosenberg
Vitaliy Margolen wrote: The error codes returned by a function are not part of the Windows API But they are. MS just made their obligation to document all of their craft that much easer and that much more undefined. According to this logic Error! is the only message you need for anything

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (6)

2009-03-06 Thread Paul Vriens
Paul Vriens wrote: Andreas Rosenberg wrote: Hi, Error during compilation: userenv_main.c:181: warning: passing argument 1 of ‘GetUserNameW’ from incompatible pointer type Shouldn't that line be: res =

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (7)

2009-03-06 Thread Paul Vriens
Andreas Rosenberg wrote: It's quite common for these functions to check for the needed buffersize when buffer=NULL and size=0 is passed. I did a quick check on W2K3 and this is what is returned: sizePath = 0;

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (6)

2009-03-06 Thread Andreas Rosenberg
On Friday 06 March 2009 14:12:11 you wrote: Paul Vriens wrote: Andreas Rosenberg wrote: Hi, Error during compilation: userenv_main.c:181: warning: passing argument 1 of ‘GetUserNameW’ from incompatible

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (6)

2009-03-06 Thread Paul Vriens
Andreas Rosenberg wrote: On Friday 06 March 2009 14:12:11 you wrote: Paul Vriens wrote: Andreas Rosenberg wrote: Hi, Error during compilation: userenv_main.c:181: warning: passing argument 1 of ‘GetUserNameW’ from

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (3rd try)

2009-03-05 Thread Nikolay Sivov
Andreas Rosenberg wrote: Test looks better but: +r = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, htoken); +expect(TRUE, r); + +r = GetUserProfileDirectoryW(htoken , NULL, NULL ); +lastError = GetLastError(); +expect(FALSE, r); +

RE: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-05 Thread Andreas Rosenberg
I don't consider it helpful writing a conformance test, for something that is not specified. One could simply omit the error codes, but if this call should fail an app may log/present a more meaningfull error message than without it. If the error codes should be different from Windows, this

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (4)

2009-03-05 Thread Nikolay Sivov
Andreas Rosenberg wrote: Fails on XP SP2 with: --- userenv.c:308: Test failed: Expected 1, got 39 userenv: 92 tests executed (0 marked as todo, 1 failure), 0 skipped. --- Much less important but still: please remove trailing whitespaces. 'git apply' should not

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (4)

2009-03-05 Thread Jeremy White
Much less important but still: please remove trailing whitespaces. 'git apply' should not produce any warnings. I've discovered that if you use git-add to fully stage your commit, you can then run: git-diff-index --check HEAD immediately prior to committing; that will catch such warnings

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-05 Thread Andreas Rosenberg
Nikolay Sivov wrote: Andreas Rosenberg wrote: +    if ( !lpcchSize ) { +        SetLastError(ERROR_INVALID_PARAMETER); +        return FALSE; +                    SetLastError(ERROR_MORE_DATA); +                } +            } +        } +        else +            

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (4)

2009-03-05 Thread Francois Gouget
On Thu, 5 Mar 2009, Jeremy White wrote: Much less important but still: please remove trailing whitespaces. 'git apply' should not produce any warnings. I've discovered that if you use git-add to fully stage your commit, you can then run: git-diff-index --check HEAD immediately prior

dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (5)

2009-03-05 Thread Andreas Rosenberg
From d59c1fe3e26e0cb41a3affe4034abc6dc9bd0556 Mon Sep 17 00:00:00 2001 From: Andreas.Rosenberg andreas.rosenb...@apis.de Date: Thu, 5 Mar 2009 18:41:37 +0100 Subject: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A --- dlls/userenv/Makefile.in |2 +- dlls/userenv/tests/userenv.c

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-05 Thread Vitaliy Margolen
Andreas Rosenberg wrote: According to MSDN the error codes are not part of the API documentation: The error codes returned by a function are not part of the Windows API But they are. MS just made their obligation to document all of their craft that much easer and that much more undefined.

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-05 Thread Vitaliy Margolen
Andreas Rosenberg wrote: Conformance tests should verify, if the function works like documented. Not correct. If you look at lots of conformance tests they test things that are not documented. In some cases they test things that documentation is wrong about. Vitaliy.

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-04 Thread Andreas Rosenberg
Nikolay Sivov wrote: Andreas Rosenberg wrote: +if ( !lpcchSize ) { +SetLastError(ERROR_INVALID_PARAMETER); +return FALSE; +SetLastError(ERROR_MORE_DATA); +} +} +} +else +

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-04 Thread Ricardo Filipe
2009/3/4 Andreas Rosenberg andreas.rosenb...@apis.de Sorry, but I disagree with you opinion. A conformance test should verify if an API call works like documented. The MSDN documentation specifies nothing regarding error codes for GetUserProfileDirectory.

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-04 Thread Nikolay Sivov
Andreas Rosenberg wrote: Nikolay Sivov wrote: Andreas Rosenberg wrote: +if ( !lpcchSize ) { +SetLastError(ERROR_INVALID_PARAMETER); +return FALSE; +SetLastError(ERROR_MORE_DATA); +} +} +} +else +

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A (2nd try)

2009-03-03 Thread Nikolay Sivov
Andreas Rosenberg wrote: +if ( !lpcchSize ) { +SetLastError(ERROR_INVALID_PARAMETER); +return FALSE; +SetLastError(ERROR_MORE_DATA); +} +} +} +else +SetLastError(ERROR_REGISTRY_CORRUPT); +} +

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A

2009-03-02 Thread Nikolay Sivov
Andreas Rosenberg wrote: +TRACE(%p %s %p\n, hToken, debugstr_w(lpProfileDir), lpcchSize ); +/* profile specific tokens not supported, so hToken ignored */ + +SetLastError(0); +res = RegOpenKeyExW(HKEY_LOCAL_MACHINE,profile_pathname,0L,KEY_QUERY_VALUE,keyProfileDir); Why do

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A

2009-03-02 Thread Andreas Rosenberg
On Monday 02 March 2009 17:26:47 Nikolay Sivov wrote: Andreas Rosenberg wrote: +TRACE(%p %s %p\n, hToken, debugstr_w(lpProfileDir), lpcchSize ); +/* profile specific tokens not supported, so hToken ignored */ + +SetLastError(0); +res =

Re: dlls/userenv: fixed stubs GetUserProfileDirectoryW/A

2009-03-02 Thread Nikolay Sivov
Andreas Rosenberg wrote: On Monday 02 March 2009 17:26:47 Nikolay Sivov wrote: Andreas Rosenberg wrote: +TRACE(%p %s %p\n, hToken, debugstr_w(lpProfileDir), lpcchSize ); +/* profile specific tokens not supported, so hToken ignored */ + +SetLastError(0); +res =