Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ScanVolumeEx not working

69 views
Skip to first unread message

John

unread,
Sep 25, 2009, 2:38:01 AM9/25/09
to
I'm trying to scan a volume for errors with ScanVolumeEx.
Until now without succes, return code = 0, which indicates failure.

- Do I need TFAT enabled for this?
- Could it be related to the funtionality enabled in the iamge (which we
create ourselves)

This is the code I use:

{
HANDLE hStore = OpenStore(STORE);

if (INVALID_HANDLE_VALUE != hStore)
{
HANDLE hPart = OpenPartition(hStore, PARTITION);

if (INVALID_HANDLE_VALUE != hPart)
{
DismountPartition(hPart);

SCAN_PARAMS ScanParams;
ScanParams.cbSize = sizeof(ScanParams);
ScanParams.so.dwFatToUse = 1; // One-based
DWORD dwScanResult = ScanVolumeEx(hPart,&ScanParams); // dwScanResult = 0

MountPartition(hPart);
CloseHandle(hPart);
}

CloseHandle(hStore);
}

Luca Calligaris [eMVP]

unread,
Sep 25, 2009, 11:55:59 AM9/25/09
to
Call GetLastError() to have more info about the error.
Do you have fatutil.dll in your OS image?

--
Luca Calligaris (MVP-Windows Embedded)
l.calliga...@eurotech.it.nospam
www.eurotech.it


"John" <Jo...@discussions.microsoft.com> ha scritto nel messaggio
news:79E3E67F-8286-4A08...@microsoft.com...

John

unread,
Sep 28, 2009, 11:30:01 AM9/28/09
to
fatutil.dll is in the image.
If I use the handle from OpenStore instead of OpenPartition ScanVolumeEx
seems to work. It finishes very quickly (1 second) and never finds a problem.
When I scan the disk with Storage Manager there are errors and it takes 5-10
seconds.

Any ideas?

Bruce Eitman [eMVP]

unread,
Sep 28, 2009, 12:50:53 PM9/28/09
to
I don't know, but I would consider fully initializing the SCAN_PARAMS
structure before passing it in.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"John" <Jo...@discussions.microsoft.com> wrote in message
news:28CB3B48-B7CD-4BB6...@microsoft.com...

John

unread,
Sep 29, 2009, 2:22:04 AM9/29/09
to
Bruce,

you are wright, I already changed this into:
SCAN_PARAMS ScanParams;
memset(&ScanParams,0,sizeof(ScanParams));

Still the same effect, ScanVolumeEx finishes succesfully (return is true)
but doesn't seem to run properly.

0 new messages