Help with /?? stuff

Shachar Shemesh wine-devel at sun.consumer.org.il
Sat Jan 11 03:13:29 CST 2003


John K. Hohm wrote:

>>>Alberto Massari wrote:
>>>I guess Wine is converting the NULL into \?? to be able to store it as 
>>>a string.
>>>      
>>>
>
>Shachar Shemesh wrote:
>  
>
>>You guessed wrong. The leading \?? is there under both Wine and Windows 
>>2000, and in both cases there is ALSO a NULL. As neither Wine nor 
>>Windows 2000 then accepts that as a valid path, I'll just remove it. I 
>>was just wondering whether anyone knows why Windows 2000 puts that extra 
>>stuff in (it's obvious why wine does that - to be compatible).
>>    
>>
>
>I'm not sure about \??, but see this excerpt from MSDN Re CreateFile:
>
>lpFileName [in]
>Pointer to a null-terminated string that specifies the name of the object
>to create or open.
>
>In the ANSI version of this function, the name is limited to MAX_PATH 
>characters. To extend this limit to 32,767 wide characters, call the
>Unicode version of the function and prepend "\\?\" to the path. For more
>information, see Naming a File.
>
>Windows 95/98/Me:  This string must not exceed MAX_PATH characters. 
>  
>
That's true, except:

   1. Wine does not support this convention.
   2. I have not managed to get Windows to really support it either.
   3. Changing the first '?' to a '\' is more difficult, as you need to
      perform elaborate tests to make sure that you are not accessing
      data outside of the buffer.

I was seriously considering doing it in C++ (which SHOULD be ok, as this 
is not a DLL, right?). That would have allowed much more felxibility. Oh 
well, maybe next time.

            Shachar

>  
>




More information about the wine-devel mailing list