WinHV WDK Library

Hi,

Does anyone know where is the WinHV library? I am exploring the WinHV C function interface. I can find the WinHV header file but couldn’t find the library to link with my driver. The WDK I am using is release 6001.18001. Thanks!

HY

the interfaces are implemented by winhv.sys.

On Thu, May 29, 2008 at 4:32 PM, wrote:

> Hi,
>
> Does anyone know where is the WinHV library? I am exploring the WinHV C
> function interface. I can find the WinHV header file but couldn’t find the
> library to link with my driver. The WDK I am using is release 6001.18001.
> Thanks!
>
> HY
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

Yes, I have read that the C interfaces are in winhv.sys. But, how to call the C interfaces from other driver? Is there any doc. about using kernel dll for 64bits Vista somewhere?

HY

What is it you want to do with WinHv? I have no idea where you get
the lib to link against. I assume it will come in some kit somewhere.
But I’m curious what you think it will get you.

I’m of the opinion that WinHv doesn’t do much for you at all, as it’s
just a wrapper around the hypercall interface. And the hypercall
interface only really does two things for you. It allows you to
figure out how to run Windows Server 2008 on top of your non-Microsoft
hypervisor (because you know what it expects to call) or it allows you
to figure out how to make a non-Windows OS run well on top of a
Microsoft hypervisor (Hyper-V, which is in Server 2008.)

Linking against WinHv doesn’t really help you in either case. If
you’re implementing a non-Microsoft hypervisor, then it’s unlikely
you’re going to use a hypercall wrapper that’s delivered as a Windows
driver. In fact, it’s unlikely that you’re going to use a hypercall
wrapper at all. If you’re implementing a non-Windows OS and trying to
get it to run on Hyper-V, then you again probably have no use for a
wrapper delivered as a Windows driver.

  • Jake Oshins
    Hyper-V I/O Architect
    (implementer of quite a bit of code that invokes WinHv)

wrote in message news:xxxxx@ntdev…
> Yes, I have read that the C interfaces are in winhv.sys. But, how to
> call the C interfaces from other driver? Is there any doc. about
> using kernel dll for 64bits Vista somewhere?
>
> HY
>

Hi Jake,

Thanks for your opinion. What I want to do is exploring the inter-partition communication for my company’s future product. The WinHV service management functions looks suitable for the job. If MSFT haven’t release the WinHV library at this point, what alternative do I have?

HY

Actually there are of course good reasons why one might want to use these
interfaces, and it is odd that the WDK documents them but appears to not
include the .lib file to link against.

On Sat, May 31, 2008 at 1:43 AM, wrote:

> Hi Jake,
>
> Thanks for your opinion. What I want to do is exploring the inter-partition
> communication for my company’s future product. The WinHV service management
> functions looks suitable for the job. If MSFT haven’t release the WinHV
> library at this point, what alternative do I have?
>
> HY
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

Pretty much, although I’m not sure I’d agree with the part about it being ‘odd.’ Maybe winhv.lib is wherever the CHK build of S2008 is?

mm

Mark Roddy wrote:

Actually there are of course good reasons why one might want to use
these interfaces, and it is odd that the WDK documents them but appears
to not include the .lib file to link against.

On Sat, May 31, 2008 at 1:43 AM, > mailto:xxxxx> wrote:
>
> Hi Jake,
>
> Thanks for your opinion. What I want to do is exploring the
> inter-partition communication for my company’s future product. The
> WinHV service management functions looks suitable for the job. If
> MSFT haven’t release the WinHV library at this point, what
> alternative do I have?
>
> HY
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
> –
> Mark Roddy</mailto:xxxxx>

Well, I suppose that your only real option here is to create your own import library, which fortunately isn’t all that difficult.

Roughly:

  1. dumpbin /exports winhv.sys

  2. create a .def file using this information that looks something like this:

LIBRARY winhv
EXPORT



3. create and import library with LIB /DEF:winhv.def /OUT:winhv.lib

Or something like that. It’s been a long time since I’ve needed to resort to something quite this silly, but I don’t see what other
choice you have here, if you want to use WinHV. In particular, the syntax of the of .DEF file may not be exactly correct, and I’m
not sure about the LIB command line either, but this is the general idea. Also, I don’t believe that I’ve ever tried this method
with something in the kernel, though I can’t think of any reason why this would make any difference.

