Anyone with batch file knowledge, is this a bug in setenv in the latest DDK?

If you would like some background please see the thread Static Driver Verifier and C++, but in essence when I compile my driver under Win7 x64
checked, the build is fine. But I cannot use OACR/PREfast as it gives me a funny error saying that size_t is being redefined to a bad size. When I
do enough digging I see that OACR is using for it’s config file:
Configuration: C:\WinDDK\7600.16385.1\bin\x86\oacr\oacr.ini
Which I believe is wrong. It should use the amd64. So when I look at what is going on when I actually open Win7 x64 checked I see that it’s a
shortcut with parameters to setenv.bat. After tracing through it I see the line that should be setting the configuration to amd64 for OACR:
:OACRInit64bit
if “%_AMD64bit%” NEQ “true” goto OACRInitEnd

But isn’t that line incorrect? All the others have a /I after the if, like:
rem Add OACR settings to x86 and x64 builds
if /I “%_RunOacr%” NEQ “true” goto OACRInitEnd

But I am no batch file expert. Is anyone? This is the relevant part of setenv.bat:

rem Do not run OACR for IA64 build environments
if /I “%_IA64bit%”==“true” echo OACR is not supported for IA64
if /I “%_IA64bit%”==“true” goto OACRInitEnd

:OACRInit32bit
if /I “%_IA32bit%” NEQ “true” goto OACRInit64bit
set SUBSTITUTE_386_CC=%BASEDIR%\Bin\x86\oacr\oacrcl
set SUBSTITUTE_AMD64_CC=%BASEDIR%\Bin\x86\oacr\oacrcl
set SUBSTITUTE_LINK=%BASEDIR%\Bin\x86\oacr\oacrlink
set SUBSTITUTE_CS_COMPILER_NAME=%BASEDIR%\BIN\x86\oacr\oacrcsc /nologo
set PATH=%BASEDIR%\bin\x86\oacr;%PATH%
set BUILD_OACR=1

If Not Exist %BASEDIR%\OACR%BUILD_ALT_DIR% MD %BASEDIR%\OACR%BUILD_ALT_DIR%

@rem Turn on checking to workaround incorrect definition of __in
set PREFAST_VALID_IMPLIES_NOTNULL=1

if Exist %BASEDIR%\bin\x86\oacr\oacr.bat call %BASEDIR%\bin\x86\oacr\oacr.bat monitor
goto OACRInitEnd

:OACRInit64bit
if “%_AMD64bit%” NEQ “true” goto OACRInitEnd
set SUBSTITUTE_AMD64_CC=%BASEDIR%\Bin\amd64\oacr\oacrcl
set SUBSTITUTE_CS_COMPILER_NAME=%BASEDIR%\Bin\amd64\oacr\oacrcsc /nologo
set SUBSTITUTE_LINK=%BASEDIR%\Bin\amd64\oacr\oacrlink

set PATH=%BASEDIR%\bin\amd64\oacr;%PATH%
set BUILD_OACR=1

If Not Exist %BASEDIR%\OACR%BUILD_ALT_DIR% MD %BASEDIR%\OACR%BUILD_ALT_DIR%

This (prefast) works fine for me with a wdk sample
(src/general/ioctl/kmdf/sys).

Are you the same person that this ‘size_t’ error in another thread? Either
way, the problem would appear to be with your build environment/wdk
installation. Something like you’ve modified the path, et. c.

I don’t know what it is, but I would recommend that you reinstall the most
recent WDK again to rule that out.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
Sent: Thursday, January 13, 2011 7:59 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Anyone with batch file knowledge, is this a bug in setenv
in the latest DDK?

