Sync with trunk (r48123)

svn path=/branches/reactos-yarotows/; revision=48145
This commit is contained in:
Jérôme Gardou 2010-07-20 20:09:43 +00:00
commit eaa1cb5487
115 changed files with 7723 additions and 978 deletions

View file

@ -324,6 +324,7 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
PROPSHEETPAGE psp;
UINT nPages = 0;
UINT nLength;
DWORD attrs;
PCREATE_LINK_CONTEXT pContext = (PCREATE_LINK_CONTEXT) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CREATE_LINK_CONTEXT));
if (!pContext)
@ -337,10 +338,13 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
/* no directory given */
return FALSE;
}
///
/// FIXME
/// check if path is valid
///
attrs = GetFileAttributesW(szPath);
if (attrs == INVALID_FILE_ATTRIBUTES || (attrs & FILE_ATTRIBUTE_DIRECTORY))
{
/* invalid path */
return FALSE;
}
wcscpy(pContext->szLinkName, szPath);
if (pContext->szLinkName[nLength-1] != L'\\')
@ -389,7 +393,7 @@ NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
WCHAR szFile[MAX_PATH];
if (MultiByteToWideChar(CP_ACP, 0, (char*)lParam1, strlen((char*)lParam1)+1, szFile, MAX_PATH))
if (MultiByteToWideChar(CP_ACP, 0, (LPSTR) lParam1, -1, szFile, MAX_PATH))
{
return ShowCreateShortcutWizard(hwndCPl, szFile);
}
@ -401,7 +405,7 @@ LONG
CALLBACK
NewLinkHereW(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
return ShowCreateShortcutWizard(hwndCPl, (LPWSTR)lParam1);
return ShowCreateShortcutWizard(hwndCPl, (LPWSTR) lParam1);
}
LONG
@ -410,7 +414,7 @@ NewLinkHereA(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
WCHAR szFile[MAX_PATH];
if (MultiByteToWideChar(CP_ACP, 0, (char*)lParam1, strlen((char*)lParam1)+1, szFile, MAX_PATH))
if (MultiByteToWideChar(CP_ACP, 0, (LPSTR) lParam1, -1, szFile, MAX_PATH))
{
return ShowCreateShortcutWizard(hwndCPl, szFile);
}

View file

@ -618,7 +618,7 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFl
* Success: TRUE
* Failure: FALSE
*/
BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, ULONG_PTR dwFlags)
BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
{
PCRYPTPROV pProv = (PCRYPTPROV)hProv;
BOOL ret = TRUE;

View file

@ -0,0 +1,13 @@
Index: crypt.c
===================================================================
--- crypt.c (Revision 48087)
+++ crypt.c (Arbeitskopie)
@@ -618,7 +618,7 @@
* Success: TRUE
* Failure: FALSE
*/
-BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, ULONG_PTR dwFlags)
+BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
{
PCRYPTPROV pProv = (PCRYPTPROV)hProv;
BOOL ret = TRUE;

View file

@ -348,47 +348,47 @@ LsaFreeMemory(PVOID Buffer)
*/
NTSTATUS
WINAPI
LsaLookupNames(
LSA_HANDLE PolicyHandle,
ULONG Count,
PLSA_UNICODE_STRING Names,
PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
PLSA_TRANSLATED_SID *Sids)
LsaLookupNames(IN LSA_HANDLE PolicyHandle,
IN ULONG Count,
IN PLSA_UNICODE_STRING Names,
OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
OUT PLSA_TRANSLATED_SID *Sids)
{
PLSA_TRANSLATED_SID2 Sids2;
LSA_TRANSLATED_SID *TranslatedSids;
ULONG i;
LSAPR_TRANSLATED_SIDS TranslatedSids;
ULONG MappedCount = 0;
NTSTATUS Status;
TRACE("(%p,0x%08x,%p,%p,%p)\n", PolicyHandle, Count, Names,
ReferencedDomains, Sids);
/* Call LsaLookupNames2, which supersedes this function */
Status = LsaLookupNames2(PolicyHandle, Count, 0, Names, ReferencedDomains, &Sids2);
if (!NT_SUCCESS(Status))
return Status;
RpcTryExcept
{
*ReferencedDomains = NULL;
*Sids = NULL;
/* Translate the returned structure */
TranslatedSids = RtlAllocateHeap(RtlGetProcessHeap(), 0, Count * sizeof(LSA_TRANSLATED_SID));
if (!TranslatedSids)
{
LsaFreeMemory(Sids2);
return SCESTATUS_NOT_ENOUGH_RESOURCE;
TranslatedSids.Entries = Count;
TranslatedSids.Sids = *Sids;
Status = LsarLookupNames((LSAPR_HANDLE)PolicyHandle,
Count,
(PRPC_UNICODE_STRING)Names,
(PLSAPR_REFERENCED_DOMAIN_LIST *)ReferencedDomains,
&TranslatedSids,
LsapLookupWksta,
&MappedCount);
*Sids = (PLSA_TRANSLATED_SID)TranslatedSids.Sids;
}
RtlZeroMemory(Sids, Count * sizeof(PLSA_TRANSLATED_SID));
for (i = 0; i < Count; i++)
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
TranslatedSids[i].Use = Sids2[i].Use;
if (Sids2[i].Use != SidTypeInvalid && Sids2[i].Use != SidTypeUnknown)
if (TranslatedSids.Sids != NULL)
{
TranslatedSids[i].DomainIndex = Sids2[i].DomainIndex;
if (Sids2[i].Use != SidTypeDomain)
TranslatedSids[i].RelativeId = *GetSidSubAuthority(Sids2[i].Sid, 0);
MIDL_user_free(TranslatedSids.Sids);
}
}
LsaFreeMemory(Sids2);
*Sids = TranslatedSids;
Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return Status;
}
@ -487,12 +487,11 @@ LsaLookupPrivilegeValue(IN LSA_HANDLE PolicyHandle,
*/
NTSTATUS
WINAPI
LsaLookupSids(
LSA_HANDLE PolicyHandle,
ULONG Count,
PSID *Sids,
PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
PLSA_TRANSLATED_NAME *Names)
LsaLookupSids(IN LSA_HANDLE PolicyHandle,
IN ULONG Count,
IN PSID *Sids,
OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
OUT PLSA_TRANSLATED_NAME *Names)
{
LSAPR_SID_ENUM_BUFFER SidEnumBuffer;
LSAPR_TRANSLATED_NAMES TranslatedNames;

View file

@ -906,51 +906,49 @@ LookupAccountSidA(LPCSTR lpSystemName,
PSID_NAME_USE peUse)
{
UNICODE_STRING NameW, ReferencedDomainNameW, SystemNameW;
DWORD szName, szReferencedDomainName;
LPWSTR NameBuffer = NULL;
LPWSTR ReferencedDomainNameBuffer = NULL;
DWORD dwName, dwReferencedDomainName;
BOOL Ret;
/*
* save the buffer sizes the caller passed to us, as they may get modified and
* we require the original values when converting back to ansi
*/
szName = *cchName;
szReferencedDomainName = *cchReferencedDomainName;
dwName = *cchName;
dwReferencedDomainName = *cchReferencedDomainName;
/*
* allocate buffers for the unicode strings to receive
*/
if(szName > 0)
if(dwName > 0)
{
NameW.Length = 0;
NameW.MaximumLength = szName * sizeof(WCHAR);
NameW.Buffer = (PWSTR)LocalAlloc(LMEM_FIXED, NameW.MaximumLength);
if(NameW.Buffer == NULL)
NameBuffer = (PWSTR)LocalAlloc(LMEM_FIXED, dwName);
if(NameBuffer == NULL)
{
SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
}
else
NameW.Buffer = NULL;
NameBuffer = NULL;
if(szReferencedDomainName > 0)
if(dwReferencedDomainName > 0)
{
ReferencedDomainNameW.Length = 0;
ReferencedDomainNameW.MaximumLength = szReferencedDomainName * sizeof(WCHAR);
ReferencedDomainNameW.Buffer = (PWSTR)LocalAlloc(LMEM_FIXED, ReferencedDomainNameW.MaximumLength);
if(ReferencedDomainNameW.Buffer == NULL)
ReferencedDomainNameBuffer = (PWSTR)LocalAlloc(LMEM_FIXED, dwReferencedDomainName);
if(ReferencedDomainNameBuffer == NULL)
{
if(szName > 0)
if(dwName > 0)
{
LocalFree(NameW.Buffer);
LocalFree(NameBuffer);
}
SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
}
else
ReferencedDomainNameW.Buffer = NULL;
ReferencedDomainNameBuffer = NULL;
/*
* convert the system name to unicode - if present
@ -972,9 +970,9 @@ LookupAccountSidA(LPCSTR lpSystemName,
Ret = LookupAccountSidW(SystemNameW.Buffer,
lpSid,
NameW.Buffer,
NameBuffer,
cchName,
ReferencedDomainNameW.Buffer,
ReferencedDomainNameBuffer,
cchReferencedDomainName,
peUse);
if(Ret)
@ -989,9 +987,10 @@ LookupAccountSidA(LPCSTR lpSystemName,
ANSI_STRING NameA;
NameA.Length = 0;
NameA.MaximumLength = ((szName <= 0xFFFF) ? (USHORT)szName : 0xFFFF);
NameA.MaximumLength = ((dwName <= 0xFFFF) ? (USHORT)dwName : 0xFFFF);
NameA.Buffer = lpName;
RtlInitUnicodeString(&NameW, NameBuffer);
RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
NameA.Buffer[NameA.Length] = '\0';
}
@ -1001,10 +1000,11 @@ LookupAccountSidA(LPCSTR lpSystemName,
ANSI_STRING ReferencedDomainNameA;
ReferencedDomainNameA.Length = 0;
ReferencedDomainNameA.MaximumLength = ((szReferencedDomainName <= 0xFFFF) ?
(USHORT)szReferencedDomainName : 0xFFFF);
ReferencedDomainNameA.MaximumLength = ((dwReferencedDomainName <= 0xFFFF) ?
(USHORT)dwReferencedDomainName : 0xFFFF);
ReferencedDomainNameA.Buffer = lpReferencedDomainName;
RtlInitUnicodeString(&ReferencedDomainNameW, ReferencedDomainNameBuffer);
RtlUnicodeStringToAnsiString(&ReferencedDomainNameA, &ReferencedDomainNameW, FALSE);
ReferencedDomainNameA.Buffer[ReferencedDomainNameA.Length] = '\0';
}
@ -1018,13 +1018,13 @@ LookupAccountSidA(LPCSTR lpSystemName,
{
RtlFreeUnicodeString(&SystemNameW);
}
if(NameW.Buffer != NULL)
if(NameBuffer != NULL)
{
LocalFree(NameW.Buffer);
LocalFree(NameBuffer);
}
if(ReferencedDomainNameW.Buffer != NULL)
if(ReferencedDomainNameBuffer != NULL)
{
LocalFree(ReferencedDomainNameW.Buffer);
LocalFree(ReferencedDomainNameBuffer);
}
return Ret;
@ -1177,7 +1177,7 @@ LookupAccountNameA(LPCSTR SystemName,
/******************************************************************************
* LookupAccountNameW [ADVAPI32.@]
*
* @unimplemented
* @implemented
*/
BOOL
WINAPI
@ -1189,78 +1189,94 @@ LookupAccountNameW(LPCWSTR lpSystemName,
LPDWORD cchReferencedDomainName,
PSID_NAME_USE peUse)
{
/* Default implementation: Always return a default SID */
SID_IDENTIFIER_AUTHORITY identifierAuthority = {SECURITY_NT_AUTHORITY};
BOOL ret;
PSID pSid;
static const WCHAR dm[] = {'D','O','M','A','I','N',0};
unsigned int i;
OBJECT_ATTRIBUTES ObjectAttributes = {0};
UNICODE_STRING SystemName;
UNICODE_STRING AccountName;
LSA_HANDLE PolicyHandle = NULL;
PLSA_REFERENCED_DOMAIN_LIST ReferencedDomains = NULL;
PLSA_TRANSLATED_SID TranslatedSid = NULL;
PSID pDomainSid;
DWORD dwDomainNameLength;
DWORD dwSidLength;
UCHAR nSubAuthorities;
BOOL bResult;
NTSTATUS Status;
TRACE("%s %s %p %p %p %p %p - stub\n", lpSystemName, lpAccountName,
TRACE("%s %s %p %p %p %p %p\n", lpSystemName, lpAccountName,
Sid, cbSid, ReferencedDomainName, cchReferencedDomainName, peUse);
if (!ADVAPI_IsLocalComputer(lpSystemName))
RtlInitUnicodeString(&SystemName,
lpSystemName);
Status = LsaOpenPolicy(lpSystemName ? &SystemName : NULL,
&ObjectAttributes,
POLICY_LOOKUP_NAMES,
&PolicyHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RPC_S_SERVER_UNAVAILABLE);
SetLastError(LsaNtStatusToWinError(Status));
return FALSE;
}
for (i = 0; i < (sizeof(ACCOUNT_SIDS) / sizeof(ACCOUNT_SIDS[0])); i++)
RtlInitUnicodeString(&AccountName,
lpAccountName);
Status = LsaLookupNames(PolicyHandle,
1,
&AccountName,
&ReferencedDomains,
&TranslatedSid);
LsaClose(PolicyHandle);
if (!NT_SUCCESS(Status) || Status == STATUS_SOME_NOT_MAPPED)
{
if (!wcscmp(lpAccountName, ACCOUNT_SIDS[i].account))
{
if (*cchReferencedDomainName)
*ReferencedDomainName = '\0';
*cchReferencedDomainName = 0;
*peUse = SidTypeWellKnownGroup;
return CreateWellKnownSid(ACCOUNT_SIDS[i].type, NULL, Sid, cbSid);
}
}
ret = AllocateAndInitializeSid(&identifierAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&pSid);
if (!ret)
return FALSE;
if (!RtlValidSid(pSid))
{
FreeSid(pSid);
return FALSE;
}
if (Sid != NULL && (*cbSid >= GetLengthSid(pSid)))
CopySid(*cbSid, Sid, pSid);
if (*cbSid < GetLengthSid(pSid))
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
ret = FALSE;
}
*cbSid = GetLengthSid(pSid);
if (ReferencedDomainName != NULL && (*cchReferencedDomainName > wcslen(dm)))
wcscpy(ReferencedDomainName, dm);
if ((*cchReferencedDomainName <= wcslen(dm)) || (!ret))
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
ret = FALSE;
*cchReferencedDomainName = wcslen(dm) + 1;
SetLastError(LsaNtStatusToWinError(Status));
bResult = FALSE;
}
else
{
*cchReferencedDomainName = wcslen(dm);
pDomainSid = ReferencedDomains->Domains[TranslatedSid->DomainIndex].Sid;
nSubAuthorities = *GetSidSubAuthorityCount(pDomainSid);
dwSidLength = GetSidLengthRequired(nSubAuthorities + 1);
dwDomainNameLength = ReferencedDomains->Domains->Name.Length / sizeof(WCHAR);
if (*cbSid < dwSidLength ||
*cchReferencedDomainName < dwDomainNameLength + 1)
{
*cbSid = dwSidLength;
*cchReferencedDomainName = dwDomainNameLength + 1;
bResult = FALSE;
}
else
{
CopySid(*cbSid, Sid, pDomainSid);
*GetSidSubAuthorityCount(Sid) = nSubAuthorities + 1;
*GetSidSubAuthority(Sid, (DWORD)nSubAuthorities) = TranslatedSid->RelativeId;
RtlCopyMemory(ReferencedDomainName, ReferencedDomains->Domains->Name.Buffer, dwDomainNameLength * sizeof(WCHAR));
ReferencedDomainName[dwDomainNameLength] = L'\0';
*cchReferencedDomainName = dwDomainNameLength;
*peUse = TranslatedSid->Use;
bResult = TRUE;
}
if (bResult == FALSE)
SetLastError(ERROR_INSUFFICIENT_BUFFER);
}
FreeSid(pSid);
if (ReferencedDomains != NULL)
LsaFreeMemory(ReferencedDomains);
return ret;
if (TranslatedSid != NULL)
LsaFreeMemory(TranslatedSid);
return bResult;
}
@ -1499,11 +1515,11 @@ LookupPrivilegeNameW(LPCWSTR lpSystemName,
&PrivilegeName);
if (NT_SUCCESS(Status))
{
if (PrivilegeName->Length + sizeof(WCHAR) > (*cchName) * sizeof(WCHAR))
if (PrivilegeName->Length + sizeof(WCHAR) > *cchName * sizeof(WCHAR))
{
Status = STATUS_BUFFER_TOO_SMALL;
(*cchName) = (PrivilegeName->Length + sizeof(WCHAR)) / sizeof(WCHAR);
*cchName = (PrivilegeName->Length + sizeof(WCHAR)) / sizeof(WCHAR);
}
else
{
@ -1512,7 +1528,7 @@ LookupPrivilegeNameW(LPCWSTR lpSystemName,
PrivilegeName->Length);
lpName[PrivilegeName->Length / sizeof(WCHAR)] = 0;
(*cchName) = PrivilegeName->Length / sizeof(WCHAR);
*cchName = PrivilegeName->Length / sizeof(WCHAR);
}
LsaFreeMemory(PrivilegeName->Buffer);

View file

@ -232,11 +232,11 @@ ProcessIdToHandle(IN DWORD dwProcessId)
CLIENT_ID ClientId;
/* If we don't have a PID, look it up */
if (dwProcessId == MAXDWORD) dwProcessId = (DWORD)CsrGetProcessId();
if (dwProcessId == MAXDWORD) dwProcessId = (DWORD_PTR)CsrGetProcessId();
/* Open a handle to the process */
ClientId.UniqueThread = NULL;
ClientId.UniqueProcess = (HANDLE)dwProcessId;
ClientId.UniqueProcess = UlongToHandle(dwProcessId);
InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);
Status = NtOpenProcess(&Handle,
PROCESS_ALL_ACCESS,

View file

@ -124,10 +124,11 @@ _module_name_from_addr(const void* addr, void **module_start_addr,
return psz;
}
#ifdef _M_IX86
static VOID
_dump_context(PCONTEXT pc)
{
#ifdef _M_IX86
/*
* Print out the CPU registers
*/
@ -138,14 +139,19 @@ _dump_context(PCONTEXT pc)
DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x ESP: %.8x\n", pc->Edx,
pc->Ebp, pc->Esi, pc->Esp);
DbgPrint("EDI: %.8x EFLAGS: %.8x\n", pc->Edi, pc->EFlags);
}
#elif defined(_M_AMD64)
DbgPrint("CS:RIP %x:%I64x\n", pc->SegCs&0xffff, pc->Rip );
DbgPrint("DS %x ES %x FS %x GS %x\n", pc->SegDs&0xffff, pc->SegEs&0xffff,
pc->SegFs&0xffff, pc->SegGs&0xfff);
DbgPrint("RAX: %I64x RBX: %I64x RCX: %I64x RDI: %I64x\n", pc->Rax, pc->Rbx, pc->Rcx, pc->Rdi);
DbgPrint("RDX: %I64x RBP: %I64x RSI: %I64x RSP: %I64x\n", pc->Rdx, pc->Rbp, pc->Rsi, pc->Rsp);
DbgPrint("R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->R8, pc->R9, pc->R10, pc->R11);
DbgPrint("R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->R12, pc->R13, pc->R14, pc->R15);
DbgPrint("EFLAGS: %.8x\n", pc->EFlags);
#else
#warning Unknown architecture
static VOID
_dump_context(PCONTEXT pc)
{
}
#endif
}
static LONG
BasepCheckForReadOnlyResource(IN PVOID Ptr)
@ -275,7 +281,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
LONG RetValue;
HANDLE DebugPort = NULL;
NTSTATUS ErrCode;
ULONG ErrorParameters[4];
ULONG_PTR ErrorParameters[4];
ULONG ErrorResponse;
PEXCEPTION_RECORD ExceptionRecord = ExceptionInfo->ExceptionRecord;
@ -326,7 +332,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
/* Save exception code and address */
ErrorParameters[0] = (ULONG)ExceptionRecord->ExceptionCode;
ErrorParameters[1] = (ULONG)ExceptionRecord->ExceptionAddress;
ErrorParameters[1] = (ULONG_PTR)ExceptionRecord->ExceptionAddress;
if ((NTSTATUS)ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION)
{

View file

@ -31,7 +31,7 @@
#endif
#define IsConsoleHandle(h) \
(((((ULONG)h) & 0x10000003) == 0x3) ? TRUE : FALSE)
(((((ULONG_PTR)h) & 0x10000003) == 0x3) ? TRUE : FALSE)
#define HANDLE_DETACHED_PROCESS (HANDLE)-2
#define HANDLE_CREATE_NEW_CONSOLE (HANDLE)-3
@ -110,8 +110,8 @@ BasepConvertObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
NTSTATUS
WINAPI
BasepCreateStack(HANDLE hProcess,
ULONG StackReserve,
ULONG StackCommit,
SIZE_T StackReserve,
SIZE_T StackCommit,
PINITIAL_TEB InitialTeb);
VOID

File diff suppressed because it is too large Load diff

View file

@ -130,6 +130,12 @@
<file>thread.S</file>
</directory>
</if>
<if property="ARCH" value="amd64">
<directory name="amd64">
<file>fiber.S</file>
<file>thread.S</file>
</directory>
</if>
</directory>
<directory name="misc">
<file>icustubs.cpp</file>

View file

@ -23,8 +23,8 @@ NTAPI
ReadProcessMemory(IN HANDLE hProcess,
IN LPCVOID lpBaseAddress,
IN LPVOID lpBuffer,
IN DWORD nSize,
OUT LPDWORD lpNumberOfBytesRead)
IN SIZE_T nSize,
OUT SIZE_T* lpNumberOfBytesRead)
{
NTSTATUS Status;

View file

@ -432,6 +432,7 @@ InterlockedDecrement(IN OUT LONG volatile *lpAddend)
return _InterlockedDecrement(lpAddend);
}
#undef InterlockedExchange
LONG
WINAPI
InterlockedExchange(IN OUT LONG volatile *Target,

View file

@ -225,8 +225,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
HANDLE hSection;
PTH32SNAPSHOT Snapshot;
ULONG_PTR DataOffset;
ULONG ViewSize, i;
ULONG nProcesses = 0, nThreads = 0, nHeaps = 0, nModules = 0;
SIZE_T ViewSize;
ULONG i, nProcesses = 0, nThreads = 0, nHeaps = 0, nModules = 0;
ULONG RequiredSnapshotSize = sizeof(TH32SNAPSHOT);
PRTL_PROCESS_HEAPS hi = NULL;
PRTL_PROCESS_MODULES mi = NULL;
@ -670,7 +670,7 @@ Heap32ListFirst(HANDLE hSnapshot, LPHEAPLIST32 lphl)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lphl, sizeof(HEAPLIST32));
@ -724,7 +724,7 @@ Heap32ListNext(HANDLE hSnapshot, LPHEAPLIST32 lphl)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lphl, sizeof(HEAPLIST32));
@ -811,7 +811,7 @@ Module32FirstW(HANDLE hSnapshot, LPMODULEENTRY32W lpme)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lpme, sizeof(MODULEENTRY32W));
@ -898,7 +898,7 @@ Module32NextW(HANDLE hSnapshot, LPMODULEENTRY32W lpme)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lpme, sizeof(MODULEENTRY32W));
@ -985,7 +985,7 @@ Process32FirstW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lppe, sizeof(PROCESSENTRY32W));
@ -1074,7 +1074,7 @@ Process32NextW(HANDLE hSnapshot, LPPROCESSENTRY32W lppe)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lppe, sizeof(PROCESSENTRY32W));
@ -1128,7 +1128,7 @@ Thread32First(HANDLE hSnapshot, LPTHREADENTRY32 lpte)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lpte, sizeof(THREADENTRY32));
@ -1182,7 +1182,7 @@ Thread32Next(HANDLE hSnapshot, LPTHREADENTRY32 lpte)
{
PTH32SNAPSHOT Snapshot;
LARGE_INTEGER SOffset;
ULONG ViewSize;
SIZE_T ViewSize;
NTSTATUS Status;
CHECK_PARAM_SIZE(lpte, sizeof(THREADENTRY32));
@ -1233,7 +1233,7 @@ Thread32Next(HANDLE hSnapshot, LPTHREADENTRY32 lpte)
BOOL
WINAPI
Toolhelp32ReadProcessMemory(DWORD th32ProcessID, LPCVOID lpBaseAddress,
LPVOID lpBuffer, DWORD cbRead, LPDWORD lpNumberOfBytesRead)
LPVOID lpBuffer, SIZE_T cbRead, SIZE_T* lpNumberOfBytesRead)
{
HANDLE hProcess = OpenProcess(PROCESS_VM_READ, FALSE, th32ProcessID);
if(hProcess != NULL)

View file

@ -11,6 +11,8 @@
#include <k32.h>
#ifdef _M_IX86
#include "i386/ketypes.h"
#elif defined _M_AMD64
#include "amd64/ketypes.h"
#endif
#define NDEBUG
@ -189,8 +191,8 @@ BasepConvertObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
NTSTATUS
WINAPI
BasepCreateStack(HANDLE hProcess,
ULONG StackReserve,
ULONG StackCommit,
SIZE_T StackReserve,
SIZE_T StackCommit,
PINITIAL_TEB InitialTeb)
{
NTSTATUS Status;
@ -290,7 +292,7 @@ BasepCreateStack(HANDLE hProcess,
/* Create a guard page */
if (UseGuard)
{
ULONG GuardPageSize = SystemBasicInfo.PageSize;
SIZE_T GuardPageSize = SystemBasicInfo.PageSize;
ULONG Dummy;
/* Attempt maximum space possible */
@ -318,7 +320,7 @@ WINAPI
BasepFreeStack(HANDLE hProcess,
PINITIAL_TEB InitialTeb)
{
ULONG Dummy = 0;
SIZE_T Dummy = 0;
/* Free the Stack */
NtFreeVirtualMemory(hProcess,
@ -376,6 +378,44 @@ BasepInitializeContext(IN PCONTEXT Context,
/* Give it some room for the Parameter */
Context->Esp -= sizeof(PVOID);
#elif defined(_M_AMD64)
DPRINT("BasepInitializeContext: %p\n", Context);
/* Setup the Initial Win32 Thread Context */
Context->Rax = (ULONG_PTR)StartAddress;
Context->Rbx = (ULONG_PTR)Parameter;
Context->Rsp = (ULONG_PTR)StackAddress;
/* The other registers are undefined */
/* Setup the Segments */
Context->SegGs = KGDT64_R3_DATA | RPL_MASK;
Context->SegEs = KGDT64_R3_DATA | RPL_MASK;
Context->SegDs = KGDT64_R3_DATA | RPL_MASK;
Context->SegCs = KGDT64_R3_CODE | RPL_MASK;
Context->SegSs = KGDT64_R3_DATA | RPL_MASK;
Context->SegFs = KGDT64_R3_CMTEB | RPL_MASK;
/* Set the EFLAGS */
Context->EFlags = 0x3000; /* IOPL 3 */
if (ContextType == 1) /* For Threads */
{
Context->Rip = (ULONG_PTR)BaseThreadStartupThunk;
}
else if (ContextType == 2) /* For Fibers */
{
Context->Rip = (ULONG_PTR)BaseFiberStartup;
}
else /* For first thread in a Process */
{
Context->Rip = (ULONG_PTR)BaseProcessStartThunk;
}
/* Set the Context Flags */
Context->ContextFlags = CONTEXT_FULL;
/* Give it some room for the Parameter */
Context->Rsp -= sizeof(PVOID);
#else
#warning Unknown architecture
UNIMPLEMENTED;

View file

@ -36,8 +36,8 @@ RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle);
BOOL
WINAPI
GetProcessAffinityMask(HANDLE hProcess,
LPDWORD lpProcessAffinityMask,
LPDWORD lpSystemAffinityMask)
PDWORD_PTR lpProcessAffinityMask,
PDWORD_PTR lpSystemAffinityMask)
{
PROCESS_BASIC_INFORMATION ProcessInfo;
SYSTEM_BASIC_INFORMATION SystemInfo;
@ -77,7 +77,7 @@ GetProcessAffinityMask(HANDLE hProcess,
BOOL
WINAPI
SetProcessAffinityMask(HANDLE hProcess,
DWORD dwProcessAffinityMask)
DWORD_PTR dwProcessAffinityMask)
{
NTSTATUS Status;
@ -284,7 +284,7 @@ DWORD
WINAPI
GetCurrentProcessId(VOID)
{
return (DWORD)GetTeb()->ClientId.UniqueProcess;
return HandleToUlong(GetTeb()->ClientId.UniqueProcess);
}
@ -355,7 +355,7 @@ OpenProcess(DWORD dwDesiredAccess,
OBJECT_ATTRIBUTES ObjectAttributes;
CLIENT_ID ClientId;
ClientId.UniqueProcess = (HANDLE)dwProcessId;
ClientId.UniqueProcess = UlongToHandle(dwProcessId);
ClientId.UniqueThread = 0;
InitializeObjectAttributes(&ObjectAttributes,
@ -559,7 +559,7 @@ BOOL
WINAPI
FlushInstructionCache(HANDLE hProcess,
LPCVOID lpBaseAddress,
DWORD dwSize)
SIZE_T dwSize)
{
NTSTATUS Status;

View file

@ -325,7 +325,7 @@ BasepDuplicateAndWriteHandle(IN HANDLE ProcessHandle,
{
NTSTATUS Status;
HANDLE DuplicatedHandle;
ULONG Dummy;
SIZE_T Dummy;
DPRINT("BasepDuplicateAndWriteHandle. hProcess: %lx, Handle: %lx,"
"Address: %p\n", ProcessHandle, StandardHandle, Address);

View file

@ -73,7 +73,7 @@ ProcessIdToSessionId(IN DWORD dwProcessId,
return FALSE;
}
ClientId.UniqueProcess = (HANDLE)dwProcessId;
ClientId.UniqueProcess = UlongToHandle(dwProcessId);
ClientId.UniqueThread = 0;
InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);

View file

@ -0,0 +1,17 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/thread/i386/fiber.S
* PURPOSE: Fiber context switch code for the x86 architecture
* PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
* KJK::Hyperion <noog@libero.it>
*/
#include <ndk/asm.h>
.globl SwitchToFiber
.intel_syntax noprefix
SwitchToFiber:
/* FIXME: TODO */
ret 4

View file

@ -0,0 +1,32 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/thread/i386/thread.S
* PURPOSE: Thread Start Thunks
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
*/
.globl BaseThreadStartupThunk
.globl BaseProcessStartThunk
.intel_syntax noprefix
BaseThreadStartupThunk:
/* Start out fresh */
xor rbp, rbp
push rbx /* lpParameter */
push rax /* lpStartAddress */
push 0 /* Return RIP */
jmp BaseThreadStartup
BaseProcessStartThunk:
/* Start out fresh */
xor rbp, rbp
push rax /* lpStartAddress */
push 0 /* Return RIP */
jmp BaseProcessStartup
/* EOF */

View file

@ -258,6 +258,13 @@ BaseFiberStartup(VOID)
DPRINT("Starting Fiber\n");
BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax,
(LPVOID)Fiber->Context.Ebx);
#elif defined(_M_AMD64)
PFIBER Fiber = GetFiberData();
/* Call the Thread Startup Routine */
DPRINT1("Starting Fiber\n");
BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Rax,
(LPVOID)Fiber->Context.Rbx);
#else
#warning Unknown architecture
UNIMPLEMENTED;

View file

@ -232,7 +232,7 @@ CreateRemoteThread(HANDLE hProcess,
}
/* Success */
if(lpThreadId) *lpThreadId = (DWORD)ClientId.UniqueThread;
if(lpThreadId) *lpThreadId = HandleToUlong(ClientId.UniqueThread);
/* Resume it if asked */
if (!(dwCreationFlags & CREATE_SUSPENDED))
@ -344,7 +344,7 @@ DWORD
WINAPI
GetCurrentThreadId(VOID)
{
return (DWORD)(NtCurrentTeb()->ClientId).UniqueThread;
return HandleToUlong(NtCurrentTeb()->ClientId.UniqueThread);
}
/*
@ -684,6 +684,7 @@ GetThreadSelectorEntry(IN HANDLE hThread,
IN DWORD dwSelector,
OUT LPLDT_ENTRY lpSelectorEntry)
{
#ifdef _M_IX86
DESCRIPTOR_TABLE_ENTRY DescriptionTableEntry;
NTSTATUS Status;
@ -704,6 +705,10 @@ GetThreadSelectorEntry(IN HANDLE hThread,
/* Success, return the selector */
*lpSelectorEntry = DescriptionTableEntry.Descriptor;
return TRUE;
#else
DPRINT1("Calling GetThreadSelectorEntry!\n");
return FALSE;
#endif
}
/*
@ -749,7 +754,7 @@ GetProcessIdOfThread(HANDLE Thread)
return 0;
}
return (DWORD)ThreadBasic.ClientId.UniqueProcess;
return HandleToUlong(ThreadBasic.ClientId.UniqueProcess);
}
/*
@ -772,7 +777,7 @@ GetThreadId(HANDLE Thread)
return 0;
}
return (DWORD)ThreadBasic.ClientId.UniqueThread;
return HandleToUlong(ThreadBasic.ClientId.UniqueThread);
}
/*

View file

@ -333,8 +333,91 @@ NTSTATUS LsarLookupNames(
LSAP_LOOKUP_LEVEL LookupLevel,
DWORD *MappedCount)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
SID_IDENTIFIER_AUTHORITY IdentifierAuthority = {SECURITY_NT_AUTHORITY};
static const UNICODE_STRING DomainName = RTL_CONSTANT_STRING(L"DOMAIN");
PLSAPR_REFERENCED_DOMAIN_LIST OutputDomains = NULL;
PLSA_TRANSLATED_SID OutputSids = NULL;
ULONG OutputSidsLength;
ULONG i;
PSID Sid;
ULONG SidLength;
NTSTATUS Status;
TRACE("LsarLookupNames(%p, %lu, %p, %p, %p, %d, %p)\n",
PolicyHandle, Count, Names, ReferencedDomains, TranslatedSids,
LookupLevel, MappedCount);
TranslatedSids->Entries = Count;
TranslatedSids->Sids = NULL;
*ReferencedDomains = NULL;
OutputSidsLength = Count * sizeof(LSA_TRANSLATED_SID);
OutputSids = MIDL_user_allocate(OutputSidsLength);
if (OutputSids == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlZeroMemory(OutputSids, OutputSidsLength);
OutputDomains = MIDL_user_allocate(sizeof(LSAPR_REFERENCED_DOMAIN_LIST));
if (OutputDomains == NULL)
{
MIDL_user_free(OutputSids);
return STATUS_INSUFFICIENT_RESOURCES;
}
OutputDomains->Entries = Count;
OutputDomains->Domains = MIDL_user_allocate(Count * sizeof(LSA_TRUST_INFORMATION));
if (OutputDomains->Domains == NULL)
{
MIDL_user_free(OutputDomains);
MIDL_user_free(OutputSids);
return STATUS_INSUFFICIENT_RESOURCES;
}
Status = RtlAllocateAndInitializeSid(&IdentifierAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&Sid);
if (!NT_SUCCESS(Status))
{
MIDL_user_free(OutputDomains->Domains);
MIDL_user_free(OutputDomains);
MIDL_user_free(OutputSids);
return Status;
}
SidLength = RtlLengthSid(Sid);
for (i = 0; i < Count; i++)
{
OutputDomains->Domains[i].Sid = MIDL_user_allocate(SidLength);
RtlCopyMemory(OutputDomains->Domains[i].Sid, Sid, SidLength);
OutputDomains->Domains[i].Name.Buffer = MIDL_user_allocate(DomainName.MaximumLength);
OutputDomains->Domains[i].Name.Length = DomainName.Length;
OutputDomains->Domains[i].Name.MaximumLength = DomainName.MaximumLength;
RtlCopyMemory(OutputDomains->Domains[i].Name.Buffer, DomainName.Buffer, DomainName.MaximumLength);
}
for (i = 0; i < Count; i++)
{
OutputSids[i].Use = SidTypeWellKnownGroup;
OutputSids[i].RelativeId = DOMAIN_ALIAS_RID_ADMINS;
OutputSids[i].DomainIndex = i;
}
*ReferencedDomains = OutputDomains;
*MappedCount = Count;
TranslatedSids->Entries = Count;
TranslatedSids->Sids = OutputSids;
return STATUS_SUCCESS;
}
@ -347,10 +430,16 @@ NTSTATUS LsarLookupSids(
LSAP_LOOKUP_LEVEL LookupLevel,
DWORD *MappedCount)
{
SID_IDENTIFIER_AUTHORITY IdentifierAuthority = {SECURITY_NT_AUTHORITY};
static const UNICODE_STRING DomainName = RTL_CONSTANT_STRING(L"DOMAIN");
static const UNICODE_STRING UserName = RTL_CONSTANT_STRING(L"Administrator");
PLSAPR_REFERENCED_DOMAIN_LIST OutputDomains = NULL;
PLSAPR_TRANSLATED_NAME OutputNames = NULL;
ULONG OutputNamesLength;
ULONG i;
PSID Sid;
ULONG SidLength;
NTSTATUS Status;
TRACE("LsarLookupSids(%p, %p, %p, %p, %d, %p)\n",
PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames,
@ -369,19 +458,65 @@ NTSTATUS LsarLookupSids(
RtlZeroMemory(OutputNames, OutputNamesLength);
OutputDomains = MIDL_user_allocate(sizeof(LSAPR_REFERENCED_DOMAIN_LIST));
if (OutputDomains == NULL)
{
MIDL_user_free(OutputNames);
return STATUS_INSUFFICIENT_RESOURCES;
}
OutputDomains->Entries = SidEnumBuffer->Entries;
OutputDomains->Domains = MIDL_user_allocate(SidEnumBuffer->Entries * sizeof(LSA_TRUST_INFORMATION));
if (OutputDomains->Domains == NULL)
{
MIDL_user_free(OutputDomains);
MIDL_user_free(OutputNames);
return STATUS_INSUFFICIENT_RESOURCES;
}
Status = RtlAllocateAndInitializeSid(&IdentifierAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&Sid);
if (!NT_SUCCESS(Status))
{
MIDL_user_free(OutputDomains->Domains);
MIDL_user_free(OutputDomains);
MIDL_user_free(OutputNames);
return Status;
}
SidLength = RtlLengthSid(Sid);
for (i = 0; i < SidEnumBuffer->Entries; i++)
{
OutputDomains->Domains[i].Sid = MIDL_user_allocate(SidLength);
RtlCopyMemory(OutputDomains->Domains[i].Sid, Sid, SidLength);
OutputDomains->Domains[i].Name.Buffer = MIDL_user_allocate(DomainName.MaximumLength);
OutputDomains->Domains[i].Name.Length = DomainName.Length;
OutputDomains->Domains[i].Name.MaximumLength = DomainName.MaximumLength;
RtlCopyMemory(OutputDomains->Domains[i].Name.Buffer, DomainName.Buffer, DomainName.MaximumLength);
}
for (i = 0; i < SidEnumBuffer->Entries; i++)
{
OutputNames[i].Use = SidTypeWellKnownGroup;
OutputNames[i].DomainIndex = 0;
OutputNames[i].DomainIndex = i;
OutputNames[i].Name.Buffer = MIDL_user_allocate(UserName.MaximumLength);
OutputNames[i].Name.Length = UserName.Length;
OutputNames[i].Name.MaximumLength = UserName.MaximumLength;
RtlCopyMemory(OutputNames[i].Name.Buffer, UserName.Buffer, UserName.MaximumLength);
}
*ReferencedDomains = OutputDomains;
*MappedCount = SidEnumBuffer->Entries;
TranslatedNames->Entries = SidEnumBuffer->Entries;
TranslatedNames->Entries = SidEnumBuffer->Entries;
TranslatedNames->Names = OutputNames;
return STATUS_SUCCESS;

View file

@ -11,166 +11,91 @@
#include <wine/debug.h>
static const WCHAR SE_CREATE_TOKEN_NAME_W[] =
{ 'S','e','C','r','e','a','t','e','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_ASSIGNPRIMARYTOKEN_NAME_W[] =
{ 'S','e','A','s','s','i','g','n','P','r','i','m','a','r','y','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_LOCK_MEMORY_NAME_W[] =
{ 'S','e','L','o','c','k','M','e','m','o','r','y','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_INCREASE_QUOTA_NAME_W[] =
{ 'S','e','I','n','c','r','e','a','s','e','Q','u','o','t','a','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_MACHINE_ACCOUNT_NAME_W[] =
{ 'S','e','M','a','c','h','i','n','e','A','c','c','o','u','n','t','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_TCB_NAME_W[] =
{ 'S','e','T','c','b','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_SECURITY_NAME_W[] =
{ 'S','e','S','e','c','u','r','i','t','y','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_TAKE_OWNERSHIP_NAME_W[] =
{ 'S','e','T','a','k','e','O','w','n','e','r','s','h','i','p','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_LOAD_DRIVER_NAME_W[] =
{ 'S','e','L','o','a','d','D','r','i','v','e','r','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_SYSTEM_PROFILE_NAME_W[] =
{ 'S','e','S','y','s','t','e','m','P','r','o','f','i','l','e','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_SYSTEMTIME_NAME_W[] =
{ 'S','e','S','y','s','t','e','m','t','i','m','e','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_PROF_SINGLE_PROCESS_NAME_W[] =
{ 'S','e','P','r','o','f','i','l','e','S','i','n','g','l','e','P','r','o','c','e','s','s','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_INC_BASE_PRIORITY_NAME_W[] =
{ 'S','e','I','n','c','r','e','a','s','e','B','a','s','e','P','r','i','o','r','i','t','y','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_CREATE_PAGEFILE_NAME_W[] =
{ 'S','e','C','r','e','a','t','e','P','a','g','e','f','i','l','e','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_CREATE_PERMANENT_NAME_W[] =
{ 'S','e','C','r','e','a','t','e','P','e','r','m','a','n','e','n','t','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_BACKUP_NAME_W[] =
{ 'S','e','B','a','c','k','u','p','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_RESTORE_NAME_W[] =
{ 'S','e','R','e','s','t','o','r','e','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_SHUTDOWN_NAME_W[] =
{ 'S','e','S','h','u','t','d','o','w','n','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_DEBUG_NAME_W[] =
{ 'S','e','D','e','b','u','g','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_AUDIT_NAME_W[] =
{ 'S','e','A','u','d','i','t','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_SYSTEM_ENVIRONMENT_NAME_W[] =
{ 'S','e','S','y','s','t','e','m','E','n','v','i','r','o','n','m','e','n','t','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_CHANGE_NOTIFY_NAME_W[] =
{ 'S','e','C','h','a','n','g','e','N','o','t','i','f','y','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_REMOTE_SHUTDOWN_NAME_W[] =
{ 'S','e','R','e','m','o','t','e','S','h','u','t','d','o','w','n','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_UNDOCK_NAME_W[] =
{ 'S','e','U','n','d','o','c','k','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_SYNC_AGENT_NAME_W[] =
{ 'S','e','S','y','n','c','A','g','e','n','t','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_ENABLE_DELEGATION_NAME_W[] =
{ 'S','e','E','n','a','b','l','e','D','e','l','e','g','a','t','i','o','n','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_MANAGE_VOLUME_NAME_W[] =
{ 'S','e','M','a','n','a','g','e','V','o','l','u','m','e','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_IMPERSONATE_NAME_W[] =
{ 'S','e','I','m','p','e','r','s','o','n','a','t','e','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_CREATE_GLOBAL_NAME_W[] =
{ 'S','e','C','r','e','a','t','e','G','l','o','b','a','l','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1] =
typedef struct
{
NULL,
NULL,
SE_CREATE_TOKEN_NAME_W,
SE_ASSIGNPRIMARYTOKEN_NAME_W,
SE_LOCK_MEMORY_NAME_W,
SE_INCREASE_QUOTA_NAME_W,
SE_MACHINE_ACCOUNT_NAME_W,
SE_TCB_NAME_W,
SE_SECURITY_NAME_W,
SE_TAKE_OWNERSHIP_NAME_W,
SE_LOAD_DRIVER_NAME_W,
SE_SYSTEM_PROFILE_NAME_W,
SE_SYSTEMTIME_NAME_W,
SE_PROF_SINGLE_PROCESS_NAME_W,
SE_INC_BASE_PRIORITY_NAME_W,
SE_CREATE_PAGEFILE_NAME_W,
SE_CREATE_PERMANENT_NAME_W,
SE_BACKUP_NAME_W,
SE_RESTORE_NAME_W,
SE_SHUTDOWN_NAME_W,
SE_DEBUG_NAME_W,
SE_AUDIT_NAME_W,
SE_SYSTEM_ENVIRONMENT_NAME_W,
SE_CHANGE_NOTIFY_NAME_W,
SE_REMOTE_SHUTDOWN_NAME_W,
SE_UNDOCK_NAME_W,
SE_SYNC_AGENT_NAME_W,
SE_ENABLE_DELEGATION_NAME_W,
SE_MANAGE_VOLUME_NAME_W,
SE_IMPERSONATE_NAME_W,
SE_CREATE_GLOBAL_NAME_W,
LUID Luid;
LPCWSTR Name;
} PRIVILEGE_DATA;
static const PRIVILEGE_DATA WellKnownPrivileges[] =
{
{{SE_CREATE_TOKEN_PRIVILEGE, 0}, L"SeCreateTokenPrivilege"},
{{SE_ASSIGNPRIMARYTOKEN_PRIVILEGE, 0}, L"SeAssignPrimaryTokenPrivilege"},
{{SE_LOCK_MEMORY_PRIVILEGE, 0}, L"SeLockMemoryPrivilege"},
{{SE_INCREASE_QUOTA_PRIVILEGE, 0}, L"SeIncreaseQuotaPrivilege"},
{{SE_MACHINE_ACCOUNT_PRIVILEGE, 0}, L"SeMachineAccountPrivilege"},
{{SE_TCB_PRIVILEGE, 0}, L"SeTcbPrivilege"},
{{SE_SECURITY_PRIVILEGE, 0}, L"SeSecurityPrivilege"},
{{SE_TAKE_OWNERSHIP_PRIVILEGE, 0}, L"SeTakeOwnershipPrivilege"},
{{SE_LOAD_DRIVER_PRIVILEGE, 0}, L"SeLoadDriverPrivilege"},
{{SE_SYSTEM_PROFILE_PRIVILEGE, 0}, L"SeSystemProfilePrivilege"},
{{SE_SYSTEMTIME_PRIVILEGE, 0}, L"SeSystemtimePrivilege"},
{{SE_PROF_SINGLE_PROCESS_PRIVILEGE, 0}, L"SeProfileSingleProcessPrivilege"},
{{SE_INC_BASE_PRIORITY_PRIVILEGE, 0}, L"SeIncreaseBasePriorityPrivilege"},
{{SE_CREATE_PAGEFILE_PRIVILEGE, 0}, L"SeCreatePagefilePrivilege"},
{{SE_CREATE_PERMANENT_PRIVILEGE, 0}, L"SeCreatePermanentPrivilege"},
{{SE_BACKUP_PRIVILEGE, 0}, L"SeBackupPrivilege"},
{{SE_RESTORE_PRIVILEGE, 0}, L"SeRestorePrivilege"},
{{SE_SHUTDOWN_PRIVILEGE, 0}, L"SeShutdownPrivilege"},
{{SE_DEBUG_PRIVILEGE, 0}, L"SeDebugPrivilege"},
{{SE_AUDIT_PRIVILEGE, 0}, L"SeAuditPrivilege"},
{{SE_SYSTEM_ENVIRONMENT_PRIVILEGE, 0}, L"SeSystemEnvironmentPrivilege"},
{{SE_CHANGE_NOTIFY_PRIVILEGE, 0}, L"SeChangeNotifyPrivilege"},
{{SE_REMOTE_SHUTDOWN_PRIVILEGE, 0}, L"SeRemoteShutdownPrivilege"},
{{SE_UNDOCK_PRIVILEGE, 0}, L"SeUndockPrivilege"},
{{SE_SYNC_AGENT_PRIVILEGE, 0}, L"SeSyncAgentPrivilege"},
{{SE_ENABLE_DELEGATION_PRIVILEGE, 0}, L"SeEnableDelegationPrivilege"},
{{SE_MANAGE_VOLUME_PRIVILEGE, 0}, L"SeManageVolumePrivilege"},
{{SE_IMPERSONATE_PRIVILEGE, 0}, L"SeImpersonatePrivilege"},
{{SE_CREATE_GLOBAL_PRIVILEGE, 0}, L"SeCreateGlobalPrivilege"}
};
static const WCHAR * const DefaultPrivNames[] =
{
L"SeCreateTokenPrivilege",
L"SeAssignPrimaryTokenPrivilege",
L"SeLockMemoryPrivilege",
L"SeIncreaseQuotaPrivilege",
L"SeMachineAccountPrivilege",
L"SeTcbPrivilege",
L"SeSecurityPrivilege",
L"SeTakeOwnershipPrivilege",
L"SeLoadDriverPrivilege",
L"SeSystemProfilePrivilege",
L"SeSystemtimePrivilege",
L"SeProfileSingleProcessPrivilege",
L"SeIncreaseBasePriorityPrivilege",
L"SeCreatePagefilePrivilege",
L"SeCreatePermanentPrivilege",
L"SeBackupPrivilege",
L"SeRestorePrivilege",
L"SeShutdownPrivilege",
L"SeDebugPrivilege",
L"SeAuditPrivilege",
L"SeSystemEnvironmentPrivilege",
L"SeChangeNotifyPrivilege",
L"SeRemoteShutdownPrivilege",
L"SeUndockPrivilege",
L"SeSyncAgentPrivilege",
L"SeEnableDelegationPrivilege",
L"SeManageVolumePrivilege",
L"SeImpersonatePrivilege",
L"SeCreateGlobalPrivilege"
};
/* FUNCTIONS ***************************************************************/
NTSTATUS
LsarpLookupPrivilegeName(PLUID Value,
PUNICODE_STRING *Name)
{
PUNICODE_STRING NameBuffer;
ULONG Priv;
if (Value->HighPart ||
if (Value->HighPart != 0 ||
(Value->LowPart < SE_MIN_WELL_KNOWN_PRIVILEGE ||
Value->LowPart > SE_MAX_WELL_KNOWN_PRIVILEGE))
{
return STATUS_NO_SUCH_PRIVILEGE;
}
NameBuffer = MIDL_user_allocate(sizeof(UNICODE_STRING));
if (NameBuffer == NULL)
return STATUS_NO_MEMORY;
NameBuffer->Length = wcslen(WellKnownPrivNames[Value->LowPart]) * sizeof(WCHAR);
NameBuffer->MaximumLength = NameBuffer->Length + sizeof(WCHAR);
NameBuffer->Buffer = MIDL_user_allocate(NameBuffer->MaximumLength);
if (NameBuffer == NULL)
for (Priv = 0; Priv < sizeof(WellKnownPrivileges) / sizeof(WellKnownPrivileges[0]); Priv++)
{
MIDL_user_free(NameBuffer);
return STATUS_NO_MEMORY;
if (Value->LowPart == WellKnownPrivileges[Priv].Luid.LowPart &&
Value->HighPart == WellKnownPrivileges[Priv].Luid.HighPart)
{
NameBuffer = MIDL_user_allocate(sizeof(UNICODE_STRING));
if (NameBuffer == NULL)
return STATUS_NO_MEMORY;
NameBuffer->Length = wcslen(WellKnownPrivileges[Priv].Name) * sizeof(WCHAR);
NameBuffer->MaximumLength = NameBuffer->Length + sizeof(WCHAR);
NameBuffer->Buffer = MIDL_user_allocate(NameBuffer->MaximumLength);
if (NameBuffer == NULL)
{
MIDL_user_free(NameBuffer);
return STATUS_NO_MEMORY;
}
wcscpy(NameBuffer->Buffer, WellKnownPrivileges[Priv].Name);
*Name = NameBuffer;
return STATUS_SUCCESS;
}
}
wcscpy(NameBuffer->Buffer, WellKnownPrivNames[Value->LowPart]);
*Name = NameBuffer;
return STATUS_SUCCESS;
return STATUS_NO_SUCH_PRIVILEGE;
}
@ -183,12 +108,12 @@ LsarpLookupPrivilegeValue(PUNICODE_STRING Name,
if (Name->Length == 0 || Name->Buffer == NULL)
return STATUS_NO_SUCH_PRIVILEGE;
for (Priv = 0; Priv < sizeof(DefaultPrivNames) / sizeof(DefaultPrivNames[0]); Priv++)
for (Priv = 0; Priv < sizeof(WellKnownPrivileges) / sizeof(WellKnownPrivileges[0]); Priv++)
{
if (0 == _wcsicmp(Name->Buffer, DefaultPrivNames[Priv]))
if (_wcsicmp(Name->Buffer, WellKnownPrivileges[Priv].Name) == 0)
{
Value->LowPart = Priv + SE_MIN_WELL_KNOWN_PRIVILEGE;
Value->HighPart = 0;
Value->LowPart = WellKnownPrivileges[Priv].Luid.LowPart;
Value->HighPart = WellKnownPrivileges[Priv].Luid.HighPart;
return STATUS_SUCCESS;
}
}

View file

@ -495,6 +495,38 @@ static void TEXT_PathEllipsify (HDC hdc, WCHAR *str, unsigned int max_len,
}
}
/* Check the character is Chinese, Japanese, Korean and/or Thai */
inline BOOL IsCJKT(WCHAR wch)
{
if (0x0E00 <= wch && wch <= 0x0E7F)
return TRUE; /* Thai */
if (0x3000 <= wch && wch <= 0x9FFF)
return TRUE; /* CJK */
if (0xAC00 <= wch && wch <= 0xD7FF)
return TRUE; /* Korean */
if (0xFF00 <= wch && wch <= 0xFFEF)
return TRUE; /* CJK */
return FALSE;
}
/* See http://en.wikipedia.org/wiki/Kinsoku_shori */
static const WCHAR KinsokuClassA[] =
{
0x2010, 0x2013, 0x2019, 0x201D, 0x203C, 0x2047, 0x2048, 0x2049, 0x3001,
0x3002, 0x3005, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015, 0x3017,
0x3019, 0x301C, 0x301F, 0x303B, 0x3041, 0x3043, 0x3045, 0x3047, 0x3049,
0x3063, 0x3083, 0x3085, 0x3087, 0x308E, 0x3095, 0x3096, 0x30A0, 0x30A1,
0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30C3, 0x30E3, 0x30E5, 0x30E7, 0x30EE,
0x30F5, 0x30F6, 0x30FB, 0x30FC, 0x30FD, 0x30FE, 0x31F0, 0x31F1, 0x31F2,
0x31F3, 0x31F4, 0x31F5, 0x31F6, 0x31F7, 0x31F8, 0x31F9, 0x31FA, 0x31FB,
0x31FC, 0x31FD, 0x31FE, 0x31FF, 0xFF01, 0xFF09, 0xFF0C, 0xFF0E, 0xFF1A,
0xFF1B, 0xFF1F, 0xFF3D, 0xFF5D, 0xFF60, 0
};
/*********************************************************************
* TEXT_WordBreak (static)
*
@ -576,9 +608,10 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
p--; /* the word just fitted */
else
{
while (p > str && *(--p) != SPACE)
while (p > str && *(--p) != SPACE && (!IsCJKT(p[1]) ||
p[1] == L'\0' || wcschr(KinsokuClassA, p[1]) != NULL))
;
word_fits = (p != str || *p == SPACE);
word_fits = (p != str || *p == SPACE || IsCJKT(p[1]));
}
/* If there was one or the first character didn't fit then */
if (word_fits)

View file

@ -607,7 +607,7 @@ WSAAccept(IN SOCKET s,
OUT LPSOCKADDR addr,
IN OUT LPINT addrlen,
IN LPCONDITIONPROC lpfnCondition,
IN DWORD dwCallbackData)
IN DWORD_PTR dwCallbackData)
{
PCATALOG_ENTRY Provider;
SOCKET Socket;

View file

@ -14,6 +14,68 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE ArbiterInterfaceBusNumber =
{
&GUID_ARBITER_INTERFACE_STANDARD,
sizeof(ARBITER_INTERFACE),
0,
0,
PCI_INTERFACE_FDO,
0,
PciArb_BusNumber,
arbusno_Constructor,
arbusno_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
arbusno_Initializer(IN PVOID Instance)
{
/* Not yet implemented */
UNIMPLEMENTED;
//while (TRUE);
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
arbusno_Constructor(IN PVOID DeviceExtension,
IN PVOID PciInterface,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
NTSTATUS Status;
PAGED_CODE();
/* Make sure it's the expected interface */
if ((ULONG)InterfaceData != CmResourceTypeBusNumber)
{
/* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
else
{
/* No arbiters for this FDO */
Status = STATUS_NOT_SUPPORTED;
}
}
else
{
/* Not the right interface */
Status = STATUS_INVALID_PARAMETER_5;
}
/* Return the status */
return Status;
}
/* EOF */

View file

@ -14,6 +14,170 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE ArbiterInterfaceMemory =
{
&GUID_ARBITER_INTERFACE_STANDARD,
sizeof(ARBITER_INTERFACE),
0,
0,
PCI_INTERFACE_FDO,
0,
PciArb_Memory,
armem_Constructor,
armem_Initializer
};
PCI_INTERFACE ArbiterInterfaceIo =
{
&GUID_ARBITER_INTERFACE_STANDARD,
sizeof(ARBITER_INTERFACE),
0,
0,
PCI_INTERFACE_FDO,
0,
PciArb_Io,
ario_Constructor,
ario_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
ario_Initializer(IN PVOID Instance)
{
/* Not yet implemented */
UNIMPLEMENTED;
//while (TRUE);
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
ario_Constructor(IN PVOID DeviceExtension,
IN PVOID PciInterface,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
NTSTATUS Status;
PAGED_CODE();
/* Make sure it's the expected interface */
if ((ULONG)InterfaceData != CmResourceTypePort)
{
/* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
else
{
/* No arbiters for this FDO */
Status = STATUS_NOT_SUPPORTED;
}
}
else
{
/* Not the right interface */
Status = STATUS_INVALID_PARAMETER_5;
}
/* Return the status */
return Status;
}
VOID
NTAPI
ario_ApplyBrokenVideoHack(IN PPCI_FDO_EXTENSION FdoExtension)
{
PPCI_ARBITER_INSTANCE PciArbiter;
//PARBITER_INSTANCE CommonInstance;
NTSTATUS Status;
/* Only valid for root FDOs who are being applied the hack for the first time */
ASSERT(!FdoExtension->BrokenVideoHackApplied);
ASSERT(PCI_IS_ROOT_FDO(FdoExtension));
/* Find the I/O arbiter */
PciArbiter = (PVOID)PciFindNextSecondaryExtension(FdoExtension->
SecondaryExtension.Next,
PciArb_Io);
ASSERT(PciArbiter);
#if 0 // when arb exist
/* Get the Arb instance */
CommonInstance = &PciArbiter->CommonInstance;
/* Free the two lists, enabling full VGA access */
ArbFreeOrderingList(&CommonInstance->OrderingList);
ArbFreeOrderingList(&CommonInstance->ReservedList);
/* Build the ordering for broken video PCI access */
Status = ArbBuildAssignmentOrdering(CommonInstance,
L"Pci",
L"BrokenVideo",
NULL);
ASSERT(NT_SUCCESS(Status));
#else
Status = STATUS_SUCCESS;
UNIMPLEMENTED;
while (TRUE);
#endif
/* Now the hack has been applied */
FdoExtension->BrokenVideoHackApplied = TRUE;
}
NTSTATUS
NTAPI
armem_Initializer(IN PVOID Instance)
{
/* Not yet implemented */
UNIMPLEMENTED;
//while (TRUE);
return STATUS_SUCCESS;
}
NTSTATUS
NTAPI
armem_Constructor(IN PVOID DeviceExtension,
IN PVOID PciInterface,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
NTSTATUS Status;
PAGED_CODE();
/* Make sure it's the expected interface */
if ((ULONG)InterfaceData != CmResourceTypeMemory)
{
/* Arbiter support must have been initialized first */
if (FdoExtension->ArbitersInitialized)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
else
{
/* No arbiters for this FDO */
Status = STATUS_NOT_SUPPORTED;
}
}
else
{
/* Not the right interface */
Status = STATUS_INVALID_PARAMETER_5;
}
/* Return the status */
return Status;
}
/* EOF */

View file

@ -38,30 +38,29 @@ NTAPI
PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension)
{
PPCI_INTERFACE CurrentInterface, *Interfaces;
PPCI_PDO_EXTENSION PdoExtension;
PPCI_ARBITER_INSTANCE ArbiterInterface;
NTSTATUS Status;
PCI_SIGNATURE ArbiterType;
ASSERT_FDO(FdoExtension);
/* Loop all the arbiters */
for (ArbiterType = PciArb_Io; ArbiterType <= PciArb_Memory; ArbiterType++)
for (ArbiterType = PciArb_Io; ArbiterType <= PciArb_BusNumber; ArbiterType++)
{
/* Check if this is the extension for the Root PCI Bus */
if (!PCI_IS_ROOT_FDO(FdoExtension))
{
#if 0 // at next sync when PDO add
/* Get the PDO extension */
PdoExtension = FdoExtension->PhysicalDeviceObject->DeviceExtension;
ASSERT_PDO(PdoExtension);
/* Skip this bus if it does subtractive decode */
if (PdoExtension->Substractive)
if (PdoExtension->Dependent.type1.SubtractiveDecode)
{
DPRINT1("PCI Not creating arbiters for subtractive bus %d\n",
PdoExtension->Substractive);
PdoExtension->Dependent.type1.SubtractiveDecode);
continue;
}
#endif
}
/* Query all the registered arbiter interfaces */
@ -113,7 +112,7 @@ PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension)
/* This arbiter is now initialized, move to the next one */
DPRINT1("PCI - FDO ext 0x%08x %S arbiter initialized (context 0x%08x).\n",
FdoExtension,
"ARBITER HEADER MISSING", //ArbiterInterface->CommonInstance.Name,
L"ARBITER HEADER MISSING", //ArbiterInterface->CommonInstance.Name,
ArbiterInterface);
Status = STATUS_SUCCESS;
}
@ -121,4 +120,82 @@ PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension)
/* Return to caller */
return Status;
}
NTSTATUS
NTAPI
PciInitializeArbiterRanges(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCM_RESOURCE_LIST Resources)
{
PPCI_PDO_EXTENSION PdoExtension;
CM_RESOURCE_TYPE DesiredType;
PVOID Instance;
PCI_SIGNATURE ArbiterType;
/* Arbiters should not already be initialized */
if (DeviceExtension->ArbitersInitialized)
{
/* Duplicated start request, fail initialization */
DPRINT1("PCI Warning hot start FDOx %08x, resource ranges not checked.\n", DeviceExtension);
return STATUS_INVALID_DEVICE_REQUEST;
}
/* Check for non-root FDO */
if (!PCI_IS_ROOT_FDO(DeviceExtension))
{
/* Grab the PDO */
PdoExtension = (PPCI_PDO_EXTENSION)DeviceExtension->PhysicalDeviceObject->DeviceExtension;
ASSERT(PdoExtension->ExtensionType == PciPdoExtensionType);
/* Multiple FDOs are not yet supported */
UNIMPLEMENTED;
while (TRUE);
return STATUS_SUCCESS;
}
/* Loop all arbiters */
for (ArbiterType = PciArb_Io; ArbiterType <= PciArb_Memory; ArbiterType++)
{
/* Pick correct resource type for each arbiter */
if (ArbiterType == PciArb_Io)
{
/* I/O Port */
DesiredType = CmResourceTypePort;
}
else if (ArbiterType == PciArb_Memory)
{
/* Device RAM */
DesiredType = CmResourceTypeMemory;
}
else
{
/* Ignore anything else */
continue;
}
/* Find an arbiter of this type */
Instance = PciFindNextSecondaryExtension(&DeviceExtension->SecondaryExtension,
ArbiterType);
if (Instance)
{
/*
* Now we should initialize it, not yet implemented because Arb
* library isn't yet implemented, not even the headers.
*/
UNIMPLEMENTED;
//while (TRUE);
}
else
{
/* The arbiter was not found, this is an error! */
DPRINT1("PCI - FDO ext 0x%08x %s arbiter (REQUIRED) is missing.\n",
DeviceExtension,
PciArbiterNames[ArbiterType - PciArb_Io]);
}
}
/* Arbiters are now initialized */
DeviceExtension->ArbitersInitialized = TRUE;
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -1,8 +1,8 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/arb/tr_irq.c
* PURPOSE: IRQ Resource Translation
* FILE: drivers/bus/pci/intrface/tr_irq.c
* PURPOSE: IRQ Translator Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
@ -14,6 +14,84 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE TranslatorInterfaceInterrupt =
{
&GUID_TRANSLATOR_INTERFACE_STANDARD,
sizeof(TRANSLATOR_INTERFACE),
0,
0,
PCI_INTERFACE_FDO,
0,
PciTrans_Interrupt,
tranirq_Constructor,
tranirq_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
tranirq_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI tranirq_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
tranirq_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
ULONG BaseBus, ParentBus;
INTERFACE_TYPE ParentInterface;
ASSERT_FDO(FdoExtension);
/* Make sure it's the right resource type */
if ((ULONG)InterfaceData != CmResourceTypeInterrupt)
{
/* Fail this invalid request */
DPRINT1("PCI - IRQ trans constructor doesn't like %x in InterfaceSpecificData\n",
InterfaceData);
return STATUS_INVALID_PARAMETER_3;
}
/* Get the bus, and use this as the interface-specific data */
BaseBus = FdoExtension->BaseBus;
InterfaceData = (PVOID)BaseBus;
/* Check if this is the root bus */
if (PCI_IS_ROOT_FDO(FdoExtension))
{
/* It is, so there is no parent, and it's connected on the system bus */
ParentBus = 0;
ParentInterface = Internal;
DPRINT1(" Is root FDO\n");
}
else
{
/* It's not, so we have to get the root bus' bus number instead */
#if 0 // when have PDO commit
ParentBus = FdoExtension->PhysicalDeviceObject->DeviceExtension->ParentFdoExtension->BaseBus;
ParentInterface = PCIBus;
DPRINT1(" Is bridge FDO, parent bus %x, secondary bus %x\n",
ParentBus, BaseBus);
#endif
}
/* Now call the legacy HAL interface to get the correct translator */
return HalGetInterruptTranslator(ParentInterface,
ParentBus,
PCIBus,
sizeof(TRANSLATOR_INTERFACE),
0,
(PTRANSLATOR_INTERFACE)Interface,
(PULONG)&InterfaceData);
}
/* EOF */

View file

@ -104,7 +104,7 @@ PciDebugIrpDispatchDisplay(IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_FDO_EXTENSION DeviceExtension,
IN USHORT MaxMinor)
{
//PPCI_PDO_EXTENSION PdoDeviceExtension;
PPCI_PDO_EXTENSION PdoDeviceExtension;
ULONG BreakMask, DebugLevel = 0;
PCHAR IrpString;
@ -147,7 +147,7 @@ PciDebugIrpDispatchDisplay(IN PIO_STACK_LOCATION IoStackLocation,
{
DebugLevel = 0x200;
}
#if 0 // after commit PDO support
/* For a PDO, print out the bus, device, and function number */
PdoDeviceExtension = (PVOID)DeviceExtension;
DPRINT1("PDO(b=0x%x, d=0x%x, f=0x%x)<-%s\n",
@ -155,7 +155,6 @@ PciDebugIrpDispatchDisplay(IN PIO_STACK_LOCATION IoStackLocation,
PdoDeviceExtension->Slot.u.bits.DeviceNumber,
PdoDeviceExtension->Slot.u.bits.FunctionNumber,
IrpString);
#endif
}
else if (DeviceExtension->ExtensionType == PciFdoExtensionType)
{
@ -181,4 +180,18 @@ PciDebugIrpDispatchDisplay(IN PIO_STACK_LOCATION IoStackLocation,
return ((1 << IoStackLocation->MinorFunction) & BreakMask);
}
VOID
NTAPI
PciDebugDumpCommonConfig(IN PPCI_COMMON_HEADER PciData)
{
USHORT i;
/* Loop the PCI header */
for (i = 0; i < PCI_COMMON_HDR_LENGTH; i += 4)
{
/* Dump each DWORD and its offset */
DPRINT1(" %02x - %08x\n", i, *(PULONG)((ULONG_PTR)PciData + i));
}
}
/* EOF */

View file

@ -16,4 +16,62 @@
/* FUNCTIONS ******************************************************************/
VOID
NTAPI
Device_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Device_SaveLimits(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Device_MassageHeaderForLimitsDetermination(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Device_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Device_GetAdditionalResourceDescriptors(IN PPCI_CONFIGURATOR_CONTEXT Context,
IN PPCI_COMMON_HEADER PciData,
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Device_ResetDevice(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Device_ChangeResourceSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -102,8 +102,8 @@ PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS Status;
PPCI_MN_DISPATCH_TABLE TableArray = NULL, Table;
USHORT MaxMinor;
PCI_DISPATCH_STYLE DispatchStyle;
PCI_DISPATCH_FUNCTION DispatchFunction;
PCI_DISPATCH_STYLE DispatchStyle = 0;
PCI_DISPATCH_FUNCTION DispatchFunction = NULL;
DPRINT1("PCI: Dispatch IRP\n");
/* Get the extension and I/O stack location for this IRP */
@ -146,7 +146,7 @@ PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject,
/* WMI IRPs */
DispatchFunction = IrpDispatchTable->SystemControlIrpDispatchFunction;
DispatchStyle = IrpDispatchTable->SystemControlIrpDispatchStyle;
MaxMinor = -1;
MaxMinor = 0xFFFF;
break;
default:
@ -154,12 +154,12 @@ PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject,
/* Unrecognized IRPs */
DispatchFunction = IrpDispatchTable->OtherIrpDispatchFunction;
DispatchStyle = IrpDispatchTable->OtherIrpDispatchStyle;
MaxMinor = -1;
MaxMinor = 0xFFFF;
break;
}
/* Only deal with recognized IRPs */
if (MaxMinor != -1)
if (MaxMinor != 0xFFFF)
{
/* Make sure the function is recognized */
if (IoStackLocation->MinorFunction > MaxMinor)
@ -260,8 +260,18 @@ PciIrpNotSupported(IN PIRP Irp,
{
/* Not supported */
DPRINT1("WARNING: PCI received unsupported IRP!\n");
DbgBreakPoint();
//DbgBreakPoint();
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciIrpInvalidDeviceRequest(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_FDO_EXTENSION DeviceExtension)
{
/* Not supported */
return STATUS_INVALID_DEVICE_REQUEST;
}
/* EOF */

File diff suppressed because it is too large Load diff

View file

@ -19,41 +19,41 @@ BOOLEAN PciBreakOnDefault;
PCI_MN_DISPATCH_TABLE PciFdoDispatchPowerTable[] =
{
{IRP_DISPATCH, PciFdoWaitWake},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciFdoSetPowerState},
{IRP_DOWNWARD, PciFdoIrpQueryPower},
{IRP_DOWNWARD, PciIrpNotSupported}
{IRP_DISPATCH, (PCI_DISPATCH_FUNCTION)PciFdoWaitWake},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoSetPowerState},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryPower},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported}
};
PCI_MN_DISPATCH_TABLE PciFdoDispatchPnpTable[] =
{
{IRP_UPWARD, PciFdoIrpStartDevice},
{IRP_DOWNWARD, PciFdoIrpQueryRemoveDevice},
{IRP_DISPATCH, PciFdoIrpRemoveDevice},
{IRP_DOWNWARD, PciFdoIrpCancelRemoveDevice},
{IRP_DOWNWARD, PciFdoIrpStopDevice},
{IRP_DOWNWARD, PciFdoIrpQueryStopDevice},
{IRP_DOWNWARD, PciFdoIrpCancelStopDevice},
{IRP_DOWNWARD, PciFdoIrpQueryDeviceRelations},
{IRP_DISPATCH, PciFdoIrpQueryInterface},
{IRP_UPWARD, PciFdoIrpQueryCapabilities},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_DOWNWARD, PciIrpNotSupported},
{IRP_UPWARD, PciFdoIrpDeviceUsageNotification},
{IRP_DOWNWARD, PciFdoIrpSurpriseRemoval},
{IRP_DOWNWARD, PciFdoIrpQueryLegacyBusInformation},
{IRP_DOWNWARD, PciIrpNotSupported}
{IRP_UPWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpStartDevice},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryRemoveDevice},
{IRP_DISPATCH, (PCI_DISPATCH_FUNCTION)PciFdoIrpRemoveDevice},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpCancelRemoveDevice},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpStopDevice},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryStopDevice},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpCancelStopDevice},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryDeviceRelations},
{IRP_DISPATCH, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryInterface},
{IRP_UPWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryCapabilities},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_UPWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpDeviceUsageNotification},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpSurpriseRemoval},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciFdoIrpQueryLegacyBusInformation},
{IRP_DOWNWARD, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported}
};
PCI_MJ_DISPATCH_TABLE PciFdoDispatchTable =
@ -63,9 +63,9 @@ PCI_MJ_DISPATCH_TABLE PciFdoDispatchTable =
IRP_MN_QUERY_POWER,
PciFdoDispatchPowerTable,
IRP_DOWNWARD,
PciIrpNotSupported,
(PCI_DISPATCH_FUNCTION)PciIrpNotSupported,
IRP_DOWNWARD,
PciIrpNotSupported
(PCI_DISPATCH_FUNCTION)PciIrpNotSupported
};
/* FUNCTIONS ******************************************************************/
@ -76,9 +76,49 @@ PciFdoIrpStartDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_FDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
NTSTATUS Status;
PCM_RESOURCE_LIST Resources;
PAGED_CODE();
/* The device stack must be starting the FDO in a success path */
if (!NT_SUCCESS(Irp->IoStatus.Status)) return STATUS_NOT_SUPPORTED;
/* Attempt to switch the state machine to the started state */
Status = PciBeginStateTransition(DeviceExtension, PciStarted);
if (!NT_SUCCESS(Status)) return Status;
/* Check for any boot-provided resources */
Resources = IoStackLocation->Parameters.StartDevice.AllocatedResources;
DPRINT1("Resources: %p\n", Resources);
if ((Resources) && !(PCI_IS_ROOT_FDO(DeviceExtension)))
{
/* These resources would only be for non-root FDOs, unhandled for now */
ASSERT(Resources->Count == 1);
UNIMPLEMENTED;
while (TRUE);
}
/* Initialize the arbiter for this FDO */
Status = PciInitializeArbiterRanges(DeviceExtension, Resources);
if (!NT_SUCCESS(Status))
{
/* Cancel the transition if this failed */
PciCancelStateTransition(DeviceExtension, PciStarted);
return Status;
}
/* Again, check for boot-provided resources for non-root FDO */
if ((Resources) && !(PCI_IS_ROOT_FDO(DeviceExtension)))
{
/* Unhandled for now */
ASSERT(Resources->Count == 1);
UNIMPLEMENTED;
while (TRUE);
}
/* Commit the transition to the started state */
PciCommitStateTransition(DeviceExtension, PciStarted);
return STATUS_SUCCESS;
}
NTSTATUS
@ -153,9 +193,25 @@ PciFdoIrpQueryDeviceRelations(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_FDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
NTSTATUS Status;
PAGED_CODE();
/* Are bus relations being queried? */
if (IoStackLocation->Parameters.QueryDeviceRelations.Type != BusRelations)
{
/* The FDO is a bus, so only bus relations can be obtained */
Status = STATUS_NOT_SUPPORTED;
}
else
{
/* Scan the PCI bus and build the device relations for the caller */
Status = PciQueryDeviceRelations(DeviceExtension,
(PDEVICE_RELATIONS*)
&Irp->IoStatus.Information);
}
/* Return the enumeration status back */
return Status;
}
NTSTATUS
@ -164,9 +220,73 @@ PciFdoIrpQueryInterface(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_FDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
NTSTATUS Status;
PAGED_CODE();
ASSERT(DeviceExtension->ExtensionType == PciFdoExtensionType);
/* Deleted extensions don't respond to IRPs */
if (DeviceExtension->DeviceState == PciDeleted)
{
/* Hand it bacO try to deal with it */
return PciPassIrpFromFdoToPdo(DeviceExtension, Irp);
}
/* Query our driver for this interface */
Status = PciQueryInterface(DeviceExtension,
IoStackLocation->Parameters.QueryInterface.
InterfaceType,
IoStackLocation->Parameters.QueryInterface.
Size,
IoStackLocation->Parameters.QueryInterface.
Version,
IoStackLocation->Parameters.QueryInterface.
InterfaceSpecificData,
IoStackLocation->Parameters.QueryInterface.
Interface,
FALSE);
if (NT_SUCCESS(Status))
{
/* We found it, let the PDO handle it */
Irp->IoStatus.Status = Status;
return PciPassIrpFromFdoToPdo(DeviceExtension, Irp);
}
else if (Status == STATUS_NOT_SUPPORTED)
{
/* Otherwise, we can't handle it, let someone else down the stack try */
Status = PciCallDownIrpStack(DeviceExtension, Irp);
if (Status == STATUS_NOT_SUPPORTED)
{
/* They can't either, try a last-resort interface lookup */
Status = PciQueryInterface(DeviceExtension,
IoStackLocation->Parameters.QueryInterface.
InterfaceType,
IoStackLocation->Parameters.QueryInterface.
Size,
IoStackLocation->Parameters.QueryInterface.
Version,
IoStackLocation->Parameters.QueryInterface.
InterfaceSpecificData,
IoStackLocation->Parameters.QueryInterface.
Interface,
TRUE);
}
}
/* Has anyone claimed this interface yet? */
if (Status == STATUS_NOT_SUPPORTED)
{
/* No, return the original IRP status */
Status = Irp->IoStatus.Status;
}
else
{
/* Yes, set the new IRP status */
Irp->IoStatus.Status = Status;
}
/* Complete this IRP */
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
NTSTATUS
@ -386,11 +506,15 @@ PciAddDevice(IN PDRIVER_OBJECT DriverObject,
if (PciBreakOnDefault)
{
/* If a second bus is found and there's still no data, crash */
#if 0 // ros bug?
KeBugCheckEx(PCI_BUS_DRIVER_INTERNAL,
0xDEAD0010u,
(ULONG_PTR)DeviceObject,
0,
0);
#else
DPRINT1("Windows would crash!\n");
#endif
}
/* Warn that a default configuration will be used, and set bus 0 */

View file

@ -14,6 +14,52 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE AgpTargetInterface =
{
&GUID_AGP_TARGET_BUS_INTERFACE_STANDARD,
sizeof(AGP_BUS_INTERFACE_STANDARD),
AGP_BUS_INTERFACE_V1,
AGP_BUS_INTERFACE_V1,
PCI_INTERFACE_PDO,
0,
PciInterface_AgpTarget,
agpintrf_Constructor,
agpintrf_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
agpintrf_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI agpintrf_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
agpintrf_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
PPCI_PDO_EXTENSION PdoExtension = (PPCI_PDO_EXTENSION)DeviceExtension;
/* Only AGP bridges are supported (which are PCI-to-PCI Bridge Devices) */
if ((PdoExtension->BaseClass != PCI_CLASS_BRIDGE_DEV) ||
(PdoExtension->SubClass != PCI_SUBCLASS_BR_PCI_TO_PCI))
{
/* Fail any other PDO */
return STATUS_NOT_SUPPORTED;
}
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -14,6 +14,42 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE BusHandlerInterface =
{
&GUID_BUS_INTERFACE_STANDARD,
sizeof(BUS_INTERFACE_STANDARD),
1,
1,
PCI_INTERFACE_PDO,
0,
PciInterface_BusHandler,
busintrf_Constructor,
busintrf_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
busintrf_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI busintrf_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
busintrf_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -14,6 +14,100 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE PciCardbusPrivateInterface =
{
&GUID_PCI_CARDBUS_INTERFACE_PRIVATE,
sizeof(PCI_CARDBUS_INTERFACE_PRIVATE),
PCI_CB_INTRF_VERSION,
PCI_CB_INTRF_VERSION,
PCI_INTERFACE_PDO,
0,
PciInterface_PciCb,
pcicbintrf_Constructor,
pcicbintrf_Initializer
};
/* FUNCTIONS ******************************************************************/
VOID
NTAPI
Cardbus_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Cardbus_SaveLimits(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Cardbus_MassageHeaderForLimitsDetermination(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Cardbus_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Cardbus_GetAdditionalResourceDescriptors(IN PPCI_CONFIGURATOR_CONTEXT Context,
IN PPCI_COMMON_HEADER PciData,
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Cardbus_ResetDevice(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
Cardbus_ChangeResourceSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
NTSTATUS
NTAPI
pcicbintrf_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI pcicbintrf_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
pcicbintrf_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -0,0 +1,57 @@
/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/intrface/devhere.c
* PURPOSE: Device Presence Interface
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
PCI_INTERFACE PciDevicePresentInterface =
{
&GUID_PCI_DEVICE_PRESENT_INTERFACE,
sizeof(PCI_DEVICE_PRESENT_INTERFACE),
PCI_DEVICE_PRESENT_INTERFACE_VERSION,
PCI_DEVICE_PRESENT_INTERFACE_VERSION,
PCI_INTERFACE_PDO,
0,
PciInterface_DevicePresent,
devpresent_Constructor,
devpresent_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
devpresent_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI devpresent_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
devpresent_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
PAGED_CODE();
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -16,9 +16,135 @@
PPCI_INTERFACE PciInterfaces[] =
{
&ArbiterInterfaceBusNumber,
&ArbiterInterfaceMemory,
&ArbiterInterfaceIo,
&BusHandlerInterface,
&PciRoutingInterface,
&PciCardbusPrivateInterface,
&PciLegacyDeviceDetectionInterface,
&PciPmeInterface,
&PciDevicePresentInterface,
// &PciNativeIdeInterface,
&PciLocationInterface,
&AgpTargetInterface,
NULL
};
PPCI_INTERFACE PciInterfacesLastResort[] =
{
&TranslatorInterfaceInterrupt,
NULL
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
PciQueryInterface(IN PPCI_FDO_EXTENSION DeviceExtension,
IN CONST GUID* InterfaceType,
IN ULONG Size,
IN ULONG Version,
IN PVOID InterfaceData,
IN PINTERFACE Interface,
IN BOOLEAN LastChance)
{
UNICODE_STRING GuidString;
NTSTATUS Status;
PPCI_INTERFACE *InterfaceList;
PPCI_INTERFACE PciInterface;
RtlStringFromGUID(InterfaceType, &GuidString);
DPRINT1("PCI - PciQueryInterface TYPE = %wZ\n", &GuidString);
RtlFreeUnicodeString(&GuidString);
DPRINT1(" Size = %d, Version = %d, InterfaceData = %x, LastChance = %s\n",
Size,
Version,
InterfaceData,
LastChance ? "TRUE" : "FALSE");
/* Loop all the available interfaces */
for (InterfaceList = LastChance ? PciInterfacesLastResort : PciInterfaces;
*InterfaceList;
InterfaceList++)
{
/* Get the current interface */
PciInterface = *InterfaceList;
/* For debugging, construct the GUID string */
RtlStringFromGUID(PciInterface->InterfaceType, &GuidString);
/* Check if this is an FDO or PDO */
if (DeviceExtension->ExtensionType == PciFdoExtensionType)
{
/* Check if the interface is for FDOs */
if (!(PciInterface->Flags & PCI_INTERFACE_FDO))
{
/* This interface is not for FDOs, skip it */
DPRINT1("PCI - PciQueryInterface: guid = %wZ only for FDOs\n",
&GuidString);
RtlFreeUnicodeString(&GuidString);
continue;
}
/* Check if the interface is for root FDO only */
if ((PciInterface->Flags & PCI_INTERFACE_ROOT) &&
(!PCI_IS_ROOT_FDO(DeviceExtension)))
{
/* This FDO isn't the root, skip the interface */
DPRINT1("PCI - PciQueryInterface: guid = %wZ only for ROOT\n",
&GuidString);
RtlFreeUnicodeString(&GuidString);
continue;
}
}
else
{
/* This is a PDO, check if the interface is for PDOs too */
if (!(PciInterface->Flags & PCI_INTERFACE_PDO))
{
/* It isn't, skip it */
DPRINT1("PCI - PciQueryInterface: guid = %wZ only for PDOs\n",
&GuidString);
RtlFreeUnicodeString(&GuidString);
continue;
}
}
/* Print the GUID for debugging, and then free the string */
DPRINT1("PCI - PciQueryInterface looking at guid = %wZ\n", &GuidString);
RtlFreeUnicodeString(&GuidString);
/* Check if the GUID, version, and size all match */
if ((IsEqualGUIDAligned(PciInterface->InterfaceType, InterfaceType)) &&
(Version >= PciInterface->MinVersion) &&
(Version <= PciInterface->MaxVersion) &&
(Size >= PciInterface->MinSize))
{
/* Call the interface's constructor */
Status = PciInterface->Constructor(DeviceExtension,
PciInterface,
InterfaceData,
Version,
Size,
Interface);
if (!NT_SUCCESS(Status))
{
/* This interface was not initialized correctly, skip it */
DPRINT1("PCI - PciQueryInterface - Contructor %08lx = %08lx\n",
PciInterface->Constructor, Status);
continue;
}
/* Reference the interface and return success, all is good */
Interface->InterfaceReference(Interface->Context);
DPRINT1("PCI - PciQueryInterface returning SUCCESS\n");
return Status;
}
}
/* An interface of this type, and for this device, could not be found */
DPRINT1("PCI - PciQueryInterface FAILED TO FIND INTERFACE\n");
return STATUS_NOT_SUPPORTED;
}
/* EOF */

View file

@ -14,6 +14,42 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE PciLegacyDeviceDetectionInterface =
{
&GUID_LEGACY_DEVICE_DETECTION_STANDARD,
sizeof(LEGACY_DEVICE_DETECTION_INTERFACE),
0,
0,
PCI_INTERFACE_FDO,
0,
PciInterface_LegacyDeviceDetection,
lddintrf_Constructor,
lddintrf_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
lddintrf_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI lddintrf_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
lddintrf_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -14,6 +14,42 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE PciLocationInterface =
{
&GUID_PNP_LOCATION_INTERFACE,
sizeof(PNP_LOCATION_INTERFACE),
PNP_LOCATION_INTERFACE_VERSION,
PNP_LOCATION_INTERFACE_VERSION,
PCI_INTERFACE_FDO | PCI_INTERFACE_ROOT | PCI_INTERFACE_PDO,
0,
PciInterface_Location,
locintrf_Constructor,
locintrf_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
locintrf_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI locintrf_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
locintrf_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -14,6 +14,45 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE PciPmeInterface =
{
&GUID_PCI_PME_INTERFACE,
sizeof(PCI_PME_INTERFACE),
PCI_PME_INTRF_STANDARD_VER,
PCI_PME_INTRF_STANDARD_VER,
PCI_INTERFACE_FDO | PCI_INTERFACE_ROOT,
0,
PciInterface_PmeHandler,
PciPmeInterfaceConstructor,
PciPmeInterfaceInitializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
PciPmeInterfaceInitializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI PciPmeInterfaceInitializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
PciPmeInterfaceConstructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
/* Only version 1 is supported */
if (Version != PCI_PME_INTRF_STANDARD_VER) return STATUS_NOINTERFACE;
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -14,6 +14,45 @@
/* GLOBALS ********************************************************************/
PCI_INTERFACE PciRoutingInterface =
{
&GUID_INT_ROUTE_INTERFACE_STANDARD,
sizeof(INT_ROUTE_INTERFACE_STANDARD),
PCI_INT_ROUTE_INTRF_STANDARD_VER,
PCI_INT_ROUTE_INTRF_STANDARD_VER,
PCI_INTERFACE_FDO,
0,
PciInterface_IntRouteHandler,
routeintrf_Constructor,
routeintrf_Initializer
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
routeintrf_Initializer(IN PVOID Instance)
{
/* PnP Interfaces don't get Initialized */
ASSERTMSG(FALSE, "PCI routeintrf_Initializer, unexpected call.");
return STATUS_UNSUCCESSFUL;
}
NTSTATUS
NTAPI
routeintrf_Constructor(IN PVOID DeviceExtension,
IN PVOID Instance,
IN PVOID InterfaceData,
IN USHORT Version,
IN USHORT Size,
IN PINTERFACE Interface)
{
/* Only version 1 is supported */
if (Version != PCI_INT_ROUTE_INTRF_STANDARD_VER) return STATUS_NOINTERFACE;
/* Not yet implemented */
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,118 @@ BOOLEAN PciAssignBusNumbers;
/* FUNCTIONS ******************************************************************/
UCHAR
NTAPI
PciGetAdjustedInterruptLine(IN PPCI_PDO_EXTENSION PdoExtension)
{
UCHAR InterruptLine = 0, PciInterruptLine;
ULONG Length;
/* Does the device have an interrupt pin? */
if (PdoExtension->InterruptPin)
{
/* Find the associated line on the parent bus */
Length = HalGetBusDataByOffset(PCIConfiguration,
PdoExtension->ParentFdoExtension->BaseBus,
PdoExtension->Slot.u.AsULONG,
&PciInterruptLine,
FIELD_OFFSET(PCI_COMMON_HEADER,
u.type0.InterruptLine),
sizeof(UCHAR));
if (Length) InterruptLine = PciInterruptLine;
}
/* Either keep the original interrupt line, or the one on the master bus */
return InterruptLine ? PdoExtension->RawInterruptLine : InterruptLine;
}
VOID
NTAPI
PciReadWriteConfigSpace(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCI_SLOT_NUMBER Slot,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length,
IN BOOLEAN Read)
{
PPCI_BUS_INTERFACE_STANDARD PciInterface;
PBUS_HANDLER BusHandler;
PPCIBUSDATA BusData;
PciReadWriteConfig HalFunction;
/* Only the root FDO can access configuration space */
ASSERT(PCI_IS_ROOT_FDO(DeviceExtension->BusRootFdoExtension));
/* Get the ACPI-compliant PCI interface */
PciInterface = DeviceExtension->BusRootFdoExtension->PciBusInterface;
if (PciInterface)
{
/* Currently this driver only supports the legacy HAL interface */
UNIMPLEMENTED;
while (TRUE);
}
else
{
/* Make sure there's a registered HAL bus handler */
ASSERT(DeviceExtension->BusHandler);
/* PCI Bus Number assignment is only valid on ACPI systems */
ASSERT(!PciAssignBusNumbers);
/* Grab the HAL PCI Bus Handler data */
BusHandler = (PBUS_HANDLER)DeviceExtension->BusHandler;
BusData = (PPCIBUSDATA)BusHandler->BusData;
/* Choose the appropriate read or write function, and call it */
HalFunction = Read ? BusData->ReadConfig : BusData->WriteConfig;
HalFunction(BusHandler, Slot, Buffer, Offset, Length);
}
}
VOID
NTAPI
PciWriteDeviceConfig(IN PPCI_PDO_EXTENSION DeviceExtension,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length)
{
/* Call the generic worker function */
PciReadWriteConfigSpace(DeviceExtension->ParentFdoExtension,
DeviceExtension->Slot,
Buffer,
Offset,
Length,
FALSE);
}
VOID
NTAPI
PciReadDeviceConfig(IN PPCI_PDO_EXTENSION DeviceExtension,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length)
{
/* Call the generic worker function */
PciReadWriteConfigSpace(DeviceExtension->ParentFdoExtension,
DeviceExtension->Slot,
Buffer,
Offset,
Length,
TRUE);
}
VOID
NTAPI
PciReadSlotConfig(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCI_SLOT_NUMBER Slot,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length)
{
/* Call the generic worker function */
PciReadWriteConfigSpace(DeviceExtension, Slot, Buffer, Offset, Length, TRUE);
}
NTSTATUS
NTAPI
PciQueryForPciBusInterface(IN PPCI_FDO_EXTENSION FdoExtension)

View file

@ -16,4 +16,95 @@
/* FUNCTIONS ******************************************************************/
PWCHAR
NTAPI
PciGetDescriptionMessage(IN ULONG Identifier,
OUT PULONG Length)
{
PMESSAGE_RESOURCE_ENTRY Entry;
ULONG TextLength;
PWCHAR Description, Buffer;
ANSI_STRING MessageString;
UNICODE_STRING UnicodeString;
NTSTATUS Status;
/* Find the message identifier in the message table */
MessageString.Buffer = NULL;
Status = RtlFindMessage(PciDriverObject->DriverStart,
11, // RT_MESSAGETABLE
LANG_NEUTRAL,
Identifier,
&Entry);
if (!NT_SUCCESS(Status)) return NULL;
/* Check if the resource data is Unicode or ANSI */
if (Entry->Flags & MESSAGE_RESOURCE_UNICODE)
{
/* Subtract one space for the end-of-message terminator */
TextLength = Entry->Length -
FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Text) -
sizeof(WCHAR);
/* Grab the text */
Description = (PWCHAR)Entry->Text;
/* Validate valid message length, ending with a newline character */
ASSERT(TextLength > 1);
ASSERT(Description[TextLength / sizeof(WCHAR) == L'\n']);
/* Allocate the buffer to hold the message string */
Buffer = ExAllocatePoolWithTag(PagedPool, TextLength, 'BicP');
if (!Buffer) return NULL;
/* Copy the message, minus the newline character, and terminate it */
RtlCopyMemory(Buffer, Entry->Text, TextLength - 1);
Buffer[TextLength / sizeof(WCHAR)] = UNICODE_NULL;
/* Return the length to the caller */
if (Length) *Length = UnicodeString.Length;
}
else
{
/* Initialize the entry as a string */
RtlInitAnsiString(&MessageString, (PCHAR)Entry->Text);
/* Remove the newline character */
MessageString.Length -= sizeof(CHAR);
/* Convert it to Unicode */
RtlAnsiStringToUnicodeString(&UnicodeString, &MessageString, TRUE);
Buffer = UnicodeString.Buffer;
/* Return the length to the caller */
if (Length) *Length = UnicodeString.Length;
}
/* Return the message buffer to the caller */
return Buffer;
}
PWCHAR
NTAPI
PciGetDeviceDescriptionMessage(IN UCHAR BaseClass,
IN UCHAR SubClass)
{
PWCHAR Message;
ULONG Identifier;
/* The message identifier in the table is encoded based on the PCI class */
Identifier = (BaseClass << 8) | SubClass;
/* Go grab the description message for this device */
Message = PciGetDescriptionMessage(Identifier, NULL);
if (!Message)
{
/* It wasn't found, allocate a buffer for a generic description */
Message = ExAllocatePoolWithTag(PagedPool, sizeof(L"PCI Device"), 'bicP');
if (Message) RtlCopyMemory(Message, L"PCI Device", sizeof(L"PCI Device"));
}
/* Return the description message */
return Message;
}
/* EOF */

View file

@ -16,4 +16,62 @@
/* FUNCTIONS ******************************************************************/
VOID
NTAPI
PPBridge_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
PPBridge_SaveLimits(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
PPBridge_MassageHeaderForLimitsDetermination(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
PPBridge_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
PPBridge_GetAdditionalResourceDescriptors(IN PPCI_CONFIGURATOR_CONTEXT Context,
IN PPCI_COMMON_HEADER PciData,
IN PIO_RESOURCE_DESCRIPTOR IoDescriptor)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
PPBridge_ResetDevice(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
VOID
NTAPI
PPBridge_ChangeResourceSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
{
UNIMPLEMENTED;
while (TRUE);
}
/* EOF */

View file

@ -14,6 +14,72 @@
/* GLOBALS ********************************************************************/
PCHAR PciTransitionText[PciMaxObjectState + 1] =
{
"PciNotStarted",
"PciStarted",
"PciDeleted",
"PciStopped",
"PciSurpriseRemoved",
"PciSynchronizedOperation",
"PciMaxObjectState"
};
NTSTATUS PnpStateCancelArray[PciMaxObjectState] =
{
STATUS_INVALID_DEVICE_REQUEST,
STATUS_FAIL_CHECK,
STATUS_INVALID_DEVICE_STATE,
STATUS_INVALID_DEVICE_STATE,
STATUS_FAIL_CHECK,
STATUS_FAIL_CHECK
};
NTSTATUS PnpStateTransitionArray[PciMaxObjectState * PciMaxObjectState] =
{
STATUS_SUCCESS, // Not Started -> Not Started
STATUS_SUCCESS, // Started -> Not Started
STATUS_FAIL_CHECK, // Deleted -> Not Started
STATUS_SUCCESS, // Stopped -> Not Started
STATUS_FAIL_CHECK, // Surprise Removed -> Not Started
STATUS_FAIL_CHECK, // Synchronized Operation -> Not Started
STATUS_SUCCESS, // Not Started -> Started
STATUS_FAIL_CHECK, // Started -> Started
STATUS_FAIL_CHECK, // Deleted -> Started
STATUS_SUCCESS, // Stopped -> Started
STATUS_FAIL_CHECK, // Surprise Removed -> Started
STATUS_FAIL_CHECK, // Synchronized Operation -> Started
STATUS_SUCCESS, // Not Started -> Deleted
STATUS_SUCCESS, // Started -> Deleted
STATUS_FAIL_CHECK, // Deleted -> Deleted
STATUS_FAIL_CHECK, // Stopped -> Deleted
STATUS_SUCCESS, // Surprise Removed -> Deleted
STATUS_FAIL_CHECK, // Synchronized Operation -> Deleted
STATUS_INVALID_DEVICE_REQUEST, // Not Started -> Stopped
STATUS_SUCCESS, // Started -> Stopped
STATUS_FAIL_CHECK, // Deleted -> Stopped
STATUS_FAIL_CHECK, // Stopped -> Stopped
STATUS_FAIL_CHECK, // Surprise Removed -> Stopped
STATUS_FAIL_CHECK, // Synchronized Operation -> Stopped
STATUS_SUCCESS, // Not Started -> Surprise Removed
STATUS_SUCCESS, // Started -> Surprise Removed
STATUS_FAIL_CHECK, // Deleted -> Surprise Removed
STATUS_SUCCESS, // Stopped -> Surprise Removed
STATUS_FAIL_CHECK, // Surprise Removed -> Surprise Removed
STATUS_FAIL_CHECK, // Synchronized Operation -> Surprise Removed
STATUS_SUCCESS, // Not Started -> Synchronized Operation
STATUS_SUCCESS, // Started -> Synchronized Operation
STATUS_INVALID_DEVICE_STATE, // Deleted -> Synchronized Operation
STATUS_SUCCESS, // Stopped -> Synchronized Operation
STATUS_INVALID_DEVICE_STATE, // Surprise Removed -> Synchronized Operation
STATUS_FAIL_CHECK // Synchronized Operation -> Synchronized Operation
};
/* FUNCTIONS ******************************************************************/
VOID
@ -25,4 +91,104 @@ PciInitializeState(IN PPCI_FDO_EXTENSION DeviceExtension)
DeviceExtension->TentativeNextState = PciNotStarted;
}
NTSTATUS
NTAPI
PciBeginStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCI_STATE NewState)
{
PCI_STATE CurrentState;
NTSTATUS Status;
DPRINT1("PCI Request to begin transition of Extension %p to %s ->",
DeviceExtension,
PciTransitionText[NewState]);
/* Assert the device isn't already in a pending transition */
ASSERT(DeviceExtension->TentativeNextState == DeviceExtension->DeviceState);
/* Assert this is a valid state */
CurrentState = DeviceExtension->DeviceState;
ASSERT(CurrentState < PciMaxObjectState);
ASSERT(NewState < PciMaxObjectState);
/* Lookup if this state transition is valid */
Status = PnpStateTransitionArray[CurrentState + 6 * NewState];
if (Status == STATUS_FAIL_CHECK)
{
/* Invalid transition (logical fault) */
DPRINT1("ERROR\nPCI: Error trying to enter state \"%s\" "
"from state \"%s\"\n",
PciTransitionText[NewState],
PciTransitionText[CurrentState]);
DbgBreakPoint();
}
else if (Status == STATUS_INVALID_DEVICE_REQUEST)
{
/* Invalid transition (illegal request) */
DPRINT1("ERROR\nPCI: Illegal request to try to enter state \"%s\" "
"from state \"%s\", rejecting",
PciTransitionText[NewState],
PciTransitionText[CurrentState]);
}
/* New state must be different from current, unless request is at fault */
ASSERT((NewState != DeviceExtension->DeviceState) || (!NT_SUCCESS(Status)));
/* Enter the new state if successful, and return state status */
if (NT_SUCCESS(Status)) DeviceExtension->TentativeNextState = NewState;
DbgPrint("%x\n", Status);
return Status;
}
NTSTATUS
NTAPI
PciCancelStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCI_STATE StateNotEntered)
{
NTSTATUS Status;
DPRINT1("PCI Request to cancel transition of Extension %p to %s ->",
DeviceExtension,
PciTransitionText[StateNotEntered]);
/* The next state can't be the state the device is already in */
if (DeviceExtension->TentativeNextState == DeviceExtension->DeviceState)
{
/* It's too late since the state was already committed */
ASSERT(StateNotEntered < PciMaxObjectState);
ASSERT(PnpStateCancelArray[StateNotEntered] != STATUS_FAIL_CHECK);
/* Return failure */
Status = STATUS_INVALID_DEVICE_STATE;
DbgPrint("%x\n", Status);
}
else
{
/* The device hasn't yet entered the state, so it's still possible to cancel */
ASSERT(DeviceExtension->TentativeNextState == StateNotEntered);
DeviceExtension->TentativeNextState = DeviceExtension->DeviceState;
/* Return success */
Status = STATUS_SUCCESS;
DbgPrint("%x\n", Status);
}
/* Return the cancel state */
return Status;
}
VOID
NTAPI
PciCommitStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCI_STATE NewState)
{
DPRINT1("PCI Commit transition of Extension %p to %s\n",
DeviceExtension, PciTransitionText[NewState]);
/* Make sure this is a valid commit */
ASSERT(NewState != PciSynchronizedOperation);
ASSERT(DeviceExtension->TentativeNextState == NewState);
/* Enter the new state */
DeviceExtension->DeviceState = NewState;
}
/* EOF */

View file

@ -17,8 +17,62 @@
BOOLEAN PciVerifierRegistered;
PVOID PciVerifierNotificationHandle;
PCI_VERIFIER_DATA PciVerifierFailureTable[PCI_VERIFIER_CODES] =
{
{
1,
VFFAILURE_FAIL_LOGO,
0,
"The BIOS has reprogrammed the bus numbers of an active PCI device "
"(!devstack %DevObj) during a dock or undock!"
},
{
2,
VFFAILURE_FAIL_LOGO,
0,
"A device in the system did not update it's PMCSR register in the spec "
"mandated time (!devstack %DevObj, Power state D%Ulong)"
},
{
3,
VFFAILURE_FAIL_LOGO,
0,
"A driver controlling a PCI device has tried to access OS controlled "
"configuration space registers (!devstack %DevObj, Offset 0x%Ulong1, "
"Length 0x%Ulong2)"
},
{
4,
VFFAILURE_FAIL_UNDER_DEBUGGER,
0,
"A driver controlling a PCI device has tried to read or write from an "
"invalid space using IRP_MN_READ/WRITE_CONFIG or via BUS_INTERFACE_STANDARD."
" NB: These functions take WhichSpace parameters of the form PCI_WHICHSPACE_*"
" and not a BUS_DATA_TYPE (!devstack %DevObj, WhichSpace 0x%Ulong1)"
},
};
/* FUNCTIONS ******************************************************************/
PPCI_VERIFIER_DATA
NTAPI
PciVerifierRetrieveFailureData(IN ULONG FailureCode)
{
PPCI_VERIFIER_DATA VerifierData;
/* Scan the verifier failure table for this code */
VerifierData = PciVerifierFailureTable;
while (VerifierData->FailureCode != FailureCode)
{
/* Keep searching */
++VerifierData;
ASSERT(VerifierData < &PciVerifierFailureTable[PCI_VERIFIER_CODES]);
}
/* Return the entry for this code */
return VerifierData;
}
NTSTATUS
NTAPI
PciVerifierProfileChangeCallback(IN PVOID NotificationStructure,

View file

@ -16,6 +16,7 @@
<file>agpintrf.c</file>
<file>busintrf.c</file>
<file>cardbus.c</file>
<file>devhere.c</file>
<file>ideintrf.c</file>
<file>intrface.c</file>
<file>lddintrf.c</file>

View file

@ -14,6 +14,393 @@
/* GLOBALS ********************************************************************/
LONG PciPdoSequenceNumber;
C_ASSERT(FIELD_OFFSET(PCI_FDO_EXTENSION, DeviceState) == FIELD_OFFSET(PCI_PDO_EXTENSION, DeviceState));
C_ASSERT(FIELD_OFFSET(PCI_FDO_EXTENSION, TentativeNextState) == FIELD_OFFSET(PCI_PDO_EXTENSION, TentativeNextState));
C_ASSERT(FIELD_OFFSET(PCI_FDO_EXTENSION, List) == FIELD_OFFSET(PCI_PDO_EXTENSION, Next));
PCI_MN_DISPATCH_TABLE PciPdoDispatchPowerTable[] =
{
{IRP_DISPATCH, (PCI_DISPATCH_FUNCTION)PciPdoWaitWake},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoSetPowerState},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryPower},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported}
};
PCI_MN_DISPATCH_TABLE PciPdoDispatchPnpTable[] =
{
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpStartDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryRemoveDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpRemoveDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpCancelRemoveDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpStopDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryStopDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpCancelStopDevice},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryDeviceRelations},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryInterface},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryCapabilities},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryResources},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryResourceRequirements},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryDeviceText},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpReadConfig},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpWriteConfig},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryId},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryDeviceState},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryBusInformation},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpDeviceUsageNotification},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpSurpriseRemoval},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciPdoIrpQueryLegacyBusInformation},
{IRP_COMPLETE, (PCI_DISPATCH_FUNCTION)PciIrpNotSupported}
};
PCI_MJ_DISPATCH_TABLE PciPdoDispatchTable =
{
IRP_MN_QUERY_LEGACY_BUS_INFORMATION,
PciPdoDispatchPnpTable,
IRP_MN_QUERY_POWER,
PciPdoDispatchPowerTable,
IRP_COMPLETE,
(PCI_DISPATCH_FUNCTION)PciIrpNotSupported,
IRP_COMPLETE,
(PCI_DISPATCH_FUNCTION)PciIrpInvalidDeviceRequest
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
PciPdoWaitWake(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoSetPowerState(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryPower(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpStartDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryRemoveDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpRemoveDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpCancelRemoveDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpStopDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryStopDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpCancelStopDevice(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryInterface(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryDeviceRelations(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryCapabilities(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryResources(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryResourceRequirements(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryDeviceText(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryId(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryBusInformation(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpReadConfig(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpWriteConfig(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryDeviceState(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpDeviceUsageNotification(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpSurpriseRemoval(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoIrpQueryLegacyBusInformation(IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation,
IN PPCI_PDO_EXTENSION DeviceExtension)
{
UNIMPLEMENTED;
while (TRUE);
return STATUS_NOT_SUPPORTED;
}
NTSTATUS
NTAPI
PciPdoCreate(IN PPCI_FDO_EXTENSION DeviceExtension,
IN PCI_SLOT_NUMBER Slot,
OUT PDEVICE_OBJECT *PdoDeviceObject)
{
WCHAR DeviceName[32];
UNICODE_STRING DeviceString;
NTSTATUS Status;
PDEVICE_OBJECT DeviceObject;
PPCI_PDO_EXTENSION PdoExtension;
ULONG SequenceNumber;
PAGED_CODE();
/* Pick an atomically unique sequence number for this device */
SequenceNumber = InterlockedIncrement(&PciPdoSequenceNumber);
/* Create the standard PCI device name for a PDO */
swprintf(DeviceName, L"\\Device\\NTPNP_PCI%04d", SequenceNumber);
RtlInitUnicodeString(&DeviceString, DeviceName);
/* Create the actual device now */
Status = IoCreateDevice(DeviceExtension->FunctionalDeviceObject->DriverObject,
sizeof(PCI_PDO_EXTENSION),
&DeviceString,
FILE_DEVICE_BUS_EXTENDER,
0,
0,
&DeviceObject);
ASSERT(NT_SUCCESS(Status));
/* Get the extension for it */
PdoExtension = (PPCI_PDO_EXTENSION)DeviceObject->DeviceExtension;
DPRINT1("PCI: New PDO (b=0x%x, d=0x%x, f=0x%x) @ %p, ext @ %p\n",
DeviceExtension->BaseBus,
Slot.u.bits.DeviceNumber,
Slot.u.bits.FunctionNumber,
DeviceObject,
DeviceObject->DeviceExtension);
/* Configure the extension */
PdoExtension->ExtensionType = PciPdoExtensionType;
PdoExtension->IrpDispatchTable = &PciPdoDispatchTable;
PdoExtension->PhysicalDeviceObject = DeviceObject;
PdoExtension->Slot = Slot;
PdoExtension->PowerState.CurrentSystemState = PowerDeviceD0;
PdoExtension->PowerState.CurrentDeviceState = PowerDeviceD0;
PdoExtension->ParentFdoExtension = DeviceExtension;
/* Initialize the lock for arbiters and other interfaces */
KeInitializeEvent(&PdoExtension->SecondaryExtLock, SynchronizationEvent, TRUE);
/* Initialize the state machine */
PciInitializeState((PPCI_FDO_EXTENSION)PdoExtension);
/* Add the PDO to the parent's list */
PdoExtension->Next = NULL;
PciInsertEntryAtTail((PSINGLE_LIST_ENTRY)&DeviceExtension->ChildPdoList,
(PPCI_FDO_EXTENSION)PdoExtension,
&DeviceExtension->ChildListLock);
/* And finally return it to the caller */
*PdoDeviceObject = DeviceObject;
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -14,8 +14,192 @@
/* GLOBALS ********************************************************************/
ULONG PciPowerDelayTable[PowerDeviceD3 * PowerDeviceD3] =
{
0, // D0 -> D0
0, // D1 -> D0
200, // D2 -> D0
10000, // D3 -> D0
0, // D0 -> D1
0, // D1 -> D1
200, // D2 -> D1
10000, // D3 -> D1
200, // D0 -> D2
200, // D1 -> D2
0, // D2 -> D2
10000, // D3 -> D2
10000, // D0 -> D3
10000, // D1 -> D3
10000, // D2 -> D3
0 // D3 -> D3
};
/* FUNCTIONS ******************************************************************/
NTSTATUS
NTAPI
PciStallForPowerChange(IN PPCI_PDO_EXTENSION PdoExtension,
IN DEVICE_POWER_STATE PowerState,
IN ULONG_PTR CapOffset)
{
ULONG PciState, TimeoutEntry, PmcsrOffset, TryCount;
PPCI_VERIFIER_DATA VerifierData;
LARGE_INTEGER Interval;
PCI_PMCSR Pmcsr;
KIRQL Irql;
/* Make sure the power state is valid, and the device can support it */
ASSERT((PdoExtension->PowerState.CurrentDeviceState >= PowerDeviceD0) &&
(PdoExtension->PowerState.CurrentDeviceState <= PowerDeviceD3));
ASSERT((PowerState >= PowerDeviceD0) && (PowerState <= PowerDeviceD3));
ASSERT(!(PdoExtension->HackFlags & PCI_HACK_NO_PM_CAPS));
/* Save the current IRQL */
Irql = KeGetCurrentIrql();
/* Pick the expected timeout for this transition */
TimeoutEntry = PciPowerDelayTable[PowerState * PdoExtension->PowerState.CurrentDeviceState];
/* PCI power states are one less than NT power states */
PciState = PowerState - 1;
/* The state status is stored in the PMCSR offset */
PmcsrOffset = CapOffset + FIELD_OFFSET(PCI_PM_CAPABILITY, PMCSR);
/* Try changing the power state up to 100 times */
TryCount = 100;
while (--TryCount)
{
/* Check if this state transition will take time */
if (TimeoutEntry > 0)
{
/* Check if this is happening at high IRQL */
if (Irql >= DISPATCH_LEVEL)
{
/* Can't wait at high IRQL, stall the processor */
KeStallExecutionProcessor(TimeoutEntry);
}
else
{
/* Do a wait for the timeout specified instead */
Interval.QuadPart = -10 * TimeoutEntry;
Interval.QuadPart -= KeQueryTimeIncrement() - 1;
KeDelayExecutionThread(0, 0, &Interval);
}
}
/* Read the PMCSR and see if the state has changed */
PciReadDeviceConfig(PdoExtension, &Pmcsr, PmcsrOffset, sizeof(PCI_PMCSR));
if (Pmcsr.PowerState == PciState) return STATUS_SUCCESS;
/* Try again, forcing a timeout of 1ms */
TimeoutEntry = 1000;
}
/* Call verifier with this error */
VerifierData = PciVerifierRetrieveFailureData(2);
ASSERT(VerifierData);
VfFailDeviceNode(PdoExtension->PhysicalDeviceObject,
PCI_VERIFIER_DETECTED_VIOLATION,
2, // The PMCSR register was not updated within the spec-mandated time.
VerifierData->FailureClass,
&VerifierData->AssertionControl,
VerifierData->DebuggerMessageText,
"%DevObj%Ulong",
PdoExtension->PhysicalDeviceObject,
PciState);
return STATUS_DEVICE_PROTOCOL_ERROR;
}
NTSTATUS
NTAPI
PciSetPowerManagedDevicePowerState(IN PPCI_PDO_EXTENSION DeviceExtension,
IN DEVICE_POWER_STATE DeviceState,
IN BOOLEAN IrpSet)
{
NTSTATUS Status;
PCI_PM_CAPABILITY PmCaps;
ULONG CapsOffset;
/* Assume success */
Status = STATUS_SUCCESS;
/* Check if this device can support low power states */
if (!(PciCanDisableDecodes(DeviceExtension, NULL, 0, TRUE)) &&
(DeviceState != PowerDeviceD0))
{
/* Simply return success, ignoring this request */
DPRINT1("Cannot disable decodes on this device, ignoring PM request...\n");
return Status;
}
/* Does the device support power management at all? */
if (!(DeviceExtension->HackFlags & PCI_HACK_NO_PM_CAPS))
{
/* Get the PM capabailities register */
CapsOffset = PciReadDeviceCapability(DeviceExtension,
DeviceExtension->CapabilitiesPtr,
PCI_CAPABILITY_ID_POWER_MANAGEMENT,
&PmCaps.Header,
sizeof(PCI_PM_CAPABILITY));
ASSERT(CapsOffset);
ASSERT(DeviceState != PowerDeviceUnspecified);
/* Check if the device is being powered up */
if (DeviceState == PowerDeviceD0)
{
/* Set full power state */
PmCaps.PMCSR.ControlStatus.PowerState = 0;
/* Check if the device supports Cold-D3 poweroff */
if (PmCaps.PMC.Capabilities.Support.PMED3Cold)
{
/* If there was a pending PME, clear it */
PmCaps.PMCSR.ControlStatus.PMEStatus = 1;
}
}
else
{
/* Otherwise, just set the new power state, converting from NT */
PmCaps.PMCSR.ControlStatus.PowerState = DeviceState - 1;
}
/* Write the new power state in the PMCSR */
PciWriteDeviceConfig(DeviceExtension,
&PmCaps.PMCSR,
CapsOffset + FIELD_OFFSET(PCI_PM_CAPABILITY, PMCSR),
sizeof(PCI_PMCSR));
/* Now wait for the change to "stick" based on the spec-mandated time */
Status = PciStallForPowerChange(DeviceExtension, DeviceState, CapsOffset);
if (!NT_SUCCESS(Status)) return Status;
}
else
{
/* Nothing to do! */
DPRINT1("No PM on this device, ignoring request\n");
}
/* Check if new resources have to be assigned */
if (IrpSet)
{
/* Check if the new device state is lower (higher power) than now */
if (DeviceState < DeviceExtension->PowerState.CurrentDeviceState)
{
/* We would normally re-assign resources after powerup */
UNIMPLEMENTED;
while (TRUE);
}
}
/* Return the power state change status */
return Status;
}
NTSTATUS
NTAPI
PciFdoWaitWake(IN PIRP Irp,

View file

@ -14,6 +14,8 @@
/* GLOBALS ********************************************************************/
ULONG PciDebugPortsCount;
RTL_RANGE_LIST PciIsaBitExclusionList;
RTL_RANGE_LIST PciVgaAndIsaBitExclusionList;
@ -338,9 +340,11 @@ NTAPI
PciFindParentPciFdoExtension(IN PDEVICE_OBJECT DeviceObject,
IN PKEVENT Lock)
{
PPCI_FDO_EXTENSION FoundExtension;
PPCI_FDO_EXTENSION DeviceExtension;
PPCI_PDO_EXTENSION SearchExtension, FoundExtension;
/* Assume we'll find nothing */
SearchExtension = DeviceObject->DeviceExtension;
FoundExtension = NULL;
/* Check if a lock was specified */
@ -352,11 +356,31 @@ PciFindParentPciFdoExtension(IN PDEVICE_OBJECT DeviceObject,
}
/* Now search for the extension */
if (PciFdoExtensionListHead.Next)
DeviceExtension = (PPCI_FDO_EXTENSION)PciFdoExtensionListHead.Next;
while (DeviceExtension)
{
/* This case should not be hit yet */
UNIMPLEMENTED;
while (TRUE);
/* Acquire this device's lock */
KeEnterCriticalRegion();
KeWaitForSingleObject(&DeviceExtension->ChildListLock,
Executive,
KernelMode,
FALSE,
NULL);
/* Scan all children PDO, stop when no more PDOs, or found it */
for (FoundExtension = DeviceExtension->ChildPdoList;
FoundExtension && (FoundExtension != SearchExtension);
FoundExtension = FoundExtension->Next);
/* If we found it, break out */
if (FoundExtension) break;
/* Release this device's lock */
KeSetEvent(&DeviceExtension->ChildListLock, IO_NO_INCREMENT, FALSE);
KeLeaveCriticalRegion();
/* Move to the next device */
DeviceExtension = (PPCI_FDO_EXTENSION)DeviceExtension->List.Next;
}
/* Check if we had acquired a lock previously */
@ -368,7 +392,7 @@ PciFindParentPciFdoExtension(IN PDEVICE_OBJECT DeviceObject,
}
/* Return which extension was found, if any */
return FoundExtension;
return DeviceExtension;
}
VOID
@ -555,4 +579,604 @@ PciSendIoctl(IN PDEVICE_OBJECT DeviceObject,
return Status;
}
PPCI_SECONDARY_EXTENSION
NTAPI
PciFindNextSecondaryExtension(IN PSINGLE_LIST_ENTRY ListHead,
IN PCI_SIGNATURE ExtensionType)
{
PSINGLE_LIST_ENTRY NextEntry;
PPCI_SECONDARY_EXTENSION Extension;
/* Scan the list */
for (NextEntry = ListHead; NextEntry; NextEntry = NextEntry->Next)
{
/* Grab each extension and check if it's the one requested */
Extension = CONTAINING_RECORD(NextEntry, PCI_SECONDARY_EXTENSION, List);
if (Extension->ExtensionType == ExtensionType) return Extension;
}
/* Nothing was found */
return NULL;
}
ULONGLONG
NTAPI
PciGetHackFlags(IN USHORT VendorId,
IN USHORT DeviceId,
IN USHORT SubVendorId,
IN USHORT SubSystemId,
IN UCHAR RevisionId)
{
PPCI_HACK_ENTRY HackEntry;
ULONGLONG HackFlags;
ULONG LastWeight, MatchWeight;
ULONG EntryFlags;
/* Initialize the variables before looping */
LastWeight = 0;
HackFlags = 0;
ASSERT(PciHackTable);
/* Scan the hack table */
for (HackEntry = PciHackTable;
HackEntry->VendorID != PCI_INVALID_VENDORID;
++HackEntry)
{
/* Check if there's an entry for this device */
if ((HackEntry->DeviceID == DeviceId) &&
(HackEntry->VendorID == VendorId))
{
/* This is a basic match */
EntryFlags = HackEntry->Flags;
MatchWeight = 1;
/* Does the entry have revision information? */
if (EntryFlags & PCI_HACK_HAS_REVISION_INFO)
{
/* Check if the revision matches, if so, this is a better match */
if (HackEntry->RevisionID != RevisionId) continue;
MatchWeight = 3;
}
/* Does the netry have subsystem information? */
if (EntryFlags & PCI_HACK_HAS_SUBSYSTEM_INFO)
{
/* Check if it matches, if so, this is the best possible match */
if ((HackEntry->SubVendorID != SubVendorId) ||
(HackEntry->SubSystemID != SubSystemId))
{
continue;
}
MatchWeight += 4;
}
/* Is this the best match yet? */
if (MatchWeight > LastWeight)
{
/* This is the best match for now, use this as the hack flags */
HackFlags = HackEntry->HackFlags;
LastWeight = MatchWeight;
}
}
}
/* Return the best match */
return HackFlags;
}
BOOLEAN
NTAPI
PciIsCriticalDeviceClass(IN UCHAR BaseClass,
IN UCHAR SubClass)
{
/* Check for system or bridge devices */
if (BaseClass == PCI_CLASS_BASE_SYSTEM_DEV)
{
/* Interrupt controlers are critical */
return SubClass == PCI_SUBCLASS_SYS_INTERRUPT_CTLR;
}
else if (BaseClass == PCI_CLASS_BRIDGE_DEV)
{
/* ISA Bridges are critical */
return SubClass == PCI_SUBCLASS_BR_ISA;
}
else
{
/* All display controllers are critical */
return BaseClass == PCI_CLASS_DISPLAY_CTLR;
}
}
PPCI_PDO_EXTENSION
NTAPI
PciFindPdoByFunction(IN PPCI_FDO_EXTENSION DeviceExtension,
IN ULONG FunctionNumber,
IN PPCI_COMMON_HEADER PciData)
{
KIRQL Irql;
PPCI_PDO_EXTENSION PdoExtension;
/* Get the current IRQL when this call was made */
Irql = KeGetCurrentIrql();
/* Is this a low-IRQL call? */
if (Irql < DISPATCH_LEVEL)
{
/* Acquire this device's lock */
KeEnterCriticalRegion();
KeWaitForSingleObject(&DeviceExtension->ChildListLock,
Executive,
KernelMode,
FALSE,
NULL);
}
/* Loop every child PDO */
for (PdoExtension = DeviceExtension->ChildPdoList;
PdoExtension;
PdoExtension = PdoExtension->Next)
{
/* Find only enumerated PDOs */
if (!PdoExtension->ReportedMissing)
{
/* Check if the function number and header data matches */
if ((FunctionNumber == PdoExtension->Slot.u.AsULONG) &&
(PdoExtension->VendorId == PciData->VendorID) &&
(PdoExtension->DeviceId == PciData->DeviceID) &&
(PdoExtension->RevisionId == PciData->RevisionID))
{
/* This is considered to be the same PDO */
break;
}
}
}
/* Was this a low-IRQL call? */
if (Irql < DISPATCH_LEVEL)
{
/* Release this device's lock */
KeSetEvent(&DeviceExtension->ChildListLock, IO_NO_INCREMENT, FALSE);
KeLeaveCriticalRegion();
}
/* If the search found something, this is non-NULL, otherwise it's NULL */
return PdoExtension;
}
BOOLEAN
NTAPI
PciIsDeviceOnDebugPath(IN PPCI_PDO_EXTENSION DeviceExtension)
{
PAGED_CODE();
/* Check for too many, or no, debug ports */
ASSERT(PciDebugPortsCount <= MAX_DEBUGGING_DEVICES_SUPPORTED);
if (!PciDebugPortsCount) return FALSE;
/* eVb has not been able to test such devices yet */
UNIMPLEMENTED;
while (TRUE);
}
NTSTATUS
NTAPI
PciGetBiosConfig(IN PPCI_PDO_EXTENSION DeviceExtension,
OUT PPCI_COMMON_HEADER PciData)
{
HANDLE KeyHandle, SubKeyHandle;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName, KeyValue;
WCHAR Buffer[32];
WCHAR DataBuffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + PCI_COMMON_HDR_LENGTH];
PKEY_VALUE_PARTIAL_INFORMATION PartialInfo = (PVOID)DataBuffer;
NTSTATUS Status;
ULONG ResultLength;
PAGED_CODE();
/* Open the PCI key */
Status = IoOpenDeviceRegistryKey(DeviceExtension->ParentFdoExtension->
PhysicalDeviceObject,
TRUE,
KEY_ALL_ACCESS,
&KeyHandle);
if (!NT_SUCCESS(Status)) return Status;
/* Create a volatile BIOS configuration key */
RtlInitUnicodeString(&KeyName, L"BiosConfig");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_KERNEL_HANDLE,
KeyHandle,
NULL);
Status = ZwCreateKey(&SubKeyHandle,
KEY_READ,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE,
NULL);
ZwClose(KeyHandle);
if (!NT_SUCCESS(Status)) return Status;
/* Create the key value based on the device and function number */
swprintf(Buffer,
L"DEV_%02x&FUN_%02x",
DeviceExtension->Slot.u.bits.DeviceNumber,
DeviceExtension->Slot.u.bits.FunctionNumber);
RtlInitUnicodeString(&KeyValue, Buffer);
/* Query the value information (PCI BIOS configuration header) */
Status = ZwQueryValueKey(SubKeyHandle,
&KeyValue,
KeyValuePartialInformation,
PartialInfo,
sizeof(DataBuffer),
&ResultLength);
ZwClose(SubKeyHandle);
if (!NT_SUCCESS(Status)) return Status;
/* If any information was returned, go ahead and copy its data */
ASSERT(PartialInfo->DataLength == PCI_COMMON_HDR_LENGTH);
RtlCopyMemory(PciData, PartialInfo->Data, PCI_COMMON_HDR_LENGTH);
return Status;
}
NTSTATUS
NTAPI
PciSaveBiosConfig(IN PPCI_PDO_EXTENSION DeviceExtension,
IN PPCI_COMMON_HEADER PciData)
{
HANDLE KeyHandle, SubKeyHandle;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName, KeyValue;
WCHAR Buffer[32];
NTSTATUS Status;
PAGED_CODE();
/* Open the PCI key */
Status = IoOpenDeviceRegistryKey(DeviceExtension->ParentFdoExtension->
PhysicalDeviceObject,
TRUE,
KEY_READ | KEY_WRITE,
&KeyHandle);
if (!NT_SUCCESS(Status)) return Status;
/* Create a volatile BIOS configuration key */
RtlInitUnicodeString(&KeyName, L"BiosConfig");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_KERNEL_HANDLE,
KeyHandle,
NULL);
Status = ZwCreateKey(&SubKeyHandle,
KEY_READ | KEY_WRITE,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE,
NULL);
ZwClose(KeyHandle);
if (!NT_SUCCESS(Status)) return Status;
/* Create the key value based on the device and function number */
swprintf(Buffer,
L"DEV_%02x&FUN_%02x",
DeviceExtension->Slot.u.bits.DeviceNumber,
DeviceExtension->Slot.u.bits.FunctionNumber);
RtlInitUnicodeString(&KeyValue, Buffer);
/* Set the value data (the PCI BIOS configuration header) */
Status = ZwSetValueKey(SubKeyHandle,
&KeyValue,
0,
REG_BINARY,
PciData,
PCI_COMMON_HDR_LENGTH);
ZwClose(SubKeyHandle);
return Status;
}
UCHAR
NTAPI
PciReadDeviceCapability(IN PPCI_PDO_EXTENSION DeviceExtension,
IN UCHAR Offset,
IN ULONG CapabilityId,
OUT PPCI_CAPABILITIES_HEADER Buffer,
IN ULONG Length)
{
ULONG CapabilityCount = 0;
/* If the device has no capabilility list, fail */
if (!Offset) return 0;
/* Validate a PDO with capabilities, a valid buffer, and a valid length */
ASSERT(DeviceExtension->ExtensionType == PciPdoExtensionType);
ASSERT(DeviceExtension->CapabilitiesPtr != 0);
ASSERT(Buffer);
ASSERT(Length >= sizeof(PCI_CAPABILITIES_HEADER));
/* Loop all capabilities */
while (Offset)
{
/* Make sure the pointer is spec-aligned and spec-sized */
ASSERT((Offset >= PCI_COMMON_HDR_LENGTH) && ((Offset & 0x3) == 0));
/* Read the capability header */
PciReadDeviceConfig(DeviceExtension,
Buffer,
Offset,
sizeof(PCI_CAPABILITIES_HEADER));
/* Check if this is the capability being looked up */
if ((Buffer->CapabilityID == CapabilityId) || !(CapabilityId))
{
/* Check if was at a valid offset and length */
if ((Offset) && (Length > sizeof(PCI_CAPABILITIES_HEADER)))
{
/* Sanity check */
ASSERT(Length <= (sizeof(PCI_COMMON_CONFIG) - Offset));
/* Now read the whole capability data into the buffer */
PciReadDeviceConfig(DeviceExtension,
(PVOID)((ULONG_PTR)Buffer +
sizeof(PCI_CAPABILITIES_HEADER)),
Offset + sizeof(PCI_CAPABILITIES_HEADER),
Length - sizeof(PCI_CAPABILITIES_HEADER));
}
/* Return the offset where the capability was found */
return Offset;
}
/* Try the next capability instead */
CapabilityCount++;
Offset = Buffer->Next;
/* There can't be more than 48 capabilities (256 bytes max) */
if (CapabilityCount > 48)
{
/* Fail, since this is basically a broken PCI device */
DPRINT1("PCI device %p capabilities list is broken.\n", DeviceExtension);
return 0;
}
}
/* Capability wasn't found, fail */
return 0;
}
BOOLEAN
NTAPI
PciCanDisableDecodes(IN PPCI_PDO_EXTENSION DeviceExtension,
IN PPCI_COMMON_HEADER Config,
IN ULONGLONG HackFlags,
IN BOOLEAN ForPowerDown)
{
UCHAR BaseClass, SubClass;
BOOLEAN IsVga;
/* Is there a device extension or should the PCI header be used? */
if (DeviceExtension)
{
/* Never disable decodes for a debug PCI Device */
if (DeviceExtension->OnDebugPath) return FALSE;
/* Hack flags will be obtained from the extension, not the caller */
ASSERT(HackFlags == 0);
/* Get hacks and classification from the device extension */
HackFlags = DeviceExtension->HackFlags;
SubClass = DeviceExtension->SubClass;
BaseClass = DeviceExtension->BaseClass;
}
else
{
/* There must be a PCI header, go read the classification information */
ASSERT(Config != NULL);
BaseClass = Config->BaseClass;
SubClass = Config->SubClass;
}
/* Check for hack flags that prevent disabling the decodes */
if (HackFlags & (PCI_HACK_PRESERVE_COMMAND |
PCI_HACK_CB_SHARE_CMD_BITS |
PCI_HACK_DONT_DISABLE_DECODES))
{
/* Don't do it */
return FALSE;
}
/* Is this a VGA adapter? */
if ((BaseClass == PCI_CLASS_DISPLAY_CTLR) &&
(SubClass == PCI_SUBCLASS_VID_VGA_CTLR))
{
/* Never disable decodes if this is for power down */
return ForPowerDown;
}
/* Check for legacy devices */
if (BaseClass == PCI_CLASS_PRE_20)
{
/* Never disable video adapter cards if this is for power down */
if (SubClass == PCI_SUBCLASS_PRE_20_VGA) return ForPowerDown;
}
else if (BaseClass == PCI_CLASS_DISPLAY_CTLR)
{
/* Never disable VGA adapters if this is for power down */
if (SubClass == PCI_SUBCLASS_VID_VGA_CTLR) return ForPowerDown;
}
else if (BaseClass == PCI_CLASS_BRIDGE_DEV)
{
/* Check for legacy bridges */
if ((SubClass == PCI_SUBCLASS_BR_ISA) ||
(SubClass == PCI_SUBCLASS_BR_EISA) ||
(SubClass == PCI_SUBCLASS_BR_MCA) ||
(SubClass == PCI_SUBCLASS_BR_HOST) ||
(SubClass == PCI_SUBCLASS_BR_OTHER))
{
/* Never disable these */
return FALSE;
}
else if ((SubClass == PCI_SUBCLASS_BR_PCI_TO_PCI) ||
(SubClass == PCI_SUBCLASS_BR_CARDBUS))
{
/* This is a supported bridge, but does it have a VGA card? */
if (!DeviceExtension)
{
/* Read the bridge control flag from the PCI header */
IsVga = Config->u.type1.BridgeControl & PCI_ENABLE_BRIDGE_VGA;
}
else
{
/* Read the cached flag in the device extension */
IsVga = DeviceExtension->Dependent.type1.VgaBitSet;
}
/* Never disable VGA adapters if this is for power down */
if (IsVga) return ForPowerDown;
}
}
/* Finally, never disable decodes if there's no power management */
return !(HackFlags & PCI_HACK_NO_PM_CAPS);
}
ULONG_PTR
NTAPI
PciExecuteCriticalSystemRoutine(IN ULONG_PTR IpiContext)
{
PPCI_IPI_CONTEXT Context = (PPCI_IPI_CONTEXT)IpiContext;
/* Check if the IPI is already running */
if (!InterlockedDecrement(&Context->RunCount))
{
/* Nope, this is the first instance, so execute the IPI function */
Context->Function(Context->PdoExtension, Context->Context);
/* Notify anyone that was spinning that they can stop now */
Context->Barrier = 0;
}
else
{
/* Spin until it has finished running */
while (Context->Barrier);
}
/* Done */
return 0;
}
BOOLEAN
NTAPI
PciIsSlotPresentInParentMethod(IN PPCI_PDO_EXTENSION PdoExtension,
IN ULONG Method)
{
BOOLEAN FoundSlot;
PACPI_METHOD_ARGUMENT Argument;
ACPI_EVAL_INPUT_BUFFER InputBuffer;
PACPI_EVAL_OUTPUT_BUFFER OutputBuffer;
ULONG i, Length;
NTSTATUS Status;
PAGED_CODE();
/* Assume slot is not part of the parent method */
FoundSlot = FALSE;
/* Allocate a 2KB buffer for the method return parameters */
Length = sizeof(ACPI_EVAL_OUTPUT_BUFFER) + 2048;
OutputBuffer = ExAllocatePoolWithTag(PagedPool, Length, 'BicP');
if (OutputBuffer)
{
/* Clear out the output buffer */
RtlZeroMemory(OutputBuffer, Length);
/* Initialize the input buffer with the method requested */
InputBuffer.Signature = 0;
*(PULONG)InputBuffer.MethodName = Method;
InputBuffer.Signature = ACPI_EVAL_INPUT_BUFFER_SIGNATURE;
/* Send it to the ACPI driver */
Status = PciSendIoctl(PdoExtension->ParentFdoExtension->PhysicalDeviceObject,
IOCTL_ACPI_EVAL_METHOD,
&InputBuffer,
sizeof(ACPI_EVAL_INPUT_BUFFER),
OutputBuffer,
Length);
if (NT_SUCCESS(Status))
{
/* Scan all output arguments */
for (i = 0; i < OutputBuffer->Count; i++)
{
/* Make sure it's an integer */
Argument = &OutputBuffer->Argument[i];
if (Argument->Type != ACPI_METHOD_ARGUMENT_INTEGER) continue;
/* Check if the argument matches this PCI slot structure */
if (Argument->Argument == ((PdoExtension->Slot.u.bits.DeviceNumber) |
((PdoExtension->Slot.u.bits.FunctionNumber) << 16)))
{
/* This slot has been found, return it */
FoundSlot = TRUE;
break;
}
}
}
/* Finished with the buffer, free it */
ExFreePoolWithTag(OutputBuffer, 0);
}
/* Return if the slot was found */
return FoundSlot;
}
VOID
NTAPI
PciDecodeEnable(IN PPCI_PDO_EXTENSION PdoExtension,
IN BOOLEAN Enable,
OUT PUSHORT Command)
{
USHORT CommandValue;
/*
* If decodes are being disabled, make sure it's allowed, and in both cases,
* make sure that a hackflag isn't preventing touching the decodes at all.
*/
if (((Enable) || (PciCanDisableDecodes(PdoExtension, 0, 0, 0))) &&
!(PdoExtension->HackFlags & PCI_HACK_PRESERVE_COMMAND))
{
/* Did the caller already have a command word? */
if (Command)
{
/* Use the caller's */
CommandValue = *Command;
}
else
{
/* Otherwise, read the current command */
PciReadDeviceConfig(PdoExtension,
&Command,
FIELD_OFFSET(PCI_COMMON_HEADER, Command),
sizeof(USHORT));
}
/* Turn off decodes by default */
CommandValue &= ~(PCI_ENABLE_IO_SPACE |
PCI_ENABLE_MEMORY_SPACE |
PCI_ENABLE_BUS_MASTER);
/* If requested, enable the decodes that were enabled at init time */
if (Enable) CommandValue |= PdoExtension->CommandEnables &
(PCI_ENABLE_IO_SPACE |
PCI_ENABLE_MEMORY_SPACE |
PCI_ENABLE_BUS_MASTER);
/* Update the command word */
PciWriteDeviceConfig(PdoExtension,
&CommandValue,
FIELD_OFFSET(PCI_COMMON_HEADER, Command),
sizeof(USHORT));
}
}
/* EOF */

View file

@ -137,7 +137,7 @@ VideoPortEnableInterrupt(IN PVOID HwDeviceExtension)
#else
/* FIXME: Function still present? If so what to use instead of HalEnableSystemInterrupt? */
UNIMPLEMENTED;
return ERROR_INVALID_ACCESS;
return ERROR_INVALID_FUNCTION;
#endif
}
@ -168,6 +168,6 @@ VideoPortDisableInterrupt(IN PVOID HwDeviceExtension)
#else
/* FIXME: Function still present? If so what to use instead of HalDisableSystemInterrupt? */
UNIMPLEMENTED;
return ERROR_INVALID_ACCESS;
return ERROR_INVALID_FUNCTION;
#endif
}

View file

@ -122,7 +122,7 @@ HalpFindBusAddressTranslation(IN PHYSICAL_ADDRESS BusAddress,
*/
NTSTATUS
NTAPI
HalAdjustResourceList(IN PCM_RESOURCE_LIST Resources)
HalAdjustResourceList(IN OUT PIO_RESOURCE_REQUIREMENTS_LIST* pRequirementsList)
{
/* Deprecated, return success */
return STATUS_SUCCESS;

View file

@ -84,15 +84,15 @@ extern "C" {
#endif
#ifndef NO_OLDNAMES
_CRTIMP _CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s) _CRTIMP char *__cdecl cgets(char *_Buffer);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_cprintf) _CRTIMP int __cdecl cprintf(const char *_Format,...);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_cputs) _CRTIMP int __cdecl cputs(const char *_Str);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_cscanf) _CRTIMP int __cdecl cscanf(const char *_Format,...);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_getch) _CRTIMP int __cdecl getch(void);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_getche) _CRTIMP int __cdecl getche(void);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_kbhit) _CRTIMP int __cdecl kbhit(void);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_putch) _CRTIMP int __cdecl putch(int _Ch);
_CRTIMP _CRT_NONSTDC_DEPRECATE(_ungetch) _CRTIMP int __cdecl ungetch(int _Ch);
_CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s) _CRTIMP char *__cdecl cgets(char *_Buffer);
_CRT_NONSTDC_DEPRECATE(_cprintf) _CRTIMP int __cdecl cprintf(const char *_Format,...);
_CRT_NONSTDC_DEPRECATE(_cputs) _CRTIMP int __cdecl cputs(const char *_Str);
_CRT_NONSTDC_DEPRECATE(_cscanf) _CRTIMP int __cdecl cscanf(const char *_Format,...);
_CRT_NONSTDC_DEPRECATE(_getch) _CRTIMP int __cdecl getch(void);
_CRT_NONSTDC_DEPRECATE(_getche) _CRTIMP int __cdecl getche(void);
_CRT_NONSTDC_DEPRECATE(_kbhit) _CRTIMP int __cdecl kbhit(void);
_CRT_NONSTDC_DEPRECATE(_putch) _CRTIMP int __cdecl putch(int _Ch);
_CRT_NONSTDC_DEPRECATE(_ungetch) _CRTIMP int __cdecl ungetch(int _Ch);
#if (defined(_X86_) && !defined(__x86_64))
_CRT_NONSTDC_DEPRECATE(_inp) _CRTIMP int __cdecl inp(unsigned short);

View file

@ -7,160 +7,284 @@ extern "C" {
/*** Stack frame juggling ***/
void * _ReturnAddress(void);
#pragma intrinsic(_ReturnAddress)
void * _AddressOfReturnAddress(void);
#pragma intrinsic(_AddressOfReturnAddress)
unsigned int __getcallerseflags(void);
#pragma intrinsic(__getcallerseflags)
/*** Atomic operations ***/
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
void _ReadBarrier(void);
#pragma intrinsic(_ReadBarrier)
void _WriteBarrier(void);
#pragma intrinsic(_WriteBarrier)
char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand);
#pragma intrinsic(_InterlockedCompareExchange8)
short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand);
#pragma intrinsic(_InterlockedCompareExchange16)
long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand);
void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand);
#pragma intrinsic(_InterlockedCompareExchange)
long _InterlockedExchange(volatile long * const Target, const long Value);
void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value);
long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value);
#pragma intrinsic(_InterlockedExchange)
short _InterlockedExchangeAdd16(volatile short * const Addend, const short Value);
#pragma intrinsic(_InterlockedExchangeAdd16)
long _InterlockedExchangeAdd(volatile long * const Addend, const long Value);
#pragma intrinsic(_InterlockedExchangeAdd)
char _InterlockedAnd8(volatile char * const value, const char mask);
#pragma intrinsic(_InterlockedAnd8)
short _InterlockedAnd16(volatile short * const value, const short mask);
#pragma intrinsic(_InterlockedAnd16)
long _InterlockedAnd(volatile long * const value, const long mask);
#pragma intrinsic(_InterlockedAnd)
char _InterlockedOr8(volatile char * const value, const char mask);
#pragma intrinsic(_InterlockedOr8)
short _InterlockedOr16(volatile short * const value, const short mask);
#pragma intrinsic(_InterlockedOr16)
long _InterlockedOr(volatile long * const value, const long mask);
#pragma intrinsic(_InterlockedOr)
char _InterlockedXor8(volatile char * const value, const char mask);
#pragma intrinsic(_InterlockedXor8)
short _InterlockedXor16(volatile short * const value, const short mask);
#pragma intrinsic(_InterlockedXor16)
long _InterlockedXor(volatile long * const value, const long mask);
#pragma intrinsic(_InterlockedXor)
long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value);
#pragma intrinsic(_InterlockedAddLargeStatistic)
long _InterlockedDecrement(volatile long * const lpAddend);
#pragma intrinsic(_InterlockedDecrement)
long _InterlockedIncrement(volatile long * const lpAddend);
#pragma intrinsic(_InterlockedIncrement)
short _InterlockedDecrement16(volatile short * const lpAddend);
#pragma intrinsic(_InterlockedDecrement16)
short _InterlockedIncrement16(volatile short * const lpAddend);
#pragma intrinsic(_InterlockedIncrement16)
unsigned char _interlockedbittestandreset(volatile long * a, const long b);
#pragma intrinsic(_interlockedbittestandreset)
unsigned char _interlockedbittestandset(volatile long * a, const long b);
#pragma intrinsic(_interlockedbittestandset)
#if defined(_M_AMD64)
__int64 _InterlockedExchange64(volatile __int64 * const Target, const __int64 Value);
#pragma intrinsic(_InterlockedExchange64)
__int64 _InterlockedExchangeAdd64(volatile __int64 * const Addend, const __int64 Value);
long _InterlockedAnd64(volatile __int64 * const value, const __int64 mask);
#pragma intrinsic(_InterlockedExchangeAdd64)
void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand);
#pragma intrinsic(_InterlockedCompareExchangePointer)
void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value);
#pragma intrinsic(_InterlockedExchangePointer)
__int64 _InterlockedAnd64(volatile __int64 * const value, const __int64 mask);
#pragma intrinsic(_InterlockedAnd64)
long _InterlockedOr64(volatile __int64 * const value, const __int64 mask);
#pragma intrinsic(_InterlockedOr64)
__int64 _InterlockedCompareExchange64(volatile __int64 * const Destination, const __int64 Exchange, const __int64 Comperand);
#pragma intrinsic(_InterlockedCompareExchange64)
__int64 _InterlockedDecrement64(volatile __int64 * const lpAddend);
#pragma intrinsic(_InterlockedDecrement64)
__int64 _InterlockedIncrement64(volatile __int64 * const lpAddend);
#pragma intrinsic(_InterlockedIncrement64)
unsigned char _interlockedbittestandreset64(volatile __int64 * a, const __int64 b);
#pragma intrinsic(_interlockedbittestandreset64)
unsigned char _interlockedbittestandset64(volatile __int64 * a, const __int64 b);
#pragma intrinsic(_interlockedbittestandset64)
#endif
/*** String operations ***/
void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count);
#pragma intrinsic(__stosb)
void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count);
#pragma intrinsic(__stosw)
void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count);
#pragma intrinsic(__stosd)
void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count);
#pragma intrinsic(__movsb)
void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count);
#pragma intrinsic(__movsw)
void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count);
#pragma intrinsic(__movsd)
#if defined(_M_AMD64)
/*** GS segment addressing ***/
void __writegsbyte(const unsigned long Offset, const unsigned char Data);
#pragma intrinsic(__writegsbyte)
void __writegsword(const unsigned long Offset, const unsigned short Data);
#pragma intrinsic(__writegsword)
void __writegsdword(const unsigned long Offset, const unsigned long Data);
#pragma intrinsic(__writegsdword)
void __writegsqword(const unsigned long Offset, const unsigned __int64 Data);
#pragma intrinsic(__writegsqword)
unsigned char __readgsbyte(const unsigned long Offset);
#pragma intrinsic(__readgsbyte)
unsigned short __readgsword(const unsigned long Offset);
#pragma intrinsic(__readgsword)
unsigned long __readgsdword(const unsigned long Offset);
#pragma intrinsic(__readgsdword)
unsigned __int64 __readgsqword(const unsigned long Offset);
#pragma intrinsic(__readgsqword)
void __incgsbyte(const unsigned long Offset);
#pragma intrinsic(__incgsbyte)
void __incgsword(const unsigned long Offset);
#pragma intrinsic(__incgsword)
void __incgsdword(const unsigned long Offset);
#pragma intrinsic(__incgsdword)
void __addgsbyte(const unsigned long Offset, const unsigned char Data);
#pragma intrinsic(__addgsbyte)
void __addgsword(const unsigned long Offset, const unsigned short Data);
#pragma intrinsic(__addgsword)
void __addgsdword(const unsigned long Offset, const unsigned int Data);
#pragma intrinsic(__addgsdword)
void __addgsqword(const unsigned long Offset, const unsigned __int64 Data);
#pragma intrinsic(__addgsqword)
#endif
#if defined(_M_IX86)
//#if defined(_M_IX86)
/*** FS segment addressing ***/
void __writefsbyte(const unsigned long Offset, const unsigned char Data);
#pragma intrinsic(__writefsbyte)
void __writefsword(const unsigned long Offset, const unsigned short Data);
#pragma intrinsic(__writefsword)
void __writefsdword(const unsigned long Offset, const unsigned long Data);
#pragma intrinsic(__writefsdword)
unsigned char __readfsbyte(const unsigned long Offset);
#pragma intrinsic(__readfsbyte)
unsigned short __readfsword(const unsigned long Offset);
#pragma intrinsic(__readfsword)
unsigned long __readfsdword(const unsigned long Offset);
#pragma intrinsic(__readfsdword)
void __incfsbyte(const unsigned long Offset);
#pragma intrinsic(__incfsbyte)
void __incfsword(const unsigned long Offset);
#pragma intrinsic(__incfsword)
void __incfsdword(const unsigned long Offset);
#pragma intrinsic(__incfsdword)
void __addfsbyte(const unsigned long Offset, const unsigned char Data);
#pragma intrinsic(__addfsbyte)
void __addfsword(const unsigned long Offset, const unsigned short Data);
#pragma intrinsic(__addfsword)
void __addfsdword(const unsigned long Offset, const unsigned int Data);
#endif
#pragma intrinsic(__addfsdword)
//#endif
/*** Bit manipulation ***/
unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask);
#pragma intrinsic(_BitScanForward)
unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask);
#pragma intrinsic(_BitScanReverse)
unsigned char _bittest(const long * const a, const long b);
#pragma intrinsic(_bittest)
unsigned char _bittestandcomplement(long * const a, const long b);
#pragma intrinsic(_bittestandcomplement)
unsigned char _bittestandreset(long * const a, const long b);
#pragma intrinsic(_bittestandreset)
unsigned char _bittestandset(long * const a, const long b);
#pragma intrinsic(_bittestandset)
unsigned char _rotl8(unsigned char value, unsigned char shift);
#pragma intrinsic(_rotl8)
unsigned short _rotl16(unsigned short value, unsigned char shift);
#pragma intrinsic(_rotl16)
unsigned int _rotl(unsigned int value, int shift);
#pragma intrinsic(_rotl)
unsigned int _rotr(unsigned int value, int shift);
#pragma intrinsic(_rotr)
unsigned char _rotr8(unsigned char value, unsigned char shift);
#pragma intrinsic(_rotr8)
unsigned short _rotr16(unsigned short value, unsigned char shift);
#pragma intrinsic(_rotr16)
unsigned __int64 __ll_lshift(const unsigned __int64 Mask, const int Bit);
#pragma intrinsic(__ll_lshift)
__int64 __ll_rshift(const __int64 Mask, const int Bit);
#pragma intrinsic(__ll_rshift)
unsigned __int64 __ull_rshift(const unsigned __int64 Mask, int Bit);
#pragma intrinsic(__ull_rshift)
unsigned short _byteswap_ushort(unsigned short value);
#pragma intrinsic(_byteswap_ushort)
unsigned long _byteswap_ulong(unsigned long value);
#pragma intrinsic(_byteswap_ulong)
unsigned __int64 _byteswap_uint64(unsigned __int64 value);
#pragma intrinsic(_byteswap_uint64)
/*** 64-bit math ***/
__int64 __emul(const int a, const int b);
#pragma intrinsic(__emul)
unsigned __int64 __emulu(const unsigned int a, const unsigned int b);
#pragma intrinsic(__emulu)
/*** Port I/O ***/
unsigned char __inbyte(const unsigned short Port);
#pragma intrinsic(__inbyte)
unsigned short __inword(const unsigned short Port);
#pragma intrinsic(__inword)
unsigned long __indword(const unsigned short Port);
#pragma intrinsic(__indword)
void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count);
#pragma intrinsic(__inbytestring)
void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count);
#pragma intrinsic(__inwordstring)
void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count);
#pragma intrinsic(__indwordstring)
void __outbyte(unsigned short const Port, const unsigned char Data);
#pragma intrinsic(__outbyte)
void __outword(unsigned short const Port, const unsigned short Data);
#pragma intrinsic(__outword)
void __outdword(unsigned short const Port, const unsigned long Data);
#pragma intrinsic(__outdword)
void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count);
#pragma intrinsic(__outbytestring)
void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count);
#pragma intrinsic(__outwordstring)
void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count);
#pragma intrinsic(__outdwordstring)
/*** System information ***/
void __cpuid(int CPUInfo[], const int InfoType);
#pragma intrinsic(__cpuid)
unsigned __int64 __rdtsc(void);
#pragma intrinsic(__rdtsc)
void __writeeflags(uintptr_t Value);
#pragma intrinsic(__writeeflags)
uintptr_t __readeflags(void);
#pragma intrinsic(__readeflags)
/*** Interrupts ***/
void __debugbreak(void);
#pragma intrinsic(__debugbreak)
void __int2c(void);
#pragma intrinsic(__int2c)
void _disable(void);
#pragma intrinsic(_disable)
void _enable(void);
#pragma intrinsic(_enable)
void __halt(void);
#pragma intrinsic(__halt)
/*** Protected memory management ***/
void __writecr0(const unsigned __int64 Data);
#pragma intrinsic(__writecr0)
void __writecr3(const unsigned __int64 Data);
#pragma intrinsic(__writecr3)
void __writecr4(const unsigned __int64 Data);
#pragma intrinsic(__writecr4)
#ifdef _M_AMD64
void __writecr8(const unsigned __int64 Data);
#pragma intrinsic(__writecr8)
unsigned __int64 __readcr0(void);
#pragma intrinsic(__readcr0)
unsigned __int64 __readcr2(void);
#pragma intrinsic(__readcr2)
unsigned __int64 __readcr3(void);
#pragma intrinsic(__readcr3)
unsigned __int64 __readcr4(void);
#pragma intrinsic(__readcr4)
unsigned __int64 __readcr8(void);
#pragma intrinsic(__readcr8)
unsigned __int64 __readdr(unsigned int reg);
#pragma intrinsic(__readdr)
void __writedr(unsigned reg, unsigned __int64 value);
#pragma intrinsic(__writedr)
#else
unsigned long __readcr0(void);
unsigned long __readcr2(void);
@ -171,16 +295,25 @@ void __writedr(unsigned reg, unsigned int value);
#endif
void __invlpg(void * const Address);
#pragma intrinsic(__invlpg)
/*** System operations ***/
unsigned __int64 __readmsr(const int reg);
#pragma intrinsic(__readmsr)
void __writemsr(const unsigned long Register, const unsigned __int64 Value);
#pragma intrinsic(__writemsr)
unsigned __int64 __readpmc(const int counter);
#pragma intrinsic(__readpmc)
unsigned long __segmentlimit(const unsigned long a);
#pragma intrinsic(__segmentlimit)
void __wbinvd(void);
#pragma intrinsic(__wbinvd)
void __lidt(void *Source);
#pragma intrinsic(__lidt)
void __sidt(void *Destination);
#pragma intrinsic(__sidt)
void _mm_pause(void);
#pragma intrinsic(_mm_pause)
#ifdef __cplusplus
}