I don’t have any idea of what the deal with winhv.lib is (why it’s MIA from the WDK, that is), but I wouldn’t hold my breath while
waiting for it to appear. As Mickey Mouse and low rent as it would be to intentionally exclude it, only so many things can go
missing or experience technical difficulties, and either way, they don’t seem to appear after the issue is acknowledged, which is
really the only thing that matters for the purpose of planning, so were I you, that would be my working assumption.

Good luck,

mm

xxxxx@gmail.com wrote:
> Hi Jake,
>
> Thanks for your opinion. What I want to do is exploring the inter-partition communication for my company’s future product. The WinHV service management functions looks suitable for the job. If MSFT haven’t release the WinHV library at this point, what alternative do I have?
>
> HY
>

Even with WinHv, you don’t get useful inter-partition communication.
Since virtual machine state management for Hyper-V isn’t within the
hypervisor itself, (it’s in the parent partition,) merely hooking into
the hypervisor won’t allow you to integrate with VM
save/snapshot/migration operations. Without these, the VM is largely
crippled. So even if you build your own inter-partition
communications using the hypervisor, you end up with a system that’s a
lot less than usable.

  • Jake Oshins

wrote in message news:xxxxx@ntdev…
> Hi Jake,
>
> Thanks for your opinion. What I want to do is exploring the
> inter-partition communication for my company’s future product. The
> WinHV service management functions looks suitable for the job. If
> MSFT haven’t release the WinHV library at this point, what
> alternative do I have?
>
> HY
>

Hi mm,

Using this method I can create the .lib and link with the driver. However,
the Server 2008 give me “The driver may be corrupted or missing. (Code 39)”
error while loading the driver. I guess I just have to wait for MSFT release
the lib or go for the native hypercall. Thanks for tip.

HY

“Martin O’Brien” wrote in message
news:xxxxx@ntdev…
> Well, I suppose that your only real option here is to create your own
> import library, which fortunately isn’t all that difficult.
>
> Roughly:
>
> 1. dumpbin /exports winhv.sys
>
> 2. create a .def file using this information that looks something like
> this:
>
> LIBRARY winhv
> EXPORT
>
>
>
> 3. create and import library with LIB /DEF:winhv.def /OUT:winhv.lib
>
> Or something like that. It’s been a long time since I’ve needed to resort
> to something quite this silly, but I don’t see what other choice you have
> here, if you want to use WinHV. In particular, the syntax of the of .DEF
> file may not be exactly correct, and I’m not sure about the LIB command
> line either, but this is the general idea. Also, I don’t believe that
> I’ve ever tried this method with something in the kernel, though I can’t
> think of any reason why this would make any difference.
>
> I don’t have any idea of what the deal with winhv.lib is (why it’s MIA
> from the WDK, that is), but I wouldn’t hold my breath while waiting for it
> to appear. As Mickey Mouse and low rent as it would be to intentionally
> exclude it, only so many things can go missing or experience technical
> difficulties, and either way, they don’t seem to appear after the issue is
> acknowledged, which is really the only thing that matters for the purpose
> of planning, so were I you, that would be my working assumption.
>
>
> Good luck,
>
> mm
>
> xxxxx@gmail.com wrote:
>> Hi Jake,
>>
>> Thanks for your opinion. What I want to do is exploring the
>> inter-partition communication for my company’s future product. The WinHV
>> service management functions looks suitable for the job. If MSFT haven’t
>> release the WinHV library at this point, what alternative do I have?
>>
>> HY
>

Hi Jake,

I understand the VM save/snapshot/migration is going to be the problem needs
to be solved. At this stage we just like to explore the capability of
inter-partition communication and share memory between partitions.

Since WDK documents the WinHV interface, I guess MSFT should have the plan
to release the Hyper-V development kit. Any ideal of the release date?
Thanks.

HY

