reactos/sdk/include/psdk
Hermès Bélusca-Maïto 0ad65796bb
[WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV.
CORE-12149

VIDEOPRT:
=========

Improve interfacing with INBV, so as to detect when an external module
acquired INBV display ownership, and whether ownership is being released
later on. (This does NOT rely on hooking!)

For this purpose we improve the IntVideoPortResetDisplayParameters(Ex)
callback that gets registered with an InbvNotifyDisplayOwnershipLost()
call during initialization, and we add a monitoring thread.

The callback is called whenever an external module calls
InbvAcquireDisplayOwnership(), for example the bugcheck code or the KDBG
debugger in SCREEN mode. When this happens, a flag that tells the
monitoring thread to start monitoring INBV is set (ReactOS-specific),
and the display adapters get reset with HwResetHw() (as done on Windows).

Due to the fact that this INBV callback can be called at *ANY* IRQL, we
cannot use dispatcher synchronization mechanisms such as events to tell
the INBV monitoring thread to start its operations, so we need to rely
instead on a flag to be set. And, since INBV doesn't provide with any
proper callback/notification system either, we need to actively monitor
its state by pooling. To reduce the load on the system the monitoring
thread performs 1-second waits between each check for the flag set by
the INBV callback, and during checking the INBV ownership status.

When the INBV ownership is detected to be released by an external module,
the INBV callback is re-registered (this is *MANDATORY* since the
external module has called InbvNotifyDisplayOwnershipLost() with a
different callback parameter!), and then we callout to Win32k for
re-enabling the display.

This has the virtue of correctly resetting the display once the KDBG
debugger in SCREEN mode is being exited, and fixes CORE-12149 .

The following additional fixes were needed:

VIDEOPRT & WIN32K:
==================

Remove the registration with INBV that was previously done in a ReactOS-
specific hacked IRP_MJ_WRITE call; it is now done correctly during the
video device opening done by EngpRegisterGraphicsDevice() in the VIDEOPRT's
IRP_MJ_CREATE handler, as done on Windows.

WIN32K:
=======

- Stub the VideoPortCallout() support, for VIDEOPRT -> WIN32 callbacks.
  This function gets registered with VIDEOPRT through an
  IOCTL_VIDEO_INIT_WIN32K_CALLBACKS call in EngpRegisterGraphicsDevice().

- Only partially implement the 'VideoFindAdapterCallout' case, that just
  re-enables the primary display by refreshing it (using the new function
  UserRefreshDisplay()).

VIDEOPRT:
=========

- PVIDEO_WIN32K_CALLOUT is an NTAPI (stdcall) callback.

- In the IntVideoPortResetDisplayParameters(Ex) callback, reset all the
  "resettable" adapters registered in the HwResetAdaptersList list.
  We thus get rid of the global ResetDisplayParametersDeviceExtension.

- Make the IntVideoPortResetDisplayParameters(Ex) callback slightly more
  robust (using SEH) against potential HwResetListEntry list corruption
  or invalid DriverExtension->InitializationData.HwResetHw() that would
  otherwise trigger a BSOD, and this would be disastrous since that
  callback is precisely called when INBV is acquired, typically when the
  BSOD code initializes the display for displaying its information...

Extras:
- Validate the IrpStack->MajorFunction in IntVideoPortDispatchDeviceControl()
  and implement IRP_MJ_SHUTDOWN handling. Stub out the other IOCTLs that
  are handled by VIDEOPRT only (and not by the miniports).

- VIDEOPRT doesn't require IRP_MJ_INTERNAL_DEVICE_CONTROL (unused).

- Implement IOCTL_VIDEO_PREPARE_FOR_EARECOVERY that just resets the
  display to standard VGA 80x25 text mode.
2019-12-02 02:33:20 +01:00
..
accctrl.h
access.idl
aclapi.h
aclui.h
activaut.idl
activdbg.idl
activscp.idl [PSDK] Update activscp.idl. CORE-16441 2019-12-01 19:42:38 +01:00
adshlp.h
advpub.h
af_irda.h
afxres.h
appmgmt.h
asptlb.idl
asynot.idl
asysta.idl
atliface.idl
atsmedia.h
audioclient.idl
audiopolicy.idl
audiosessiontypes.h
authz.h
basetsd.h
basetyps.h
batclass.h
bcrypt.h
bdaiface.idl
binres.idl
bits.idl
bits1_5.idl
bits2_0.idl
bits2_5.idl
bits3_0.idl
bitsmsg.h
bthdef.h
cderr.h
cfg.h
cfgmgr32.h
cguid.h [PSDK] Fix GCC8 complaining on duplicate and wrong declarations 2019-08-20 15:05:47 +02:00
chstring.h [PSDK] Remove throw specifiers, deprecated in C++11 2019-04-01 11:38:32 +02:00
cierror.h
clusapi.h
CMakeLists.txt [PSDK][UUID] Import natupnp.idl from Wine Staging 4.18. CORE-16441 2019-10-20 20:01:58 +01:00
cmdbas.idl
cmdtxt.idl
comcat.idl
commctrl.h [PSDK] Update commctrl.h. CORE-16441 2019-10-26 22:51:35 +01:00
commdlg.h [PSDK] Use CALLBACK instead of APIENTRY 2019-03-06 00:42:43 +01:00
common.ver
commoncontrols.idl
compstui.h
concurrencysal.h
control.idl
cor.idl
cordebug.idl
corerror.h
corhdr.h
cpl.h
cplext.h
crtrow.idl
cryptdlg.h
cryptuiapi.h
ctfutb.idl
ctxtcall.idl
custcntl.h
cvconst.h
d3d.h
d3d8.h
d3d8types.h
d3d9.h
d3d9types.h [PSDK] Add missing D3DFORMAT enum members to d3d9types.h 2019-03-06 00:41:52 +01:00
d3d10.idl
d3d10effect.h
d3d10misc.h
d3d10shader.h
d3d11shader.h [PSDK] Add missing GetRequiresFlags. CORE-16441 2019-10-26 12:59:56 +01:00
d3dcommon.idl
d3dcompiler.h
d3dnthal.h
d3drm.h
d3drmdef.h
d3drmobj.h
d3drmwin.h
d3dtypes.h
d3dukmdt.h
d3dx8core.h
dbccmd.idl
dbcses.idl
dbdsad.idl
dbghelp.h [PSDK] dbghelp.h: Fix 64 bit version of LOADED_IMAGE 2019-08-15 18:04:57 +02:00
dbinit.idl
dbprop.idl
dbs.idl
dbt.h
dciman.h
dde.h
ddeml.h [PSDK] Improve definition of CBR_BLOCK 2019-03-04 21:58:42 +01:00
ddkernel.h
ddkmapi.h
ddraw.h
ddrawgdi.h
ddrawi.h
ddrawint.h
delayimp.h
delayloadhandler.h
devenum.idl
devguid.h
devicetopology.idl
devpkey.h
devpropdef.h
dhcpcapi.h
dhcpcsdk.h
digitalv.h
dimm.idl
dinput.h [PSDK] Update dinput.h. CORE-16441 2019-10-26 13:03:08 +01:00
dinputd.h
diskguid.h
dispex.idl
dlgs.h
dmemmgr.h
dmksctrl.h
docobj.idl [PSDK] Fix GCC8 complaining on duplicate and wrong declarations 2019-08-20 15:05:47 +02:00
docobjectservice.idl
downloadmgr.idl
dpfilter.h
dplay.h
dplobby.h
driverspecs.h
drmexternals.idl
dsgetdc.h
dsound.h
dsrole.h
dvdevcod.h
dvdmedia.h
dvp.h
dwmapi.h
dyngraph.idl
eaptypes.h
edevdefs.h
endpointvolume.idl
errorrep.h
evntprov.h
evntrace.h
exdisp.idl [SHELLFIND] Add search command events 2019-09-15 19:46:36 +03:00
exdispid.h [SHELLFIND] Add search command events 2019-09-15 19:46:36 +03:00
fci.h
fdi.h
fileapi.h
fltdefs.h [PSDK] Add fltdefs.h 2019-09-08 16:23:46 +02:00
fontsub.h
fusion.idl
gdiplus.h
gdiplusbase.h
gdiplusbrush.h
gdipluscolor.h
gdipluscolormatrix.h
gdipluseffects.h
gdiplusenums.h
gdiplusflat.h
gdiplusgpstubs.h
gdiplusgraphics.h
gdiplusheaders.h
gdiplusimageattributes.h
gdiplusimaging.h
gdiplusinit.h
gdipluslinecaps.h
gdiplusmatrix.h
gdiplusmem.h
gdiplusmetafile.h
gdiplusmetaheader.h
gdipluspath.h
gdipluspen.h
gdipluspixelformats.h
gdiplusstringformat.h
gdiplustypes.h
guiddef.h [PSDK] Add DECLSPEC_SELECTANY to GUIDs to make GCC 8 happy 2019-07-20 13:56:18 +02:00
hidpi.h
hidusage.h
hlguids.h
hlink.idl
htiface.idl
htiframe.idl
htmlhelp.h
http.h [PSDK] Update http.h. CORE-16441 2019-11-02 18:31:30 +01:00
httpext.h
httprequest.idl
httprequestid.h
i_cryptasn1tls.h
iads.idl
icftypes.idl
icm.h [PSDK] Update icm.h. CORE-16441 2019-11-09 21:58:15 +01:00
icmpapi.h
idispids.h
idndl.h
ieautomation.idl
ieverp.h
ifdef.h
ifmib.h
imagehlp.h [REACTOS] Fix 64 bit issues 2019-03-04 21:58:42 +01:00
imm.h
imnact.idl
imnxport.idl
in6addr.h
inaddr.h
indexsrv.idl
initguid.h
inputscope.idl
inseng.idl
intsafe.h
intshcut.h
ioevent.h
ipexport.h
iphlpapi.h
ipifcons.h
ipmib.h
iprtrmib.h
iptypes.h
isguids.h
knownfolders.h
ks.h [PSDK] ks.h : Fix some IOCTL values, caught by Ben Nottelling. 2019-07-29 00:20:07 +02:00
ksdebug.h
ksmedia.h
ksproxy.h
ksuuids.h
ktmtypes.h
l2cmn.h
largeint.h
libloaderapi.h
lm.h
lmaccess.h
lmalert.h
lmapibuf.h
lmat.h
lmaudit.h
lmbrowsr.h
lmchdev.h
lmconfig.h
lmcons.h
lmerr.h
lmerrlog.h
lmjoin.h
lmmsg.h
lmon.h
lmremutl.h
lmrepl.h [PSDK] Improve lmrepl.h 2019-04-26 10:30:01 +02:00
lmserver.h
lmshare.h
lmsname.h
lmstats.h
lmsvc.h
lmuse.h
lmuseflg.h
lmwksta.h
loadperf.h
lzexpand.h
mapi.h
mapicode.h
mapidefs.h
mapiform.h
mapiguid.h
mapitags.h
mapiutil.h
mapival.h
mapix.h
mciavi.h
mcx.h
mediaobj.idl
metahost.idl
mfidl.idl
mfobjects.idl
mftransform.idl
mgmtapi.h
midles.h
mimeinfo.idl
mimeole.idl
mlang.idl
mmddk.h
mmdeviceapi.idl
mmreg.h
mmsystem.h
mprapi.h
msacm.h
msacmdlg.h
mscat.h
mscoree.idl
msctf.idl [PSDK] Update msctf.idl. CORE-16441 2019-11-09 22:01:26 +01:00
msdadc.idl
mshtmcid.h
mshtmdid.h
mshtmhst.idl
mshtml.idl
msi.h
msidefs.h
msinkaut.idl
msiquery.h
mssip.h
mstask.idl
mstcpip.h
mswsock.h
mswsockdef.h [PSDK] Fix GCC8 complaining on duplicate and wrong declarations 2019-08-20 15:05:47 +02:00
msxml.idl
msxml2.idl [PSDK] Remove default value for BSTR parameter in msxml2.idl 2019-07-20 13:56:18 +02:00
msxml2did.h
msxml6.idl
msxml6did.h
msxmldid.h
multimon.h
natupnp.idl [PSDK][UUID] Import natupnp.idl from Wine Staging 4.18. CORE-16441 2019-10-20 20:01:58 +01:00
nb30.h
nddeapi.h
ndrtypes.h
netcfgn.h
netcfgx.h
netcon.h
netcon.idl
netevent.h
netfw.idl
netioapi.h
netiodef.h
nettypes.h
newdev.h
nldef.h
npapi.h
nserror.h
nspapi.h
ntdd1394.h
ntdd8042.h
ntddbeep.h
ntddcdrm.h
ntddcdvd.h
ntddchgr.h
ntdddisk.h [SDK] Properly define IsFTPartition so that it doesn't match Unix partition type 2019-11-11 21:18:13 +01:00
ntddft.h
ntddkbd.h
ntddmmc.h
ntddmou.h
ntddndis.h [DDK][PSDK] Add missing definitions for WPA/WPA2 authentication 2019-08-19 13:12:13 +02:00
ntddpar.h
ntddscsi.h
ntddser.h
ntddstor.h
ntddtape.h
ntddtdi.h
ntddvdeo.h [WIN32K][VIDEOPRT] Improve initialization and interfacing with INBV. 2019-12-02 02:33:20 +01:00
ntddvol.h
ntdll.h
ntdsapi.h
ntgdi.h
ntiologc.h
ntldap.h
ntlsa.h
ntquery.h
ntsecapi.h
ntsecpkg.h
ntstatus.h
ntverp.h
oaidl.idl
objbase.h
objectarray.idl
objerror.h
objfwd.h
objidl.idl
objsafe.idl
objsel.h
ocidl.idl
ocmm.idl
odbcinst.h
ole.h
ole2.h
ole2ver.h
oleacc.idl
oleauto.h [PSDK] Update oleauto.h. CORE-16441 2019-11-23 12:04:39 +01:00
olectl.h
olectlid.h
oledb.idl
oledlg.h
oleidl.idl
opnrst.idl
optary.idl
patchapi.h
pbt.h
pdh.h
pdhmsg.h
perhist.idl
polarity.h
poppack.h
powrprof.h
prntfont.h
propidl.idl
propkey.h
propkeydef.h
propsys.idl [PSDK] Update propsys.idl and propvarutil.h. CORE-16441 2019-11-23 12:09:13 +01:00
propvarutil.h [PSDK] Update propsys.idl and propvarutil.h. CORE-16441 2019-11-23 12:09:13 +01:00
provexce.h
provider.h
prsht.h
psapi.h
pshpack1.h
pshpack2.h
pshpack4.h
pshpack8.h
pshpck16.h
pstore.idl
qos.h
rapi.h
ras.h
rasdlg.h
raseapif.h
raserror.h
rassapi.h
rasshost.h
README.w32api
reason.h
regstr.h
richedit.h
richole.idl
row.idl
rowchg.idl
rpc.h
rpcasync.h
rpcdce.h
rpcdce2.h
rpcdcep.h
rpcndr.h [PSDK] Update rpcndr.h. CORE-16441 2019-11-23 12:12:08 +01:00
rpcnsi.h
rpcnsip.h
rpcnterr.h
rpcproxy.h
rstbas.idl
rstinf.idl
rstloc.idl
sal.h [SDK] Fix build with sal.h 2019-06-29 12:13:09 +02:00
sal_old.h
scarderr.h
schannel.h
schemadef.h
schnlsp.h
scrnsave.h
sddl.h
sdkddkver.h
secext.h
security.h
sensapi.h
sensevts.idl
servprov.idl
sesprp.idl
setupapi.h [SETUPAPI] Implement SetupDiRestartDevices() 2019-06-22 21:01:25 +02:00
sfc.h
shdeprecated.idl
shdispid.h
shellapi.h
shldisp.idl
shlguid.h
shlobj.h [PSDK] Add some missing defines to shlobj.h 2019-10-19 18:42:14 +02:00
shlwapi.h
shobjidl.idl [BOOT][SHELL32][INCLUDE] Support 'SuperHidden' files (#2102) 2019-11-29 15:14:18 +09:00
shtypes.idl
snmp.h
softpub.h
specstrings.h
sql.h
sqlext.h
sqltypes.h
sqlucode.h
srrestoreptapi.h
sspi.h [PSDK] Add SECPKG_FLAG_APPLY_LOOPBACK. CORE-16441 2019-11-30 14:48:23 +01:00
stdole2.idl
stdole32.idl
sti.h
stierr.h
stireg.h
stralign.h
strmif.idl
strsafe.h
structuredquerycondition.idl
subauth.h
suppress.h
svcguid.h
svrapi.h
t2embapi.h
tapi.h
taskschd.idl
tcpioctl.h
tcpmib.h
tdi.h
tdiinfo.h
textserv.h
textstor.idl
tlhelp32.h
tlogstg.idl
tmschema.h
tom.idl
traffic.h
transact.idl
tuner.idl
tvout.h
twain.h
txcoord.idl
txdtc.idl
udpmib.h
unknown.h
unknwn.idl
urlhist.idl
urlmon.idl
usb.h
usb100.h
usb200.h
usbcamdi.h
usbdi.h
usbioctl.h
usbiodef.h
usbrpmif.h
usbuser.h
userenv.h
usp10.h
uxtheme.h
verrsrc.h
vfw.h
vfwmsgs.h
vmr9.idl
vmrender.idl
vss.idl
vsstyle.h
vssym32.h
vswriter.h
w32api.h
warning.h
wbemcli.idl
wbemdisp.idl
wbemprov.idl
wdbgexts.h
werapi.h
wia.h
wia_lh.idl
wia_xp.idl
winable.h
winbase.h [PSDK] Add GetSystemFirmwareTable. CORE-16441 2019-12-01 19:44:36 +01:00
winber.h
wincodec.idl
wincodecsdk.idl
wincon.h
wincred.h
wincrypt.h
winddi.h
winddiui.h
windef.h [PSDK] Add some missing definitions. CORE-16441 2019-12-01 19:40:17 +01:00
windns.h [DNSAPI][PSDK] Implement GetCurrentTimeInSeconds() and fix DnsQuery_A/UTF8/W() 2019-11-02 23:59:06 +01:00
windot11.h
windows.h
windowsx.h [USER32_APITEST][INCLUDE] Add MessageStateAnalyzer testcase (#1732) 2019-07-25 01:45:55 +09:00
winefs.h
winerror.h
winfax.h
wingdi.h [PSDK] Add some missing definitions. CORE-16441 2019-12-01 19:40:17 +01:00
winhttp.h
wininet.h
winineti.h
winioctl.h
winldap.h
winnetwk.h
winnls.h
winnls32.h
winperf.h
winreg.h
winres.h
winresrc.h
winsafer.h
winscard.h
winsmcrd.h
winsnmp.h
winsock.h
winsock2.h
winsplp.h
winspool.h
winsvc.h
winsxs.idl
winternl.h
wintrust.h
winuser.h [PSDK] Add some missing definitions. CORE-16441 2019-12-01 19:40:17 +01:00
winver.h
winwlx.h
wlanapi.h
wlantypes.h
wmdrmsdk.idl
wmistr.h
wmiutils.idl
wmsbuffer.idl
wmsdk.h
wmsdkidl.idl
ws2atm.h
ws2bth.h
ws2def.h
ws2ipdef.h
ws2spi.h
ws2tcpip.h
wsahelp.h
wsipv6ok.h
wsipx.h
wsnetbs.h
wsnwlink.h
wspiapi.h
wtsapi32.h [WTSAPI32][PSDK] Addendum to 27ed609a: Some of the WTS_INFO_CLASS values are NT6-SP1+ 2019-03-23 16:31:15 +01:00
wtypes.idl
wuapi.idl
xcmc.h
xinput.h
xmldom.h
xmldom.idl
xmldomdid.h
xmldso.idl
xmldsodid.h
xmllite.idl
xprtdefs.h
zmouse.h

        Free headers and libraries for the Win32 API

        Originally written by Anders Norlander 
	Last known and not working email: <anorland@hem2.passagen.se>

	Now maintained by MinGW Developers
        Send bug reports and questions to MinGW-users@lists.sourceforge.net
	URL: http://www.mingw.org

* License 2.0

  You are free to use, modify and copy this package as long as this
  README.w32api file is included unmodified with any distribution, source or
  binary, of this package.  No restrictions are imposed on any package or 
  product using or incorporating this package.  You are free to license your 
  package as you see fit.
  
  You may not restrict others freedoms as set forth in the above paragraph.
  You may distribute this library as part of another package or as a
  modified package if and only if you do *not* restrict others freedoms as
  set forth in the above paragraph as it concerns this package.  You do have
  the right to restrict uses of any package using this package.

  This package is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

* What is it?

  This is a free set of headers and import libraries for the Win32
  API.  The library differs from the GNU Windows32 library in that I
  have tried to use a file structure that mirrors Microsoft's.  I
  don't like having *all* definitions in one single header as in the
  GNU Windows32 library, I want a clean separation between different
  parts of the API.

  Daniel Guerrero Miralles contributed the DirectX 6.1 import
  libraries and DirectX GUID definitions.

  See the files NOTES and TODO for what needs to be done.

* Size does matter

  Since the WIN32 API is severely bloated (as most MS products seem to
  be) the headers are designed to be as compact as possible, while
  still being readable, in order to minimize parsing time.

  The convention is to omit parameter names for function prototypes,
  no excessive white space. Struct/union members are indented with tab
  characters to make them readable. Comment only when necessary.

  If you are contributing a patch please follow the above mentioned
  convention. Make sure your editor does not convert tabs to spaces.

* What do I need to use it?

  The library is intended for use with egcs 1.1 or later but it is
  possible to use with some other tools as well (although it is not
  very useful). LCC-Win32, MSVC and Borland C++ 5.01 or higher may
  work as well. The import libraries are for GNU tools only.

  The library requires egcs 1.1 or later, since the `#pragma pack'
  feature is used. Mumit Khan provides egcs patches and binaries for
  win32 at `http://www.xraylith.wisc.edu/~khan/software/gnu-win32/'.

  If you are going to use C++ COM objects, you will need a version of
  egcs that recognizes the `comobject' attribute and then define
  HAVE_COMOBJECT when compiling your program. Antonio Mendes de
  Oliveira Neto has a prebuilt version at
  `http://li.facens.br/EGCS-WIN32/english/index.html'. Note that this
  is very experimental. If you want to use COM objects in C++ but with
  C interfaces you must define CINTERFACE.

  Objective-C programs cannot use COM functionality because of
  conflicts between the interface define and the Objective-C
  @interface directive.  There is also a conflict between the windows
  Obj-C BOOL types. To avoid this conflict you should use WINBOOL in
  all places where you would use BOOL in a C/C++ windows program. If
  you include any windows headers *after* `windows.h' you must use the
  method outlined below:

  /* non-windows includes */
  #include <objc/objc.h>
  ...
  /* windows specific headers */
  #include <windows.h>
  #define BOOL WINBOOL
  #include <commctrl.h>
  ...
  #undef BOOL
  ...
  /* include other headers */