From: LRN <lr...@gm...> - 2010-03-08 19:54:47
|
On 08.03.2010 21:58, Vincent Richomme wrote: > On Mon, 08 Mar 2010 21:22:18 +0300, LRN <lr...@gm...> wrote: > >> On 08.03.2010 21:15, Vincent Richomme wrote: >> >>> Hi, >>> >>> I tried to recompile your libntlink and I get : >>> >>> >>> C:\GNUstep\home\Vincent\libntlink>make-mingw.cmd >>> gcc -std=c99 -I. -O3 -fno-common -Wno-format -mms-bitfields >>> -D_WIN32_WINNT=0x50 >>> 0 -o juncpoint.o -c juncpoint.c >>> gcc -std=c99 -I. -O3 -fno-common -Wno-format -mms-bitfields >>> -D_WIN32_WINNT=0x50 >>> 0 -o quasisymlink.o -c quasisymlink.c >>> quasisymlink.c:25:23: error: juncpoint.h: No such file or directory >>> >>> >> I probably forgot to include this file into archive. >> >>> And will it work also with exe file or just directories ? >>> >>> >> Should, in theory, work with both directories and files. >> > I would be surprised if it would work with files at least not on XP. > I have tested on Windows XP : > > C:\GNUstep\home\Vincent\libntlink>junc.exe l C:\GNUstep\bin binlnk > > and sometimes explorer.exe just crashes but I always end up with a simple > directory that doesnt' reference my target dir. > I am dowloading windows driver kit to recompile it with native tools and > see what is going on. > If you look at the source, you'll see that it calls SetJuncPointW() for directories and CreateHardLinkW() for files. So it should work for both. Also, in SetJuncPointW() documentation you'll see that: * @path1: full directory path (UTF-16), unparseable * @path2: full directory path (UTF-16) And there's a /* FIXME: check that wpath is absolute */ in quasisymlink.c (actually, there should be one more such comment, in ntlink_symlink(), i've missed that). And main() never checks for absolute paths either. libntlink is not a complete (well-designed, well-tested and well-maintained) solution, so do not treat it as such. I've made it to try to port some symlink-dependent application to Windows, then abandoned the idea, but kept the library. You should definitely read the source (reading some parts of SetJuncPointW(), UnJuncPointW() and GetJuncPointW() might lead to serious brain injury, but the rest of the code is fairly trivial - argument checks, path and codepage conversion, string operations) and fix it where appropriate. I've used MinGW to build it, and there's no need to use MS tools to build or debug it (but if you want to, i won't stop you - it's your funeral). |