- Move all ASM internal intrinsics to intrin_i.h. Request for KJK::Hyperion/hackbunny to look at the GCC ones and optimize/fix them up.

- Add MSVC versions for some of them (not yet complete).
- Fix the fact that KeGetLocalDescriptorTable was setting the LDT instead of retrieving it.
- Fix bug in LIST_FOR_EACH and LIST_FOR_EACH_SAFE which was setting the flink to NULL instead of checking if the flink is NULL. One more reason these damned macros should've never been used.
- Use MSVC-intrinsics when applicable (_disable/_enable, etc).
- Fix JOB_SET_ARRAY problems.
- Fix buffer overflow in SystemProcessInformation QSI_DEF.
- Fix some broken compares/arithmetic to due to lack of parens.
- Add some ASSERTS to some unknown functions that make pointer assumptions.

svn path=/trunk/; revision=24650
This commit is contained in:
Alex Ionescu
2006-10-25 16:37:46 +00:00
parent 6f17cc84f7
commit b5e25167e2
30 changed files with 282 additions and 316 deletions
-8
View File
@@ -264,11 +264,9 @@ typedef struct _DESCRIPTOR
#include <poppack.h>
#ifndef NTOS_MODE_USER
//
// Macro to get current KPRCB
//
#ifndef __GNUC__ // fixme
FORCEINLINE
struct _KPRCB *
KeGetCurrentPrcb(VOID)
@@ -276,12 +274,6 @@ KeGetCurrentPrcb(VOID)
return (struct _KPRCB *)(ULONG_PTR)__readfsdword(FIELD_OFFSET(KPCR, Prcb));
}
//
// Macro to get current previous mode
//
#define KeGetPreviousMode ExGetPreviousMode
#endif
//
// FN/FX (FPU) Save Area Structures
//
+10
View File
@@ -914,6 +914,16 @@ typedef struct _THREAD_BASIC_INFORMATION
#ifndef NTOS_MODE_USER
//
// Job Set Array
//
typedef struct _JOB_SET_ARRAY
{
HANDLE JobHandle;
ULONG MemberLevel;
ULONG Flags;
} JOB_SET_ARRAY, *PJOB_SET_ARRAY;
//
// EPROCESS Quota Structures
//
+1 -1
View File
@@ -3384,7 +3384,6 @@ typedef enum _JOBOBJECTINFOCLASS {
JobObjectJobSetInformation,
MaxJobObjectInfoClass
} JOBOBJECTINFOCLASS;
#endif
typedef struct _JOB_SET_ARRAY
{
@@ -3392,6 +3391,7 @@ typedef struct _JOB_SET_ARRAY
DWORD MemberLevel;
DWORD Flags;
} JOB_SET_ARRAY, *PJOB_SET_ARRAY;
#endif
typedef struct _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
LARGE_INTEGER TotalUserTime;
+2 -2
View File
@@ -41,7 +41,7 @@
*/
#define LIST_FOR_EACH(elem, list, type, field) \
for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
&(elem)->field != (list) || (elem = NULL); \
&(elem)->field != (list) || (elem == NULL); \
(elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
/* iterate through the list using a list entry, with safety against removal
@@ -50,7 +50,7 @@
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \
for ((cursor) = CONTAINING_RECORD((list)->Flink, type, field), \
(cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field); \
&(cursor)->field != (list) || (cursor = NULL); \
&(cursor)->field != (list) || (cursor == NULL); \
(cursor) = (cursor2), \
(cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field))