none
Build issues in 64-bit driver with Visual studio 2008 RRS feed

  • Question

  • Hello all,

    I am building a 32 bit driver in 64-bit platform with visual studio 2008. I have changed the platform in visual studio but it gives below errors/warning. These warnings are treated as error so i should clear it. We are using Windriver as our base driver. Can anyone help on this.

    Thanks in Advance,

    Mary

    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(108) : warning C4163: '__readgsqword' : n
    ot available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(129) : error C2373: 'KeGetCurrentThread'
    : redefinition; different type modifiers
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1098) : warning C4163: '_bittest64' : not
     available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1099) : warning C4163: '_bittestandcomple
    ment64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1100) : warning C4163: '_bittestandset64'
     : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1101) : warning C4163: '_bittestandreset6
    4' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1102) : warning C4163: '_interlockedbitte
    standset64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1103) : warning C4163: '_interlockedbitte
    standreset64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1144) : warning C4163: '_BitScanForward64
    ' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1145) : warning C4163: '_BitScanReverse64
    ' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1368) : warning C4163: '_InterlockedAnd64
    ' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1369) : warning C4163: '_InterlockedOr64'
     : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1370) : warning C4163: '_InterlockedXor64
    ' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1371) : warning C4163: '_InterlockedIncre
    ment64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1372) : warning C4163: '_InterlockedDecre
    ment64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1373) : warning C4163: '_InterlockedExcha
    nge64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1374) : warning C4163: '_InterlockedExcha
    ngeAdd64' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1376) : warning C4163: '_InterlockedExcha
    ngePointer' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1377) : warning C4163: '_InterlockedCompa
    reExchangePointer' : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1507) : warning C4163: '__faststorefence'
     : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1659) : warning C4163: '__movsq' : not av
    ailable as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1696) : warning C4163: '__stosq' : not av
    ailable as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1717) : warning C4163: '__mulh' : not ava
    ilable as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1718) : warning C4163: '__umulh' : not av
    ailable as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1741) : warning C4163: '__shiftleft128' :
     not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1742) : warning C4163: '__shiftright128'
    : not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1757) : warning C4163: '_mul128' : not av
    ailable as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1770) : warning C4163: '_umul128' : not a
    vailable as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1879) : warning C4163: '__readgsbyte' : n
    ot available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1880) : warning C4163: '__readgsword' : n
    ot available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1881) : warning C4163: '__readgsdword' :
    not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1882) : warning C4163: '__readgsqword' :
    not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1883) : warning C4163: '__writegsbyte' :
    not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1884) : warning C4163: '__writegsword' :
    not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1885) : warning C4163: '__writegsdword' :
     not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(1886) : warning C4163: '__writegsqword' :
     not available as an intrinsic function
    1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(12734) : warning C4391: 'ULONG64 __readcr
    8(void)' : incorrect return type for intrinsic function, expected 'unsigned long
    '
    1>c:\windriver\include\kpstdlib.h(142) : error C4028: formal parameter 2 differe
    nt from declaration
    1>c:\windriver\include\kpstdlib.h(142) : warning C4273: '_snprintf' : inconsiste
    nt dll linkage
    1>c:\windriver\include\kpstdlib.h(144) : error C4028: formal parameter 2 differe
    nt from declaration
    1>c:\windriver\include\kpstdlib.h(144) : warning C4273: '_vsnprintf' : inconsist
    ent dll linkage
    1>c:\windriver\include\windrvr.h(287) : warning C4273: 'sprintf' : inconsistent
    dll linkage


    Tuesday, July 7, 2015 5:51 AM

Answers

  • Two things:

    1. To build a driver with Visual studio, use VS2013 or 2015 (RC, or wait a little until released). VS 2008 is not good.

    2. On a 64-bit platform, 32-bit drivers won't work, you need a 64-bit driver.

    -- pa


    Tuesday, July 7, 2015 6:25 AM
  • You have the Windows 7 WDK installed (this is what the includes are from), use BUILD to make the driver.  Go to the start menu, and choose the "Windows Server 2003" and then the "X64 ..." environment and run BUILD in the directory with the SOURCES or DIRS file.  Now if you want to integrate this with VS use DDKBUILD http://www.hollistech.com/

    If this is an attempt to build a Windows driver directly with VS2008, throw out the attempt and take the source file an place them in a BUILD project.  Direct building is not supported till the Windows 8 WDK or later, and while there are various attempts to do this, I have never seen one that produces a stable product.

     

    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, July 7, 2015 11:22 AM

All replies

  • Hello Pavel

    Thanks.

    1. The existing 32-bit driver source code is integrated with vs2008. I will check the same with VS2013 or vs2015.

    2. As per my understanding, if we compile the existing 32-bit source code with "WDK x64 free build environment", it should work in 64-bit platform. Please correct me if i am wrong. Do I need to do any extra changes in driver code for 64-bit building.

    Mary.

    Tuesday, July 7, 2015 6:37 AM
  • One more query,

    I need to support windows xp also. Is the latest version of visual studio (vs2013 or vs2015) supported windows xp driver building?

    Thanks.


    • Edited by Mary Net Tuesday, July 7, 2015 6:43 AM
    Tuesday, July 7, 2015 6:42 AM
  • You have the Windows 7 WDK installed (this is what the includes are from), use BUILD to make the driver.  Go to the start menu, and choose the "Windows Server 2003" and then the "X64 ..." environment and run BUILD in the directory with the SOURCES or DIRS file.  Now if you want to integrate this with VS use DDKBUILD http://www.hollistech.com/

    If this is an attempt to build a Windows driver directly with VS2008, throw out the attempt and take the source file an place them in a BUILD project.  Direct building is not supported till the Windows 8 WDK or later, and while there are various attempts to do this, I have never seen one that produces a stable product.

     

    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, July 7, 2015 11:22 AM