However, when Perl is started through a \\?\ prefixed path, e.g. with
start \\?\c:\perl\bin\perl -e"print qq($_\n) for @INC;<>"
then Win32 reports the module filename as \\?\c:\perl\bin\perl58.dll,
which in turn leads Perl to add //?/c:/perl/lib and //?/c:/perl/site/lib
to @INC which are now invalid names because you can't use forward slashes
with the \\?\ prefix.
The easiest way around this is to just strip the prefix from the module
filename. We'll immediately pass it to win32_longpath(), which only
supports MAX_PATH characters anyways.
Cheers,
-Jan
PS: In case you really want to know, I ran into this issue with a DLL
having a dependency on perl58.dll and being loaded by IIS. :)
--- win32/win32.c.~1~ Thu Jun 16 11:27:57 2005
+++ win32/win32.c Thu Jun 16 11:27:57 2005
@@ -138,6 +138,10 @@
: w32_perldll_handle),
w32_module_name, sizeof(w32_module_name));
+ /* remove \\?\ prefix */
+ if (memcmp(w32_module_name, "\\\\?\\", 4) == 0)
+ memmove(w32_module_name, w32_module_name+4, strlen(w32_module_name+4)+1);
+
/* try to get full path to binary (which may be mangled when perl is
* run from a 16-bit app) */
/*PerlIO_printf(Perl_debug_log, "Before %s\n", w32_module_name);*/
End of Patch.
>The easiest way around this is to just strip the prefix from the module
>filename. We'll immediately pass it to win32_longpath(), which only
>supports MAX_PATH characters anyways.
>
>
Thanks, applied to bleadperl as #24880.
>Cheers,
>-Jan
>
>PS: In case you really want to know, I ran into this issue with a DLL
> having a dependency on perl58.dll and being loaded by IIS. :)
>
>--- win32/win32.c.~1~ Thu Jun 16 11:27:57 2005
>+++ win32/win32.c Thu Jun 16 11:27:57 2005
>@@ -138,6 +138,10 @@
> : w32_perldll_handle),
> w32_module_name, sizeof(w32_module_name));
>
>+ /* remove \\?\ prefix */
>+ if (memcmp(w32_module_name, "\\\\?\\", 4) == 0)
>+ memmove(w32_module_name, w32_module_name+4, strlen(w32_module_name+4)+1);
>+
> /* try to get full path to binary (which may be mangled when perl is
> * run from a 16-bit app) */
> /*PerlIO_printf(Perl_debug_log, "Before %s\n", w32_module_name);*/
>End of Patch.
>
------------------------------------------------
Radan Computational Ltd.
The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.