Ok so I am trying to write something which can scan through a folder and identify files with a Zone.Identifier tag and delete the tag (hopefully). I've been looking at ways to do it and I'm trying out several different methods.
I have a function which uses BackupRead()
etc, however I am a bit of a rookie to this kind of thing and while I've managed to find the stream with this method I was hoping to use FindFirstStreamW()
to make life easier, or at least learn more about this in general.
Below is my first attempt to use this:
int
StreamsFunctionAlt (
LPCTSTR lpFileName )
{
LPVOID lpFindStreamData;
HANDLE hFindStream;
STREAM_INFO_LEVELS InfoLevel;
DWORD dwFlags;
HANDLE hFile;
if ( !FileExists ( lpFileName ))
{
return 1;
}
lpFindStreamData = NULL;
InfoLevel = 0;
dwFlags = 0;
hFindStream = FindFirstStreamW ( lpFileName,
InfoLevel,
lpFindStreamData,
dwFlags );
if ( !hFindStream == INVALID_HANDLE_VALUE )
{
FindNextStreamW ( hFindStream,
lpFindStreamData );
}
FindClose ( hFindStream );
return 0;
}
What I'm seeing is lpFindStreamData
is set to NULL
and stays NULL
and FindFirstStreamW()
returns0xffffffff
which I think I'm safe in assuming isn't what I want. lpFileName
is the correct file name, and is the path to a file with an alternate stream.
As mentioned, I am a rookie, new to C and new to the windows API so if I'm using this incorrectly, have made some kind of embarrassingly silly error or you think I'm barking up the wrong tree then please let me know.