View file

@ -1,38 +0,0 @@
/*
* netevent.h
*
* Network events
*
* This file is part of the w32api package.
*
* Contributors:
* Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef __NETEVENT_H
#define __NETEVENT_H
#define EVENT_TRANSPORT_REGISTER_FAILED 0xC000232CL
#define EVENT_TRANSPORT_ADAPTER_NOT_FOUND 0xC000232EL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* __NETEVENT_H */

View file

@ -253,7 +253,10 @@ typedef struct _KCALLOUT_FRAME
//
// Dummy LDT_ENTRY
//
#ifndef _LDT_ENTRY_DEFINED
#define _LDT_ENTRY_DEFINED
typedef ULONG LDT_ENTRY;
#endif
//
// GDT Entry Definition
@ -824,9 +827,41 @@ typedef struct _KTSS64
#define PKTSS PKTSS64
//
// i386 CPUs don't have exception frames
// KEXCEPTION_FRAME
//
typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
typedef struct _KEXCEPTION_FRAME
{
UINT64 P1Home;
UINT64 P2Home;
UINT64 P3Home;
UINT64 P4Home;
UINT64 P5;
UINT64 InitialStack;
M128A Xmm6;
M128A Xmm7;
M128A Xmm8;
M128A Xmm9;
M128A Xmm10;
M128A Xmm11;
M128A Xmm12;
M128A Xmm13;
M128A Xmm14;
M128A Xmm15;
UINT64 TrapFrame;
UINT64 CallbackStack;
UINT64 OutputBuffer;
UINT64 OutputLength;
UINT64 MxCsr;
UINT64 Rbp;
UINT64 Rbx;
UINT64 Rdi;
UINT64 Rsi;
UINT64 R12;
UINT64 R13;
UINT64 R14;
UINT64 R15;
UINT64 Return;
} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
//
// Inline function to get current KPRCB

