cudaHostRegister in Windows Help me please. cudaHostRegister && VirtualAlloc && Wind


I am having a problem: a CUDA-code written for linux, which used functions valloc () and cudaHostRegister ().
while porting the code on a Windows system, I replaced the function valloc () function to VirtualAlloc (NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE | PAGE_EXECUTE );… but after the memory allocation so that the function cudaHostRegister accepting it, fails. Anybody can tell you what I’m doing wrong and how to allocate memory for use cudaHostRegister in Windows?
Thanks in advance!