Partially implemented NtQueryFullAttributes.

Enough to get past the ShaderDump test most games seem to do.
This commit is contained in:
Ben Vanik
2013-10-16 21:32:53 -07:00
parent c53db98517
commit ab1ba9a508
3 changed files with 97 additions and 18 deletions

View File

@@ -107,11 +107,64 @@ typedef uint32_t X_STATUS;
#define X_LANGUAGE_JAPANESE 2
typedef struct {
class X_ANSI_STRING {
public:
uint16_t length;
uint16_t maximum_length;
char* buffer;
} X_ANSI_STRING;
X_ANSI_STRING() {
Zero();
}
X_ANSI_STRING(const uint8_t* base, uint32_t p) {
Read(base, p);
}
void Read(const uint8_t* base, uint32_t p) {
length = XEGETUINT16BE(base + p);
maximum_length = XEGETUINT16BE(base + p + 2);
if (maximum_length) {
buffer = (char*)(base + XEGETUINT32BE(base + p + 4));
} else {
buffer = 0;
}
}
void Zero() {
length = maximum_length = 0;
buffer = 0;
}
};
class X_OBJECT_ATTRIBUTES {
public:
uint32_t root_directory;
uint32_t object_name_ptr;
X_ANSI_STRING object_name;
uint32_t attributes;
X_OBJECT_ATTRIBUTES() {
Zero();
}
X_OBJECT_ATTRIBUTES(const uint8_t* base, uint32_t p) {
Read(base, p);
}
void Read(const uint8_t* base, uint32_t p) {
root_directory = XEGETUINT32BE(base + p);
object_name_ptr = XEGETUINT32BE(base + p + 4);
if (object_name_ptr) {
object_name.Read(base, object_name_ptr);
} else {
object_name.Zero();
}
attributes = XEGETUINT32BE(base + p + 8);
}
void Zero() {
root_directory = 0;
object_name_ptr = 0;
object_name.Zero();
attributes = 0;
}
};
} // namespace kernel