//*****************************************************************************
//* FILE NAME:       w2k_wmi.h
//* FILE CONTAINS:
//* DESCRIPTION:     WMI support for Win 2000.
//*****************************************************************************
//*                   INTEL CORPORATION PROPRIETARY INFORMATION
//*     This software is supplied under the terms of a license agreement or
//*     nondisclosure agreement with Intel Corporation and may not be copied
//*     or disclosed except in accordance with the terms of that agreement.
//*           Copyright (c) 1995-2000 Intel Corporation.  All Rights Reserved.
//*****************************************************************************

#ifndef D_w2k_wmi_HeaderFile
#define D_w2k_wmi_HeaderFile

#include "CompDiag.h"

#ifdef D_CompilerDiagnostics
   #pragma D_CompDiagMsg("Include")
#endif

//*****************************************************************************
//* EXTERN VARIABLES
//*****************************************************************************

extern WMIGUIDREGINFO               gta_WMIGUIDREGINFO[];
extern struct S_QueryWMI_DataBlock  gsa_QueryWMI_DataBlock[];

//*****************************************************************************
//* STRUCTS
//*****************************************************************************

struct S_WMI_MethodArg
  {
   IN ULONG                ulMethodID;
   IN ULONG                ulInputBufferSize;
   IN ULONG                ulOutputBufferSize;
   IN OUT PUCHAR           ucpBuffer;
   struct S_Win2000_DevExt *stpFDO_DevExt;
   };

typedef NTSTATUS (*Tp_tWMI_Method)(struct S_WMI_MethodArg *asp_WMI_MethodArg);

struct S_WMI_Method
  {
   Tp_tWMI_Method tpMethod;
   ULONG          ulID;
   ULONG          ulReqOutputBufSize;
   };

struct S_QueryWMI_DataBlock
  {
   struct S_WMI_Method  *sp_WMI_Method;
   const unsigned       cuNumWMI_Methods;
   };

#define D_NumWMI_Methods(ArrayVariable) sizeof(ArrayVariable)/sizeof(struct S_WMI_Method)

//*****************************************************************************
//* EXTERN FUNCTIONS
//*****************************************************************************

extern BOOL gbRegisterWMI
  (
   IN PDEVICE_OBJECT atpFDO,
   IN WMIGUIDREGINFO asa_WMIGUIDREGINFO[],
   const unsigned    acuNumWMI_GUIDs
   );

extern BOOL gbDeregisterWMI(IN PDEVICE_OBJECT atpFDO);

extern NTSTATUS gtDecodeWMI_IRP
  (
   IN PDEVICE_OBJECT atpFDO,
   IN PIRP           atpIRP
   );

extern NTSTATUS gtFailWMI_Request
  (
   IN PDEVICE_OBJECT atpFDO,
   IN PIRP           atpIRP,
	IN ULONG          aulGUID_Index
   );

//=============================================================================
// EXTERN FUNCTIONS (extendable).
//=============================================================================

extern NTSTATUS gtSetWMI_DataItem
  (
   IN PDEVICE_OBJECT atpFDO,
   IN PIRP           atpIRP,
	IN ULONG          aulGUID_Index,
   IN ULONG          aulInstanceIndex,
	IN ULONG          aulDataItemID,
	IN ULONG          aulBufferSize,
   IN PUCHAR         aucpBuffer
   );

extern NTSTATUS gtSetWMI_DataBlock
  (
   IN PDEVICE_OBJECT atpFDO,
   IN PIRP           atpIRP,
   IN ULONG          aulGUID_Index,
   IN ULONG          aulInstanceIndex,
   IN ULONG          aulBufferSize,
   IN PUCHAR         aucpBuffer
   );

extern NTSTATUS gtQueryWMI_DataBlock
  (
   IN PDEVICE_OBJECT atpFDO,
   IN PIRP           atpIRP,
   IN ULONG          aulGUID_Index,
   IN ULONG          aulInstanceIndex,
   IN ULONG          aulInstanceCount,
   IN OUT PULONG     aulpInstanceLengthArray,
   IN ULONG          aulOutputBufferSize,
   IN PUCHAR         aucpBuffer
   );

extern NTSTATUS gtQueryWMI_RegInfo
  (
   IN PDEVICE_OBJECT    atpFDO,
   OUT PULONG           atpRegFlags,
   OUT PUNICODE_STRING  atpInstanceName,
   OUT PUNICODE_STRING *atppRegistryPath,
   OUT PUNICODE_STRING  atpMOF_ResourceName,
   OUT PDEVICE_OBJECT  *atppPDO
   );

extern NTSTATUS gtWMI_FunctionControl
  (
   IN PDEVICE_OBJECT          atpFDO,
   IN PIRP                    atpIRP,
   IN ULONG                   aulGUID_Index,
   IN WMIENABLEDISABLECONTROL tFunction,
   IN BOOLEAN                 bEnable
   );

extern NTSTATUS gtWMI_FireEvent
  (
   IN PDEVICE_OBJECT    atpFDO,
   wchar_t             *wcpMsg
   );

extern NTSTATUS gtExecuteWMI_Method
  (
   IN PDEVICE_OBJECT atpFDO,
   IN PIRP           atpIRP,
   IN ULONG          aulGUID_Index,
   IN ULONG          aulInstanceIndex,
   IN ULONG          aulMethodID,
   IN ULONG          aulInputBufferSize,
   IN ULONG          aulOutputBufferSize,
   IN OUT PUCHAR     aucpBuffer
   );

#endif