I think I may have found a bug in Samba. I'm new to this so it's
possible
that it may just be a misconfiguration on my part.
Here's the symptom: When I open a file through Samba from a Windows box
using the code below I never get the "Existing file" case.
GetLastError()
always returns 0. If I change the path to point to a share on a Windows
computer it works correctly.
I'm running Samba 2.2.2 on SuSE Linux 7.3. The Windows box is running
Windows 2000 SP2.
If you have any ideas or need any more info let me know.
Thanks for any help you can provide,
-Michael O. Schoneman
HANDLE hFile = CreateFile(
lpszFullPath, // pointer to name of the file
GENERIC_READ, // access (read-write) mode
FILE_SHARE_READ, // share mode
NULL, // pointer to security descriptor
OPEN_ALWAYS, // how to create
FILE_FLAG_SEQUENTIAL_SCAN, // file attributes
NULL // handle to file with attributes to copy
);
if(hFile != INVALID_HANDLE_VALUE)
{
// New File Test
if(GetLastError() != ERROR_ALREADY_EXISTS)
{
// It's a new file
}
else
{
// Existing file
}
}