[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [GPLPV] exclude xenscsi from installer, since it is not compiled



> 
> > > > The line in question is the following:
> > > >   HwInitializationData.HwFindAdapter = XenVbd_HwStorFindAdapter;
> > > >
> > > > XenVbd_HwStorFindAdapter is the data structure which you have
> > > > corrected a few lines in, in the patch. As it is a level 4 warning,
> > > > it can be ignored by setting /W3 in the MSC_WARNING_LEVEL.
> However I
> > > > suspect that it would be preferred to find the cause of the warning.
> > >
> > > That would imply that my function definition doesn't match the
> > > expected function definition in the HW_INITIALIZATION_DATA structure,
> > > but according to the docs I have everything right. Can you check the
> > > storport headers and check the declaration there against my function?
> >
> > For windows 8 and newer HwFindAdapter is declared as
> >   PVOID                                     HwFindAdapter;
> > While for earlier versions of windows it is declared as:
> >   PHW_FIND_ADAPTER          HwFindAdapter;
> >
> 
> I have tried to typecast the HwFindAdapter like:
>   (PHW_FIND_ADAPTER) HwInitializationData.HwFindAdapter =
> XenVbd_HwStorFindAdapter;
> 
> However this results in the following error and warnings:
>   error C2220: warning treated as error - no 'object' file generated
>   warning C4055: 'type cast' : from data pointer 'PVOID' to function pointer
> 'PHW_FIND_ADAPTER'
>   warning C4213: nonstandard extension used : cast on l-value
> 
> I might be doing something wrong, however my experience in C++ is limited.

At line 28, please insert the following:

HW_FIND_ADAPTER XenVbd_HwStorFindAdapter;

This pre-declares the function as conforming to the expected declaration.

Alternatively, your cast above is backwards, and should be:

HwInitializationData.HwFindAdapter =  
(PHW_FIND_ADAPTER)XenVbd_HwStorFindAdapter;

But try the declaration above first.

James

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.