Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > WINDOWS PROGRAMMING (NNTP) > Alignment exception
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 18th May 21:11
vladimir beker
External User
 
Posts: 1
Default Alignment exception



Hello

I've got Alignment Exception in my driver. Trying to figure out the source
of the problem I found that it is function RtlFillMemory who fails. It gets
unaligned address as parameter, and implemented via
rep stosd
I was very surprised to see it since:
1) DDK do***entation says nothing about alignment restriction when using
this function.
2) If there are no such restrictions, why the function works with DWORDs. It
should either work with bytes or (if they prefer speed optimization) to move
in more sophisticated way.
3) As far as I know, there is some flag in Pentium (in one of CR registers)
that controls whether access to unaligned data should bring to exception. As
far as I know this flag is usually disabled. Are there any chances that it
will be enabled? Is there any Registry entry that controls it?
I found interesting entry FeatureSet in
HARDWARE\DESCRIPTION\System\CentralProcessor but have no idea what it is
talking about.

Any help will be appreciated.
Regards
Vladimir
  Reply With Quote


  sponsored links


2 18th May 21:11
maxim s. shatskih
External User
 
Posts: 1
Default Alignment exception



What is the machine you use? IIRC x86 CPU has not alignment exceptions, it
just slows down in this case.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
  Reply With Quote
3 18th May 21:11
alexander grigoriev
External User
 
Posts: 1
Default Alignment exception


IIRC, alignment exception can only be enabled for Ring3 mode.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666