Hi all.
I’m writing a driver with both C and ASM Code( because Inline asm can’t
access to IDTR ). My compling step is as following:
1 Complies asm code using MASM32 v8 to generate interrutprocess.obj file;
2 Add the .obj file to Source using macro TARGETLIBS;
3 run build -cZ
Then I get error:
interrutprocess.obj LNK2026: module unsafe for SAFESEH image;
error LNK1281: Unable to generate SAFESEH image.
I tried to complies ASM code with option /safeseh, but finally I get another
error:
interrutprocess.obj LNK1107: invalid or corrupt file: cannot read at 0xD8
Does anyone see this error?
Thank you for your reply
Hi all.
I’m writing a driver with both C and ASM Code( because Inline asm can’t access to IDTR ). My compling step is as following:
1 Complies asm code using MASM32 v8 to generate interrutprocess.obj file;
2 Add the .obj file to Source using macro TARGETLIBS;
3 run build –cZ
Then I get error:
interrutprocess.obj LNK2026: module unsafe for SAFESEH image;
error LNK1281: Unable to generate SAFESEH image.
I tried to complies ASM code with option /safeseh, but finally I get another error:
interrutprocess.obj LNK1107: invalid or corrupt file: cannot read at 0xD8
Does anyone see this error?
Thank you for your reply
Usually I see this error when I do something like inadvertently try to
use the same file for input and output, or something like that, but I
don’t use BUILD. I’m not entirely sure what you mean by MASM32. If you
mean an old version of ML, then it is possible that you need to specify
the /coff switch to prevent it from defaulting to OMF.
mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@21cn.com
Sent: Sunday, August 19, 2007 08:48
To: Windows File Systems Devs Interest List
Subject: [ntfsd] How to complie driver with C and ASM code using WDK
6000?
Hi all.
I’m writing a driver with both C and ASM Code( because Inline asm can’t
access to IDTR ). My compling step is as following:
1 Complies asm code using MASM32 v8 to generate interrutprocess.obj
file;
2 Add the .obj file to Source using macro TARGETLIBS;
3 run build -cZ
Then I get error:
interrutprocess.obj LNK2026: module unsafe for SAFESEH image;
error LNK1281: Unable to generate SAFESEH image.
I tried to complies ASM code with option /safeseh, but finally I get
another error:
interrutprocess.obj LNK1107: invalid or corrupt file: cannot read at
0xD8
Does anyone see this error?
Thank you for your reply
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
The WDK includes a working version of MASM. You should integrate the build process of your .asm files into the BUILD.EXE build environment rather than creating object files outside the scope of the build environment and then linking to those .obj files. Using foreign versions of MASM is just as discouraged as using a different compiler than as ships with the WDK.
You may list .asm files as normal in a “SOURCES=” directive of a “SOURCES” file. The .asm files must be placed in a subdirectory named by the target architecture. For example, x64 .asm files are required to be in an “amd64” subdirectory and x86 .asm files are required to be an “i386” subdirectory.
–
Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
“LiaoWei” wrote in message news:xxxxx@ntfsd…
Hi all.
I’m writing a driver with both C and ASM Code( because Inline asm can’t access to IDTR ). My compling step is as following:
1 Complies asm code using MASM32 v8 to generate interrutprocess.obj file;
2 Add the .obj file to Source using macro TARGETLIBS;
3 run build -cZ
Then I get error:
interrutprocess.obj LNK2026: module unsafe for SAFESEH image;
error LNK1281: Unable to generate SAFESEH image.
I tried to complies ASM code with option /safeseh, but finally I get another error:
interrutprocess.obj LNK1107: invalid or corrupt file: cannot read at 0xD8
Does anyone see this error?
Thank you for your reply