The MASM Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 09, 2010, 02:15:15 am

Login with username, password and session length
Search:     Advanced search
117346 Posts in 14003 Topics by 1654 Members
Latest Member: road_hog
* Home Help Search Login Register
+  The MASM Forum
|-+  Specialised Projects
| |-+  Pelle's Macro Assembler Development (Moderator: Vortex)
| | |-+  poasm and winioctl.inc
« previous next »
Pages: [1] Print
Author Topic: poasm and winioctl.inc  (Read 1820 times)
petrik
New Member
*
Posts: 7



poasm and winioctl.inc
« on: October 03, 2009, 07:49:01 pm »

I am in the process of writing a Win32 low level disk sector editor to cater for both FAT and NTFS. I have previously written one for DOS and was writing one for Windows 98 but became tired of all the messing around with 16-bit and 32--bit thunking. Win32 seems a lot less hassle.
I am running Windows XP Pro SP3.
I am using Japheth's winioctl.inc, porc.exe, poasm.exe and polink.exe.
The baic file assembles OK but everytime polink (\masm32\bin\polink.exe /VERBOSE /SUBSYSTEM:WINDOWS DiskEdit.obj rsrc.res) runs it throws up the following error: \masm32\include\winioctl.inc(363): fatal error: Must be inside a section.
The offending line 363 is 'if (_WIN32_WINNT ge 0400h)'.
I don't know what to change in winioctl.inc to make it compatible with poilink.
I would be extremely grateful for any help.
Many thanks.

Logged
hutch--
Administrator
Member
*****
Posts: 9581


Mnemonic Driven API Grinder


Re: poasm and winioctl.inc
« Reply #1 on: October 07, 2009, 08:41:55 am »

petrik,

In the short term for testing, just load the two values into registers and do the comparison that way. Check the SIZE of both _WIN32_WINNT and 0400h to ensure they are the same so the comparison can be done. Also check the values in the include file to make sure they are correct.
Logged

Regards,



Download site for MASM32
http://www.masm32.com
japheth
Member
*****
Posts: 831


DOS


Re: poasm and winioctl.inc
« Reply #2 on: October 07, 2009, 10:26:17 am »

I am using Japheth's winioctl.inc, porc.exe, poasm.exe and polink.exe.
The baic file assembles OK but everytime polink (\masm32\bin\polink.exe /VERBOSE /SUBSYSTEM:WINDOWS DiskEdit.obj rsrc.res) runs it throws up the following error: \masm32\include\winioctl.inc(363): fatal error: Must be inside a section.
The offending line 363 is 'if (_WIN32_WINNT ge 0400h)'.
I don't know what to change in winioctl.inc to make it compatible with poilink.

Please elaborate more carefully which tool displays the error. Because PoLink is a linker, it has nothing to do with assembly source files (winioctl.inc).
If it is poasm which complains then just define _WIN32_WINNT somewhere. The winioctl.inc was generated from MS PSDK sources, IIRC common values are:

_WIN32_WINNT equ 400h  ;for Windows NT
_WIN32_WINNT equ 500h  ;for Windows XP
Logged

() ()
(•.•)
(><)
petrik
New Member
*
Posts: 7



Re: poasm and winioctl.inc
« Reply #3 on: October 07, 2009, 07:11:57 pm »

 BigGrin
Thank you very much Hutch and Japheth.
Simply adding _WIN32_WINNT equ 500h to winioctl.inc solved the problem.
Why didn't I figure this out myself?
I guess I'll have to stop being lazy and relying on everything always being in the relevant predefined .inc files.
Thanks again.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!