If you would like some background please see the thread Static Driver
Verifier and C++, but in essence when I compile my driver under Win7 x64
checked, the build is fine. But I cannot use OACR/PREfast as it gives me a
funny error saying that size_t is being redefined to a bad size. When I
do enough digging I see that OACR is using for it’s config file:
Configuration: C:\WinDDK\7600.16385.1\bin\x86\oacr\oacr.ini
Which I believe is wrong. It should use the amd64. So when I look at what
is going on when I actually open Win7 x64 checked I see that it’s a
shortcut with parameters to setenv.bat. After tracing through it I see the
line that should be setting the configuration to amd64 for OACR:
:OACRInit64bit
if “%_AMD64bit%” NEQ “true” goto OACRInitEnd

But isn’t that line incorrect? All the others have a /I after the if, like:
rem Add OACR settings to x86 and x64 builds
if /I “%_RunOacr%” NEQ “true” goto OACRInitEnd

But I am no batch file expert. Is anyone? This is the relevant part of
setenv.bat:

rem Do not run OACR for IA64 build environments
if /I “%_IA64bit%”==“true” echo OACR is not supported for IA64
if /I “%_IA64bit%”==“true” goto OACRInitEnd

:OACRInit32bit
if /I “%_IA32bit%” NEQ “true” goto OACRInit64bit
set SUBSTITUTE_386_CC=%BASEDIR%\Bin\x86\oacr\oacrcl
set SUBSTITUTE_AMD64_CC=%BASEDIR%\Bin\x86\oacr\oacrcl
set SUBSTITUTE_LINK=%BASEDIR%\Bin\x86\oacr\oacrlink
set SUBSTITUTE_CS_COMPILER_NAME=%BASEDIR%\BIN\x86\oacr\oacrcsc /nologo
set PATH=%BASEDIR%\bin\x86\oacr;%PATH%
set BUILD_OACR=1

If Not Exist %BASEDIR%\OACR%BUILD_ALT_DIR% MD
%BASEDIR%\OACR%BUILD_ALT_DIR%

@rem Turn on checking to workaround incorrect definition of __in
set PREFAST_VALID_IMPLIES_NOTNULL=1

if Exist %BASEDIR%\bin\x86\oacr\oacr.bat call
%BASEDIR%\bin\x86\oacr\oacr.bat monitor
goto OACRInitEnd

:OACRInit64bit
if “%_AMD64bit%” NEQ “true” goto OACRInitEnd
set SUBSTITUTE_AMD64_CC=%BASEDIR%\Bin\amd64\oacr\oacrcl
set SUBSTITUTE_CS_COMPILER_NAME=%BASEDIR%\Bin\amd64\oacr\oacrcsc /nologo
set SUBSTITUTE_LINK=%BASEDIR%\Bin\amd64\oacr\oacrlink

set PATH=%BASEDIR%\bin\amd64\oacr;%PATH%
set BUILD_OACR=1

If Not Exist %BASEDIR%\OACR%BUILD_ALT_DIR% MD
%BASEDIR%\OACR%BUILD_ALT_DIR%


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

I should have said that this assumes that you are build your driver
correctly. That is, using an unmodified WDK build environment, started with
and unmodified WDK build shortcut.

If not, anything’s possible.

mm

-----Original Message-----
From: Martin O’Brien [mailto:xxxxx@gmail.com]
Sent: Thursday, January 13, 2011 8:06 PM
To: ‘Windows System Software Devs Interest List’
Subject: RE: [ntdev] Anyone with batch file knowledge, is this a bug in
setenv in the latest DDK?

This (prefast) works fine for me with a wdk sample
(src/general/ioctl/kmdf/sys).

Are you the same person that this ‘size_t’ error in another thread? Either
way, the problem would appear to be with your build environment/wdk
installation. Something like you’ve modified the path, et. c.

I don’t know what it is, but I would recommend that you reinstall the most
recent WDK again to rule that out.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
Sent: Thursday, January 13, 2011 7:59 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Anyone with batch file knowledge, is this a bug in setenv
in the latest DDK?