“Jake Oshins” wrote in message
news:xxxxx@ntdev…
> Even with WinHv, you don’t get useful inter-partition communication. Since
> virtual machine state management for Hyper-V isn’t within the hypervisor
> itself, (it’s in the parent partition,) merely hooking into the hypervisor
> won’t allow you to integrate with VM save/snapshot/migration operations.
> Without these, the VM is largely crippled. So even if you build your own
> inter-partition communications using the hypervisor, you end up with a
> system that’s a lot less than usable.
>
> - Jake Oshins
>
>
> wrote in message news:xxxxx@ntdev…
>> Hi Jake,
>>
>> Thanks for your opinion. What I want to do is exploring the
>> inter-partition communication for my company’s future product. The WinHV
>> service management functions looks suitable for the job. If MSFT haven’t
>> release the WinHV library at this point, what alternative do I have?
>>
>> HY
>>
>
>
>
>

> the Server 2008 give me “The driver may be corrupted or missing. (Code 39)”

Lack of signature?


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Yeah, I think that’s a signing error. It certainly isn’t a lib issue.

mm

Maxim S. Shatskih wrote:

> the Server 2008 give me “The driver may be corrupted or missing. (Code 39)”

Lack of signature?

My driver works fine before link with the lib. I also tried to disable the driver signature enforcement (by F8 key) and got the same error.

HY

Silly question…are you sure winhv.sys is in %windir%\system32\drivers on your target system?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, June 03, 2008 10:08 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WinHV WDK Library

My driver works fine before link with the lib. I also tried to disable the driver signature enforcement (by F8 key) and got the same error.

HY


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@gmail.com wrote:

My driver works fine before link with the lib. I also tried to disable the driver signature enforcement (by F8 key) and got the same error.

Is winhv.sys really installed on your operating system? Is the
Hypervisor running?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Yes, the WinHV.sys is in %windir%\system32\drivers and I have two guest OS (WinXP and Vista) running.

xxxxx@gmail.com wrote:

Yes, the WinHV.sys is in %windir%\system32\drivers and I have two guest OS (WinXP and Vista) running.

In the “grasping at straws” phase now, can you do a “link /dump /exports
%windir%\system32\drivers\winhv.sys” and make sure the entry points you
want are exported? I don’t know how many versions of winhv.sys there
have been.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I don’t think that there’s any kit in plan.

You’ll be able to create cross-paritition communication. I know
because that’s exactly what I’ve done. What you won’t be able to do
is get to the next stage where that works with VM state changes.

  • Jake Oshins

“HY Yang” wrote in message news:xxxxx@ntdev…
> Hi Jake,
>
> I understand the VM save/snapshot/migration is going to be the
> problem needs to be solved. At this stage we just like to explore
> the capability of inter-partition communication and share memory
> between partitions.
>
> Since WDK documents the WinHV interface, I guess MSFT should have
> the plan to release the Hyper-V development kit. Any ideal of the
> release date? Thanks.
>
> HY
>
>
> “Jake Oshins” wrote in message
> news:xxxxx@ntdev…
>> Even with WinHv, you don’t get useful inter-partition
>> communication. Since virtual machine state management for Hyper-V
>> isn’t within the hypervisor itself, (it’s in the parent partition,)
>> merely hooking into the hypervisor won’t allow you to integrate
>> with VM save/snapshot/migration operations. Without these, the VM
>> is largely crippled. So even if you build your own inter-partition
>> communications using the hypervisor, you end up with a system
>> that’s a lot less than usable.
>>
>> - Jake Oshins
>>
>>
>> wrote in message news:xxxxx@ntdev…
>>> Hi Jake,
>>>
>>> Thanks for your opinion. What I want to do is exploring the
>>> inter-partition communication for my company’s future product. The
>>> WinHV service management functions looks suitable for the job. If
>>> MSFT haven’t release the WinHV library at this point, what
>>> alternative do I have?
>>>
>>> HY
>>>
>>
>>
>>
>>
>
>
>

Hi Jake,

Regarding the ‘kit’ availability, if there will be no such release, do you know how IHVs will support their products under Server 2008/Hyper-V? That is, IHVs outside of those such as NIC and HBA?

Reading various bits of documentation, I was under the impression there would be a DDK to allow IHVs to create ‘enlightened’ interfaces to guest VMs via VMBus/WinHV, moving data into the Server 2008 root partition to native hardware drivers.