View file

@ -212,6 +212,16 @@ HalSystemVectorDispatchEntry(
OUT PKINTERRUPT_ROUTINE *NoConnection
);
//
// Bus Functions
//
NTHALAPI
NTSTATUS
NTAPI
HalAdjustResourceList(
IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList
);
//
// Environment Functions
//

View file

@ -54,11 +54,11 @@ OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR, 0xA799A801, 0xA46D, 0x11D0, 0xA1, 0x8C, 0
OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO, 0xA799A802, 0xA46D, 0x11D0, 0xA1, 0x8C, 0x00, 0xa0, 0x24, 0x01, 0xDC, 0xD4)
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC, 0x07DAD660, 0x22F1, 0x11D1, 0xa9, 0xF4, 0x00, 0xc0, 0x4F, 0xBB, 0xDE, 0x8F)
OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER, 0x0A4252A0, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00)
OUR_GUID_ENTRY(IID_IKsInterfACeHandler, 0xD3ABC7E0, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96)
OUR_GUID_ENTRY(IID_IKsInterfaceHandler, 0xD3ABC7E0, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96)
OUR_GUID_ENTRY(IID_IKsDataTypeHandler, 0x5FFBAA02, 0x49A3, 0x11D0, 0x9F, 0x36, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xA1)
OUR_GUID_ENTRY(IID_IKsPin, 0xB61178D1, 0xA2D9, 0x11CF, 0x9E, 0x53, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xa1)
OUR_GUID_ENTRY(IID_IKsControl, 0x28F54685, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96)
OUR_GUID_ENTRY(IID_IKsPinFACtory, 0xCD5EBE6B, 0x8B6E, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96)
OUR_GUID_ENTRY(IID_IKsPinFactory, 0xCD5EBE6B, 0x8B6E, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96)
OUR_GUID_ENTRY(AM_INTERFACESETID_Standard, 0x1A8766A0, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00)
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)

