Joerg-Cyril.Hoehle@t-systems.com writes:
The tests prove that not all calls without a trailing slash must fail. So until we know more precisely the exact conditions, I feel it's better to revert to the old behaviour that allowed the copy protection scheme to work.
That's only moving the bug around. We have tests for the current behavior, any further improvement must keep the existing tests working.
Hi,
That's only moving the bug around.
Indeed. It just moves the todo_wine from one side to the other.
We have tests for the current behavior, any further improvement must keep the existing tests working.
I dispute the correctness of the tests. Here's what I get on a real (as opposed to virtual) w2k machine, starting the test from within D:...:
volume.c:337: Test failed: GetVolumeInformationA w/o '' did not fail, last error 234 volume: 257 tests executed (0 marked as todo, 1 failure), 0 skipped.
the "not" is my addition to reveal the value of "ret": ok(!ret && GetLastError() == ERROR_INVALID_NAME, "GetVolumeInformationA w/o '\' did%s fail, last error %u\n", ret ? " not":"", GetLastError());
So from the 3 relevant tests about GetVolumeInformation, 2 return no error without the trailing slash.
My conclusion is that the current tests (that all pass on winetestbot) may lead us to false conclusions. There's something else that controls whether no trailing slash succeeds or not. ... Well, here's a little light:
C:>d: D:\foo>d:\bar\zot\kernel32_test.exe volume # from testbot job #3225 volume.c:328: Test failed: GetVolumeInformationA w/o '' did not fail, last error 3735928559 volume: 285 tests executed (0 marked as todo, 1 failure), 0 skipped.
I.e. the test fails (GetVolumeInformation succeeds) when the "active" directory on C: is , regardless of my current directory being anywhere on another drive. Whether my current directory is a root or not does not matter (unless I'm in C:).
There may be more strangeness to the behaviour: I don't understand why the test failed on the first run, as IIRC the cmd window shell supposedly opens with CD on C: as "C:\Documents...\user", i.e. not C:\
Regards, Jörg Höhle
Joerg-Cyril.Hoehle@t-systems.com writes:
C:>d: D:\foo>d:\bar\zot\kernel32_test.exe volume # from testbot job #3225 volume.c:328: Test failed: GetVolumeInformationA w/o '' did not fail, last error 3735928559 volume: 285 tests executed (0 marked as todo, 1 failure), 0 skipped.
I.e. the test fails (GetVolumeInformation succeeds) when the "active" directory on C: is , regardless of my current directory being anywhere on another drive. Whether my current directory is a root or not does not matter (unless I'm in C:).
Most likely the implementation should just do an open_device_root() like the other volume functions. However, the corresponding ntdll functions to retrieve volume information from a file handle are not implemented yet, so it will be a bit of work.
In any case, if you think the existing tests are not good enough, you can certainly add more of them to clarify things. But any proposed patch has to pass the existing tests, plus of course any new ones.
Hi,
The kernel32/volume test either passes or fails depending on C:'s current directory prior to invocation in the shell.
C: CD \ # Use CD \windows or CD \anydir to obtain opposite results D: CD \somesubdir X:\path\to\kernel32_test.exe volume volume.c:328: Test failed: GetVolumeInformationA w/o '' did not fail, last error 3735928559 volume: 267 tests executed (0 marked as todo, 1 failure), 0 skipped.
In any case, if you think the existing tests are not good enough, you can certainly add more of them to clarify things.
I'd like to, but how to change a drive's directory from within a program? No combination of SetCurrentDirectory() I tried worked. - SetCurrentDirectory("C:") is synonym to "C:" and does not switch to C:'s current directory. - SetCD("C:..."); SetCD("D:\somesubdir"); does not influence the test result like CD in the shell does, as if the last dir on C: was not remembered. It looks like SetCurrentDirectory is from a different API layer.
DefineDOSDevice looks too low-level - I don't want new DOS devices, I just want to influence the current directory of drive C:
http://msdn.microsoft.com/en-us/library/aa365247%28v=VS.85%29.aspx "[the system] also keeps track of the current directories in each of the different drive letters, ... regardless of which drive designator is set as the current drive."
Thanks for any hints or ideas, Jörg Höhle
Joerg-Cyril.Hoehle@t-systems.com writes:
In any case, if you think the existing tests are not good enough, you can certainly add more of them to clarify things.
I'd like to, but how to change a drive's directory from within a program?
Set the corresponding "=X:" environment variable.