VirtualBox

Changeset 53877 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 21, 2015 12:30:58 AM (10 years ago)
Author:
vboxsync
Message:

ldrPE: Windows 10 IMAGE_LOAD_CONFIG_DIRECTORY update.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r53818 r53877  
    29312931     * volatile everywhere! Trying to prevent the compiler being a smarta$$ and reorder stuff.
    29322932     */
    2933     IMAGE_LOAD_CONFIG_DIRECTORY32_V3 volatile *pLoadCfg32 = (IMAGE_LOAD_CONFIG_DIRECTORY32_V3 volatile *)pLoadCfg;
    2934     IMAGE_LOAD_CONFIG_DIRECTORY64_V3 volatile *pLoadCfg64 = pLoadCfg;
    2935 
     2933    IMAGE_LOAD_CONFIG_DIRECTORY32_V4 volatile *pLoadCfg32 = (IMAGE_LOAD_CONFIG_DIRECTORY32_V4 volatile *)pLoadCfg;
     2934    IMAGE_LOAD_CONFIG_DIRECTORY64_V4 volatile *pLoadCfg64 = pLoadCfg;
     2935
     2936    pLoadCfg64->CodeIntegrity.Reserved      = pLoadCfg32->CodeIntegrity.Reserved;
     2937    pLoadCfg64->CodeIntegrity.CatalogOffset = pLoadCfg32->CodeIntegrity.CatalogOffset;
     2938    pLoadCfg64->CodeIntegrity.Catalog       = pLoadCfg32->CodeIntegrity.Catalog;
     2939    pLoadCfg64->CodeIntegrity.Flags         = pLoadCfg32->CodeIntegrity.Flags;
    29362940    pLoadCfg64->GuardFlags                  = pLoadCfg32->GuardFlags;
    29372941    pLoadCfg64->GuardCFFunctionCount        = pLoadCfg32->GuardCFFunctionCount;
     
    34333437    if (Dir.Size)
    34343438    {
     3439        const size_t cbExpectV4 = !pModPe->f64Bit
     3440                                ? sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32_V4)
     3441                                : sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64_V4);
    34353442        const size_t cbExpectV3 = !pModPe->f64Bit
    34363443                                ? sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32_V3)
     
    34433450                                : sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64_V2) /*No V1*/;
    34443451
    3445         if (   Dir.Size != cbExpectV3
     3452        if (   Dir.Size != cbExpectV4
     3453            && Dir.Size != cbExpectV3
    34463454            && Dir.Size != cbExpectV2
    34473455            && Dir.Size != cbExpectV1)
    34483456        {
    3449             Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %d bytes, expected %d, %d, or %d.\n",
    3450                  pszLogName, Dir.Size, cbExpectV3, cbExpectV2, cbExpectV1));
     3457            Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %d bytes, expected %d, %d, %d, or %d.\n",
     3458                 pszLogName, Dir.Size, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1));
    34513459            return VERR_LDRPE_LOAD_CONFIG_SIZE;
    34523460        }
     
    34553463         * Read and convert to 64-bit.
    34563464         */
    3457         memset(&u.Cfg64, 0, sizeof(u.Cfg64));
     3465        RT_ZERO(u.Cfg64);
    34583466        int rc = rtldrPEReadRVA(pModPe, &u.Cfg64, Dir.Size, Dir.VirtualAddress);
    34593467        if (RT_FAILURE(rc))
  • trunk/src/VBox/Runtime/include/internal/ldrPE.h

    r51770 r53877  
    540540
    541541
     542/** @since Windows 10 (preview 9879) */
     543typedef struct _IMAGE_LOAD_CONFIG_CODE_INTEGRITY
     544{
     545    uint16_t  Flags;
     546    uint16_t  Catalog;
     547    uint32_t  CatalogOffset;
     548    uint32_t  Reserved;
     549} IMAGE_LOAD_CONFIG_CODE_INTEGRITY;
     550AssertCompileSize(IMAGE_LOAD_CONFIG_CODE_INTEGRITY, 12);
     551typedef IMAGE_LOAD_CONFIG_CODE_INTEGRITY *PIMAGE_LOAD_CONFIG_CODE_INTEGRITY;
     552typedef IMAGE_LOAD_CONFIG_CODE_INTEGRITY const *PCIMAGE_LOAD_CONFIG_CODE_INTEGRITY;
    542553
    543554typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32_V1
     
    625636typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V3 const *PCIMAGE_LOAD_CONFIG_DIRECTORY32_V3;
    626637
    627 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V3   IMAGE_LOAD_CONFIG_DIRECTORY32;
    628 typedef PIMAGE_LOAD_CONFIG_DIRECTORY32_V3  PIMAGE_LOAD_CONFIG_DIRECTORY32;
    629 typedef PCIMAGE_LOAD_CONFIG_DIRECTORY32_V3 PCIMAGE_LOAD_CONFIG_DIRECTORY32;
     638/** @since Windows 10 (preview 9879) */
     639typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32_V4
     640{
     641    uint32_t  Size;
     642    uint32_t  TimeDateStamp;
     643    uint16_t  MajorVersion;
     644    uint16_t  MinorVersion;
     645    uint32_t  GlobalFlagsClear;
     646    uint32_t  GlobalFlagsSet;
     647    uint32_t  CriticalSectionDefaultTimeout;
     648    uint32_t  DeCommitFreeBlockThreshold;
     649    uint32_t  DeCommitTotalFreeThreshold;
     650    uint32_t  LockPrefixTable;
     651    uint32_t  MaximumAllocationSize;
     652    uint32_t  VirtualMemoryThreshold;
     653    uint32_t  ProcessHeapFlags;
     654    uint32_t  ProcessAffinityMask;
     655    uint16_t  CSDVersion;
     656    uint16_t  Reserved1;
     657    uint32_t  EditList;
     658    uint32_t  SecurityCookie;
     659    uint32_t  SEHandlerTable;
     660    uint32_t  SEHandlerCount;
     661    uint32_t  GuardCFCCheckFunctionPointer;
     662    uint32_t  Reserved2;
     663    uint32_t  GuardCFFunctionTable;
     664    uint32_t  GuardCFFunctionCount;
     665    uint32_t  GuardFlags;
     666    IMAGE_LOAD_CONFIG_CODE_INTEGRITY  CodeIntegrity;
     667} IMAGE_LOAD_CONFIG_DIRECTORY32_V4;
     668AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY32_V4, 0x68);
     669typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V4 *PIMAGE_LOAD_CONFIG_DIRECTORY32_V4;
     670typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V4 const *PCIMAGE_LOAD_CONFIG_DIRECTORY32_V4;
     671
     672typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V4   IMAGE_LOAD_CONFIG_DIRECTORY32;
     673typedef PIMAGE_LOAD_CONFIG_DIRECTORY32_V4  PIMAGE_LOAD_CONFIG_DIRECTORY32;
     674typedef PCIMAGE_LOAD_CONFIG_DIRECTORY32_V4 PCIMAGE_LOAD_CONFIG_DIRECTORY32;
    630675
    631676/* No _IMAGE_LOAD_CONFIG_DIRECTORY64_V1 exists. */
     
    692737typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V3 const *PCIMAGE_LOAD_CONFIG_DIRECTORY64_V3;
    693738
    694 typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V3   IMAGE_LOAD_CONFIG_DIRECTORY64;
    695 typedef PIMAGE_LOAD_CONFIG_DIRECTORY64_V3  PIMAGE_LOAD_CONFIG_DIRECTORY64;
    696 typedef PCIMAGE_LOAD_CONFIG_DIRECTORY64_V3 PCIMAGE_LOAD_CONFIG_DIRECTORY64;
     739/** @since  Windows 10 (Preview (9879). */
     740typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64_V4
     741{
     742    uint32_t  Size;
     743    uint32_t  TimeDateStamp;
     744    uint16_t  MajorVersion;
     745    uint16_t  MinorVersion;
     746    uint32_t  GlobalFlagsClear;
     747    uint32_t  GlobalFlagsSet;
     748    uint32_t  CriticalSectionDefaultTimeout;
     749    uint64_t  DeCommitFreeBlockThreshold;
     750    uint64_t  DeCommitTotalFreeThreshold;
     751    uint64_t  LockPrefixTable;
     752    uint64_t  MaximumAllocationSize;
     753    uint64_t  VirtualMemoryThreshold;
     754    uint64_t  ProcessAffinityMask;
     755    uint32_t  ProcessHeapFlags;
     756    uint16_t  CSDVersion;
     757    uint16_t  Reserved1;
     758    uint64_t  EditList;
     759    uint64_t  SecurityCookie;
     760    uint64_t  SEHandlerTable;
     761    uint64_t  SEHandlerCount;
     762    uint64_t  GuardCFCCheckFunctionPointer;
     763    uint64_t  Reserved2;
     764    uint64_t  GuardCFFunctionTable;
     765    uint64_t  GuardCFFunctionCount;
     766    uint32_t  GuardFlags;
     767    IMAGE_LOAD_CONFIG_CODE_INTEGRITY  CodeIntegrity;
     768} IMAGE_LOAD_CONFIG_DIRECTORY64_V4;
     769AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY64_V4, 0xa0);
     770typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V4 *PIMAGE_LOAD_CONFIG_DIRECTORY64_V4;
     771typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V4 const *PCIMAGE_LOAD_CONFIG_DIRECTORY64_V4;
     772
     773typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V4   IMAGE_LOAD_CONFIG_DIRECTORY64;
     774typedef PIMAGE_LOAD_CONFIG_DIRECTORY64_V4  PIMAGE_LOAD_CONFIG_DIRECTORY64;
     775typedef PCIMAGE_LOAD_CONFIG_DIRECTORY64_V4 PCIMAGE_LOAD_CONFIG_DIRECTORY64;
     776
    697777
    698778typedef struct _IMAGE_DEBUG_DIRECTORY
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette