Hi Stefan,
On 07/13/17 17:40, Stefan Dösinger wrote:
+enum msvcp140_file_type {
- msvcp140_file_type_not_found = -1, msvcp140_file_type_none, msvcp140_file_type_regular,
- msvcp140_file_type_directory, msvcp140_file_type_symlink, msvcp140_file_type_block,
- msvcp140_file_type_character, msvcp140_file_type_fifo, msvcp140_file_type_socket, msvcp140_file_type_unknown
+};
Did you consider changing current structure instead of defining new one? I'm talking about something like: enum file_type { #if _MSVCP_VER < 140 status_unknown, file_not_found, #else file_not_found = -1, status_unknown, #endif regular_file, directory_file, ... } Thanks to it you will be able to use the same implementation of _Open_dir/_Read_dir in msvcp120 and msvcp140.
- *permissions = (attr & FILE_ATTRIBUTE_READONLY)?0555:0777;
You should also handle permission==NULL case.
Thanks, Piotr
Hi,
Andrey has spotted one more thing in the patch: + ok(tests[i].perms == tests[i].perms, "_Stat(): test %d perms expect: 0%o, got 0%o\n", + i+1, tests[i].perms, perms); +
there should be: ok(perms == tests[i].perms, ...
Thanks, Piotr
On 14/07/17 11:58, Piotr Caban wrote:
Did you consider changing current structure instead of defining new one? I'm talking about something like: enum file_type { #if _MSVCP_VER < 140 status_unknown, file_not_found, #else file_not_found = -1, status_unknown, #endif regular_file, directory_file, ... } Thanks to it you will be able to use the same implementation of _Open_dir/_Read_dir in msvcp120 and msvcp140.
I like that idea, I'll see if I can make it work. One possible issue that pops into my mind is that we'll need both names to be available or we'll have to put msvcp120 / 140 Stat into #if statements as well. I vaguely prefer the latter option.