649
include/psdk/netevent.h Normal file
View file

@ -0,0 +1,649 @@
/*
* netevent.h
*
* Network events
*
* This file is part of the ReactOS PSDK package.
*
* Contributors:
* Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef __NETEVENT_H
#define __NETEVENT_H
#ifdef __cplusplus
extern "C" {
#endif
#define COULD_NOT_VERIFY_VOLUMES 0xC00037E8L
#define DFS_CONNECTION_FAILURE 0x40003842L
#define DFS_ERROR_ACTIVEDIRECTORY_OFFLINE 0xC00038BBL
#define DFS_ERROR_CLUSTERINFO_FAILED 0xC00038B5L
#define DFS_ERROR_COMPUTERINFO_FAILED 0xC00038B4L
#define DFS_ERROR_CREATEEVENT_FAILED 0xC00038B3L
#define DFS_ERROR_CREATE_REPARSEPOINT_FAILURE 0xC00038A7L
#define DFS_ERROR_CREATE_REPARSEPOINT_SUCCESS 0x400038D2L
#define DFS_ERROR_CROSS_FOREST_TRUST_INFO_FAILED 0xC00038D6L
#define DFS_ERROR_DCINFO_FAILED 0xC00038B6L
#define DFS_ERROR_DSCONNECT_FAILED 0x800038BEL
#define DFS_ERROR_DUPLICATE_LINK 0xC00038D3L
#define DFS_ERROR_HANDLENAMESPACE_FAILED 0xC00038B8L
#define DFS_ERROR_LINKS_OVERLAP 0xC00038D0L
#define DFS_ERROR_LINK_OVERLAP 0xC00038D1L
#define DFS_ERROR_MUTLIPLE_ROOTS_NOT_SUPPORTED 0xC00038C7L
#define DFS_ERROR_NO_DFS_DATA 0xC00038C2L
#define DFS_ERROR_ON_ROOT 0x800038C6L
#define DFS_ERROR_OVERLAPPING_DIRECTORIES 0xC00038A9L
#define DFS_ERROR_PREFIXTABLE_FAILED 0xC00038B7L
#define DFS_ERROR_REFLECTIONENGINE_FAILED 0xC00038BAL
#define DFS_ERROR_REGISTERSTORE_FAILED 0xC00038B9L
#define DFS_ERROR_REMOVE_LINK_FAILED 0xC00038CCL
#define DFS_ERROR_RESYNCHRONIZE_FAILED 0xC00038CBL
#define DFS_ERROR_ROOTSYNCINIT_FAILED 0xC00038B2L
#define DFS_ERROR_SECURITYINIT_FAILED 0xC00038AFL
#define DFS_ERROR_SITECACHEINIT_FAILED 0xC00038B1L
#define DFS_ERROR_SITESUPPOR_FAILED 0xC00038BCL
#define DFS_ERROR_TARGET_LIST_INCORRECT 0xC00038CFL
#define DFS_ERROR_THREADINIT_FAILED 0xC00038B0L
#define DFS_ERROR_TOO_MANY_ERRORS 0xC00038ADL
#define DFS_ERROR_TRUSTED_DOMAIN_INFO_FAILED 0xC00038D4L
#define DFS_ERROR_UNSUPPORTED_FILESYSTEM 0xC00038A8L
#define DFS_ERROR_WINSOCKINIT_FAILED 0xC00038AEL
#define DFS_INFO_ACTIVEDIRECTORY_ONLINE 0x400038ACL
#define DFS_INFO_CROSS_FOREST_TRUST_INFO_SUCCESS 0x400038D7L
#define DFS_INFO_DOMAIN_REFERRAL_MIN_OVERFLOW 0x400038C9L
#define DFS_INFO_DS_RECONNECTED 0x400038C1L
#define DFS_INFO_FINISH_BUILDING_NAMESPACE 0x400038C5L
#define DFS_INFO_FINISH_INIT 0x400038C3L
#define DFS_INFO_RECONNECT_DATA 0x400038C4L
#define DFS_INFO_TRUSTED_DOMAIN_INFO_SUCCESS 0x400038D5L
#define DFS_MAX_DNR_ATTEMPTS 0x40003845L
#define DFS_OPEN_FAILURE 0x40003847L
#define DFS_REFERRAL_FAILURE 0x40003843L
#define DFS_REFERRAL_REQUEST 0x400037EEL
#define DFS_REFERRAL_SUCCESS 0x40003844L
#define DFS_SPECIAL_REFERRAL_FAILURE 0x40003846L
#define DFS_WARN_DOMAIN_REFERRAL_OVERFLOW 0x800038C8L
#define DFS_WARN_INCOMPLETE_MOVE 0x800038CAL
#define DFS_WARN_METADATA_LINK_INFO_INVALID 0x800038CEL
#define DFS_WARN_METADATA_LINK_TYPE_INCORRECT 0x800038CDL
#define EVENT_BAD_ACCOUNT_NAME 0xC0001B60L
#define EVENT_BAD_SERVICE_STATE 0xC0001B68L
#define EVENT_BOOT_SYSTEM_DRIVERS_FAILED 0xC0001B72L
#define EVENT_BOWSER_CANT_READ_REGISTRY 0x40001F5DL
#define EVENT_BOWSER_ELECTION_RECEIVED 0x00001F4CL
#define EVENT_BOWSER_ELECTION_SENT_FIND_MASTER_FAILED 0x40001F4EL
#define EVENT_BOWSER_ELECTION_SENT_GETBLIST_FAILED 0x40001F4DL
#define EVENT_BOWSER_GETBROWSERLIST_THRESHOLD_EXCEEDED 0x40001F5FL
#define EVENT_BOWSER_ILLEGAL_DATAGRAM 0x80001F46L
#define EVENT_BOWSER_ILLEGAL_DATAGRAM_THRESHOLD 0xC0001F50L
#define EVENT_BOWSER_MAILSLOT_DATAGRAM_THRESHOLD_EXCEEDED 0x40001F5EL
#define EVENT_BOWSER_NAME_CONVERSION_FAILED 0xC0001F4AL
#define EVENT_BOWSER_NON_MASTER_MASTER_ANNOUNCE 0x80001F45L
#define EVENT_BOWSER_NON_PDC_WON_ELECTION 0x40001F5CL
#define EVENT_BOWSER_OLD_BACKUP_FOUND 0x40001F58L
#define EVENT_BOWSER_OTHER_MASTER_ON_NET 0xC0001F43L
#define EVENT_BOWSER_PDC_LOST_ELECTION 0x40001F5BL
#define EVENT_BOWSER_PROMOTED_WHILE_ALREADY_MASTER 0x80001F44L
#define EVENT_BRIDGE_ADAPTER_BIND_FAILED 0xC0003970L
#define EVENT_BRIDGE_ADAPTER_FILTER_FAILED 0xC000396EL
#define EVENT_BRIDGE_ADAPTER_LINK_SPEED_QUERY_FAILED 0xC000396CL
#define EVENT_BRIDGE_ADAPTER_MAC_ADDR_QUERY_FAILED 0xC000396DL
#define EVENT_BRIDGE_ADAPTER_NAME_QUERY_FAILED 0xC000396FL
#define EVENT_BRIDGE_BUFFER_POOL_CREATION_FAILED 0xC0003912L
#define EVENT_BRIDGE_DEVICE_CREATION_FAILED 0xC000390BL
#define EVENT_BRIDGE_ETHERNET_NOT_OFFERED 0xC000390EL
#define EVENT_BRIDGE_INIT_MALLOC_FAILED 0xC0003913L
#define EVENT_BRIDGE_MINIPORT_INIT_FAILED 0xC000390DL
#define EVENT_BRIDGE_MINIPORT_REGISTER_FAILED 0xC000390AL
#define EVENT_BRIDGE_MINIPROT_DEVNAME_MISSING 0xC0003909L
#define EVENT_BRIDGE_NO_BRIDGE_MAC_ADDR 0xC000390CL
#define EVENT_BRIDGE_PACKET_POOL_CREATION_FAILED 0xC0003911L
#define EVENT_BRIDGE_PROTOCOL_REGISTER_FAILED 0xC0003908L
#define EVENT_BRIDGE_THREAD_CREATION_FAILED 0xC000390FL
#define EVENT_BRIDGE_THREAD_REF_FAILED 0xC0003910L
#define EVENT_BROWSER_BACKUP_STOPPED 0xC0001F60L
#define EVENT_BROWSER_DEPENDANT_SERVICE_FAILED 0xC0001F51L
#define EVENT_BROWSER_DOMAIN_LIST_FAILED 0x80001F56L
#define EVENT_BROWSER_DOMAIN_LIST_RETRIEVED 0x00001F5AL
#define EVENT_BROWSER_ELECTION_SENT_LANMAN_NT_STARTED 0x40001F4FL
#define EVENT_BROWSER_ELECTION_SENT_LANMAN_NT_STOPPED 0x40001F61L
#define EVENT_BROWSER_ELECTION_SENT_ROLE_CHANGED 0x40001F63L
#define EVENT_BROWSER_GETBLIST_RECEIVED_NOT_MASTER 0xC0001F62L
#define EVENT_BROWSER_ILLEGAL_CONFIG 0x80001F57L
#define EVENT_BROWSER_MASTER_PROMOTION_FAILED 0xC0001F49L
#define EVENT_BROWSER_MASTER_PROMOTION_FAILED_NO_MASTER 0xC0001F54L
#define EVENT_BROWSER_MASTER_PROMOTION_FAILED_STOPPING 0xC0001F53L
#define EVENT_BROWSER_NOT_STARTED_IPX_CONFIG_MISMATCH 0xC0001F64L
#define EVENT_BROWSER_OTHERDOMAIN_ADD_FAILED 0xC0001F4BL
#define EVENT_BROWSER_ROLE_CHANGE_FAILED 0xC0001F48L
#define EVENT_BROWSER_SERVER_LIST_FAILED 0x80001F55L
#define EVENT_BROWSER_SERVER_LIST_RETRIEVED 0x00001F59L
#define EVENT_BROWSER_STATUS_BITS_UPDATE_FAILED 0xC0001F47L
#define EVENT_CALL_TO_FUNCTION_FAILED 0xC0001B5DL
#define EVENT_CALL_TO_FUNCTION_FAILED_II 0xC0001B5EL
#define EVENT_CIRCULAR_DEPENDENCY_AUTO 0xC0001B6AL
#define EVENT_CIRCULAR_DEPENDENCY_DEMAND 0xC0001B69L
#define EVENT_COMMAND_NOT_INTERACTIVE 0xC0001EDCL
#define EVENT_COMMAND_START_FAILED 0xC0001EDDL
#define EVENT_CONNECTION_TIMEOUT 0xC0001B61L
#define EVENT_ComputerNameChange 0x8000177BL
#define EVENT_DAV_REDIR_DELAYED_WRITE_FAILED 0x800039D0L
#define EVENT_DCOM_ASSERTION_FAILURE 0xC000271CL
#define EVENT_DCOM_COMPLUS_DISABLED 0xC000271EL
#define EVENT_DCOM_INVALID_ENDPOINT_DATA 0xC000271DL
#define EVENT_DEPEND_ON_LATER_GROUP 0xC0001B6CL
#define EVENT_DEPEND_ON_LATER_SERVICE 0xC0001B6BL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_NOTSUPP 0x80002BAEL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_NOTSUPP_PRIMARY_DN 0x80002BBAL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_OTHER 0x80002BB1L
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_OTHER_PRIMARY_DN 0x80002BBDL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_REFUSED 0x80002BAFL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_REFUSED_PRIMARY_DN 0x80002BBBL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_SECURITY 0x80002BB0L
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_SECURITY_PRIMARY_DN 0x80002BBCL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_SERVERFAIL 0x80002BADL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_SERVERFAIL_PRIMARY_DN 0x80002BB9L
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_TIMEOUT 0x80002BACL
#define EVENT_DNSAPI_DEREGISTRATION_FAILED_TIMEOUT_PRIMARY_DN 0x80002BB8L
#define EVENT_DNSAPI_PTR_DEREGISTRATION_FAILED_NOTSUPP 0x80002BB4L
#define EVENT_DNSAPI_PTR_DEREGISTRATION_FAILED_OTHER 0x80002BB7L
#define EVENT_DNSAPI_PTR_DEREGISTRATION_FAILED_REFUSED 0x80002BB5L
#define EVENT_DNSAPI_PTR_DEREGISTRATION_FAILED_SECURITY 0x80002BB6L
#define EVENT_DNSAPI_PTR_DEREGISTRATION_FAILED_SERVERFAIL 0x80002BB3L
#define EVENT_DNSAPI_PTR_DEREGISTRATION_FAILED_TIMEOUT 0x80002BB2L
#define EVENT_DNSAPI_PTR_REGISTRATION_FAILED_NOTSUPP 0x80002B96L
#define EVENT_DNSAPI_PTR_REGISTRATION_FAILED_OTHER 0x80002B99L
#define EVENT_DNSAPI_PTR_REGISTRATION_FAILED_REFUSED 0x80002B97L
#define EVENT_DNSAPI_PTR_REGISTRATION_FAILED_SECURITY 0x80002B98L
#define EVENT_DNSAPI_PTR_REGISTRATION_FAILED_SERVERFAIL 0x80002B95L
#define EVENT_DNSAPI_PTR_REGISTRATION_FAILED_TIMEOUT 0x80002B94L
#define EVENT_DNSAPI_REGISTERED_ADAPTER 0x40002BC0L
#define EVENT_DNSAPI_REGISTERED_ADAPTER_PRIMARY_DN 0x40002BC2L
#define EVENT_DNSAPI_REGISTERED_PTR 0x40002BC1L
#define EVENT_DNSAPI_REGISTRATION_FAILED_NOTSUPP 0x80002B90L
#define EVENT_DNSAPI_REGISTRATION_FAILED_NOTSUPP_PRIMARY_DN 0x80002B9CL
#define EVENT_DNSAPI_REGISTRATION_FAILED_OTHER 0x80002B93L
#define EVENT_DNSAPI_REGISTRATION_FAILED_OTHER_PRIMARY_DN 0x80002B9FL
#define EVENT_DNSAPI_REGISTRATION_FAILED_REFUSED 0x80002B91L
#define EVENT_DNSAPI_REGISTRATION_FAILED_REFUSED_PRIMARY_DN 0x80002B9DL
#define EVENT_DNSAPI_REGISTRATION_FAILED_SECURITY 0x80002B92L
#define EVENT_DNSAPI_REGISTRATION_FAILED_SECURITY_PRIMARY_DN 0x80002B9EL
#define EVENT_DNSAPI_REGISTRATION_FAILED_SERVERFAIL 0x80002B8FL
#define EVENT_DNSAPI_REGISTRATION_FAILED_SERVERFAIL_PRIMARY_DN 0x80002B9BL
#define EVENT_DNSAPI_REGISTRATION_FAILED_TIMEOUT 0x80002B8EL
#define EVENT_DNSAPI_REGISTRATION_FAILED_TIMEOUT_PRIMARY_DN 0x80002B9AL
#define EVENT_DNSDomainNameChange 0x8000177CL
#define EVENT_DNS_CACHE_NETWORK_PERF_WARNING 0x80002B2AL
#define EVENT_DNS_CACHE_START_FAILURE_LOW_MEMORY 0xC0002AFFL
#define EVENT_DNS_CACHE_START_FAILURE_NO_CONTROL 0xC0002AFAL
#define EVENT_DNS_CACHE_START_FAILURE_NO_DLL 0xC0002AF8L
#define EVENT_DNS_CACHE_START_FAILURE_NO_DONE_EVENT 0xC0002AFBL
#define EVENT_DNS_CACHE_START_FAILURE_NO_ENTRY 0xC0002AF9L
#define EVENT_DNS_CACHE_START_FAILURE_NO_RPC 0xC0002AFCL
#define EVENT_DNS_CACHE_START_FAILURE_NO_SHUTDOWN_NOTIFY 0xC0002AFDL
#define EVENT_DNS_CACHE_START_FAILURE_NO_UPDATE 0xC0002AFEL
#define EVENT_DNS_CACHE_UNABLE_TO_REACH_SERVER_WARNING 0x80002B2BL
#define EVENT_EQOS_ERROR_MACHINE_POLICY_KEYNAME_SIZE_ZERO 0xC0004142L
#define EVENT_EQOS_ERROR_MACHINE_POLICY_KEYNAME_TOO_LONG 0xC0004140L
#define EVENT_EQOS_ERROR_MACHINE_POLICY_REFERESH 0xC000413CL
#define EVENT_EQOS_ERROR_OPENING_MACHINE_POLICY_ROOT_KEY 0xC000413EL
#define EVENT_EQOS_ERROR_OPENING_MACHINE_POLICY_SUBKEY 0xC0004144L
#define EVENT_EQOS_ERROR_OPENING_USER_POLICY_ROOT_KEY 0xC000413FL
#define EVENT_EQOS_ERROR_OPENING_USER_POLICY_SUBKEY 0xC0004145L
#define EVENT_EQOS_ERROR_PROCESSING_MACHINE_POLICY_FIELD 0xC0004146L
#define EVENT_EQOS_ERROR_PROCESSING_USER_POLICY_FIELD 0xC0004147L
#define EVENT_EQOS_ERROR_SETTING_APP_MARKING 0xC0004149L
#define EVENT_EQOS_ERROR_SETTING_TCP_AUTOTUNING 0xC0004148L
#define EVENT_EQOS_ERROR_USER_POLICY_KEYNAME_SIZE_ZERO 0xC0004143L
#define EVENT_EQOS_ERROR_USER_POLICY_KEYNAME_TOO_LONG 0xC0004141L
#define EVENT_EQOS_ERROR_USER_POLICY_REFERESH 0xC000413DL
#define EVENT_EQOS_INFO_APP_MARKING_ALLOWED 0x4000407FL
#define EVENT_EQOS_INFO_APP_MARKING_IGNORED 0x4000407EL
#define EVENT_EQOS_INFO_APP_MARKING_NOT_CONFIGURED 0x4000407DL
#define EVENT_EQOS_INFO_LOCAL_SETTING_DONT_USE_NLA 0x40004080L
#define EVENT_EQOS_INFO_MACHINE_POLICY_REFRESH_NO_CHANGE 0x40004074L
#define EVENT_EQOS_INFO_MACHINE_POLICY_REFRESH_WITH_CHANGE 0x40004075L
#define EVENT_EQOS_INFO_TCP_AUTOTUNING_HIGHLY_RESTRICTED 0x4000407AL
#define EVENT_EQOS_INFO_TCP_AUTOTUNING_NORMAL 0x4000407CL
#define EVENT_EQOS_INFO_TCP_AUTOTUNING_NOT_CONFIGURED 0x40004078L
#define EVENT_EQOS_INFO_TCP_AUTOTUNING_OFF 0x40004079L
#define EVENT_EQOS_INFO_TCP_AUTOTUNING_RESTRICTED 0x4000407BL
#define EVENT_EQOS_INFO_USER_POLICY_REFRESH_NO_CHANGE 0x40004076L
#define EVENT_EQOS_INFO_USER_POLICY_REFRESH_WITH_CHANGE 0x40004077L
#define EVENT_EQOS_URL_QOS_APPLICATION_CONFLICT 0x40004081L
#define EVENT_EQOS_WARNING_MACHINE_POLICY_CONFLICT 0x800040E0L
#define EVENT_EQOS_WARNING_MACHINE_POLICY_NO_FULLPATH_APPNAME 0x800040E2L
#define EVENT_EQOS_WARNING_MACHINE_POLICY_PROFILE_NOT_SPECIFIED 0x800040DCL
#define EVENT_EQOS_WARNING_MACHINE_POLICY_QUOTA_EXCEEDED 0x800040DEL
#define EVENT_EQOS_WARNING_MACHINE_POLICY_VERSION 0x800040DAL
#define EVENT_EQOS_WARNING_TEST_1 0x800040D8L
#define EVENT_EQOS_WARNING_TEST_2 0x800040D9L
#define EVENT_EQOS_WARNING_USER_POLICY_CONFLICT 0x800040E1L
#define EVENT_EQOS_WARNING_USER_POLICY_NO_FULLPATH_APPNAME 0x800040E3L
#define EVENT_EQOS_WARNING_USER_POLICY_PROFILE_NOT_SPECIFIED 0x800040DDL
#define EVENT_EQOS_WARNING_USER_POLICY_QUOTA_EXCEEDED 0x800040DFL
#define EVENT_EQOS_WARNING_USER_POLICY_VERSION 0x800040DBL
#define EVENT_EventLogProductInfo 0x80001779L
#define EVENT_EventlogAbnormalShutdown 0x80001778L
#define EVENT_EventlogStarted 0x80001775L
#define EVENT_EventlogStopped 0x80001776L
#define EVENT_EventlogUptime 0x8000177DL
#define EVENT_FIRST_LOGON_FAILED 0xC0001B65L
#define EVENT_FIRST_LOGON_FAILED_II 0xC0001B7EL
#define EVENT_FRS_ACCESS_CHECKS_DISABLED 0x800034CDL
#define EVENT_FRS_ACCESS_CHECKS_FAILED_UNKNOWN 0xC00034CFL
#define EVENT_FRS_ACCESS_CHECKS_FAILED_USER 0x800034CEL
#define EVENT_FRS_ASSERT 0xC00034C2L
#define EVENT_FRS_BAD_REG_DATA 0x800034EBL
#define EVENT_FRS_CANNOT_COMMUNICATE 0xC00034C6L
#define EVENT_FRS_CANNOT_CREATE_UUID 0xC00034D4L
#define EVENT_FRS_CANNOT_START_BACKUP_RESTORE_IN_PROGRESS 0xC00034D1L
#define EVENT_FRS_CANT_OPEN_PREINSTALL 0xC00034EFL
#define EVENT_FRS_CANT_OPEN_STAGE 0xC00034EEL
#define EVENT_FRS_DATABASE_SPACE 0xC00034C7L
#define EVENT_FRS_DISK_WRITE_CACHE_ENABLED 0x800034C8L
#define EVENT_FRS_DS_POLL_ERROR_SUMMARY 0x800034FAL
#define EVENT_FRS_DUPLICATE_IN_CXTION 0xC00034F6L
#define EVENT_FRS_DUPLICATE_IN_CXTION_SYSVOL 0xC00034F5L
#define EVENT_FRS_ERROR 0xC00034BCL
#define EVENT_FRS_ERROR_REPLICA_SET_DELETED 0x800034F8L
#define EVENT_FRS_HUGE_FILE 0x800034D3L
#define EVENT_FRS_IN_ERROR_STATE 0xC00034F3L
#define EVENT_FRS_JET_1414 0xC00034C9L
#define EVENT_FRS_JOIN_FAIL_TIME_SKEW 0xC00034ECL
#define EVENT_FRS_LONG_JOIN 0x800034C4L
#define EVENT_FRS_LONG_JOIN_DONE 0x800034C5L
#define EVENT_FRS_MOVED_PREEXISTING 0x800034D0L
#define EVENT_FRS_NO_DNS_ATTRIBUTE 0x800034D5L
#define EVENT_FRS_NO_SID 0xC00034D6L
#define EVENT_FRS_OVERLAPS_LOGGING 0xC00034E5L
#define EVENT_FRS_OVERLAPS_OTHER_STAGE 0xC00034E9L
#define EVENT_FRS_OVERLAPS_ROOT 0xC00034E8L
#define EVENT_FRS_OVERLAPS_STAGE 0xC00034E7L
#define EVENT_FRS_OVERLAPS_WORKING 0xC00034E6L
#define EVENT_FRS_PREPARE_ROOT_FAILED 0xC00034EAL
#define EVENT_FRS_REPLICA_IN_JRNL_WRAP_ERROR 0xC00034F9L
#define EVENT_FRS_REPLICA_NO_ROOT_CHANGE 0xC00034F4L
#define EVENT_FRS_REPLICA_SET_CREATE_FAIL 0xC00034F0L
#define EVENT_FRS_REPLICA_SET_CREATE_OK 0x400034F1L
#define EVENT_FRS_REPLICA_SET_CXTIONS 0x400034F2L
#define EVENT_FRS_RMTCO_TIME_SKEW 0xC00034EDL
#define EVENT_FRS_ROOT_HAS_MOVED 0xC00034F7L
#define EVENT_FRS_ROOT_NOT_VALID 0xC00034E3L
#define EVENT_FRS_STAGE_NOT_VALID 0xC00034E4L
#define EVENT_FRS_STAGING_AREA_FULL 0x800034D2L
#define EVENT_FRS_STARTING 0x400034BDL
#define EVENT_FRS_STOPPED 0x400034BFL
#define EVENT_FRS_STOPPED_ASSERT 0xC00034C1L
#define EVENT_FRS_STOPPED_FORCE 0xC00034C0L
#define EVENT_FRS_STOPPING 0x400034BEL
#define EVENT_FRS_SYSVOL_NOT_READY 0x800034CAL
#define EVENT_FRS_SYSVOL_NOT_READY_PRIMARY 0x800034CBL
#define EVENT_FRS_SYSVOL_READY 0x400034CCL
#define EVENT_FRS_VOLUME_NOT_SUPPORTED 0xC00034C3L
#define EVENT_INVALID_DRIVER_DEPENDENCY 0xC0001B67L
#define EVENT_IPX_CREATE_DEVICE 0xC0002522L
#define EVENT_IPX_ILLEGAL_CONFIG 0x8000251FL
#define EVENT_IPX_INTERNAL_NET_INVALID 0xC0002520L
#define EVENT_IPX_NEW_DEFAULT_TYPE 0x4000251DL
#define EVENT_IPX_NO_ADAPTERS 0xC0002523L
#define EVENT_IPX_NO_FRAME_TYPES 0xC0002521L
#define EVENT_IPX_SAP_ANNOUNCE 0x8000251EL
#define EVENT_NBT_BAD_BACKUP_WINS_ADDR 0x800010D0L
#define EVENT_NBT_BAD_PRIMARY_WINS_ADDR 0x800010D1L
#define EVENT_NBT_CREATE_ADDRESS 0xC00010D3L
#define EVENT_NBT_CREATE_CONNECTION 0xC00010D4L
#define EVENT_NBT_CREATE_DEVICE 0xC00010D7L
#define EVENT_NBT_CREATE_DRIVER 0xC00010CCL
#define EVENT_NBT_DUPLICATE_NAME 0xC00010DFL
#define EVENT_NBT_DUPLICATE_NAME_ERROR 0xC00010E1L
#define EVENT_NBT_NAME_RELEASE 0xC00010E0L
#define EVENT_NBT_NAME_SERVER_ADDRS 0xC00010D2L
#define EVENT_NBT_NON_OS_INIT 0xC00010D5L
#define EVENT_NBT_NO_BACKUP_WINS 0x800010CEL
#define EVENT_NBT_NO_DEVICES 0x800010D8L
#define EVENT_NBT_NO_RESOURCES 0xC00010E2L
#define EVENT_NBT_NO_WINS 0x800010CFL
#define EVENT_NBT_OPEN_REG_LINKAGE 0xC00010D9L
#define EVENT_NBT_OPEN_REG_NAMESERVER 0x800010DCL
#define EVENT_NBT_OPEN_REG_PARAMS 0xC00010CDL
#define EVENT_NBT_READ_BIND 0xC00010DAL
#define EVENT_NBT_READ_EXPORT 0xC00010DBL
#define EVENT_NBT_TIMERS 0xC00010D6L
#define EVENT_NDIS_ADAPTER_CHECK_ERROR 0xC00013A7L
#define EVENT_NDIS_ADAPTER_DISABLED 0x80001396L
#define EVENT_NDIS_ADAPTER_NOT_FOUND 0xC000138BL
#define EVENT_NDIS_BAD_IO_BASE_ADDRESS 0xC0001394L
#define EVENT_NDIS_BAD_VERSION 0xC000138EL
#define EVENT_NDIS_CABLE_DISCONNECTED_ERROR 0x800013A9L
#define EVENT_NDIS_DMA_CONFLICT 0x8000139BL
#define EVENT_NDIS_DRIVER_FAILURE 0xC000138DL
#define EVENT_NDIS_HARDWARE_FAILURE 0xC000138AL
#define EVENT_NDIS_INTERRUPT_CONFLICT 0x8000139AL
#define EVENT_NDIS_INTERRUPT_CONNECT 0xC000138CL
#define EVENT_NDIS_INVALID_DOWNLOAD_FILE_ERROR 0xC000139CL
#define EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER 0xC0001392L
#define EVENT_NDIS_IO_PORT_CONFLICT 0x80001397L
#define EVENT_NDIS_LOBE_FAILUE_ERROR 0x800013A3L
#define EVENT_NDIS_MAXFRAMESIZE_ERROR 0x8000139FL
#define EVENT_NDIS_MAXINTERNALBUFS_ERROR 0x800013A0L
#define EVENT_NDIS_MAXMULTICAST_ERROR 0x800013A1L
#define EVENT_NDIS_MAXRECEIVES_ERROR 0x8000139DL
#define EVENT_NDIS_MAXTRANSMITS_ERROR 0x8000139EL
#define EVENT_NDIS_MEMORY_CONFLICT 0x80001399L
#define EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER 0xC0001393L
#define EVENT_NDIS_NETWORK_ADDRESS 0xC0001390L
#define EVENT_NDIS_OUT_OF_RESOURCE 0xC0001389L
#define EVENT_NDIS_PORT_OR_DMA_CONFLICT 0x80001398L
#define EVENT_NDIS_PRODUCTID_ERROR 0x800013A2L
#define EVENT_NDIS_RECEIVE_SPACE_SMALL 0x40001395L
#define EVENT_NDIS_REMOVE_RECEIVED_ERROR 0x800013A5L
#define EVENT_NDIS_RESET_FAILURE_CORRECTION 0x800013AAL
#define EVENT_NDIS_RESET_FAILURE_ERROR 0x800013A8L
#define EVENT_NDIS_RESOURCE_CONFLICT 0xC0001388L
#define EVENT_NDIS_SIGNAL_LOSS_ERROR 0x800013A4L
#define EVENT_NDIS_TIMEOUT 0x8000138FL
#define EVENT_NDIS_TOKEN_RING_CORRECTION 0x400013A6L
#define EVENT_NDIS_UNSUPPORTED_CONFIGURATION 0xC0001391L
#define EVENT_PS_ADMISSIONCONTROL_OVERFLOW 0x8000371FL
#define EVENT_PS_BAD_BESTEFFORT_LIMIT 0x80003714L
#define EVENT_PS_BINDING_FAILED 0xC0003718L
#define EVENT_PS_GPC_REGISTER_FAILED 0xC00036B0L
#define EVENT_PS_INIT_DEVICE_FAILED 0xC000371BL
#define EVENT_PS_MISSING_ADAPTER_REGISTRY_DATA 0xC0003719L
#define EVENT_PS_NETWORK_ADDRESS_FAIL 0xC0003720L
#define EVENT_PS_NO_RESOURCES_FOR_INIT 0xC00036B1L
#define EVENT_PS_QUERY_OID_GEN_LINK_SPEED 0xC0003717L
#define EVENT_PS_QUERY_OID_GEN_MAXIMUM_FRAME_SIZE 0xC0003715L
#define EVENT_PS_QUERY_OID_GEN_MAXIMUM_TOTAL_SIZE 0xC0003716L
#define EVENT_PS_REGISTER_ADDRESS_FAMILY_FAILED 0xC000371AL
#define EVENT_PS_REGISTER_MINIPORT_FAILED 0xC00036B3L
#define EVENT_PS_REGISTER_PROTOCOL_FAILED 0xC00036B2L
#define EVENT_PS_RESOURCE_POOL 0xC000371EL
#define EVENT_PS_WAN_LIMITED_BESTEFFORT 0x8000371DL
#define EVENT_PS_WMI_INSTANCE_NAME_FAILED 0xC000371CL
#define EVENT_RDR_AT_THREAD_MAX 0x80000BD2L
#define EVENT_RDR_CANT_BIND_TRANSPORT 0x80000BD8L
#define EVENT_RDR_CANT_BUILD_SMB_HEADER 0x80000BDBL
#define EVENT_RDR_CANT_CREATE_DEVICE 0x80000BBAL
#define EVENT_RDR_CANT_CREATE_THREAD 0x80000BBBL
#define EVENT_RDR_CANT_GET_SECURITY_CONTEXT 0x80000BDAL
#define EVENT_RDR_CANT_READ_REGISTRY 0x80000BD3L
#define EVENT_RDR_CANT_REGISTER_ADDRESS 0x80000BD9L
#define EVENT_RDR_CANT_SET_THREAD 0x80000BBCL
#define EVENT_RDR_CLOSE_BEHIND 0x80000BC3L
#define EVENT_RDR_CONNECTION 0x80000BCBL
#define EVENT_RDR_CONNECTION_REFERENCE 0x80000BC7L
#define EVENT_RDR_CONTEXTS 0x80000BD0L
#define EVENT_RDR_DELAYED_SET_ATTRIBUTES_FAILED 0x80000BD6L
#define EVENT_RDR_DELETEONCLOSE_FAILED 0x80000BD7L
#define EVENT_RDR_DISPOSITION 0x80000BCFL
#define EVENT_RDR_ENCRYPT 0x80000BCAL
#define EVENT_RDR_FAILED_UNLOCK 0x80000BC1L
#define EVENT_RDR_INVALID_LOCK_REPLY 0x80000BBFL
#define EVENT_RDR_INVALID_OPLOCK 0x80000BC6L
#define EVENT_RDR_INVALID_REPLY 0x80000BBDL
#define EVENT_RDR_INVALID_SMB 0x80000BBEL
#define EVENT_RDR_MAXCMDS 0x80000BCDL
#define EVENT_RDR_OPLOCK_SMB 0x80000BCEL
#define EVENT_RDR_PRIMARY_TRANSPORT_CONNECT_FAILED 0x80000BD5L
#define EVENT_RDR_RESOURCE_SHORTAGE 0x80000BB9L
#define EVENT_RDR_SECURITY_SIGNATURE_MISMATCH 0x80000BDCL
#define EVENT_RDR_SERVER_REFERENCE 0x80000BC8L
#define EVENT_RDR_SMB_REFERENCE 0x80000BC9L
#define EVENT_RDR_TIMEOUT 0x80000BC5L
#define EVENT_RDR_TIMEZONE_BIAS_TOO_LARGE 0x80000BD4L
#define EVENT_RDR_UNEXPECTED_ERROR 0x80000BC4L
#define EVENT_RDR_WRITE_BEHIND_FLUSH_FAILED 0x80000BD1L
#define EVENT_READFILE_TIMEOUT 0xC0001B62L
#define EVENT_REVERTED_TO_LASTKNOWNGOOD 0xC0001B5FL
#define EVENT_RPCSS_ACTIVATION_ERROR 0xC0002717L
#define EVENT_RPCSS_CREATEPROCESS_FAILURE 0xC0002710L
#define EVENT_RPCSS_DEFAULT_LAUNCH_ACCESS_DENIED 0xC0002713L
#define EVENT_RPCSS_LAUNCH_ACCESS_DENIED 0xC0002712L
#define EVENT_RPCSS_REMOTE_SIDE_ERROR 0xC0002716L
#define EVENT_RPCSS_REMOTE_SIDE_ERROR_WITH_FILE 0xC0002718L
#define EVENT_RPCSS_REMOTE_SIDE_UNAVAILABLE 0xC0002719L
#define EVENT_RPCSS_RUNAS_CANT_LOGIN 0xC0002714L
#define EVENT_RPCSS_RUNAS_CREATEPROCESS_FAILURE 0xC0002711L
#define EVENT_RPCSS_SERVER_NOT_RESPONDING 0xC000271BL
#define EVENT_RPCSS_SERVER_START_TIMEOUT 0xC000271AL
#define EVENT_RPCSS_START_SERVICE_FAILURE 0xC0002715L
#define EVENT_RUNNING_LASTKNOWNGOOD 0xC0001B73L
#define EVENT_SCOPE_LABEL_TOO_LONG 0x800010DDL
#define EVENT_SCOPE_TOO_LONG 0x800010DEL
#define EVENT_SECOND_LOGON_FAILED 0xC0001B66L
#define EVENT_SERVICE_CONFIG_BACKOUT_FAILED 0xC0001B7DL
#define EVENT_SERVICE_CONTROL_SUCCESS 0x40001B7BL
#define EVENT_SERVICE_CRASH 0xC0001B77L
#define EVENT_SERVICE_CRASH_NO_ACTION 0xC0001B7AL
#define EVENT_SERVICE_DIFFERENT_PID_CONNECTED 0x80001B7FL
#define EVENT_SERVICE_EXIT_FAILED 0xC0001B6FL
#define EVENT_SERVICE_EXIT_FAILED_SPECIFIC 0xC0001B70L
#define EVENT_SERVICE_LOGON_TYPE_NOT_GRANTED 0xC0001B81L
#define EVENT_SERVICE_NOT_INTERACTIVE 0xC0001B76L
#define EVENT_SERVICE_RECOVERY_FAILED 0xC0001B78L
#define EVENT_SERVICE_SCESRV_FAILED 0xC0001B79L
#define EVENT_SERVICE_SHUTDOWN_FAILED 0xC0001B83L
#define EVENT_SERVICE_START_AT_BOOT_FAILED 0xC0001B71L
#define EVENT_SERVICE_START_FAILED 0xC0001B58L
#define EVENT_SERVICE_START_FAILED_GROUP 0xC0001B5AL
#define EVENT_SERVICE_START_FAILED_II 0xC0001B59L
#define EVENT_SERVICE_START_FAILED_NONE 0xC0001B5BL
#define EVENT_SERVICE_START_HUNG 0xC0001B6EL
#define EVENT_SERVICE_START_TYPE_CHANGED 0x40001B80L
#define EVENT_SERVICE_STATUS_SUCCESS 0x40001B7CL
#define EVENT_SERVICE_STOP_SUCCESS_WITH_REASON 0x40001B82L
#define EVENT_SEVERE_SERVICE_FAILED 0xC0001B6DL
#define EVENT_SRV_CANT_BIND_DUP_NAME 0xC00009C9L
#define EVENT_SRV_CANT_BIND_TO_TRANSPORT 0x800009C8L
#define EVENT_SRV_CANT_CHANGE_DOMAIN_NAME 0x800009D0L
#define EVENT_SRV_CANT_CREATE_DEVICE 0xC00007D2L
#define EVENT_SRV_CANT_CREATE_PROCESS 0xC00007D3L
#define EVENT_SRV_CANT_CREATE_THREAD 0xC00007D4L
#define EVENT_SRV_CANT_GROW_TABLE 0x800007D9L
#define EVENT_SRV_CANT_LOAD_DRIVER 0x800009CCL
#define EVENT_SRV_CANT_MAP_ERROR 0x800009CEL
#define EVENT_SRV_CANT_OPEN_NPFS 0xC00007D7L
#define EVENT_SRV_CANT_RECREATE_SHARE 0x800009CFL
#define EVENT_SRV_CANT_START_SCAVENGER 0xC00007DAL
#define EVENT_SRV_CANT_UNLOAD_DRIVER 0x800009CDL
#define EVENT_SRV_DISK_FULL 0x800007DDL
#define EVENT_SRV_DOS_ATTACK_DETECTED 0x800007E9L
#define EVENT_SRV_INVALID_REGISTRY_VALUE 0x800009CAL
#define EVENT_SRV_INVALID_REQUEST 0xC00007D6L
#define EVENT_SRV_INVALID_SD 0x800009CBL
#define EVENT_SRV_IRP_STACK_SIZE 0xC00007DBL
#define EVENT_SRV_KEY_NOT_CREATED 0xC00009C6L
#define EVENT_SRV_KEY_NOT_FOUND 0xC00009C5L
#define EVENT_SRV_NETWORK_ERROR 0x800007DCL
#define EVENT_SRV_NONPAGED_POOL_LIMIT 0xC00007E1L
#define EVENT_SRV_NO_BLOCKING_IO 0x800007E8L
#define EVENT_SRV_NO_FREE_CONNECTIONS 0x800007E6L
#define EVENT_SRV_NO_FREE_RAW_WORK_ITEM 0x800007E7L
#define EVENT_SRV_NO_NONPAGED_POOL 0xC00007E3L
#define EVENT_SRV_NO_PAGED_POOL 0xC00007E4L
#define EVENT_SRV_NO_TRANSPORTS_BOUND 0xC00009C7L
#define EVENT_SRV_NO_VIRTUAL_MEMORY 0xC00007E0L
#define EVENT_SRV_NO_WORK_ITEM 0x800007E5L
#define EVENT_SRV_OUT_OF_WORK_ITEM_DOS 0x800007EBL
#define EVENT_SRV_PAGED_POOL_LIMIT 0xC00007E2L
#define EVENT_SRV_RESOURCE_SHORTAGE 0xC00007D1L
#define EVENT_SRV_SERVICE_FAILED 0xC00007D0L
#define EVENT_SRV_TOO_MANY_DOS 0x800007EAL
#define EVENT_SRV_TXF_INIT_FAILED 0x800009D1L
#define EVENT_SRV_UNEXPECTED_DISC 0xC00007D5L
#define EVENT_STREAMS_ALLOCB_FAILURE 0x80000FA1L
#define EVENT_STREAMS_ALLOCB_FAILURE_CNT 0x80000FA2L
#define EVENT_STREAMS_ESBALLOC_FAILURE 0x80000FA3L
#define EVENT_STREAMS_ESBALLOC_FAILURE_CNT 0x80000FA4L
#define EVENT_STREAMS_STRLOG 0xC0000FA0L
#define EVENT_TAKE_OWNERSHIP 0xC0001B74L
#define EVENT_TCPIP6_STARTED 0x40000C1CL
#define EVENT_TCPIP_ADAPTER_REG_FAILURE 0xC000105FL
#define EVENT_TCPIP_ADDRESS_CONFLICT1 0xC0001066L
#define EVENT_TCPIP_ADDRESS_CONFLICT2 0xC0001067L
#define EVENT_TCPIP_CREATE_DEVICE_FAILED 0xC0001004L
#define EVENT_TCPIP_DHCP_INIT_FAILED 0x8000105EL
#define EVENT_TCPIP_INVALID_ADDRESS 0xC000105BL
#define EVENT_TCPIP_INVALID_DEFAULT_GATEWAY 0x80001060L
#define EVENT_TCPIP_INVALID_MASK 0xC000105CL
#define EVENT_TCPIP_IPV4_UNINSTALLED 0x4000106BL
#define EVENT_TCPIP_IP_INIT_FAILED 0xC0001064L
#define EVENT_TCPIP_MEDIA_CONNECT 0x40001069L
#define EVENT_TCPIP_MEDIA_DISCONNECT 0x4000106AL
#define EVENT_TCPIP_NO_ADAPTER_RESOURCES 0xC000105DL
#define EVENT_TCPIP_NO_ADDRESS_LIST 0xC0001061L
#define EVENT_TCPIP_NO_BINDINGS 0xC0001063L
#define EVENT_TCPIP_NO_MASK 0xC000105AL
#define EVENT_TCPIP_NO_MASK_LIST 0xC0001062L
#define EVENT_TCPIP_NO_RESOURCES_FOR_INIT 0xC0001005L
#define EVENT_TCPIP_NTE_CONTEXT_LIST_FAILURE 0xC0001068L
#define EVENT_TCPIP_TCP_CONNECT_LIMIT_REACHED 0x80001082L
#define EVENT_TCPIP_TCP_INIT_FAILED 0xC0001081L
#define EVENT_TCPIP_TCP_MPP_ATTACKS_DETECTED 0x80001085L
#define EVENT_TCPIP_TCP_TIME_WAIT_COLLISION 0x80001083L
#define EVENT_TCPIP_TCP_WSD_WS_RESTRICTED 0x80001084L
#define EVENT_TCPIP_TOO_MANY_GATEWAYS 0x80001065L
#define EVENT_TCPIP_TOO_MANY_NETS 0xC0001059L
#define EVENT_TCPIP_UDP_LIMIT_REACHED 0x800010A9L
#define EVENT_TRANSACT_INVALID 0xC0001B64L
#define EVENT_TRANSACT_TIMEOUT 0xC0001B63L
#define EVENT_TRANSPORT_ADAPTER_NOT_FOUND 0xC000232EL
#define EVENT_TRANSPORT_BAD_PROTOCOL 0x40002333L
#define EVENT_TRANSPORT_BINDING_FAILED 0xC000232DL
#define EVENT_TRANSPORT_QUERY_OID_FAILED 0xC0002330L
#define EVENT_TRANSPORT_REGISTER_FAILED 0xC000232CL
#define EVENT_TRANSPORT_RESOURCE_LIMIT 0x8000232AL
#define EVENT_TRANSPORT_RESOURCE_POOL 0x80002329L
#define EVENT_TRANSPORT_RESOURCE_SPECIFIC 0x8000232BL
#define EVENT_TRANSPORT_SET_OID_FAILED 0xC000232FL
#define EVENT_TRANSPORT_TOO_MANY_LINKS 0x40002332L
#define EVENT_TRANSPORT_TRANSFER_DATA 0x40002331L
#define EVENT_TRK_INTERNAL_ERROR 0xC00030D4L
#define EVENT_TRK_SERVICE_CORRUPT_LOG 0xC00030D7L
#define EVENT_TRK_SERVICE_DUPLICATE_VOLIDS 0x400030DBL
#define EVENT_TRK_SERVICE_MOVE_QUOTA_EXCEEDED 0x800030DCL
#define EVENT_TRK_SERVICE_START_FAILURE 0xC00030D6L
#define EVENT_TRK_SERVICE_START_SUCCESS 0x400030D5L
#define EVENT_TRK_SERVICE_VOLUME_CLAIM 0x400030DAL
#define EVENT_TRK_SERVICE_VOLUME_CREATE 0x400030D9L
#define EVENT_TRK_SERVICE_VOL_QUOTA_EXCEEDED 0x800030D8L
#define EVENT_UP_DRIVER_ON_MP 0xC00017D4L
#define EVENT_WEBCLIENT_CLOSE_DELETE_FAILED 0x80003A36L
#define EVENT_WEBCLIENT_CLOSE_PROPPATCH_FAILED 0x80003A37L
#define EVENT_WEBCLIENT_CLOSE_PUT_FAILED 0x80003A35L
#define EVENT_WEBCLIENT_SETINFO_PROPPATCH_FAILED 0x80003A38L
#define EVENT_WMI_CANT_GET_EVENT_DATA 0x80002F49L
#define EVENT_WMI_CANT_OPEN_DEVICE 0xC0002EE0L
#define EVENT_WMI_CANT_RESOLVE_INSTANCE 0x80002F48L
#define EVENT_WMI_INVALID_MOF 0x80002F44L
#define EVENT_WMI_INVALID_REGINFO 0x80002F46L
#define EVENT_WMI_INVALID_REGPATH 0x80002F47L
#define EVENT_WMI_MOF_LOAD_FAILURE 0x80002F45L
#define EVENT_WSK_OWNINGTHREAD_PARAMETER_IGNORED 0xC0003E80L
#define EXTRA_EXIT_POINT 0xC00037DCL
#define EXTRA_EXIT_POINT_DELETED 0xC00037E0L
#define EXTRA_EXIT_POINT_NOT_DELETED 0xC00037E1L
#define EXTRA_VOLUME 0xC00037DFL
#define EXTRA_VOLUME_DELETED 0xC00037E6L
#define EXTRA_VOLUME_NOT_DELETED 0xC00037E7L
#define KNOWLEDGE_INCONSISTENCY_DETECTED 0xC00037E9L
#define LM_REDIR_FAILURE 0x40003841L
#define MACHINE_UNJOINED 0xC00037EDL
#define MISSING_EXIT_POINT 0xC00037DDL
#define MISSING_EXIT_POINT_CREATED 0xC00037E2L
#define MISSING_EXIT_POINT_NOT_CREATED 0xC00037E3L
#define MISSING_VOLUME 0xC00037DEL
#define MISSING_VOLUME_CREATED 0xC00037E4L
#define MISSING_VOLUME_NOT_CREATED 0xC00037E5L
#define NET_DFS_ENUM 0x400038A4L
#define NET_DFS_ENUMEX 0x400038A5L
#define NOT_A_DFS_PATH 0x40003840L
#define NTFRSPRF_COLLECT_RPC_BINDING_ERROR_CONN 0xC00034DCL
#define NTFRSPRF_COLLECT_RPC_BINDING_ERROR_SET 0xC00034DBL
#define NTFRSPRF_COLLECT_RPC_CALL_ERROR_CONN 0xC00034DEL
#define NTFRSPRF_COLLECT_RPC_CALL_ERROR_SET 0xC00034DDL
#define NTFRSPRF_OPEN_RPC_BINDING_ERROR_CONN 0xC00034D8L
#define NTFRSPRF_OPEN_RPC_BINDING_ERROR_SET 0xC00034D7L
#define NTFRSPRF_OPEN_RPC_CALL_ERROR_CONN 0xC00034DAL
#define NTFRSPRF_OPEN_RPC_CALL_ERROR_SET 0xC00034D9L
#define NTFRSPRF_REGISTRY_ERROR_CONN 0xC00034E2L
#define NTFRSPRF_REGISTRY_ERROR_SET 0xC00034E1L
#define NTFRSPRF_VIRTUALALLOC_ERROR_CONN 0xC00034E0L
#define NTFRSPRF_VIRTUALALLOC_ERROR_SET 0xC00034DFL
#define NWSAP_EVENT_BADWANFILTER_VALUE 0xC000214AL
#define NWSAP_EVENT_BIND_FAILED 0xC0002138L
#define NWSAP_EVENT_CARDLISTEVENT_FAIL 0xC000214BL
#define NWSAP_EVENT_CARDMALLOC_FAILED 0xC000213CL
#define NWSAP_EVENT_CREATELPCEVENT_ERROR 0xC0002147L
#define NWSAP_EVENT_CREATELPCPORT_ERROR 0xC0002146L
#define NWSAP_EVENT_GETSOCKNAME_FAILED 0xC0002139L
#define NWSAP_EVENT_HASHTABLE_MALLOC_FAILED 0xC0002144L
#define NWSAP_EVENT_INVALID_FILTERNAME 0x8000214DL
#define NWSAP_EVENT_KEY_NOT_FOUND 0xC0002134L
#define NWSAP_EVENT_LPCHANDLEMEMORY_ERROR 0xC0002149L
#define NWSAP_EVENT_LPCLISTENMEMORY_ERROR 0xC0002148L
#define NWSAP_EVENT_NOCARDS 0xC000213DL
#define NWSAP_EVENT_OPTBCASTINADDR_FAILED 0xC000213BL
#define NWSAP_EVENT_OPTEXTENDEDADDR_FAILED 0xC000213AL
#define NWSAP_EVENT_OPTMAXADAPTERNUM_ERROR 0xC0002153L
#define NWSAP_EVENT_RECVSEM_FAIL 0xC000213FL
#define NWSAP_EVENT_SDMDEVENT_FAIL 0xC000214CL
#define NWSAP_EVENT_SENDEVENT_FAIL 0xC0002140L
#define NWSAP_EVENT_SETOPTBCAST_FAILED 0xC0002137L
#define NWSAP_EVENT_SOCKET_FAILED 0xC0002136L
#define NWSAP_EVENT_STARTLPCWORKER_ERROR 0xC0002145L
#define NWSAP_EVENT_STARTRECEIVE_ERROR 0xC0002141L
#define NWSAP_EVENT_STARTWANCHECK_ERROR 0xC0002152L
#define NWSAP_EVENT_STARTWANWORKER_ERROR 0xC0002151L
#define NWSAP_EVENT_STARTWORKER_ERROR 0xC0002142L
#define NWSAP_EVENT_TABLE_MALLOC_FAILED 0xC0002143L
#define NWSAP_EVENT_THREADEVENT_FAIL 0xC000213EL
#define NWSAP_EVENT_WANBIND_FAILED 0xC0002150L
#define NWSAP_EVENT_WANEVENT_ERROR 0xC0002155L
#define NWSAP_EVENT_WANHANDLEMEMORY_ERROR 0xC0002154L
#define NWSAP_EVENT_WANSEM_FAIL 0xC000214EL
#define NWSAP_EVENT_WANSOCKET_FAILED 0xC000214FL
#define NWSAP_EVENT_WSASTARTUP_FAILED 0xC0002135L
#define PREFIX_MISMATCH 0xC00037EAL
#define PREFIX_MISMATCH_FIXED 0xC00037EBL
#define PREFIX_MISMATCH_NOT_FIXED 0xC00037ECL
#define STATUS_SEVERITY_ERROR 0x3
#define STATUS_SEVERITY_INFORMATIONAL 0x1
#define STATUS_SEVERITY_SUCCESS 0x0
#define STATUS_SEVERITY_WARNING 0x2
#define TITLE_SC_MESSAGE_BOX 0xC0001B75L
#ifdef __cplusplus
}
#endif
#endif /* __NETEVENT_H */

