Code: Select all
if Win32Platform = VER_PLATFORM_WIN32_NT then
if Length(FileName) >= MAX_PATH then
FileName:='\\?\'+FileName;
CreateProcess(PChar(FileName),...)
Regards
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
if Win32Platform = VER_PLATFORM_WIN32_NT then
if Length(FileName) >= MAX_PATH then
FileName:='\\?\'+FileName;
CreateProcess(PChar(FileName),...)
AFAIK TC uses ShellExecuteEx.MarcinW wrote:However, I don't know whether TC uses CreateProcess to launch applications or not.
Code: Select all
if Length(FileName) < MAX_PATH then
ShellExecuteEx(...)
else
if Win32Platform = VER_PLATFORM_WIN32_NT then
CreateProcess(PChar('\\?\'+FileName),...) {This will work only for executable images}
According to my tests, under Windows NT family you can use both ANSI and Unicode APIs with '\\?\' prefix and they works. And MSDN says, that the limit is as large as 32767 chars (+ null) in this case. But this works only with some functions from kernel32.dll, which is a wrapper around ntdll.dll, which passes calls to kernel-mode. AFAIK in the kernel mode all paths use '\\?\' prefix, so such paths can also be passed directly from the user mode.MVV wrote:AFAIK any Unicode API function supports prefixed paths up to 1023 characters.
I was waiting for this questionMVV wrote:But is there any reason to keep applications in such deep places? Are you sure that app is able to work correctly in that place?