YongHao Hu christopherwuy@gmail.com wrote:
On Windows, CreateDirectoryA fail when the path's size longer than MAX_PATH-12(248) while Wine's implementation succeed.[1]
Is there an application that depends on this very strange implementation detail? Besides, the messages in the ok() calls sometimes are wrong. Also, you shouldn't test against TRUE/FALSE directly.
Hi,
On 15/11/5 下午12:48, Dmitry Timoshkov wrote:
YongHao Hu christopherwuy@gmail.com wrote:
On Windows, CreateDirectoryA fail when the path's size longer than MAX_PATH-12(248) while Wine's implementation succeed.[1]
Is there an application that depends on this very strange implementation detail?
Nope. I didn't find an application that depends on this implementation details. But I found this detail because of the implementation of tr2::sys::Open_dir[1]. I think if it is impossible to create a directory whose size max than 248, the patch can be improved.
Besides, the messages in the ok() calls sometimes are wrong.
Could you explain a bit more detail?
Also, you shouldn't test against TRUE/FALSE directly.
Do you have any good idea? Thank you.
[1]: http://source.winehq.org/git/wine.git/blobdiff/d8cc1dccba88a01e3eaacf958f88a...
YongHao Hu christopherwuy@gmail.com wrote:
On Windows, CreateDirectoryA fail when the path's size longer than MAX_PATH-12(248) while Wine's implementation succeed.[1]
Is there an application that depends on this very strange implementation detail?
Nope. I didn't find an application that depends on this implementation details. But I found this detail because of the implementation of tr2::sys::Open_dir[1]. I think if it is impossible to create a directory whose size max than 248, the patch can be improved.
Is there any reason that you care about the size limit? In the most cases you shouldn't unless there is an application that depends on particular behaviour.
Besides, the messages in the ok() calls sometimes are wrong.
Could you explain a bit more detail?
Compare what the calls below are supposed to do and what ok() actually reports: in case of a failure.
+ ret = CreateDirectoryA(tmpdir, NULL); + todo_wine ok(ret == FALSE, + "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + ret = RemoveDirectoryA(tmpdir); + todo_wine ok(ret == FALSE, "RemoveDirectoryA should always succeed\n");
Also, you shouldn't test against TRUE/FALSE directly.
Do you have any good idea?
ok(ret, ""); or if (!ret, ""); are commonly accepted solutions.