Re: Why does OpenStore(TEXT("\\Hard Disk")) fail?



You don't set cbSize in the STOREINFO struct. I'm just guessing here, but
that is usually important.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member


"Jimbo" <cjavajim@xxxxxxxxx> wrote in message
news:1121734493.639432.122890@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> The OpenStore passed the INVALID_HANDLE_VALUE test but GetStoreInfo
> failed. Here's the code (printStoreInfo() [code not shown] simply
> prints each field of the struct):
>
>
> HANDLE hStore;
> STOREINFO StoreInfo;
> TCHAR *szDeviceName;
> TCHAR szMsgBuf[MAX_PATH];
>
>
> szDeviceName = TEXT("DSK1:");
> hStore = OpenStore(szDeviceName);
> if (INVALID_HANDLE_VALUE == hStore)
> {
> FormatMessage(
> FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
> NULL,
> GetLastError(),
> 0,
> (LPTSTR) szMsgBuf,
> MAX_PATH,
> NULL
> );
> wprintf(TEXT("'%s'\n"), szMsgBuf);
> }
> else
> {
> if ( GetStoreInfo(hStore, &StoreInfo) )
> {
> printStoreInfo(&StoreInfo);
> }
> else
> {
> FormatMessage(
> FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
> NULL,
> GetLastError(),
> 0,
> (LPTSTR) szMsgBuf,
> MAX_PATH,
> NULL
> );
> wprintf(TEXT("'%s'\n"), szMsgBuf);
> }
> }
>


.