2020.12.18
  • PLDC (Pointer of Local Device Context): srv03rtm/windows/core/ntgdi/client/local.h: 276~309
  • DC refers to Device Context Types,有4种DC:Display、Printer、Memory、Information,下面的代码能够明显地看到Display和Printer,
    • Client即用户态:CreateDCW包装bCreateDCA包装hdcCreateDCW都位于windows/core/ntgdi/client/object.c
      • 函数hdcCreateDCW。注释写的Client side stub. Allocates a client side LDC as well.
    • Server即内核:上面的函数会调用系统调用NtGdiOpenDCW@windows/core/ntgdi/gre/ntgdi.c: 4846~4931
      • 若是Printer则调用hdcOpenDCW@windows/core/ntgdi/gre/opendc.cxx: 554
        • GreCreateDisplayDC@windows/core/ntgdi/gre/opendc.cxx: 23,这里能够看到Memory类型的DC,PDEV Initialization and Cleanup看出PDEV大概是Physical DEVice的缩写。

DC类定义在windows/core/ntgdi/gre/dcobj.hxx: 263~1318。PDC是指向它的指针1320行。XDCOBJ是DCOBJ的父类,包含的hdc()方法是执行PDC的hGet()方法