"File not found" error returned from CreateHardLink() in IIS Filter

This is a discussion on "File not found" error returned from CreateHardLink() in IIS Filter within the Windows Web Servers forums, part of the Web Server and Related Forums category; I'm getting a "file not found" error (0x2) returned from the Platform SDK function CreateHardLink(lpFileName, lpExistingFileName, ...


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2005
James
 
Posts: n/a
Default "File not found" error returned from CreateHardLink() in IIS Filter

I'm getting a "file not found" error (0x2) returned from the Platform
SDK function CreateHardLink(lpFileName, lpExistingFileName, NULL) that
is being called from within an IIS filter. The function is actually
called using two CStrings that are assigned from char[]variables:

CreateHardLink(CString, CString, NULL);

I am logging activity from the filter into a text file. The log entry
with the error shows a valid source file -- when I cut/paste from the
log into the Windows Explorer's address bar, the file is accessed just
fine, so the file definitely exists. The problem may be with certain
"special characters" in the file name, though some of the file names it
is failing on seem "normal". Here are some of the files I'm getting
the "file not found" with (path not shown):

Car_Obj3.zip
BB_House_Revised.zip
Gewächs.zip
Autoƒ.sit


Note that the 'ä' (ANSI 228) in "Gewächs.zip" and the 'ƒ' (ANSI 198)
in "Autoƒ.sit" are both ANSI characters, not unicode. The other two
file names contain normal characters (the underscores are ANSI 095).

The directory exists where the link is being created.
The existing file and the link being created are both on the same
locally mounted hard-drive.


MORE INTERESTING:

I wrote a C++ console app that takes two arguments from the command
line: the Link File (including path) and the Existing File (including
path). It executes CreateHardLink() using those strings passed in.
When executed on the same server that the IIS filter is running on
using the same paths/files mentioned above, it creates the hard-link
with no errors! It's basically the same code that is in the IIS
filter, except the CString arguments that are passed to
CreateHardLink() are assigned from the argv[] values passed in from the
commandline:

CString csHardLinkFileName(argv[1]);
CString csExistingFileName(argv[2]);
CreateHardLink(csHardLinkFileName, csExistingFileName, NULL);


Essentially this is the same code as in the IIS filter, but this works
and the filter does not!

SPECS -

O/S:
The IIS filter is running on MS Windows 2000 Server SP4

Platform SDK:
July 2002

C++ Compiler:
VC++ 6.0
Build options:
/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D
"_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D _WIN32_WINNT=0x500
/Fp"Release/ISAPIFilter.pch" /Yu"stdafx.h" /Fo"Release/"
/Fd"Release/" /FD /c



Very strange! Any answers?

Thank you!
-James

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:37 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0