Help!! Can't call the ZwOpenSection_

Windows specific forum
end7
User
User
Posts: 10
Joined: Thu Jun 01, 2006 9:07 am

Help!! Can't call the ZwOpenSection_

Post by end7 »

when i call "ZwOpenSection_" ,is failed,and return "C0000005".why?
I creat it unicode
I know success if it retrn "0",how to do?
anybody can help me!!

Code: Select all

#STATUS_ACCESS_DENIED = $C0000022
#STATUS_INVALID_HANDLE = $C0000008
#STATUS_SUCCESS = $0

#SECTION_MAP_WRITE = $2
#SECTION_MAP_READ = $4
Structure UNICODE_STRING
    Length.w
    MaximumLength.w
    Buffer.l
EndStructure
Structure OBJECT_ATTRIBUTES
    Length.l
    RootDirectory.l
    ObjectName.l
    Attributes.l
    SecurityDeor.l
    SecurityQualityOfService.l
EndStructure


Status.l
Attributes.OBJECT_ATTRIBUTES 
PhysmemString.UNICODE_STRING   
AdrString.s="\Device\PhysicalMemory"
RtlInitUnicodeString_(@PhysmemString, @adrString)
With Attributes
    \Length = SizeOf(Attributes)
    \RootDirectory = 0
    \ObjectName = @PhysmemString
    \Attributes = 0
    \SecurityDeor = 0
    \SecurityQualityOfService = 0
EndWith  
Status = ZwOpenSection_(g_hMPM,#SECTION_MAP_WRITE Or #SECTION_MAP_READ, @Attributes)
Debug "Status="+RSet(Hex(Status),8,"0") 
Select Status 
  Case #STATUS_SUCCESS 
    Debug "#STATUS_SUCCESS" 
  Case #STATUS_ACCESS_DENIED 
    Debug "#STATUS_ACCESS_DENIED" 
  Case #STATUS_INVALID_HANDLE 
    Debug "#STATUS_INVALID_HANDLE" 
EndSelect