Re: ZwCreateSection



How are you going to synchronize writes between kernel and user space? Even
if only the application does the writting, how are you going to notify the
driver about the writes? Maybe a better question is why do you think this
is needed? In the last 10+ years of writing Windows NT/2000/XP/2003/Vista
kernel code, I have only seen one use that could be justified for this
technique, all the others (and there were a lot) became faster and more
reliable by using IRP's.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"killme" <killme@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F1F81FB5-D9E3-4410-ACF6-148A4C83E58B@xxxxxxxxxxxxxxxx
> Hi All,
>
> I used ZwCreateSection() to create a section object in a kernel mode
> driver and tried to open the section object using CreateFileMapping() in
> windows. The problem is that both the driver as well as application will
> be
> updating the shared memory. So, when I tried to open the shared memory
> with
> FILE_MAP_WRITE specified in OpenFileMapping(), it returns win32 error code
> 5
> (access denied). It succeeds with the FILE_MAP_READ access. If I use
> ZwClose() in the driver to close the section handle, I am able to use in
> the
> user-mode application.
> Is there any way I can specify in the kernel mode driver to make it
> possible to the user mode application too to write to the shared memory? I
> may be missing some flags in ZwCreateSection() or ZwMapViewOfSection() or
> InitializeObjectAttributes()? Besides writing to same memory from
> user-mode
> and kernel-mode in such scenario can result in any problem ( I suspect)?
>
>


.



Relevant Pages

  • Re: 2.6.30-rc4 kernel
    ... I think there may be a problem with the 2.6.30 kernel that is ... # Generic Driver Options ... # PCI IDE chipsets support ... # Other IDE chipsets support ...
    (Linux-Kernel)
  • 2.6.30-rc4 kernel
    ... kernel panic - not syncing: ... # Generic Driver Options ... # PCI IDE chipsets support ... # Other IDE chipsets support ...
    (Linux-Kernel)
  • [PATCH 18-rc2] Fix typos in /Documentation : N-P
    ... Again, if you're not gonna do synchronization with disk drives (dang, ... -the kernel. ... There are two options specific to PSX driver portion. ... The driver uses the settings from the EEPROM set in the SCSI BIOS ...
    (Linux-Kernel)
  • two scary syslog kernel messages
    ... Sep 20 03:46:06 marvin kernel: kernel BUG at mm/rmap.c:482! ... ACPI: Local APIC address 0xfee00000 ... Allocating PCI resources starting at 80000000 ... ** driver failed to call pci_enable_device. ...
    (Debian-User)
  • Re: PCI lib for 2.4 //kwds: pci, dma, mapping memory, kernel vs. user-space.
    ... They are *all* you can use for a user-space driver. ... internal kernel interfaces that are not accessible from user space. ... You should be able to do high speed data streaming from user space -- ... I'm measuring 10 microseconds from a PCI board asserting an interrupt ...
    (Linux-Kernel)