If you would like some background please see the thread Static Driver
Verifier and C++, but in essence when I compile my driver under Win7 x64
checked, the build is fine. But I cannot use OACR/PREfast as it gives me a
funny error saying that size_t is being redefined to a bad size. When I
do enough digging I see that OACR is using for it’s config file:
Configuration: C:\WinDDK\7600.16385.1\bin\x86\oacr\oacr.ini
Which I believe is wrong. It should use the amd64. So when I look at what
is going on when I actually open Win7 x64 checked I see that it’s a
shortcut with parameters to setenv.bat. After tracing through it I see the
line that should be setting the configuration to amd64 for OACR:
:OACRInit64bit
if “%_AMD64bit%” NEQ “true” goto OACRInitEnd

But isn’t that line incorrect? All the others have a /I after the if, like:
rem Add OACR settings to x86 and x64 builds
if /I “%_RunOacr%” NEQ “true” goto OACRInitEnd

But I am no batch file expert. Is anyone? This is the relevant part of
setenv.bat:

rem Do not run OACR for IA64 build environments
if /I “%_IA64bit%”==“true” echo OACR is not supported for IA64
if /I “%_IA64bit%”==“true” goto OACRInitEnd

:OACRInit32bit
if /I “%_IA32bit%” NEQ “true” goto OACRInit64bit
set SUBSTITUTE_386_CC=%BASEDIR%\Bin\x86\oacr\oacrcl
set SUBSTITUTE_AMD64_CC=%BASEDIR%\Bin\x86\oacr\oacrcl
set SUBSTITUTE_LINK=%BASEDIR%\Bin\x86\oacr\oacrlink
set SUBSTITUTE_CS_COMPILER_NAME=%BASEDIR%\BIN\x86\oacr\oacrcsc /nologo
set PATH=%BASEDIR%\bin\x86\oacr;%PATH%
set BUILD_OACR=1

If Not Exist %BASEDIR%\OACR%BUILD_ALT_DIR% MD
%BASEDIR%\OACR%BUILD_ALT_DIR%

@rem Turn on checking to workaround incorrect definition of __in
set PREFAST_VALID_IMPLIES_NOTNULL=1

if Exist %BASEDIR%\bin\x86\oacr\oacr.bat call
%BASEDIR%\bin\x86\oacr\oacr.bat monitor
goto OACRInitEnd

:OACRInit64bit
if “%_AMD64bit%” NEQ “true” goto OACRInitEnd
set SUBSTITUTE_AMD64_CC=%BASEDIR%\Bin\amd64\oacr\oacrcl
set SUBSTITUTE_CS_COMPILER_NAME=%BASEDIR%\Bin\amd64\oacr\oacrcsc /nologo
set SUBSTITUTE_LINK=%BASEDIR%\Bin\amd64\oacr\oacrlink

set PATH=%BASEDIR%\bin\amd64\oacr;%PATH%
set BUILD_OACR=1

If Not Exist %BASEDIR%\OACR%BUILD_ALT_DIR% MD
%BASEDIR%\OACR%BUILD_ALT_DIR%


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

On Thu, 13 Jan 2011 16:59:13 -0800
Michael Wade wrote:

> But I am no batch file expert. Is anyone?

