Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Feb : DeviceIoControl and Samba

www.cryer.info
Managed Newsgroup Archive

DeviceIoControl and Samba

Subject:DeviceIoControl and Samba
Posted by:"Michael Fritz" (spam_athome@yahoo.de)
Date:Thu, 24 Feb 2005 21:02:28

Hi,

I'm using the code below to retrieve a file's compression state from any
partition - this works quite well using Windows XP and local drives/files.

However when this file is saved to a shared network resource, in my case a
samba controlled share on a Linux server, this call fails. How would you
first check if a drive/share is capable of using file compression?
The file I want to check if compression is set is save to
\server\pwc\file.dat.

try
hSrc :=     
CreateFile(PChar(SOURCE),0,0,Nil,OPEN_EXISTING,FILE_FLAG_BACKUP_SEMANTICS,0);
if hSrc > 0 then
begin
// get compression
if
DeviceIoControl(hSrc,FSCTL_GET_COMPRESSION,Nil,0,@lpOutBuffer,SizeOf(Short),@lpBytesReturned,Nil)
then
if lpOutBuffer <> COMPRESSION_FORMAT_NONE then

The line DeviceIoControl fails when SOURCE contains  \server\pwc\file.dat.

Any hints how to get this running?
--
cu,
Michael

Replies:

www.cryer.info
Managed Newsgroup Archive