View file

@ -80,6 +80,8 @@ DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
#endif /* defined(DEFINE_GUID) */
#ifndef _WINIOCTL_H
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
#define IOCTL_STORAGE_CHECK_VERIFY \
@ -88,50 +90,55 @@ DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
#define IOCTL_STORAGE_CHECK_VERIFY2 \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MEDIA_REMOVAL \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_EJECT_MEDIA \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_EJECTION_CONTROL \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_FIND_NEW_DEVICES \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_LOAD_MEDIA \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_LOAD_MEDIA2 \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MCN_CONTROL \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MEDIA_REMOVAL \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_PREDICT_FAILURE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_QUERY_PROPERTY \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_RESERVE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RELEASE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RESERVE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_FIND_NEW_DEVICES \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_EJECTION_CONTROL \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MCN_CONTROL \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_RESET_BUS \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_RESET_DEVICE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_PREDICT_FAILURE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WINIOCTL_H */
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_HOTPLUG_INFO \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)
@ -139,10 +146,10 @@ DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
#define IOCTL_STORAGE_SET_HOTPLUG_INFO \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_RESET_BUS \
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_RESET_DEVICE \
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_BREAK_RESERVATION \
@ -157,6 +164,9 @@ DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
#define IOCTL_STORAGE_READ_CAPACITY \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_QUERY_PROPERTY \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0501, METHOD_BUFFERED, FILE_WRITE_ACCESS)
@ -172,12 +182,6 @@ DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME,
#define IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0620, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE \
CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define RECOVERED_WRITES_VALID 0x00000001
#define UNRECOVERED_WRITES_VALID 0x00000002
#define RECOVERED_READS_VALID 0x00000004