There are various issues with setenv.bat (see
http://www.osronline.com/bb.cfm?CFGRIDKEY=F866CA4A-02E9-8EC8-271387F768F4C23E)
but I this this is a problem with your sources and configuration.


Bruce Cran

If anyone has any ideas on how to fix this I sure would appreciate it. I uninstalled the WinDDK. I reinstalled it. I did the same on a Win7
machine. If I open a build environment Win7x64 on the Win7 machine, go to the OACR and show “About OACR”, it says (as I expect) “…Configuration:
…amd64\oacr\oacr.ini”. If I do the same thing on my XP machine (which I am using to develop) I see “…Configuration: …x86\oacr\oacr.ini”. This
creates havoc with my ability to use PREfast. I just cannot figure out why it’s doing this. Thanks.

The Win7 machine is a 64 bit machine which is why it uses the amd64\oarc\oacr.ini.
The XP machine is a 32 bit machine which is why it uses the x86\oacr\oacr.ini.

Those ini files are dependant on the host machine architecture not the build environement.

  1. Have you tried this using an unmodified WDK sample driver? I just reran
    this over src/general/ioctl/kmdf/sys and it worked fine for me, so if you
    haven’t tried this already, perhaps
    Doing so would give us a baseline, because if that doesn’t work, you
    pretty much have to have something messed up in your wdk installation/paths.

  2. Do things work correctly if you run PreFAST directly, instead of via
    OACR? I’m not sure what this would necessarily matter, but, the
    configuration file used by each are, I believe different.

If you’re not familiar with this, here are the steps required. I’m
assuming:

  • that you’re going to do this either before running a NORMAL wdk build
    environment or ensuring
    That OACR isn’t already running.
  • that you’re going to be building for chk WIN7 X64
  • that your WDK installation is rooted in
    - that your driver is located in

    a.) Start a normal (NOT a WDK Build Environment) cmd shell
    b.) \bin\setenv.bat chk x64 WIN7 no_oacr

    cd
    prefast build -ceZ

    3. If nothing improves, please try this and post the results of your
    logfile:

    4. I’m not sure what you’re saying the issue is:

    xp …x86\oacr\oacr.ini
    win7 x64 …amd64\oacr\oacr.ini

    That looks correct.

    cd
    build -ceZ
    name /P > logfile

    Good luck,

    mm

    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
    Sent: Friday, January 14, 2011 6:39 PM
    To: Windows System Software Devs Interest List
    Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
    setenv in the latest DDK?

    If anyone has any ideas on how to fix this I sure would appreciate it. I
    uninstalled the WinDDK. I reinstalled it. I did the same on a Win7
    machine. If I open a build environment Win7x64 on the Win7 machine, go to
    the OACR and show “About OACR”, it says (as I expect) “…Configuration:
    …amd64\oacr\oacr.ini”. If I do the same thing on my XP machine (which I
    am using to develop) I see “…Configuration: …x86\oacr\oacr.ini”. This
    creates havoc with my ability to use PREfast. I just cannot figure out why
    it’s doing this. Thanks.


    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

Thanks! OK, if I follow your steps exactly it works exactly like I expect. I do NOT see this ‘size_t’ redefinition. I DO see some warnings that I
very much want to look at. So thank you again. Hmmm… so is this how I should run in the future? Or given this information does this give you any
idea what I may have done wrong?

Re oacr/x86/x64 I thought that OACR was getting confused. I didn’t realize that the config file was for the development machine, not the target.

Thanks!

On Fri, 14 Jan 2011 19:02:59 -0500, “Martin O’Brien” wrote:

>1. Have you tried this using an unmodified WDK sample driver? I just reran
>this over src/general/ioctl/kmdf/sys and it worked fine for me, so if you
>haven’t tried this already, perhaps
> Doing so would give us a baseline, because if that doesn’t work, you
>pretty much have to have something messed up in your wdk installation/paths.
>
>2. Do things work correctly if you run PreFAST directly, instead of via
>OACR? I’m not sure what this would necessarily matter, but, the
>configuration file used by each are, I believe different.
>
>If you’re not familiar with this, here are the steps required. I’m
>assuming:
>
> - that you’re going to do this either before running a NORMAL wdk build
>environment or ensuring
> That OACR isn’t already running.
> - that you’re going to be building for chk WIN7 X64
> - that your WDK installation is rooted in
> - that your driver is located in
>
>a.) Start a normal (NOT a WDK Build Environment) cmd shell
>b.) \bin\setenv.bat chk x64 WIN7 no_oacr
>
>cd
>prefast build -ceZ
>
>3. If nothing improves, please try this and post the results of your
>logfile:
>
>4. I’m not sure what you’re saying the issue is:
>
>xp …x86\oacr\oacr.ini
>win7 x64 …amd64\oacr\oacr.ini
>
>That looks correct.
>
>
>
>cd
>build -ceZ
>name /P > logfile
>
>
>Good luck,
>
>mm
>
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
>Sent: Friday, January 14, 2011 6:39 PM
>To: Windows System Software Devs Interest List
>Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
>setenv in the latest DDK?
>
>If anyone has any ideas on how to fix this I sure would appreciate it. I
>uninstalled the WinDDK. I reinstalled it. I did the same on a Win7
>machine. If I open a build environment Win7x64 on the Win7 machine, go to
>the OACR and show “About OACR”, it says (as I expect) “…Configuration:
>…amd64\oacr\oacr.ini”. If I do the same thing on my XP machine (which I
>am using to develop) I see “…Configuration: …x86\oacr\oacr.ini”. This
>creates havoc with my ability to use PREfast. I just cannot figure out why
>it’s doing this. Thanks.
>
>—
>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
>

