83#define stricmp _stricmp
86# define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
89#define CONST_STRCPY(dst, src) \
90 do { if ((dst)) { memcpy(dst, src, sizeof(src)); } } while (0);
92#define RPN_OP_STACK_SIZE 256
93#define RPN_VALUE_STACK_SIZE 256
261 for (ul = 0; ul <
Stack->Sp; ul++)
437 LONG OperatorOffset = -1;
464 if (
p[0] ==
'\0' ||
p[0] ==
')' ||
p[0] ==
']')
471 OperatorOffset = CharacterOffset++;
474 HavePoppedOperator =
FALSE;
483 HavePoppedOperator =
TRUE;
511 else if (pend ==
p + 1)
516 *ErrOffset = CharacterOffset + 1;
521 goto end_of_expression;
529 *ErrOffset = OperatorOffset;
574 *ErrOffset = CharacterOffset;
580 CharacterOffset +=
i;
597 CharacterOffset +=
i;
609 CharacterOffset += pend -
p;
617 *ErrOffset = CharacterOffset;
636 if (
p[0] ==
'(' ||
p[0] ==
'[')
643 else if (pend ==
p + 1)
648 *ErrOffset = CharacterOffset + 1;
663 *ErrOffset = CharacterOffset + (pend -
p);
689 *ErrOffset = CharacterOffset + (pend -
p);
712 CharacterOffset += pend -
p;
715 else if (
First &&
p[0] ==
'-')
736 *ErrOffset = CharacterOffset;
756 IsComparativeOp =
FALSE;
782 IsComparativeOp =
TRUE;
788 IsComparativeOp =
TRUE;
793 IsComparativeOp =
TRUE;
803 IsComparativeOp =
TRUE;
830 ComparativeOpFilled =
TRUE;
843 if (HavePoppedOperator)
905 ULONG ValueStackPointer = 0;
914 ULONG ValueStackPointerMax = 0;
926 ValueStackPointerMax =
max(ValueStackPointerMax, ValueStackPointer);
972 ValueStack[ValueStackPointer++] = ull;
976 if (ValueStackPointer < 1)
1039 ValueStack[ValueStackPointer - 1] = ull;
1043 if (ValueStackPointer < 2)
1053 ValueStackPointer--;
1054 ull = ValueStack[ValueStackPointer];
1067 ValueStack[ValueStackPointer - 1] = ull;
1077 DPRINT1(
"Max value stack pointer: %d\n", ValueStackPointerMax);
1080 if (ValueStackPointer != 1)
1125 RpnpDumpStack(
Stack);
1163 RpnpDumpStack(
Stack);
1182 NewStack->
Size = NewStack->
Sp;
ACPI_SIZE strlen(const char *String)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
NTSTATUS KdbpSafeReadMemory(OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes)
VOID KdbPuts(_In_ PCSTR String)
VOID __cdecl KdbPrintf(_In_ PCSTR Format,...)
#define RTL_FIELD_SIZE(type, field)
static BOOLEAN RpnpParseExpression(IN PRPN_STACK Stack, IN PCHAR Expression, OUT PCHAR *End OPTIONAL, IN ULONG CharacterOffset, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Parses an expression.
static BOOLEAN RpnpPushStack(IN OUT PRPN_STACK Stack, IN PRPN_OP Op)
Pushes an RPN_OP onto the stack.
ULONGLONG RpnBinaryOperatorSub(ULONGLONG a, ULONGLONG b)
ULONGLONG RpnBinaryOperatorGreaterThanOrEquals(ULONGLONG a, ULONGLONG b)
ULONGLONG RpnBinaryOperatorDiv(ULONGLONG a, ULONGLONG b)
static const INT RegisterToTrapFrameCount
enum _RPN_OP_TYPE RPN_OP_TYPE
PVOID KdbpRpnParseExpression(IN PCHAR Expression, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Parses the given expression and returns a "handle" to it.
ULONGLONG RpnBinaryOperatorGreaterThan(ULONGLONG a, ULONGLONG b)
RPN_OP Ops[RPN_OP_STACK_SIZE]
BOOLEAN KdbpRpnEvaluateExpression(IN PCHAR Expression, IN PKDB_KTRAP_FRAME TrapFrame, OUT PULONGLONG Result, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Evaluates the given expression.
BOOLEAN KdbpRpnEvaluateParsedExpression(IN PVOID Expression, IN PKDB_KTRAP_FRAME TrapFrame, OUT PULONGLONG Result, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Evaluates the given expression and returns the result.
ULONGLONG RpnBinaryOperatorMod(ULONGLONG a, ULONGLONG b)
static struct @1821 RpnStack
static VOID RpnpClearStack(OUT PRPN_STACK Stack)
Clears the given RPN stack.
ULONGLONG RpnBinaryOperatorLessThanOrEquals(ULONGLONG a, ULONGLONG b)
static BOOLEAN RpnpPopStack(IN OUT PRPN_STACK Stack, OUT PRPN_OP Op OPTIONAL)
Pops the top op from the stack.
#define RPN_VALUE_STACK_SIZE
struct _RPN_STACK RPN_STACK
ULONGLONG RpnBinaryOperatorNotEquals(ULONGLONG a, ULONGLONG b)
struct _RPN_STACK * PRPN_STACK
static const struct @1822 RegisterToTrapFrame[]
ULONGLONG(* RPN_BINARY_OPERATOR)(ULONGLONG a, ULONGLONG b)
#define CONST_STRCPY(dst, src)
static BOOLEAN RpnpTopStack(IN PRPN_STACK Stack, OUT PRPN_OP Op)
Gets the top op from the stack (not popping it)
ULONGLONG RpnBinaryOperatorAdd(ULONGLONG a, ULONGLONG b)
ULONGLONG RpnBinaryOperatorMul(ULONGLONG a, ULONGLONG b)
static BOOLEAN RpnpEvaluateStack(IN PRPN_STACK Stack, IN PKDB_KTRAP_FRAME TrapFrame, OUT PULONGLONG Result, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Evaluates the RPN op stack and returns the result.
#define RPN_OP_STACK_SIZE
ULONGLONG RpnBinaryOperatorLessThan(ULONGLONG a, ULONGLONG b)
ULONGLONG RpnBinaryOperatorEquals(ULONGLONG a, ULONGLONG b)
#define memcpy(s1, s2, n)
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
static int ErrMsg(int Error)
PULONG MinorVersion OPTIONAL
RPN_BINARY_OPERATOR BinaryOperator
union _RPN_OP::@1823 Data
static CONST DWORD MemorySize[]
#define FIELD_OFFSET(t, f)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList