dlls/kernelbase/debug.c
static BOOL check_resource_write( void *addr )
{
    DWORD old_prot;
    void *rsrc;
    DWORD size;
    MEMORY_BASIC_INFORMATION info;

    if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE;
    if (info.State == MEM_FREE || !(info.Type & MEM_IMAGE)) return FALSE;
    if (!(rsrc = RtlImageDirectoryEntryToData( info.AllocationBase, TRUE,
                                               IMAGE_DIRECTORY_ENTRY_RESOURCE, &size )))
        return FALSE;
    if (addr < rsrc || (char *)addr >= (char *)rsrc + size) return FALSE;
    TRACE( "Broken app is writing to the resource data, enabling work-around\n" );
    VirtualProtect( rsrc, size, PAGE_READWRITE, &old_prot );
    return TRUE;
}
/*******************************************************************
 *         check_resource_write
 *
 * Check if the exception is a write attempt to the resource data.
 * If yes, we unprotect the resources to let broken apps continue
 * (Windows does this too).
 */
check_resource_write
Check if the exception is a write attempt to the resource data.
If yes, we unprotect the resources to let broken apps continue
(Windows does this too).
check_resource_write Check if the exception is a write attempt to the resource data . If yes we unprotect the resources to let broken apps continue ( Windows does this too ) .
static BOOL check_resource_write( void *addr )
{
    DWORD old_prot;
    void *rsrc;
    DWORD size;
    MEMORY_BASIC_INFORMATION info;
    if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE;
    if (info.State == MEM_FREE || !(info.Type & MEM_IMAGE)) return FALSE;
    if (!(rsrc = RtlImageDirectoryEntryToData( info.AllocationBase, TRUE,
                                               IMAGE_DIRECTORY_ENTRY_RESOURCE, &size )))
        return FALSE;
    if (addr < rsrc || (char *)addr >= (char *)rsrc + size) return FALSE;
    TRACE( "Broken app is writing to the resource data, enabling work-around\n" );
    VirtualProtect( rsrc, size, PAGE_READWRITE, &old_prot );
    return TRUE;
}
static BOOL check_resource_write ( void * addr ) { DWORD old_prot ; void * rsrc ; DWORD size ; MEMORY_BASIC_INFORMATION info ; if ( ! VirtualQuery ( addr , & info , sizeof ( info ) ) ) return FALSE ; if ( info . State == MEM_FREE || ! ( info . Type & MEM_IMAGE ) ) return FALSE ; if ( ! ( rsrc = RtlImageDirectoryEntryToData ( info . AllocationBase , TRUE , IMAGE_DIRECTORY_ENTRY_RESOURCE , & size ) ) ) return FALSE ; if ( addr < rsrc || ( char * ) addr >= ( char * ) rsrc + size ) return FALSE ; TRACE ( " \n " ) ; VirtualProtect ( rsrc , size , PAGE_READWRITE , & old_prot ) ; return TRUE ; }
check_resource_write
 Check if the exception is a write attempt to the resource data.
check_resource_write Check if the exception is a write attempt to the resource data .