Not really. What were you doing before?

mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
Sent: Friday, January 14, 2011 7:29 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
setenv in the latest DDK?

Thanks! OK, if I follow your steps exactly it works exactly like I expect.
I do NOT see this ‘size_t’ redefinition. I DO see some warnings that I
very much want to look at. So thank you again. Hmmm… so is this how I
should run in the future? Or given this information does this give you any
idea what I may have done wrong?

Re oacr/x86/x64 I thought that OACR was getting confused. I didn’t realize
that the config file was for the development machine, not the target.

Thanks!

On Fri, 14 Jan 2011 19:02:59 -0500, “Martin O’Brien”
wrote:

>1. Have you tried this using an unmodified WDK sample driver? I just
reran
>this over src/general/ioctl/kmdf/sys and it worked fine for me, so if you
>haven’t tried this already, perhaps
> Doing so would give us a baseline, because if that doesn’t work, you
>pretty much have to have something messed up in your wdk
installation/paths.
>
>2. Do things work correctly if you run PreFAST directly, instead of via
>OACR? I’m not sure what this would necessarily matter, but, the
>configuration file used by each are, I believe different.
>
>If you’re not familiar with this, here are the steps required. I’m
>assuming:
>
> - that you’re going to do this either before running a NORMAL wdk build
>environment or ensuring
> That OACR isn’t already running.
> - that you’re going to be building for chk WIN7 X64
> - that your WDK installation is rooted in
> - that your driver is located in
>
>a.) Start a normal (NOT a WDK Build Environment) cmd shell
>b.) \bin\setenv.bat chk x64 WIN7 no_oacr
>
>cd
>prefast build -ceZ
>
>3. If nothing improves, please try this and post the results of your
>logfile:
>
>4. I’m not sure what you’re saying the issue is:
>
>xp …x86\oacr\oacr.ini
>win7 x64 …amd64\oacr\oacr.ini
>
>That looks correct.
>
>
>
>cd
>build -ceZ
>name /P > logfile
>
>
>Good luck,
>
>mm
>
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
>Sent: Friday, January 14, 2011 6:39 PM
>To: Windows System Software Devs Interest List
>Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
>setenv in the latest DDK?
>
>If anyone has any ideas on how to fix this I sure would appreciate it. I
>uninstalled the WinDDK. I reinstalled it. I did the same on a Win7
>machine. If I open a build environment Win7x64 on the Win7 machine, go to
>the OACR and show “About OACR”, it says (as I expect) “…Configuration:
>…amd64\oacr\oacr.ini”. If I do the same thing on my XP machine (which I
>am using to develop) I see “…Configuration: …x86\oacr\oacr.ini”. This
>creates havoc with my ability to use PREfast. I just cannot figure out why
>it’s doing this. Thanks.
>
>—
>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
>


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

I thought I was doing the correct thing:

  1. Open a Build Environment (Win 7 x64 Checked)
  2. cd SrcDir
  3. build -ce
  4. OACR always shows the same error. ‘size_t’ redefinition.

I am compiling a .cpp file. Should I do something different?

Thanks,

On Fri, 14 Jan 2011 19:33:35 -0500, “Martin O’Brien” wrote:

