ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID NTAPI ProbeForWrite ( IN PVOID  Address,
IN SIZE_T  Length,
IN ULONG  Alignment 
)

Definition at line 143 of file exintrin.c.

Referenced by AcpiOsWritable(), co_UserCallNextHookEx(), DefaultQueryInfoBufferCheck(), DoQuery(), EngSecureMem(), IopDeviceFsIoControl(), IopGetDeviceProperty(), IopGetRelatedDevice(), IopQueryAttributesFile(), KeUserModeCallback(), KiDispatchException(), KiDispatchExceptionToUser(), KiInitializeUserApc(), KspPropertyHandler(), KsProbeStreamIrp(), KsReadFile(), MiDoMappedCopy(), MiDoPoolCopy(), NtAccessCheck(), NtAdjustPrivilegesToken(), NtAllocateLocallyUniqueId(), NtCreateKeyedEvent(), NtCreateProfile(), NtCreateThread(), NtEnumerateKey(), NtEnumerateValueKey(), NtGdiCombineTransform(), NtGdiDescribePixelFormat(), NtGdiDoPalette(), NtGdiExtEscape(), NtGdiExtGetObjectW(), NtGdiGetAndSetDCDword(), NtGdiGetAppClipBox(), NtGdiGetBitmapBits(), NtGdiGetBitmapDimension(), NtGdiGetBoundsRect(), NtGdiGetDCDword(), NtGdiGetDCPoint(), NtGdiGetDeviceCapsAll(), NtGdiGetDeviceGammaRamp(), NtGdiGetDIBitsInternal(), NtGdiGetFontResourceInfoInternalW(), NtGdiGetFontUnicodeRanges(), NtGdiGetGlyphIndicesW(), NtGdiGetGlyphOutline(), NtGdiGetKerningPairs(), NtGdiGetMiterLimit(), NtGdiGetOutlineTextMetricsInternalW(), NtGdiGetRasterizerCaps(), NtGdiGetRealizationInfo(), NtGdiGetRgnBox(), NtGdiGetTextCharsetInfo(), NtGdiGetTextMetricsW(), NtGdiGetTransform(), NtGdiMoveTo(), NtGdiOffsetViewportOrgEx(), NtGdiOffsetWindowOrgEx(), NtGdiOpenDCW(), NtGdiScaleViewportExtEx(), NtGdiScaleWindowExtEx(), NtGdiSetBitmapDimension(), NtGdiSetBrushOrg(), NtGdiSetMiterLimit(), NtGdiSetViewportOrgEx(), NtGdiSetWindowOrgEx(), NtGdiTransformPoints(), NtGetWriteWatch(), NtNotifyChangeDirectoryFile(), NtOpenKeyedEvent(), NtPlugPlayControl(), NtPrivilegeCheck(), NtQueryDirectoryFile(), NtQueryDirectoryObject(), NtQueryInformationAtom(), NtQueryInformationFile(), NtQueryInformationProcess(), NtQueryInformationThread(), NtQueryKey(), NtQueryObject(), NtQuerySecurityObject(), NtQuerySymbolicLinkObject(), NtQuerySystemEnvironmentValue(), NtQuerySystemInformation(), NtQueryValueKey(), NtQueryVirtualMemory(), NtQueryVolumeInformationFile(), NtReadFile(), NtUserBuildHwndList(), NtUserCallMsgFilter(), NtUserCallOneParam(), NtUserCopyAcceleratorTable(), NtUserCreateLocalMemHandle(), NtUserEnumDisplayDevices(), NtUserEnumDisplaySettings(), NtUserGetClassInfo(), NtUserGetClipboardData(), NtUserGetClipboardFormatName(), NtUserGetComboBoxInfo(), NtUserGetCursorInfo(), NtUserGetIconInfo(), NtUserGetIconSize(), NtUserGetInternalWindowPos(), NtUserGetKeyboardLayoutList(), NtUserGetKeyboardLayoutName(), NtUserGetKeyboardState(), NtUserGetKeyNameText(), NtUserGetMessage(), NtUserGetMouseMovePointsEx(), NtUserGetTitleBarInfo(), NtUserMessageCall(), NtUserPeekMessage(), NtUserScrollDC(), NtUserScrollWindowEx(), NtUserTrackMouseEvent(), NtWaitForDebugEvent(), PsGetContextThread(), and SpiMemCopy().

{
    ULONG_PTR Last, Current = (ULONG_PTR)Address;
    PAGED_CODE();

    /* Only probe if we have a valid length */
    if (Length != 0)
    {
        /* Sanity check */
        ASSERT((Alignment == 1) ||
               (Alignment == 2) ||
               (Alignment == 4) ||
               (Alignment == 8) ||
               (Alignment == 16));

        /* Check the alignment */
        if ((Current & (Alignment - 1)) != 0)
        {
            /* Incorrect alignment */
            ExRaiseDatatypeMisalignment();
        }

        /* Get the end address */
        Last = Current + Length - 1;
        if ((Last < Current) || (Last >= (ULONG_PTR)MmUserProbeAddress))
        {
            /* Raise an access violation */
            ExRaiseAccessViolation();
        }

        /* Round down to the last page */
        Last = PAGE_ROUND_DOWN(Last) + PAGE_SIZE;
        do
        {
            /* Attempt a write */
            *(volatile CHAR*)Current = *(volatile CHAR*)Current;

            /* Go to the next address */
            Current = PAGE_ROUND_DOWN(Current) + PAGE_SIZE;
        } while (Current != Last);
    }
}

Generated on Thu May 24 2012 06:07:01 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.