View file

@ -153,10 +153,25 @@
#endif /* __ANONYMOUS_DEFINED */
// FIXME
#undef UNALIGNED
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64)
#define ALIGNMENT_MACHINE
#define UNALIGNED __unaligned
#if defined(_WIN64)
#define UNALIGNED64 __unaligned
#else
#define UNALIGNED64
#endif
#else
#undef ALIGNMENT_MACHINE
#define UNALIGNED
#define UNALIGNED64
#endif
#if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED)
#define RESTRICTED_POINTER __restrict
#else
#define RESTRICTED_POINTER
#endif
#define ARGUMENT_PRESENT(ArgumentPointer) \

View file

@ -16,6 +16,8 @@ extern "C" {
#define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
#define CTL_CODE(t,f,m,a) (((t)<<16)|((a)<<14)|((f)<<2)|(m))
#define DEVICE_TYPE_FROM_CTL_CODE(c) (((DWORD)((c)&0xffff0000))>>16)
#ifndef _NTDDSTOR_H_
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
#define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
@ -34,6 +36,8 @@ extern "C" {
#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#define IOCTL_DISK_BASE FILE_DEVICE_DISK
#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE,0,METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE,1,METHOD_BUFFERED,FILE_READ_ACCESS)

View file

@ -42,7 +42,7 @@
#define PCI_HACK_VIDEO_LEGACY_DECODE 0x0000000100000000LL
#define PCI_HACK_FAKE_CLASS_CODE 0x0000000200000000LL
#define PCI_HACK_UNUSED_40000000 0x0000000400000000LL
#define PCI_HACK_UNUSED_80000000 0x0000000800000000LL
#define PCI_HACK_DISABLE_IDE_NATIVE_MODE 0x0000000800000000LL
#define PCI_HACK_FAIL_QUERY_REMOVE 0x0000001000000000LL
#define PCI_HACK_CRITICAL_DEVICE 0x0000002000000000LL
#define PCI_HACK_UNUSED_4000000000 0x0000004000000000LL
@ -50,7 +50,9 @@
#define PCI_HACK_NO_REVISION_AFTER_D3 0x0000010000000000LL
#define PCI_HACK_ENABLE_MSI_MAPPING 0x0000020000000000LL
#define PCI_HACK_DISABLE_PM_DOWNSTREAM_PCI_BRIDGE 0x0000040000000000LL
#define PCI_HACK_DISABLE_HOT_PLUG 0x0000080000000000LL
#define PCI_HACK_IGNORE_AER_CAPABILITY 0x0000100000000000LL
//
// Bit encodes for PCI_COMMON_CONFIG.u.type1.BridgeControl
//

View file

@ -11,9 +11,9 @@ extern LPSTR __mingw_winmain_lpCmdLine;
extern DWORD __mingw_winmain_nShowCmd;
/*ARGSUSED*/
int main (int flags __attribute__ ((__unused__)),
char **cmdline __attribute__ ((__unused__)),
char **inst __attribute__ ((__unused__)))
int main (int __UNUSED_PARAM(flags),
char ** __UNUSED_PARAM(cmdline),
char ** __UNUSED_PARAM(inst))
{
return (int) WinMain (__mingw_winmain_hInstance, NULL,
__mingw_winmain_lpCmdLine, __mingw_winmain_nShowCmd);

View file

@ -16,9 +16,9 @@ extern DWORD __mingw_winmain_nShowCmd;
int wmain (int, wchar_t **, wchar_t **);
/*ARGSUSED*/
int wmain (int flags __attribute__ ((__unused__)),
wchar_t **cmdline __attribute__ ((__unused__)),
wchar_t **inst __attribute__ ((__unused__)))
int wmain (int __UNUSED_PARAM(flags),
wchar_t ** __UNUSED_PARAM(cmdline),
wchar_t ** __UNUSED_PARAM(inst))
{
return (int) wWinMain (__mingw_winmain_hInstance, NULL,
__mingw_winmain_lpCmdLine, __mingw_winmain_nShowCmd);

View file

@ -20,7 +20,6 @@
#include <tchar.h>
#include <sect_attribs.h>
#include <locale.h>
#include <intrin.h>
#ifndef __winitenv
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
@ -52,11 +51,7 @@ extern int * __MINGW_IMP_SYMBOL(_commode);
#define _commode (* __MINGW_IMP_SYMBOL(_commode))
extern int _dowildcard;
#if defined(__GNUC__)
int _MINGW_INSTALL_DEBUG_MATHERR __attribute__((weak)) = 0;
#else
int _MINGW_INSTALL_DEBUG_MATHERR = 0;
#endif
extern int __defaultmatherr;
extern _CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *);
@ -251,7 +246,7 @@ __tmainCRTStartup (void)
#ifdef _MBCS
if (_ismbblead (*lpszCommandLine))
{
if (*lpszCommandLine)
if (lpszCommandLine) /* FIXME: Why this check? Should I check for *lpszCommandLine != 0 too? */
lpszCommandLine++;
}
#endif
@ -463,12 +458,17 @@ static void duplicate_ppstrings (int ac, char ***av)
}
#endif
#ifdef __MINGW_SHOW_INVALID_PARAMETER_EXCEPTION
#define __UNUSED_PARAM_1(x) x
#else
#define __UNUSED_PARAM_1 __UNUSED_PARAM
#endif
static void
__mingw_invalidParameterHandler (const wchar_t *expression __attribute__ ((__unused__)),
const wchar_t *function __attribute__ ((__unused__)),
const wchar_t *file __attribute__ ((__unused__)),
unsigned int line __attribute__ ((__unused__)),
uintptr_t pReserved __attribute__ ((__unused__)))
__mingw_invalidParameterHandler (const wchar_t * __UNUSED_PARAM_1(expression),
const wchar_t * __UNUSED_PARAM_1(function),
const wchar_t * __UNUSED_PARAM_1(file),
unsigned int __UNUSED_PARAM_1(line),
uintptr_t __UNUSED_PARAM(pReserved))
{
#ifdef __MINGW_SHOW_INVALID_PARAMETER_EXCEPTION
wprintf(L"Invalid parameter detected in function %s. File: %s Line: %d\n", function, file, line);

View file

@ -10,9 +10,9 @@
BOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
BOOL WINAPI DllEntryPoint (HANDLE hDllHandle __attribute__ ((__unused__)),
DWORD dwReason __attribute__ ((__unused__)),
LPVOID lpreserved __attribute__ ((__unused__)))
BOOL WINAPI DllEntryPoint (HANDLE __UNUSED_PARAM(hDllHandle),
DWORD __UNUSED_PARAM(dwReason),
LPVOID __UNUSED_PARAM(lpreserved))
{
return TRUE;
}

View file

@ -2,9 +2,9 @@
#define _DECL_DLLMAIN
#include <process.h>
BOOL WINAPI DllMain (HANDLE hDllHandle __attribute__ ((__unused__)),
DWORD dwReason __attribute__ ((__unused__)),
LPVOID lpreserved __attribute__ ((__unused__)))
BOOL WINAPI DllMain (HANDLE __UNUSED_PARAM(hDllHandle),
DWORD __UNUSED_PARAM(dwReason),
LPVOID __UNUSED_PARAM(lpreserved))
{
return TRUE;
}

View file

@ -118,9 +118,9 @@ __mingwthr_run_key_dtors (void)
}
WINBOOL
__mingw_TLScallback (HANDLE hDllHandle __attribute__ ((__unused__)),
__mingw_TLScallback (HANDLE __UNUSED_PARAM(hDllHandle),
DWORD reason,
LPVOID reserved __attribute__ ((__unused__)))
LPVOID __UNUSED_PARAM(reserved))
{
switch (reason)
{

View file

@ -3,54 +3,47 @@
* PROJECT: ReactOS Run-Time Library
* PURPOSE: Debug Routines
* FILE: lib/rtl/i386/debug.S
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
*/
.intel_syntax noprefix
#include <reactos/asm.h>
/* GLOBALS ****************************************************************/
.globl _DbgBreakPoint
.globl _DbgBreakPointWithStatus
.globl _DbgUserBreakPoint
.globl _DebugService
.globl _DebugService2
.globl _DbgBreakPointNoBugCheck
.globl _RtlpBreakWithStatusInstruction
PUBLIC DbgBreakPoint
PUBLIC DbgBreakPointWithStatus
PUBLIC DbgUserBreakPoint
PUBLIC DebugService
PUBLIC DebugService2
PUBLIC DbgBreakPointNoBugCheck
PUBLIC RtlpBreakWithStatusInstruction
/* FUNCTIONS ***************************************************************/
.func DbgBreakPointNoBugCheck
_DbgBreakPointNoBugCheck:
.code64
DbgBreakPointNoBugCheck:
int 3
ret
.endfunc
.func DbgBreakPoint
_DbgBreakPoint:
_DbgUserBreakPoint:
DbgBreakPoint:
DbgUserBreakPoint:
int 3
ret
.endfunc
.func DbgBreakPointWithStatus
_DbgBreakPointWithStatus:
DbgBreakPointWithStatus:
mov eax, ecx
_RtlpBreakWithStatusInstruction:
RtlpBreakWithStatusInstruction:
int 3
ret
.endfunc
.func DebugService2
_DebugService2:
DebugService2:
ret
/* Call the interrupt */
// mov eax, [rbp+8]
// int 0x2D
// int 3
.endfunc
/******************************************************************************
* NTSTATUS NTAPI DebugService(
@ -60,8 +53,7 @@ _DebugService2:
* IN PVOID Argument1, // <r9> = [rsp + 32]
* IN PVOID Argument2); // [rsp + 40]
*/
.func DebugService
_DebugService:
DebugService:
/* Prepare registers for interrupt */
mov eax, ecx // Service
@ -71,9 +63,10 @@ _DebugService:
mov r9, [rsp + 40] // Argument2
/* Call the Interrupt */
int 0x2D
int HEX(2D)
int 3
/* Return */
ret
.endfunc
END

View file

@ -8,24 +8,25 @@
/* INCLUDES ******************************************************************/
#include <ndk/asm.h>
.intel_syntax noprefix
#include <reactos/asm.h>
#include <ndk/amd64/asm.h>
/* FUNCTIONS *****************************************************************/
.code64
/*
* VOID NTAPI
* RtlCaptureContext(
* PCONTEXT ContextRecord); <rcx>
*/
.func RtlCaptureContext
.global _RtlCaptureContext
_RtlCaptureContext:
.cfi_startproc
PUBLIC RtlCaptureContext
.PROC RtlCaptureContext
/* Push rflags */
pushfq
.cfi_adjust_cfa_offset 8
.ALLOCSTACK 8
.ENDPROLOG
/* Save the basic register context */
mov [rcx + CONTEXT_Rax], rax
@ -47,7 +48,7 @@ _RtlCaptureContext:
mov [rcx + CONTEXT_R9], r9
/* Load former stack pointer in rax */
lea rax, [rsp + 0x10]
lea rax, [rsp + 16]
mov [rcx + CONTEXT_R10], r10
mov [rcx + CONTEXT_R11], r11
@ -95,6 +96,8 @@ _RtlCaptureContext:
/* Cleanup stack and return */
add rsp, 8
ret
.cfi_endproc
.endfunc
.ENDP RtlCaptureContext
END

View file

@ -8,10 +8,12 @@
/* INCLUDES ******************************************************************/
#include <ndk/amd64/asmmacro.S>
#include <reactos/asm.h>
#include <ndk/amd64/asm.h>
/* FUNCTIONS *****************************************************************/
.intel_syntax noprefix
.code64
/* SIZE_T
* RtlCompareMemory(
@ -27,6 +29,7 @@
.pushreg rsi
push rdi
.pushreg rdi
.ENDPROLOG
/* Setup registers for compare */
mov rsi, rcx
@ -38,41 +41,48 @@
/* Get number of qwords */
mov rcx, r8
shr rcx, 3
jz 2f
jz RtlCompareMemory2
/* Compare qwords */
repe cmpsq
jnz 4f
jnz RtlCompareMemory4
2: /* Compare rest */
RtlCompareMemory2:
/* Compare rest */
mov rcx, r8
and rcx, 7
jz 3f
jz RtlCompareMemory3
repe cmpsb
jnz 5f
jnz RtlCompareMemory5
3: /* All equal */
RtlCompareMemory3:
/* All equal */
/* Return the full count */
mov rax, rcx
jmp 6f
jmp RtlCompareMemory6
4: /* Not equal after comparing qwords */
RtlCompareMemory4:
/* Not equal after comparing qwords */
/* Compare the last qword */
sub rsi, 8
sub rdi, 8
mov rcx, 8
repe cmpsb
5: /* Not equal after comparing bytes */
RtlCompareMemory5:
/* Not equal after comparing bytes */
/* Return difference */
sub rdi, rdx
dec rdi
mov rax, rdi
6: /* Cleanup and return */
RtlCompareMemory6:
/* Cleanup and return */
pop rdi
pop rsi
ret
.endproc
.endp RtlCompareMemory
END

View file

@ -6,49 +6,54 @@
* PROGRAMMERS: Timo Kreuzer
*/
#include <ndk/asm.h>
#include <ndk/amd64/asmmacro.S>
.intel_syntax noprefix
#include <reactos/asm.h>
#include <ndk/amd64/asm.h>
#define SLIST8A_DEPTH_MASK 0x000000000000FFFF
#define SLIST8A_DEPTH_INC 0x0000000000000001
#define SLIST8A_SEQUENCE_MASK 0x0000000001FF0000
#define SLIST8A_SEQUENCE_INC 0x0000000000010000
#define SLIST8A_NEXTENTRY_MASK 0xFFFFFFFFFE000000
#define SLIST8A_DEPTH_MASK HEX(000000000000FFFF)
#define SLIST8A_DEPTH_INC HEX(0000000000000001)
#define SLIST8A_SEQUENCE_MASK HEX(0000000001FF0000)
#define SLIST8A_SEQUENCE_INC HEX(0000000000010000)
#define SLIST8A_NEXTENTRY_MASK HEX(FFFFFFFFFE000000)
#define SLIST8A_NEXTENTRY_SHIFT 21
#define SLIST8B_HEADERTYPE_MASK 0x0000000000000001
#define SLIST8B_INIT_MASK 0x0000000000000002
#define SLIST8B_REGION_MASK 0xE000000000000000
#define SLIST8_POINTER_MASK 0x000007FFFFFFFFF0
#define SLIST8B_HEADERTYPE_MASK HEX(0000000000000001)
#define SLIST8B_INIT_MASK HEX(0000000000000002)
#define SLIST8B_REGION_MASK HEX(E000000000000000)
#define SLIST8_POINTER_MASK HEX(000007FFFFFFFFF0)
#define SLIST16A_DEPTH_MASK 0x000000000000FFFF
#define SLIST16A_DEPTH_INC 0x0000000000000001
#define SLIST16A_SEQUENCE_MASK 0xFFFFFFFFFFFF0000
#define SLIST16A_SEQUENCE_INC 0x0000000000010000
#define SLIST16B_HEADERTYPE_MASK 0x0000000000000001
#define SLIST16B_INIT_MASK 0x0000000000000002
#define SLIST16B_NEXTENTY_MASK 0xFFFFFFFFFFFFFFF0
#define SLIST16A_DEPTH_MASK HEX(000000000000FFFF)
#define SLIST16A_DEPTH_INC HEX(0000000000000001)
#define SLIST16A_SEQUENCE_MASK HEX(FFFFFFFFFFFF0000)
#define SLIST16A_SEQUENCE_INC HEX(0000000000010000)
#define SLIST16B_HEADERTYPE_MASK HEX(0000000000000001)
#define SLIST16B_INIT_MASK HEX(0000000000000002)
#define SLIST16B_NEXTENTY_MASK HEX(FFFFFFFFFFFFFFF0)
/* FUNCTIONS ****************************************************************/
.global _ExpInterlockedPopEntrySList
.global _ExpInterlockedPopEntrySListResume
.global _ExpInterlockedPopEntrySListFault
.global _ExpInterlockedPopEntrySListEnd
.global _ExpInterlockedPopEntrySListResume16
.global _ExpInterlockedPopEntrySListFault16
.global _ExpInterlockedPopEntrySListEnd16
.global _ExpInterlockedPushEntrySList
.global _ExpInterlockedFlushSList
.code64
PUBLIC ExpInterlockedPopEntrySList
PUBLIC ExpInterlockedPopEntrySListResume
PUBLIC ExpInterlockedPopEntrySListFault
PUBLIC ExpInterlockedPopEntrySListEnd
PUBLIC ExpInterlockedPopEntrySListResume16
PUBLIC ExpInterlockedPopEntrySListFault16
PUBLIC ExpInterlockedPopEntrySListEnd16
PUBLIC ExpInterlockedPushEntrySList
PUBLIC ExpInterlockedFlushSList
PUBLIC RtlInterlockedFlushSList
PUBLIC RtlInterlockedPopEntrySList
PUBLIC RtlInterlockedPushEntrySList
/* PSLIST_ENTRY
* NTAPI
* RtlInterlockedPopEntrySList(
* IN PSLIST_HEADER ListHead);
*/
.proc RtlInterlockedPopEntrySList
_ExpInterlockedPopEntrySList:
RtlInterlockedPopEntrySList:
ExpInterlockedPopEntrySList:
/* Load ListHead->Region into rdx */
mov rdx, [rcx + 8]
@ -58,23 +63,23 @@ _ExpInterlockedPopEntrySList:
/* Check what kind of header this is */
test rdx, SLIST8B_HEADERTYPE_MASK
jnz _RtlInterlockedPopEntrySList16
jnz RtlInterlockedPopEntrySList16
/* We have an 8 byte header */
_ExpInterlockedPopEntrySListResume:
ExpInterlockedPopEntrySListResume:
/* Check if ListHead->NextEntry is NULL */
mov r9, rax
and r9, SLIST8A_NEXTENTRY_MASK
jz _RtlInterlockedPopEntrySListEmpty
jz RtlInterlockedPopEntrySListEmpty
/* Copy Depth and Sequence number and adjust Depth */
lea r8, [rax - SLIST8A_DEPTH_INC]
and r8, SLIST8A_SEQUENCE_MASK | SLIST8A_DEPTH_MASK
and r8, (SLIST8A_SEQUENCE_MASK OR SLIST8A_DEPTH_MASK)
/* Create a pointer template from rcx in rdx */
mov rdx, ~SLIST8_POINTER_MASK
mov rdx, (NOT SLIST8_POINTER_MASK)
and rdx, rcx
/* Shift the NextEntry pointer */
@ -83,7 +88,7 @@ _ExpInterlockedPopEntrySListResume:
/* Combine to new pointer in rdx */
or rdx, r9
_ExpInterlockedPopEntrySListFault:
ExpInterlockedPopEntrySListFault:
/* Load the next NextEntry pointer to r9 */
mov r9, [rdx]
@ -94,31 +99,31 @@ _ExpInterlockedPopEntrySListFault:
/* Combine into r8 */
or r8, r9
_ExpInterlockedPopEntrySListEnd:
ExpInterlockedPopEntrySListEnd:
/* If [rcx] equals rax, exchange it with r8 */
lock cmpxchg [rcx], r8
/* If not equal, retry with rax, being the content of [rcx] now */
jnz _ExpInterlockedPopEntrySListResume
jnz ExpInterlockedPopEntrySListResume
/* Shift the pointer bits in place */
and rax, SLIST8A_NEXTENTRY_MASK
shr rax, SLIST8A_NEXTENTRY_SHIFT
/* Use rcx as pointer template */
mov rdx, ~SLIST8_POINTER_MASK
mov rdx, (NOT SLIST8_POINTER_MASK)
and rdx, rcx
/* Combine result and return */
or rax, rdx
ret
_RtlInterlockedPopEntrySListEmpty:
RtlInterlockedPopEntrySListEmpty:
xor rax, rax
ret
_RtlInterlockedPopEntrySList16:
RtlInterlockedPopEntrySList16:
/* This is a 16 byte header */
/* Save rbx */
@ -127,31 +132,31 @@ _RtlInterlockedPopEntrySList16:
/* Copy rcx to r8, as we need rcx for the exchange */
mov r8, rcx
_ExpInterlockedPopEntrySListResume16:
ExpInterlockedPopEntrySListResume16:
/* Check if ListHead->NextEntry is NULL */
mov r9, rdx
and r9, SLIST16B_NEXTENTY_MASK
jz _RtlInterlockedPopEntrySListEmpty16
jz RtlInterlockedPopEntrySListEmpty16
_ExpInterlockedPopEntrySListFault16:
ExpInterlockedPopEntrySListFault16:
/* Get next pointer */
mov rcx, [r9]
/* Set ListHead->HeaderType = 1 and ListHead->Init = 1 */
or rcx, 0x3
or rcx, 3
/* Copy Depth and Sequence number and adjust Depth */
lea rbx, [rax - SLIST16A_DEPTH_INC]
_ExpInterlockedPopEntrySListEnd16:
ExpInterlockedPopEntrySListEnd16:
/* If [r8] equals rdx:rax, exchange it with rcx:rbx */
lock cmpxchg16b [r8]
/* If not equal, retry with rdx:rax, being the content of [r8] now */
jnz _ExpInterlockedPopEntrySListResume16
jnz ExpInterlockedPopEntrySListResume16
/* Copy the old NextEntry pointer to rax */
mov rax, rdx
@ -161,13 +166,11 @@ _ExpInterlockedPopEntrySListEnd16:
pop rbx
ret
_RtlInterlockedPopEntrySListEmpty16:
RtlInterlockedPopEntrySListEmpty16:
xor rax, rax
pop rbx
ret
.endproc
/* PSLIST_ENTRY
* NTAPI
@ -175,8 +178,8 @@ _RtlInterlockedPopEntrySListEmpty16:
* IN PSLIST_HEADER ListHead,
* IN PSLIST_ENTRY ListEntry);
*/
.proc RtlInterlockedPushEntrySList
_ExpInterlockedPushEntrySList:
RtlInterlockedPushEntrySList:
ExpInterlockedPushEntrySList:
/* Load ListHead->Alignment into rax */
mov rax, [rcx]
@ -186,28 +189,28 @@ _ExpInterlockedPushEntrySList:
/* Check what kind of header this is */
test r9, SLIST8B_HEADERTYPE_MASK
jnz _RtlInterlockedPushEntrySList16
jnz RtlInterlockedPushEntrySList16
/* We have an 8 byte header */
_RtlInterlockedPushEntrySListLoop:
RtlInterlockedPushEntrySListLoop:
/* Get ListHead->NextEntry */
mov r8, rax
and r8, SLIST8A_NEXTENTRY_MASK
jz _RtlInterlockedPushEntrySListEmpty
jz RtlInterlockedPushEntrySListEmpty
/* Shift the NextEntry pointer */
shr r8, SLIST8A_NEXTENTRY_SHIFT
/* Create a pointer template from rcx in rdx */
mov r9, ~SLIST8_POINTER_MASK
mov r9, (NOT SLIST8_POINTER_MASK)
and r9, rcx
/* Combine to new pointer and save as ListEntry->NextEntry */
or r8, r9
_RtlInterlockedPushEntrySListEmpty:
RtlInterlockedPushEntrySListEmpty:
/* Store the NextEntry pointer in the new ListEntry */
mov [rdx], r8
@ -218,7 +221,7 @@ _RtlInterlockedPushEntrySListEmpty:
/* Copy and adjust depth and sequence number */
lea r9, [rax + SLIST8A_DEPTH_INC + SLIST8A_SEQUENCE_INC]
and r9, SLIST8A_SEQUENCE_MASK | SLIST8A_DEPTH_MASK
and r9, SLIST8A_SEQUENCE_MASK OR SLIST8A_DEPTH_MASK
/* Combine to exchange value in r8 */
or r8, r9
@ -230,13 +233,13 @@ _RtlInterlockedPushEntrySListEmpty:
lock cmpxchg [rcx], r8
/* If not equal, retry with rax, being the content of [rcx] now */
jnz _RtlInterlockedPushEntrySListLoop
jnz RtlInterlockedPushEntrySListLoop
/* Return the old NextEntry pointer */
mov rax, r9
ret
_RtlInterlockedPushEntrySList16:
RtlInterlockedPushEntrySList16:
/* This is a 16 byte header */
/* Save rbx */
@ -248,11 +251,11 @@ _RtlInterlockedPushEntrySList16:
/* Set ListHead->HeaderType = 1 and ListHead->Init = 1 */
mov rcx, rdx
or rcx, 0x3
or rcx, 3
mov rdx, [r8 + 8]
_RtlInterlockedPushEntrySListLoop16:
RtlInterlockedPushEntrySListLoop16:
/* Move ListHead->NextEntry to rbx */
mov rbx, rdx
@ -268,7 +271,7 @@ _RtlInterlockedPushEntrySListLoop16:
lock cmpxchg16b [r8]
/* If not equal, retry with rdx:rax, being the content of [r8] now */
jnz _RtlInterlockedPushEntrySListLoop16
jnz RtlInterlockedPushEntrySListLoop16
/* Copy the old NextEntry pointer to rax */
mov rax, rdx
@ -278,26 +281,25 @@ _RtlInterlockedPushEntrySListLoop16:
pop rbx
ret
.endproc
/* PSLIST_ENTRY
* NTAPI
* RtlInterlockedFlushSList(
* IN PSINGLE_LIST_ENTRY ListHead);
*/
.proc RtlInterlockedFlushSList
_ExpInterlockedFlushSList:
RtlInterlockedFlushSList:
ExpInterlockedFlushSList:
/* Load ListHead->Region into rdx */
mov rax, [rcx + 8]
/* Check what kind of header this is */
test rax, SLIST8B_HEADERTYPE_MASK
jnz _RtlInterlockedFlushSList16
jnz RtlInterlockedFlushSList16
/* We have an 8 byte header */
_RtlInterlockedFlushSListLoop:
RtlInterlockedFlushSListLoop:
/* Zero ListHead->Alignment */
xor r8, r8
@ -306,31 +308,31 @@ _RtlInterlockedFlushSListLoop:
lock cmpxchg [rcx], r8
/* If not equal, retry with rax, being the content of [rcx] now */
jnz _RtlInterlockedFlushSListLoop
jnz RtlInterlockedFlushSListLoop
/* Use rcx as pointer template */
mov rdx, ~SLIST8_POINTER_MASK
mov rdx, (not SLIST8_POINTER_MASK)
or rdx, rcx
/* Combine result and return */
or rax, rdx
ret
_RtlInterlockedFlushSList16:
RtlInterlockedFlushSList16:
/* We have a 16 byte header */
push rbx
mov rdx, [rcx + 8]
xor rbx, rbx
mov rcx, 0x3
mov rcx, 3
_RtlInterlockedFlushSListLoop16:
RtlInterlockedFlushSListLoop16:
/* If [r8] equals rdx:rax, exchange it with rcx:rbx */
lock cmpxchg16b [r8]
/* If not equal, retry with rdx:rax, being the content of [r8] now */
jnz _RtlInterlockedFlushSListLoop16
jnz RtlInterlockedFlushSListLoop16
/* Copy the old NextEntry pointer to rax */
mov rax, rdx
@ -340,4 +342,4 @@ _RtlInterlockedFlushSListLoop16:
pop rbx
ret
.endproc
END

View file

@ -232,7 +232,7 @@ PopReg(PCONTEXT Context, BYTE Reg)
*/
BOOLEAN
static
inline
__inline
RtlpTryToUnwindEpilog(
PCONTEXT Context,
ULONG64 ImageBase,

View file

@ -1,4 +1,5 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <precomp.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@ -12,6 +13,7 @@ void _assert(const char *msg, const char *file, unsigned line)
{
/* Assertion failed at foo.c line 45: x<y */
fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, msg);
FIXME("Assertion failed at %s line %d: %s\n", file, line, msg);
raise(SIGABRT);
for(;;); /* eliminate warning by mingw */
}

View file

@ -15,7 +15,7 @@
/* GLOBALS *******************************************************************/
static PFN_TYPE CcZeroPage = 0;
static PFN_NUMBER CcZeroPage = 0;
#define MAX_ZERO_LENGTH (256 * 1024)
#define MAX_RW_LENGTH (256 * 1024)
@ -98,7 +98,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
PCACHE_SEGMENT current2;
ULONG current_size;
ULONG i;
PPFN_TYPE MdlPages;
PPFN_NUMBER MdlPages;
/*
* Count the maximum number of bytes we could read starting
@ -119,7 +119,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
current2 = current;
current_size = 0;
MdlPages = (PPFN_TYPE)(Mdl + 1);
MdlPages = (PPFN_NUMBER)(Mdl + 1);
while (current2 != NULL && !current2->Valid && current_size < MAX_RW_LENGTH)
{
PVOID address = current2->BaseAddress;
@ -619,7 +619,7 @@ CcZeroData (IN PFILE_OBJECT FileObject,
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++)
{
((PPFN_TYPE)(Mdl + 1))[i] = CcZeroPage;
((PPFN_NUMBER)(Mdl + 1))[i] = CcZeroPage;
}
KeInitializeEvent(&Event, NotificationEvent, FALSE);
Status = IoSynchronousPageWrite(FileObject, Mdl, &WriteOffset, &Event, &Iosb);

View file

@ -330,8 +330,8 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
KeReleaseGuardedMutex(&ViewLock);
for (i = 0; i < current->Bcb->CacheSegmentSize / PAGE_SIZE; i++)
{
PFN_TYPE Page;
Page = (PFN_TYPE)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
PFN_NUMBER Page;
Page = (PFN_NUMBER)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
Status = MmPageOutPhysicalAddress(Page);
}
KeAcquireGuardedMutex(&ViewLock);
@ -842,7 +842,7 @@ CcRosRequestCacheSegment(PBCB Bcb,
#else
static VOID
CcFreeCachePage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
{
ASSERT(SwapEntry == 0);
if (Page != 0)
@ -861,7 +861,7 @@ CcRosInternalFreeCacheSegment(PCACHE_SEGMENT CacheSeg)
ULONG i;
ULONG RegionSize;
ULONG Base;
PFN_TYPE Page;
PFN_NUMBER Page;
KIRQL oldIrql;
#endif
DPRINT("Freeing cache segment 0x%p\n", CacheSeg);

View file

@ -42,6 +42,13 @@
#define MI_SYSTEM_VIEW_SIZE (16 * 1024 * 1024)
#define MI_NUMBER_SYSTEM_PTES 22000
#define MI_MIN_SECONDARY_COLORS 8
#define MI_SECONDARY_COLORS 64
#define MI_MAX_SECONDARY_COLORS 1024
#define MM_HIGHEST_VAD_ADDRESS \
(PVOID)((ULONG_PTR)MM_HIGHEST_USER_ADDRESS - (16 * PAGE_SIZE))
PULONG64
FORCEINLINE
MmGetPageDirectory(VOID)

View file

@ -889,7 +889,7 @@ KeInvalidAccessAllowed(IN PVOID TrapInformation OPTIONAL);
VOID
NTAPI
KeRosDumpStackFrames(
PULONG Frame,
PULONG_PTR Frame,
ULONG FrameCount
);

View file

@ -6,21 +6,21 @@
struct _EPROCESS;
extern ULONG MiFreeSwapPages;
extern ULONG MiUsedSwapPages;
extern ULONG MmPagedPoolSize;
extern ULONG MmTotalPagedPoolQuota;
extern ULONG MmTotalNonPagedPoolQuota;
extern PFN_NUMBER MiFreeSwapPages;
extern PFN_NUMBER MiUsedSwapPages;
extern SIZE_T MmPagedPoolSize;
extern SIZE_T MmTotalPagedPoolQuota;
extern SIZE_T MmTotalNonPagedPoolQuota;
extern PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress;
extern ULONG MmNumberOfPhysicalPages;
extern PFN_NUMBER MmNumberOfPhysicalPages;
extern UCHAR MmDisablePagingExecutive;
extern ULONG MmLowestPhysicalPage;
extern ULONG MmHighestPhysicalPage;
extern ULONG MmAvailablePages;
extern PFN_NUMBER MmLowestPhysicalPage;
extern PFN_NUMBER MmHighestPhysicalPage;
extern PFN_NUMBER MmAvailablePages;
extern PFN_NUMBER MmResidentAvailablePages;
extern PVOID MmPagedPoolBase;
extern ULONG MmPagedPoolSize;
extern SIZE_T MmPagedPoolSize;
extern PMEMORY_ALLOCATION_DESCRIPTOR MiFreeDescriptor;
extern MEMORY_ALLOCATION_DESCRIPTOR MiFreeDescriptorOrg;
@ -46,14 +46,14 @@ extern SIZE_T MmPagedPoolCommit;
extern SIZE_T MmPeakCommitment;
extern SIZE_T MmtotalCommitLimitMaximum;
extern BOOLEAN MiDbgReadyForPhysical;
extern PVOID MiDebugMapping;
extern PMMPTE MmDebugPte;
struct _KTRAP_FRAME;
struct _EPROCESS;
struct _MM_RMAP_ENTRY;
struct _MM_PAGEOP;
typedef ULONG SWAPENTRY;
typedef ULONG PFN_TYPE, *PPFN_TYPE;
//
// MmDbgCopyMemory Flags
@ -466,7 +466,7 @@ typedef VOID
PVOID Context,
PMEMORY_AREA MemoryArea,
PVOID Address,
PFN_TYPE Page,
PFN_NUMBER Page,
SWAPENTRY SwapEntry,
BOOLEAN Dirty
);
@ -688,7 +688,7 @@ VOID
NTAPI
MmBuildMdlFromPages(
PMDL Mdl,
PULONG Pages
PPFN_NUMBER Pages
);
/* mminit.c ******************************************************************/
@ -738,7 +738,7 @@ NTSTATUS
NTAPI
MmReadFromSwapPage(
SWAPENTRY SwapEntry,
PFN_TYPE Page
PFN_NUMBER Page
);
BOOLEAN
@ -749,7 +749,7 @@ NTSTATUS
NTAPI
MmWriteToSwapPage(
SWAPENTRY SwapEntry,
PFN_TYPE Page
PFN_NUMBER Page
);
NTSTATUS
@ -875,7 +875,7 @@ MmQueryAnonMem(
PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
PULONG ResultLength
PSIZE_T ResultLength
);
VOID
@ -917,18 +917,18 @@ ExUnmapPage(PVOID Addr);
PVOID
NTAPI
ExAllocatePageWithPhysPage(PFN_TYPE Page);
ExAllocatePageWithPhysPage(PFN_NUMBER Page);
NTSTATUS
NTAPI
MiCopyFromUserPage(
PFN_TYPE Page,
PFN_NUMBER Page,
PVOID SourceAddress
);
NTSTATUS
NTAPI
MiZeroPage(PFN_TYPE Page);
MiZeroPage(PFN_NUMBER Page);
/* memsafe.s *****************************************************************/
@ -999,7 +999,7 @@ NTSTATUS
NTAPI
MmReleasePageMemoryConsumer(
ULONG Consumer,
PFN_TYPE Page
PFN_NUMBER Page
);
NTSTATUS
@ -1007,7 +1007,7 @@ NTAPI
MmRequestPageMemoryConsumer(
ULONG Consumer,
BOOLEAN MyWait,
PPFN_TYPE AllocatedPage
PPFN_NUMBER AllocatedPage
);
VOID
@ -1023,18 +1023,18 @@ MmRebalanceMemoryConsumers(VOID);
VOID
NTAPI
MmSetRmapListHeadPage(
PFN_TYPE Page,
PFN_NUMBER Page,
struct _MM_RMAP_ENTRY* ListHead
);
struct _MM_RMAP_ENTRY*
NTAPI
MmGetRmapListHeadPage(PFN_TYPE Page);
MmGetRmapListHeadPage(PFN_NUMBER Page);
VOID
NTAPI
MmInsertRmap(
PFN_TYPE Page,
PFN_NUMBER Page,
struct _EPROCESS *Process,
PVOID Address
);
@ -1042,7 +1042,7 @@ MmInsertRmap(
VOID
NTAPI
MmDeleteAllRmaps(
PFN_TYPE Page,
PFN_NUMBER Page,
PVOID Context,
VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address)
);
@ -1050,7 +1050,7 @@ MmDeleteAllRmaps(
VOID
NTAPI
MmDeleteRmap(
PFN_TYPE Page,
PFN_NUMBER Page,
struct _EPROCESS *Process,
PVOID Address
);
@ -1061,29 +1061,29 @@ MmInitializeRmapList(VOID);
VOID
NTAPI
MmSetCleanAllRmaps(PFN_TYPE Page);
MmSetCleanAllRmaps(PFN_NUMBER Page);
VOID
NTAPI
MmSetDirtyAllRmaps(PFN_TYPE Page);
MmSetDirtyAllRmaps(PFN_NUMBER Page);
BOOLEAN
NTAPI
MmIsDirtyPageRmap(PFN_TYPE Page);
MmIsDirtyPageRmap(PFN_NUMBER Page);
NTSTATUS
NTAPI
MmWritePagePhysicalAddress(PFN_TYPE Page);
MmWritePagePhysicalAddress(PFN_NUMBER Page);
NTSTATUS
NTAPI
MmPageOutPhysicalAddress(PFN_TYPE Page);
MmPageOutPhysicalAddress(PFN_NUMBER Page);
/* freelist.c **********************************************************/
FORCEINLINE
PMMPFN
MiGetPfnEntry(IN PFN_TYPE Pfn)
MiGetPfnEntry(IN PFN_NUMBER Pfn)
{
PMMPFN Page;
extern RTL_BITMAP MiPfnBitMap;
@ -1111,33 +1111,33 @@ MiGetPfnEntryIndex(IN PMMPFN Pfn1)
return Pfn1 - MmPfnDatabase;
}
PFN_TYPE
PFN_NUMBER
NTAPI
MmGetLRUNextUserPage(PFN_TYPE PreviousPage);
MmGetLRUNextUserPage(PFN_NUMBER PreviousPage);
PFN_TYPE
PFN_NUMBER
NTAPI
MmGetLRUFirstUserPage(VOID);
VOID
NTAPI
MmInsertLRULastUserPage(PFN_TYPE Page);
MmInsertLRULastUserPage(PFN_NUMBER Page);
VOID
NTAPI
MmRemoveLRUUserPage(PFN_TYPE Page);
MmRemoveLRUUserPage(PFN_NUMBER Page);
VOID
NTAPI
MmLockPage(PFN_TYPE Page);
MmLockPage(PFN_NUMBER Page);
VOID
NTAPI
MmUnlockPage(PFN_TYPE Page);
MmUnlockPage(PFN_NUMBER Page);
ULONG
NTAPI
MmGetLockCountPage(PFN_TYPE Page);
MmGetLockCountPage(PFN_NUMBER Page);
VOID
NTAPI
@ -1151,7 +1151,7 @@ MmDumpPfnDatabase(
VOID
);
PFN_TYPE
PFN_NUMBER
NTAPI
MmGetContinuousPages(
ULONG NumberOfBytes,
@ -1222,7 +1222,7 @@ NTAPI
MmCreateVirtualMappingForKernel(
PVOID Address,
ULONG flProtect,
PPFN_TYPE Pages,
PPFN_NUMBER Pages,
ULONG PageCount
);
@ -1239,7 +1239,7 @@ MmCreateVirtualMapping(
struct _EPROCESS* Process,
PVOID Address,
ULONG flProtect,
PPFN_TYPE Pages,
PPFN_NUMBER Pages,
ULONG PageCount
);
@ -1249,7 +1249,7 @@ MmCreateVirtualMappingUnsafe(
struct _EPROCESS* Process,
PVOID Address,
ULONG flProtect,
PPFN_TYPE Pages,
PPFN_NUMBER Pages,
ULONG PageCount
);
@ -1284,7 +1284,7 @@ MmDisableVirtualMapping(
struct _EPROCESS *Process,
PVOID Address,
BOOLEAN* WasDirty,
PPFN_TYPE Page
PPFN_NUMBER Page
);
VOID
@ -1324,7 +1324,7 @@ MmIsPageSwapEntry(
VOID
NTAPI
MmTransferOwnershipPage(
PFN_TYPE Page,
PFN_NUMBER Page,
ULONG NewConsumer
);
@ -1335,7 +1335,7 @@ MmSetDirtyPage(
PVOID Address
);
PFN_TYPE
PFN_NUMBER
NTAPI
MmAllocPage(
ULONG Consumer
@ -1348,34 +1348,34 @@ MmAllocPagesSpecifyRange(
PHYSICAL_ADDRESS LowestAddress,
PHYSICAL_ADDRESS HighestAddress,
ULONG NumberOfPages,
PPFN_TYPE Pages
PPFN_NUMBER Pages
);
VOID
NTAPI
MmDereferencePage(PFN_TYPE Page);
MmDereferencePage(PFN_NUMBER Page);
VOID
NTAPI
MmReferencePage(PFN_TYPE Page);
MmReferencePage(PFN_NUMBER Page);
ULONG
NTAPI
MmGetReferenceCountPage(PFN_TYPE Page);
MmGetReferenceCountPage(PFN_NUMBER Page);
BOOLEAN
NTAPI
MmIsPageInUse(PFN_TYPE Page);
MmIsPageInUse(PFN_NUMBER Page);
VOID
NTAPI
MmSetSavedSwapEntryPage(
PFN_TYPE Page,
PFN_NUMBER Page,
SWAPENTRY SavedSwapEntry);
SWAPENTRY
NTAPI
MmGetSavedSwapEntryPage(PFN_TYPE Page);
MmGetSavedSwapEntryPage(PFN_NUMBER Page);
VOID
NTAPI
@ -1395,7 +1395,7 @@ MmDeletePageTable(
PVOID Address
);
PFN_TYPE
PFN_NUMBER
NTAPI
MmGetPfnForProcess(
struct _EPROCESS *Process,
@ -1439,7 +1439,7 @@ MmDeleteVirtualMapping(
PVOID Address,
BOOLEAN FreePage,
BOOLEAN* WasDirty,
PPFN_TYPE Page
PPFN_NUMBER Page
);
BOOLEAN
@ -1451,11 +1451,11 @@ MmIsDirtyPage(
VOID
NTAPI
MmMarkPageMapped(PFN_TYPE Page);
MmMarkPageMapped(PFN_NUMBER Page);
VOID
NTAPI
MmMarkPageUnmapped(PFN_TYPE Page);
MmMarkPageUnmapped(PFN_NUMBER Page);
VOID
NTAPI
@ -1549,7 +1549,7 @@ MmQuerySectionView(
PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
PULONG ResultLength
PSIZE_T ResultLength
);
NTSTATUS
@ -1642,8 +1642,8 @@ MiQueryVirtualMemory(
IN PVOID Address,
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
OUT PVOID VirtualMemoryInformation,
IN ULONG Length,
OUT PULONG ResultLength
IN SIZE_T Length,
OUT PSIZE_T ResultLength
);
/* sysldr.c ******************************************************************/

View file

@ -92,7 +92,7 @@ IopFreeMiniPacket(PIOP_MINI_COMPLETION_PACKET Packet)
}
/* The free was within dhe Depth */
InterlockedPushEntrySList(&List->L.ListHead, (PSINGLE_LIST_ENTRY)Packet);
InterlockedPushEntrySList(&List->L.ListHead, (PSLIST_ENTRY)Packet);
}
VOID

View file

@ -1557,7 +1557,7 @@ IoFreeIrp(IN PIRP Irp)
if (Irp)
{
InterlockedPushEntrySList(&List->L.ListHead,
(PSINGLE_LIST_ENTRY)Irp);
(PSLIST_ENTRY)Irp);
}
}
}

View file

@ -232,7 +232,7 @@ KeRosCaptureUserStackBackTrace(IN ULONG FramesToSkip,
VOID
FASTCALL
KeRosDumpStackFrameArray(IN PULONG Frames,
KeRosDumpStackFrameArray(IN PULONG_PTR Frames,
IN ULONG FrameCount)
{
ULONG i, Addr;
@ -271,13 +271,13 @@ KeRosDumpStackFrameArray(IN PULONG Frames,
{
/* Print out the module name */
Addr -= (ULONG_PTR)LdrEntry->DllBase;
DbgPrint("<%wZ: %x>\n", &LdrEntry->FullDllName, Addr);
DbgPrint("<%wZ: %p>", &LdrEntry->FullDllName, (PVOID)Addr);
}
}
else
{
/* Print only the address */
DbgPrint("<%x>\n", Addr);
DbgPrint("<%p>", (PVOID)Addr);
}
/* Go to the next frame */
@ -287,10 +287,10 @@ KeRosDumpStackFrameArray(IN PULONG Frames,
VOID
NTAPI
KeRosDumpStackFrames(IN PULONG Frame OPTIONAL,
KeRosDumpStackFrames(IN PULONG_PTR Frame OPTIONAL,
IN ULONG FrameCount OPTIONAL)
{
ULONG Frames[32];
ULONG_PTR Frames[32];
ULONG RealFrameCount;
/* If the caller didn't ask, assume 32 frames */
@ -1410,7 +1410,7 @@ KeRegisterNmiCallback(IN PNMI_CALLBACK CallbackRoutine,
//
KiAcquireNmiListLock(&OldIrql);
NmiData->Next = KiNmiCallbackListHead;
Next = InterlockedCompareExchangePointer(&KiNmiCallbackListHead,
Next = InterlockedCompareExchangePointer((PVOID*)&KiNmiCallbackListHead,
NmiData,
NmiData->Next);
ASSERT(Next == NmiData->Next);

View file

@ -606,7 +606,7 @@ MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes,
*/
PVOID
NTAPI
MmAllocateContiguousMemory(IN ULONG NumberOfBytes,
MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes,
IN PHYSICAL_ADDRESS HighestAcceptableAddress)
{
PFN_NUMBER HighestPfn;
@ -647,7 +647,7 @@ MmFreeContiguousMemory(IN PVOID BaseAddress)
VOID
NTAPI
MmFreeContiguousMemorySpecifyCache(IN PVOID BaseAddress,
IN ULONG NumberOfBytes,
IN SIZE_T NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType)
{
//

View file

@ -46,11 +46,11 @@ MI_PFN_CACHE_ATTRIBUTE MiPlatformCacheAttributes[2][MmMaximumCacheType] =
PVOID
NTAPI
MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN SIZE_T NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType)
{
PFN_TYPE Pfn, PageCount;
PFN_NUMBER Pfn, PageCount;
PMMPTE PointerPte;
PVOID BaseAddress;
MMPTE TempPte;
@ -190,7 +190,7 @@ MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress,
VOID
NTAPI
MmUnmapIoSpace(IN PVOID BaseAddress,
IN ULONG NumberOfBytes)
IN SIZE_T NumberOfBytes)
{
PFN_NUMBER PageCount, Pfn;
PMMPTE PointerPte;
@ -239,7 +239,7 @@ MmUnmapIoSpace(IN PVOID BaseAddress,
PVOID
NTAPI
MmMapVideoDisplay(IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN SIZE_T NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType)
{
PAGED_CODE();
@ -256,7 +256,7 @@ MmMapVideoDisplay(IN PHYSICAL_ADDRESS PhysicalAddress,
VOID
NTAPI
MmUnmapVideoDisplay(IN PVOID BaseAddress,
IN ULONG NumberOfBytes)
IN SIZE_T NumberOfBytes)
{
//
// Call the real function

View file

@ -28,9 +28,9 @@ PMDL
NTAPI
MmCreateMdl(IN PMDL Mdl,
IN PVOID Base,
IN ULONG Length)
IN SIZE_T Length)
{
ULONG Size;
SIZE_T Size;
//
// Check if we don't have an MDL built
@ -55,10 +55,10 @@ MmCreateMdl(IN PMDL Mdl,
/*
* @implemented
*/
ULONG
SIZE_T
NTAPI
MmSizeOfMdl(IN PVOID Base,
IN ULONG Length)
IN SIZE_T Length)
{
//
// Return the MDL size
@ -573,7 +573,7 @@ MmProbeAndLockPages(IN PMDL Mdl,
IN KPROCESSOR_MODE AccessMode,
IN LOCK_OPERATION Operation)
{
PPFN_TYPE MdlPages;
PPFN_NUMBER MdlPages;
PVOID Base, Address, LastAddress, StartAddress;
ULONG LockPages, TotalPages;
NTSTATUS Status = STATUS_SUCCESS;

View file

@ -379,29 +379,29 @@ extern LIST_ENTRY MiLargePageDriverList;
extern BOOLEAN MiLargePageAllDrivers;
extern ULONG MmVerifyDriverBufferLength;
extern ULONG MmLargePageDriverBufferLength;
extern ULONG MmSizeOfNonPagedPoolInBytes;
extern ULONG MmMaximumNonPagedPoolInBytes;
extern SIZE_T MmSizeOfNonPagedPoolInBytes;
extern SIZE_T MmMaximumNonPagedPoolInBytes;
extern PFN_NUMBER MmMaximumNonPagedPoolInPages;
extern PFN_NUMBER MmSizeOfPagedPoolInPages;
extern PVOID MmNonPagedSystemStart;
extern PVOID MmNonPagedPoolStart;
extern PVOID MmNonPagedPoolExpansionStart;
extern PVOID MmNonPagedPoolEnd;
extern ULONG MmSizeOfPagedPoolInBytes;
extern SIZE_T MmSizeOfPagedPoolInBytes;
extern PVOID MmPagedPoolStart;
extern PVOID MmPagedPoolEnd;
extern PVOID MmSessionBase;
extern ULONG MmSessionSize;
extern SIZE_T MmSessionSize;
extern PMMPTE MmFirstReservedMappingPte, MmLastReservedMappingPte;
extern PMMPTE MiFirstReservedZeroingPte;
extern MI_PFN_CACHE_ATTRIBUTE MiPlatformCacheAttributes[2][MmMaximumCacheType];
extern PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock;
extern ULONG MmBootImageSize;
extern SIZE_T MmBootImageSize;
extern PMMPTE MmSystemPtesStart[MaximumPtePoolTypes];
extern PMMPTE MmSystemPtesEnd[MaximumPtePoolTypes];
extern PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor;
extern MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor;
extern ULONG MxPfnAllocation;
extern ULONG_PTR MxPfnAllocation;
extern MM_PAGED_POOL_INFO MmPagedPoolInfo;
extern RTL_BITMAP MiPfnBitMap;
extern KGUARDED_MUTEX MmPagedPoolMutex;
@ -409,14 +409,14 @@ extern PVOID MmPagedPoolStart;
extern PVOID MmPagedPoolEnd;
extern PVOID MmNonPagedSystemStart;
extern PVOID MiSystemViewStart;
extern ULONG MmSystemViewSize;
extern SIZE_T MmSystemViewSize;
extern PVOID MmSessionBase;
extern PVOID MiSessionSpaceEnd;
extern PMMPTE MiSessionImagePteStart;
extern PMMPTE MiSessionImagePteEnd;
extern PMMPTE MiSessionBasePte;
extern PMMPTE MiSessionLastPte;
extern ULONG MmSizeOfPagedPoolInBytes;
extern SIZE_T MmSizeOfPagedPoolInBytes;
extern PMMPTE MmSystemPagePtes;
extern PVOID MmSystemCacheStart;
extern PVOID MmSystemCacheEnd;
@ -426,13 +426,13 @@ extern ULONG_PTR MmSubsectionBase;
extern ULONG MmSpecialPoolTag;
extern PVOID MmHyperSpaceEnd;
extern PMMWSL MmSystemCacheWorkingSetList;
extern ULONG MmMinimumNonPagedPoolSize;
extern SIZE_T MmMinimumNonPagedPoolSize;
extern ULONG MmMinAdditionNonPagedPoolPerMb;
extern ULONG MmDefaultMaximumNonPagedPool;
extern SIZE_T MmDefaultMaximumNonPagedPool;
extern ULONG MmMaxAdditionNonPagedPoolPerMb;
extern ULONG MmSecondaryColors;
extern ULONG MmSecondaryColorMask;
extern ULONG MmNumberOfSystemPtes;
extern ULONG_PTR MmNumberOfSystemPtes;
extern ULONG MmMaximumNonPagedPoolPercent;
extern ULONG MmLargeStackSize;
extern PMMCOLOR_TABLES MmFreePagesByColor[FreePageList + 1];

View file

@ -22,8 +22,8 @@
/* GLOBALS ********************************************************************/
PMMPTE MmDebugPte = MiAddressToPte(MI_DEBUG_MAPPING);
BOOLEAN MiDbgReadyForPhysical = FALSE;
PVOID MiDebugMapping = MI_DEBUG_MAPPING;
PMMPTE MmDebugPte = NULL;
/* FUNCTIONS ******************************************************************/
@ -49,7 +49,7 @@ MiDbgTranslatePhysicalAddress(IN ULONG64 PhysicalAddress,
//
// Check if we are called too early
//
if (MiDbgReadyForPhysical == FALSE)
if (MmDebugPte == NULL)
{
//
// The structures we require aren't initialized yet, fail

View file

@ -23,8 +23,8 @@
// figure out the most appropriate values.
//
ULONG MmMaximumNonPagedPoolPercent;
ULONG MmSizeOfNonPagedPoolInBytes;
ULONG MmMaximumNonPagedPoolInBytes;
SIZE_T MmSizeOfNonPagedPoolInBytes;
SIZE_T MmMaximumNonPagedPoolInBytes;
/* Some of the same values, in pages */
PFN_NUMBER MmMaximumNonPagedPoolInPages;
@ -36,9 +36,9 @@ PFN_NUMBER MmMaximumNonPagedPoolInPages;
// They are described on http://support.microsoft.com/default.aspx/kb/126402/ja
// along with the algorithm that uses them, which is implemented later below.
//
ULONG MmMinimumNonPagedPoolSize = 256 * 1024;
SIZE_T MmMinimumNonPagedPoolSize = 256 * 1024;
ULONG MmMinAdditionNonPagedPoolPerMb = 32 * 1024;
ULONG MmDefaultMaximumNonPagedPool = 1024 * 1024;
SIZE_T MmDefaultMaximumNonPagedPool = 1024 * 1024;
ULONG MmMaxAdditionNonPagedPoolPerMb = 400 * 1024;
//
@ -107,7 +107,7 @@ PVOID MmPagedPoolEnd;
//
// And this is its default size
//
ULONG MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE;
SIZE_T MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE;
PFN_NUMBER MmSizeOfPagedPoolInPages = MI_MIN_INIT_PAGED_POOLSIZE / PAGE_SIZE;
//
@ -131,10 +131,10 @@ PVOID MiSessionViewStart; // 0xBE000000
PVOID MiSessionPoolEnd; // 0xBE000000
PVOID MiSessionPoolStart; // 0xBD000000
PVOID MmSessionBase; // 0xBD000000
ULONG MmSessionSize;
ULONG MmSessionViewSize;
ULONG MmSessionPoolSize;
ULONG MmSessionImageSize;
SIZE_T MmSessionSize;
SIZE_T MmSessionViewSize;
SIZE_T MmSessionPoolSize;
SIZE_T MmSessionImageSize;
/*
* These are the PTE addresses of the boundaries carved out above
@ -151,7 +151,7 @@ PMMPTE MiSessionLastPte;
// By default, it is a 16MB region.
//
PVOID MiSystemViewStart;
ULONG MmSystemViewSize;
SIZE_T MmSystemViewSize;
//
// A copy of the system page directory (the page directory associated with the
@ -175,13 +175,13 @@ PMMWSL MmSystemCacheWorkingSetList = MI_SYSTEM_CACHE_WS_START;
// On systems with more than 32MB, this number is then doubled, and further
// aligned up to a PDE boundary (4MB).
//
ULONG MmNumberOfSystemPtes;
ULONG_PTR MmNumberOfSystemPtes;
//
// This is how many pages the PFN database will take up
// In Windows, this includes the Quark Color Table, but not in ARM³
//
ULONG MxPfnAllocation;
PFN_NUMBER MxPfnAllocation;
//
// Unlike the old ReactOS Memory Manager, ARM³ (and Windows) does not keep track
@ -205,7 +205,7 @@ PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock;
//
// This is where we keep track of the most basic physical layout markers
//
ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1;
PFN_NUMBER MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1;
//
// The total number of pages mapped by the boot loader, which include the kernel
@ -215,13 +215,13 @@ ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1;
//
// This number is later aligned up to a PDE boundary.
//
ULONG MmBootImageSize;
SIZE_T MmBootImageSize;
//
// These three variables keep track of the core separation of address space that
// exists between kernel mode and user mode.
//
ULONG MmUserProbeAddress;
ULONG_PTR MmUserProbeAddress;
PVOID MmHighestUserAddress;
PVOID MmSystemRangeStart;
@ -1990,7 +1990,7 @@ MmArmInitSystem(IN ULONG Phase,
MiBuildPagedPool();
/* Debugger physical memory support is now ready to be used */
MiDbgReadyForPhysical = TRUE;
MmDebugPte = MiAddressToPte(MiDebugMapping);
/* Initialize the loaded module list */
MiInitializeLoadedModuleList(LoaderBlock);

View file

@ -23,7 +23,7 @@
*/
PVOID
NTAPI
MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
MmAllocateNonCachedMemory(IN SIZE_T NumberOfBytes)
{
PFN_NUMBER PageCount, MdlPageCount, PageFrameIndex;
PHYSICAL_ADDRESS LowAddress, HighAddress, SkipBytes;
@ -170,7 +170,7 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
VOID
NTAPI
MmFreeNonCachedMemory(IN PVOID BaseAddress,
IN ULONG NumberOfBytes)
IN SIZE_T NumberOfBytes)
{
PMDL Mdl;
PMMPTE PointerPte;

View file

@ -64,8 +64,10 @@ MiCheckPdeForPagedPool(IN PVOID Address)
//
if (PointerPde->u.Hard.Valid == 0)
{
#ifndef _M_AMD64
/* This seems to be making the assumption that one PDE is one page long */
C_ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT)));
#endif
//
// Copy it from our double-mapped system page directory

View file

@ -333,8 +333,10 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
//
// Save it into our double-buffered system page directory
//
#ifndef _M_AMD64
/* This seems to be making the assumption that one PDE is one page long */
C_ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT)));
#endif
MmSystemPagePtes[(ULONG_PTR)PointerPte & (PAGE_SIZE - 1) /
sizeof(MMPTE)] = TempPte;

View file

@ -513,7 +513,7 @@ MmCreatePeb(IN PEPROCESS Process,
ImageConfigData = RtlImageDirectoryEntryToData(Peb->ImageBaseAddress,
TRUE,
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG,
&ViewSize);
(PULONG)&ViewSize);
if (ImageConfigData)
{
//

View file

@ -883,7 +883,7 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle,
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process;
NTSTATUS Status = STATUS_SUCCESS;
ULONG BytesWritten = 0;
SIZE_T BytesWritten = 0;
PAGED_CODE();
//

View file

@ -53,7 +53,7 @@ MmWritePageVirtualMemory(PMMSUPPORT AddressSpace,
PMM_PAGEOP PageOp)
{
SWAPENTRY SwapEntry;
PFN_TYPE Page;
PFN_NUMBER Page;
NTSTATUS Status;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
@ -135,7 +135,7 @@ MmPageOutVirtualMemory(PMMSUPPORT AddressSpace,
PVOID Address,
PMM_PAGEOP PageOp)
{
PFN_TYPE Page;
PFN_NUMBER Page;
BOOLEAN WasDirty;
SWAPENTRY SwapEntry;
NTSTATUS Status;
@ -253,7 +253,7 @@ MmNotPresentFaultVirtualMemory(PMMSUPPORT AddressSpace,
* NOTES: This function is called with the address space lock held.
*/
{
PFN_TYPE Page;
PFN_NUMBER Page;
NTSTATUS Status;
PMM_REGION Region;
PMM_PAGEOP PageOp;
@ -457,7 +457,7 @@ MmModifyAttributes(PMMSUPPORT AddressSpace,
for (i=0; i < PAGE_ROUND_UP(RegionSize)/PAGE_SIZE; i++)
{
PFN_TYPE Page;
PFN_NUMBER Page;
if (MmIsPageSwapEntry(Process,
(char*)BaseAddress + (i * PAGE_SIZE)))
@ -718,10 +718,10 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
MemoryAreaLength = (ULONG_PTR)MemoryArea->EndingAddress -
(ULONG_PTR)MemoryArea->StartingAddress;
if (((ULONG)BaseAddress + RegionSize) > (ULONG)MemoryArea->EndingAddress)
if (((ULONG_PTR)BaseAddress + RegionSize) > (ULONG_PTR)MemoryArea->EndingAddress)
{
DPRINT("BaseAddress + RegionSize %x is larger than MemoryArea's EndingAddress %x\n",
(ULONG)BaseAddress + RegionSize, MemoryArea->EndingAddress);
(ULONG_PTR)BaseAddress + RegionSize, MemoryArea->EndingAddress);
MmUnlockAddressSpace(AddressSpace);
ObDereferenceObject(Process);
@ -853,7 +853,7 @@ static VOID
MmFreeVirtualMemoryPage(PVOID Context,
MEMORY_AREA* MemoryArea,
PVOID Address,
PFN_TYPE Page,
PFN_NUMBER Page,
SWAPENTRY SwapEntry,
BOOLEAN Dirty)
{
@ -1123,7 +1123,7 @@ NTSTATUS NTAPI
MmQueryAnonMem(PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
PULONG ResultLength)
PSIZE_T ResultLength)
{
PMM_REGION Region;
PVOID RegionBase = NULL;

View file

@ -81,7 +81,7 @@ NTAPI
MmDisableVirtualMapping(IN PEPROCESS Process,
IN PVOID Address,
OUT PBOOLEAN WasDirty,
OUT PPFN_TYPE Page)
OUT PPFN_NUMBER Page)
{
UNIMPLEMENTED;
while (TRUE);
@ -101,7 +101,7 @@ NTAPI
MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
IN PVOID Address,
IN ULONG Protection,
IN PPFN_TYPE Pages,
IN PPFN_NUMBER Pages,
IN ULONG PageCount)
{
UNIMPLEMENTED;
@ -114,7 +114,7 @@ NTAPI
MmCreateVirtualMapping(IN PEPROCESS Process,
IN PVOID Address,
IN ULONG Protection,
IN PPFN_TYPE Pages,
IN PPFN_NUMBER Pages,
IN ULONG PageCount)
{
UNIMPLEMENTED;
@ -136,7 +136,7 @@ MmDeleteVirtualMapping(IN PEPROCESS Process,
IN PVOID Address,
IN BOOLEAN FreePage,
OUT PBOOLEAN WasDirty,
OUT PPFN_TYPE Page)
OUT PPFN_NUMBER Page)
{
UNIMPLEMENTED;
while (TRUE);
@ -163,7 +163,7 @@ MmCreatePageFileMapping(IN PEPROCESS Process,
return 0;
}
PFN_TYPE
PFN_NUMBER
NTAPI
MmGetPfnForProcess(IN PEPROCESS Process,
IN PVOID Address)

Some files were not shown because too many files have changed in this diff Show more