>Not really. What were you doing before?
>
>
>mm
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
>Sent: Friday, January 14, 2011 7:29 PM
>To: Windows System Software Devs Interest List
>Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
>setenv in the latest DDK?
>
>Thanks! OK, if I follow your steps exactly it works exactly like I expect.
>I do NOT see this ‘size_t’ redefinition. I DO see some warnings that I
>very much want to look at. So thank you again. Hmmm… so is this how I
>should run in the future? Or given this information does this give you any
>idea what I may have done wrong?
>
>Re oacr/x86/x64 I thought that OACR was getting confused. I didn’t realize
>that the config file was for the development machine, not the target.
>
>Thanks!
>
>On Fri, 14 Jan 2011 19:02:59 -0500, “Martin O’Brien”
> wrote:
>
>>1. Have you tried this using an unmodified WDK sample driver? I just
>reran
>>this over src/general/ioctl/kmdf/sys and it worked fine for me, so if you
>>haven’t tried this already, perhaps
>> Doing so would give us a baseline, because if that doesn’t work, you
>>pretty much have to have something messed up in your wdk
>installation/paths.
>>
>>2. Do things work correctly if you run PreFAST directly, instead of via
>>OACR? I’m not sure what this would necessarily matter, but, the
>>configuration file used by each are, I believe different.
>>
>>If you’re not familiar with this, here are the steps required. I’m
>>assuming:
>>
>> - that you’re going to do this either before running a NORMAL wdk build
>>environment or ensuring
>> That OACR isn’t already running.
>> - that you’re going to be building for chk WIN7 X64
>> - that your WDK installation is rooted in
>> - that your driver is located in
>>
>>a.) Start a normal (NOT a WDK Build Environment) cmd shell
>>b.) \bin\setenv.bat chk x64 WIN7 no_oacr
>>
>>cd
>>prefast build -ceZ
>>
>>3. If nothing improves, please try this and post the results of your
>>logfile:
>>
>>4. I’m not sure what you’re saying the issue is:
>>
>>xp …x86\oacr\oacr.ini
>>win7 x64 …amd64\oacr\oacr.ini
>>
>>That looks correct.
>>
>>
>>
>>cd
>>build -ceZ
>>name /P > logfile
>>
>>
>>Good luck,
>>
>>mm
>>
>>
>>-----Original Message-----
>>From: xxxxx@lists.osr.com
>>[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
>>Sent: Friday, January 14, 2011 6:39 PM
>>To: Windows System Software Devs Interest List
>>Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
>>setenv in the latest DDK?
>>
>>If anyone has any ideas on how to fix this I sure would appreciate it. I
>>uninstalled the WinDDK. I reinstalled it. I did the same on a Win7
>>machine. If I open a build environment Win7x64 on the Win7 machine, go to
>>the OACR and show “About OACR”, it says (as I expect) “…Configuration:
>>…amd64\oacr\oacr.ini”. If I do the same thing on my XP machine (which I
>>am using to develop) I see “…Configuration: …x86\oacr\oacr.ini”. This
>>creates havoc with my ability to use PREfast. I just cannot figure out why
>>it’s doing this. Thanks.
>>
>>—
>>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
>>
>
>—
>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
>

Michael Wade wrote:

I thought I was doing the correct thing:

  1. Open a Build Environment (Win 7 x64 Checked)
  2. cd SrcDir
  3. build -ce
  4. OACR always shows the same error. ‘size_t’ redefinition.

I am compiling a .cpp file. Should I do something different?

What include files are you including? That error usually means that
some include file is typedefing size_t to int, while another it
typedefing it to __int64, which is the proper one for 64-bit code.


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

Do you by any chance have a ‘c’ file with the same name as your ‘cpp’ file.

That is (hypothetically):

File.c

-AND-

File.cpp

If you do, this can cause some of the wdk tools to silently go apeshit due
to overly simplistic pattern rules in the makefiles that underlie Build.
Check your ‘wrn’ file to see if there’s any information there.

Otherwise, I would definitely try renaming your file to a ‘c’ and rerunning.

What ‘cpp’ features, if any, are you actually using? If you’re into, say,
templates, OACR/PreFast/SDV are almost certainly going to balk.

Finally, the due to the dependency tracking being more or less broken in
BUILD, you’d be better off running build with ‘-ceZ’ (v. ‘-ce’), basically
all the time.

Good luck,

Mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
Sent: Friday, January 14, 2011 8:29 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
setenv in the latest DDK?

I thought I was doing the correct thing:

  1. Open a Build Environment (Win 7 x64 Checked)
  2. cd SrcDir
  3. build -ce
  4. OACR always shows the same error. ‘size_t’ redefinition.

I am compiling a .cpp file. Should I do something different?

Thanks,

On Fri, 14 Jan 2011 19:33:35 -0500, “Martin O’Brien”
wrote:

>Not really. What were you doing before?
>
>
>mm
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
>Sent: Friday, January 14, 2011 7:29 PM
>To: Windows System Software Devs Interest List
>Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
>setenv in the latest DDK?
>
>Thanks! OK, if I follow your steps exactly it works exactly like I expect.
>I do NOT see this ‘size_t’ redefinition. I DO see some warnings that I
>very much want to look at. So thank you again. Hmmm… so is this how I
>should run in the future? Or given this information does this give you any
>idea what I may have done wrong?
>
>Re oacr/x86/x64 I thought that OACR was getting confused. I didn’t realize
>that the config file was for the development machine, not the target.
>
>Thanks!
>
>On Fri, 14 Jan 2011 19:02:59 -0500, “Martin O’Brien”
> wrote:
>
>>1. Have you tried this using an unmodified WDK sample driver? I just
>reran
>>this over src/general/ioctl/kmdf/sys and it worked fine for me, so if you
>>haven’t tried this already, perhaps
>> Doing so would give us a baseline, because if that doesn’t work, you
>>pretty much have to have something messed up in your wdk
>installation/paths.
>>
>>2. Do things work correctly if you run PreFAST directly, instead of via
>>OACR? I’m not sure what this would necessarily matter, but, the
>>configuration file used by each are, I believe different.
>>
>>If you’re not familiar with this, here are the steps required. I’m
>>assuming:
>>
>> - that you’re going to do this either before running a NORMAL wdk build
>>environment or ensuring
>> That OACR isn’t already running.
>> - that you’re going to be building for chk WIN7 X64
>> - that your WDK installation is rooted in
>> - that your driver is located in
>>
>>a.) Start a normal (NOT a WDK Build Environment) cmd shell
>>b.) \bin\setenv.bat chk x64 WIN7 no_oacr
>>
>>cd
>>prefast build -ceZ
>>
>>3. If nothing improves, please try this and post the results of your
>>logfile:
>>
>>4. I’m not sure what you’re saying the issue is:
>>
>>xp …x86\oacr\oacr.ini
>>win7 x64 …amd64\oacr\oacr.ini
>>
>>That looks correct.
>>
>>
>>
>>cd
>>build -ceZ
>>name /P > logfile
>>
>>
>>Good luck,
>>
>>mm
>>
>>
>>-----Original Message-----
>>From: xxxxx@lists.osr.com
>>[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Wade
>>Sent: Friday, January 14, 2011 6:39 PM
>>To: Windows System Software Devs Interest List
>>Subject: Re:[ntdev] Anyone with batch file knowledge, is this a bug in
>>setenv in the latest DDK?
>>
>>If anyone has any ideas on how to fix this I sure would appreciate it. I
>>uninstalled the WinDDK. I reinstalled it. I did the same on a Win7
>>machine. If I open a build environment Win7x64 on the Win7 machine, go to
>>the OACR and show “About OACR”, it says (as I expect) “…Configuration:
>>…amd64\oacr\oacr.ini”. If I do the same thing on my XP machine (which I
>>am using to develop) I see “…Configuration: …x86\oacr\oacr.ini”.
This
>>creates havoc with my ability to use PREfast. I just cannot figure out
why
>>it’s doing this. Thanks.
>>
>>—
>>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
>>
>
>—
>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
>


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