交代一些结构体:
typedef struct _GET_NAME_CONTROL {
PCHAR allocatedBuffer;
CHAR smallBuffer[256];
} GET_NAME_CONTROL, *PGET_NAME_CONTROL;
typedef struct _OBJECT_NAME_INFORMATION {
UNICODE_STRING Name;
} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
typedef struct _LSA_UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING;
PGET_NAME_CONTROL NameControl;
POBJECT_NAME_INFORMATION nameInfo = (POBJECT_NAME_INFORMATION)NameControl->smallBuffer;
这样就是用一个UNICODE_STRING的指针指向了一个CHAR数组,这样怎么可以的?
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!