if (LayoutList == NULL)
{
LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
++ if (LayoutList == NULL)
++ {
++ /* FIXME: Handle error! */
++ return;
++ }
}
ListEntry = GetFirstListEntry(LayoutList);
ListEntry = GetNextListEntry(ListEntry);
}
-- SetConsoleCodePage();
++ SetConsoleCodePage();
-- return INSTALL_INTRO_PAGE;
++ return INSTALL_INTRO_PAGE;
}
return LANGUAGE_PAGE;
PWCHAR UserData;
const MUI_LAYOUTS * LayoutsList;
ULONG uIndex = 0;
++ BOOL KeyboardLayoutsFound = FALSE;
/* Get default layout id */
if (!SetupFindFirstLineW (InfFile, L"NLS", L"DefaultLayout", &Context))
/* FIXME: Handle error! */
DPRINT("INF_GetData() failed\n");
DestroyGenericList(List, FALSE);
-- break;
++ return NULL;
}
if (_wcsicmp(LayoutsList[uIndex].LayoutID, KeyName) == 0)
if (UserData == NULL)
{
/* FIXME: Handle error! */
++ DPRINT("RtlAllocateHeap() failed\n");
++ DestroyGenericList(List, FALSE);
++ return NULL;
}
wcscpy(UserData, KeyName);
Buffer,
UserData,
_wcsicmp(KeyName, DefaultKBLayout) ? FALSE : TRUE);
++ KeyboardLayoutsFound = TRUE;
}
--
++
} while (SetupFindNextLine(&Context, &Context));
uIndex++;
} while (LayoutsList[uIndex].LangID != NULL);
++ /* FIXME: Handle this case */
++ if (!KeyboardLayoutsFound)
++ {
++ DPRINT1("No keyboard layouts have been found\n");
++ DestroyGenericList(List, FALSE);
++ return NULL;
++ }
++
return List;
}
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
-- strcpy(szErrorOut, "Language Default setting exists, but isn't readable");
++ sprintf(szErrorOut, "Language Default setting exists, but isn't readable (%S)", szIdBuffer);
return(FALSE);
}
ASSERT(Module);
memset(Module, 0, sizeof(LDR_DATA_TABLE_ENTRY));
Module->DllBase = (PVOID)ImageBase;
- Module->EntryPoint = (PVOID)NTHeaders->OptionalHeader.AddressOfEntryPoint;
+ Module->EntryPoint = (PVOID)(ULONG_PTR)NTHeaders->OptionalHeader.AddressOfEntryPoint;
if (Module->EntryPoint != 0)
Module->EntryPoint = (PVOID)((ULONG_PTR)Module->EntryPoint + (ULONG_PTR)Module->DllBase);
Module->SizeOfImage = LdrpGetResidentSize(NTHeaders);
PLDR_DATA_TABLE_ENTRY ModulePtr;
BOOLEAN ContainsPath;
UNICODE_STRING AdjustedName;
- unsigned i;
DPRINT("LdrFindEntryForName(Name %wZ)\n", Name);
return(STATUS_SUCCESS);
}
- LdrAdjustDllName (&AdjustedName, Name, FALSE);
-
- ContainsPath = (AdjustedName.Length >= 2 * sizeof(WCHAR) && L':' == AdjustedName.Buffer[1]);
- for (i = 0; ! ContainsPath && i < AdjustedName.Length / sizeof(WCHAR); i++)
- {
- ContainsPath = L'\\' == AdjustedName.Buffer[i] ||
- L'/' == AdjustedName.Buffer[i];
- }
+ ContainsPath = (Name->Length >= 2 * sizeof(WCHAR) && L':' == Name->Buffer[1]);
+ LdrAdjustDllName (&AdjustedName, Name, !ContainsPath);
if (LdrpLastModule)
{
? RVA(BaseAddress, ExFunctions[Ordinal - ExportDir->Base] )
: NULL);
- if (((ULONG)Function >= (ULONG)ExportDir) &&
- ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize))
+ if (((ULONG_PTR)Function >= (ULONG_PTR)ExportDir) &&
+ ((ULONG_PTR)Function < (ULONG_PTR)ExportDir + (ULONG_PTR)ExportDirSize))
{
DPRINT("Forward: %s\n", (PCHAR)Function);
Function = LdrFixupForward((PCHAR)Function);
{
Ordinal = ExOrdinals[Hint];
Function = RVA(BaseAddress, ExFunctions[Ordinal]);
- if (((ULONG)Function >= (ULONG)ExportDir) &&
- ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize))
+ if (((ULONG_PTR)Function >= (ULONG_PTR)ExportDir) &&
+ ((ULONG_PTR)Function < (ULONG_PTR)ExportDir + (ULONG_PTR)ExportDirSize))
{
DPRINT("Forward: %s\n", (PCHAR)Function);
Function = LdrFixupForward((PCHAR)Function);
{
Ordinal = ExOrdinals[mid];
Function = RVA(BaseAddress, ExFunctions[Ordinal]);
- if (((ULONG)Function >= (ULONG)ExportDir) &&
- ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize))
+ if (((ULONG_PTR)Function >= (ULONG_PTR)ExportDir) &&
+ ((ULONG_PTR)Function < (ULONG_PTR)ExportDir + (ULONG_PTR)ExportDirSize))
{
DPRINT("Forward: %s\n", (PCHAR)Function);
Function = LdrFixupForward((PCHAR)Function);
{
PIMAGE_DATA_DIRECTORY RelocationDDir;
PIMAGE_BASE_RELOCATION RelocationDir, RelocationEnd;
- ULONG Count, ProtectSize, OldProtect, OldProtect2;
+ ULONG Count, OldProtect, OldProtect2;
+ SIZE_T ProtectSize;
PVOID Page, ProtectPage, ProtectPage2;
PUSHORT TypeOffset;
ULONG_PTR Delta;
PVOID IATBase;
ULONG OldProtect;
ULONG Ordinal;
- ULONG IATSize;
+ SIZE_T IATSize;
if (ImportModuleDirectory == NULL || ImportModuleDirectory->Name == 0)
{
PVOID IATBase;
ULONG OldProtect;
ULONG Offset;
- ULONG IATSize;
+ SIZE_T IATSize;
PIMAGE_NT_HEADERS NTHeaders;
PCHAR Name;
ULONG Size;
#endif /* DBG || KDBG */
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
InsertTailList(&NtCurrentPeb()->Ldr->InInitializationOrderModuleList,
- &(*Module)->InInitializationOrderModuleList);
+ &(*Module)->InInitializationOrderLinks);
RtlLeaveCriticalSection (NtCurrentPeb()->LoaderLock);
}
return STATUS_SUCCESS;
IN ULONG Ordinal,
OUT PVOID *ProcedureAddress)
{
+ NTSTATUS Status = STATUS_PROCEDURE_NOT_FOUND;
if (Name && Name->Length)
{
TRACE_LDR("LdrGetProcedureAddress by NAME - %Z\n", Name);
DPRINT("LdrGetProcedureAddress (BaseAddress %p Name %Z Ordinal %lu ProcedureAddress %p)\n",
BaseAddress, Name, Ordinal, ProcedureAddress);
- if (Name && Name->Length)
+ _SEH2_TRY
+ {
+ if (Name && Name->Length)
{
/* by name */
*ProcedureAddress = LdrGetExportByName(BaseAddress, (PUCHAR)Name->Buffer, 0xffff);
if (*ProcedureAddress != NULL)
{
- return STATUS_SUCCESS;
+ Status = STATUS_SUCCESS;
}
DPRINT("LdrGetProcedureAddress: Can't resolve symbol '%Z'\n", Name);
}
- else
+ else
{
/* by ordinal */
Ordinal &= 0x0000FFFF;
*ProcedureAddress = LdrGetExportByOrdinal(BaseAddress, (WORD)Ordinal);
if (*ProcedureAddress)
{
- return STATUS_SUCCESS;
+ Status = STATUS_SUCCESS;
}
DPRINT("LdrGetProcedureAddress: Can't resolve symbol @%lu\n", Ordinal);
}
- return STATUS_PROCEDURE_NOT_FOUND;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = STATUS_DLL_NOT_FOUND;
+ }
+ _SEH2_END;
+
+ return Status;
}
/**********************************************************************
Entry = ModuleListHead->Blink;
while (Entry != ModuleListHead)
{
- Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
+ Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
if (((UnloadAll && Module->LoadCount == 0xFFFF) || Module->LoadCount == 0) &&
Module->Flags & LDRP_ENTRY_PROCESSED &&
!(Module->Flags & LDRP_UNLOAD_IN_PROGRESS))
{
TRACE_LDR("Unload %wZ - Calling entry point at %x\n",
&Module->BaseDllName, Module->EntryPoint);
- LdrpCallDllEntry(Module, DLL_PROCESS_DETACH, (PVOID)(Module->LoadCount == 0xFFFF ? 1 : 0));
+ LdrpCallDllEntry(Module, DLL_PROCESS_DETACH, (PVOID)(INT_PTR)(Module->LoadCount == 0xFFFF ? 1 : 0));
}
else
{
Entry = ModuleListHead->Blink;
while (Entry != ModuleListHead)
{
- Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
+ Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
Entry = Entry->Blink;
if (Module->Flags & LDRP_UNLOAD_IN_PROGRESS &&
((UnloadAll && Module->LoadCount != 0xFFFF) || Module->LoadCount == 0))
{
/* remove the module entry from the list */
RemoveEntryList (&Module->InLoadOrderLinks);
- RemoveEntryList (&Module->InInitializationOrderModuleList);
+ RemoveEntryList (&Module->InInitializationOrderLinks);
NtUnmapViewOfSection (NtCurrentProcess (), Module->DllBase);
NtClose (Module->SectionPointer);
Entry = ModuleListHead->Flink;
while (Entry != ModuleListHead)
{
- Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
+ Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
if (!(Module->Flags & (LDRP_LOAD_IN_PROGRESS|LDRP_UNLOAD_IN_PROGRESS|LDRP_ENTRY_PROCESSED)))
{
Module->Flags |= LDRP_LOAD_IN_PROGRESS;
TRACE_LDR("%wZ loaded - Calling init routine at %x for process attaching\n",
&Module->BaseDllName, Module->EntryPoint);
- Result = LdrpCallDllEntry(Module, DLL_PROCESS_ATTACH, (PVOID)(Module->LoadCount == 0xFFFF ? 1 : 0));
+ Result = LdrpCallDllEntry(Module, DLL_PROCESS_ATTACH, (PVOID)(INT_PTR)(Module->LoadCount == 0xFFFF ? 1 : 0));
if (!Result)
{
Status = STATUS_DLL_INIT_FAILED;
while (Entry != ModuleListHead)
{
- Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
+ Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
if (Module->Flags & LDRP_PROCESS_ATTACH_CALLED &&
!(Module->Flags & LDRP_DONT_CALL_FOR_THREADS) &&
!(Module->Flags & LDRP_UNLOAD_IN_PROGRESS))
Entry = ModuleListHead->Blink;
while (Entry != ModuleListHead)
{
- Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
+ Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks);
if (Module->Flags & LDRP_PROCESS_ATTACH_CALLED &&
!(Module->Flags & LDRP_DONT_CALL_FOR_THREADS) &&
LongPtr = (PULONG)((ULONG_PTR)Address + Offset);
*LongPtr += Delta;
break;
+#ifdef _WIN64
+ case IMAGE_REL_BASED_DIR64:
+ LongPtr = (PULONG)((ULONG_PTR)Address + Offset);
+ *LongPtr += Delta;
+ break;
+#endif
case IMAGE_REL_BASED_HIGHADJ:
case IMAGE_REL_BASED_MIPS_JMPADDR:
WINAPI
CancelDC(HDC hdc)
{
-- UNIMPLEMENTED;
-- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-- return FALSE;
++ /* FIXME Sharememory */
++ return NtGdiCancelDC(hdc);
}
int
WINAPI
DrawEscape(HDC hdc,
-- int a1,
-- int a2,
-- LPCSTR a3)
++ INT nEscape,
++ INT cbInput,
++ LPCSTR lpszInData)
{
-- UNIMPLEMENTED;
-- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-- return 0;
++ /* FIXME Sharememory */
++ return NtGdiDrawEscape(hdc, nEscape, cbInput, (LPSTR) lpszInData);
}
int
WINAPI
EnumObjects(HDC hdc,
-- int a1,
-- GOBJENUMPROC a2,
-- LPARAM a3)
++ int nObjectType,
++ GOBJENUMPROC lpObjectFunc,
++ LPARAM lParam)
{
++ switch (nObjectType)
++ {
++ case OBJ_BRUSH:
++ case OBJ_PEN:
++ break;
++
++ default:
++ SetLastError(ERROR_INVALID_PARAMETER);
++ return 0;
++ }
++
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
HMETAFILE
WINAPI
SetMetaFileBitsEx(
-- UINT a0,
-- CONST BYTE *a1
++ UINT size,
++ CONST BYTE *lpData
)
{
++ const METAHEADER *mh_in = (const METAHEADER *)lpData;
++
++ if (size & 1) return 0;
++
++ if (!size || mh_in->mtType != METAFILE_MEMORY || mh_in->mtVersion != 0x300 ||
++ mh_in->mtHeaderSize != sizeof(METAHEADER) / 2)
++ {
++ SetLastError(ERROR_INVALID_DATA);
++ return 0;
++ }
++
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
+ /***********************************************************************
+ * SetupEnumInfSectionsA (SETUPAPI.@)
+ */
+ BOOL WINAPI SetupEnumInfSectionsA( HINF hinf, UINT index, PSTR buffer, DWORD size, DWORD *need )
+ {
+ struct inf_file *file = hinf;
+
+ for (file = hinf; file; file = file->next)
+ {
+ if (index < file->nb_sections)
+ {
+ DWORD len = WideCharToMultiByte( CP_ACP, 0, file->sections[index]->name, -1,
+ NULL, 0, NULL, NULL );
+ if (need) *need = len;
+ if (!buffer)
+ {
+ if (!size) return TRUE;
+ SetLastError( ERROR_INVALID_USER_BUFFER );
+ return FALSE;
+ }
+ if (len > size)
+ {
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ return FALSE;
+ }
+ WideCharToMultiByte( CP_ACP, 0, file->sections[index]->name, -1, buffer, size, NULL, NULL );
+ return TRUE;
+ }
+ index -= file->nb_sections;
+ }
+ SetLastError( ERROR_NO_MORE_ITEMS );
+ return FALSE;
+ }
+
+
+ /***********************************************************************
+ * SetupEnumInfSectionsW (SETUPAPI.@)
+ */
+ BOOL WINAPI SetupEnumInfSectionsW( HINF hinf, UINT index, PWSTR buffer, DWORD size, DWORD *need )
+ {
+ struct inf_file *file = hinf;
+
+ for (file = hinf; file; file = file->next)
+ {
+ if (index < file->nb_sections)
+ {
+ DWORD len = strlenW( file->sections[index]->name ) + 1;
+ if (need) *need = len;
+ if (!buffer)
+ {
+ if (!size) return TRUE;
+ SetLastError( ERROR_INVALID_USER_BUFFER );
+ return FALSE;
+ }
+ if (len > size)
+ {
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ return FALSE;
+ }
+ memcpy( buffer, file->sections[index]->name, len * sizeof(WCHAR) );
+ return TRUE;
+ }
+ index -= file->nb_sections;
+ }
+ SetLastError( ERROR_NO_MORE_ITEMS );
+ return FALSE;
+ }
+
+
/***********************************************************************
* SetupGetLineCountA (SETUPAPI.@)
*/
struct inf_file *file = hinf;
int section_index;
-- SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next)
{
if ((section_index = find_section( file, section )) == -1) continue;
-- SetLastError( ERROR_LINE_NOT_FOUND );
if (index < file->sections[section_index]->nb_lines)
{
context->Inf = hinf;
index -= file->sections[section_index]->nb_lines;
}
TRACE( "(%p,%s) not found\n", hinf, debugstr_w(section) );
++ SetLastError( ERROR_LINE_NOT_FOUND );
return FALSE;
}
struct inf_file *file;
int section_index;
-- SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next)
{
if ((section_index = find_section( file, section )) == -1) continue;
ctx.Line = -1;
return SetupFindNextMatchLineW( &ctx, key, context );
}
-- SetLastError( ERROR_LINE_NOT_FOUND ); /* found at least one section */
if (file->sections[section_index]->nb_lines)
{
context->Inf = hinf;
}
}
TRACE( "(%p,%s,%s): not found\n", hinf, debugstr_w(section), debugstr_w(key) );
++ SetLastError( ERROR_LINE_NOT_FOUND );
return FALSE;
}
{'D','e','f','a','u','l','t','D','e','s','t','D','i','r',0};
INFCONTEXT ctx;
-- WCHAR *dir;
-- INT size;
++ WCHAR *dir, systemdir[MAX_PATH];
++ unsigned int size;
++ BOOL ret = FALSE;
TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer,
buffer_size, required_size);
-- if (context && !SetupFindFirstLineW( hinf, destination_dirs, NULL, context )) return FALSE;
-- else if (section && !SetupFindFirstLineW( hinf, section, NULL, &ctx )) return FALSE;
-- else if (!SetupFindFirstLineW( hinf, destination_dirs, default_dest_dir, &ctx )) return FALSE;
--
-- if (!(dir = PARSER_get_dest_dir( context ? context : &ctx ))) return FALSE;
--
-- size = lstrlenW( dir ) + 1;
++ if (context) ret = SetupFindFirstLineW( hinf, destination_dirs, NULL, context );
++ else if (section)
++ {
++ if (!(ret = SetupFindFirstLineW( hinf, destination_dirs, section, &ctx )))
++ ret = SetupFindFirstLineW( hinf, destination_dirs, default_dest_dir, &ctx );
++ }
++ if (!ret || !(dir = PARSER_get_dest_dir( context ? context : &ctx )))
++ {
++ GetSystemDirectoryW( systemdir, MAX_PATH );
++ dir = systemdir;
++ }
++ size = strlenW( dir ) + 1;
if (required_size) *required_size = size;
if (buffer)
return FALSE;
}
}
-- HeapFree( GetProcessHeap(), 0, dir );
++ if (dir != systemdir) HeapFree( GetProcessHeap(), 0, dir );
return TRUE;
}
}
--/*
-- * @unimplemented
-- */
--VOID
--EXPORT
--NdisMGetDeviceProperty(
-- IN NDIS_HANDLE MiniportAdapterHandle,
-- IN OUT PDEVICE_OBJECT *PhysicalDeviceObject OPTIONAL,
-- IN OUT PDEVICE_OBJECT *FunctionalDeviceObject OPTIONAL,
-- IN OUT PDEVICE_OBJECT *NextDeviceObject OPTIONAL,
-- IN OUT PCM_RESOURCE_LIST *AllocatedResources OPTIONAL,
-- IN OUT PCM_RESOURCE_LIST *AllocatedResourcesTranslated OPTIONAL)
--/*
-- * FUNCTION:
-- * ARGUMENTS:
-- * NOTES:
-- * NDIS 5.0
-- */
--{
-- UNIMPLEMENTED
--}
--
--
/*
* @unimplemented
*/
OUT PUCHAR Data)
{
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- *Data = READ_PORT_UCHAR((PUCHAR)Port); // FIXME: What to do with WrapperConfigurationContext?
+ *Data = READ_PORT_UCHAR(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext?
}
\f
OUT PULONG Data)
{
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- *Data = READ_PORT_ULONG((PULONG)Port); // FIXME: What to do with WrapperConfigurationContext?
+ *Data = READ_PORT_ULONG(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext?
}
\f
OUT PUSHORT Data)
{
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- *Data = READ_PORT_USHORT((PUSHORT)Port); // FIXME: What to do with WrapperConfigurationContext?
+ *Data = READ_PORT_USHORT(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext?
}
\f
IN UCHAR Data)
{
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- WRITE_PORT_UCHAR((PUCHAR)Port, Data); // FIXME: What to do with WrapperConfigurationContext?
+ WRITE_PORT_UCHAR(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext?
}
\f
IN ULONG Data)
{
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- WRITE_PORT_ULONG((PULONG)Port, Data); // FIXME: What to do with WrapperConfigurationContext?
+ WRITE_PORT_ULONG(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext?
}
\f
IN USHORT Data)
{
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- WRITE_PORT_USHORT((PUSHORT)Port, Data); // FIXME: What to do with WrapperConfigurationContext?
+ WRITE_PORT_USHORT(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext?
}
\f
NDIS_DbgPrint(MIN_TRACE, ("Didn't get enough map registers from hal - requested 0x%x, got 0x%x\n",
MapRegistersPerBaseRegister, AvailableMapRegisters));
+ AdapterObject->DmaOperations->PutDmaAdapter(AdapterObject);
+ Adapter->NdisMiniportBlock.SystemAdapterObject = NULL;
return NDIS_STATUS_RESOURCES;
}
if(!Adapter->NdisMiniportBlock.MapRegisters)
{
NDIS_DbgPrint(MIN_TRACE, ("insufficient resources.\n"));
+ AdapterObject->DmaOperations->PutDmaAdapter(AdapterObject);
+ Adapter->NdisMiniportBlock.SystemAdapterObject = NULL;
return NDIS_STATUS_RESOURCES;
}
{
NDIS_DbgPrint(MIN_TRACE, ("IoAllocateAdapterChannel failed: 0x%x\n", NtStatus));
ExFreePool(Adapter->NdisMiniportBlock.MapRegisters);
+ AdapterObject->DmaOperations->PutDmaAdapter(AdapterObject);
+ Adapter->NdisMiniportBlock.CurrentMapRegister = Adapter->NdisMiniportBlock.BaseMapRegistersNeeded = 0;
+ Adapter->NdisMiniportBlock.SystemAdapterObject = NULL;
return NDIS_STATUS_RESOURCES;
}
{
NDIS_DbgPrint(MIN_TRACE, ("KeWaitForSingleObject failed: 0x%x\n", NtStatus));
ExFreePool(Adapter->NdisMiniportBlock.MapRegisters);
+ AdapterObject->DmaOperations->PutDmaAdapter(AdapterObject);
+ Adapter->NdisMiniportBlock.CurrentMapRegister = Adapter->NdisMiniportBlock.BaseMapRegistersNeeded = 0;
+ Adapter->NdisMiniportBlock.SystemAdapterObject = NULL;
return NDIS_STATUS_RESOURCES;
}
if(AddressSpace)
{
ASSERT(TranslatedAddress.u.HighPart == 0);
- *PortOffset = (PVOID) TranslatedAddress.u.LowPart;
+ *PortOffset = (PVOID)(ULONG_PTR)TranslatedAddress.QuadPart;
NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x\n", *PortOffset));
return NDIS_STATUS_SUCCESS;
}
NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
}
+ VOID NTAPI
+ MiniQueryComplete(
+ IN NDIS_HANDLE MiniportAdapterHandle,
+ IN NDIS_STATUS Status)
+ {
+ UNIMPLEMENTED;
+ }
+
+ VOID NTAPI
+ MiniSetComplete(
+ IN NDIS_HANDLE MiniportAdapterHandle,
+ IN NDIS_STATUS Status)
+ {
+ UNIMPLEMENTED;
+ }
+
\f
VOID NTAPI
MiniIndicateReceivePacket(
return NdisStatus;
}
+
+ NDIS_DbgPrint(MIN_TRACE, ("Current lookahead is %ld\n", Adapter->NdisMiniportBlock.CurrentLookahead));
+ NDIS_DbgPrint(MIN_TRACE, ("Maximum lookahead is %ld\n", Adapter->NdisMiniportBlock.MaximumLookahead));
+
NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAXIMUM_SEND_PACKETS, sizeof(ULONG),
&Adapter->NdisMiniportBlock.MaxSendPackets, &BytesWritten);
Adapter->NdisMiniportBlock.PacketIndicateHandler= MiniIndicateReceivePacket;
Adapter->NdisMiniportBlock.StatusHandler = MiniStatus;
Adapter->NdisMiniportBlock.StatusCompleteHandler= MiniStatusComplete;
+ Adapter->NdisMiniportBlock.SendPacketsHandler = ProSendPackets;
+ Adapter->NdisMiniportBlock.QueryCompleteHandler = MiniQueryComplete;
+ Adapter->NdisMiniportBlock.SetCompleteHandler = MiniSetComplete;
/*
* Call MiniportInitialize.
ShutdownHandler);
}
++/*
++ * @implemented
++ */
++VOID
++EXPORT
++NdisMGetDeviceProperty(
++ IN NDIS_HANDLE MiniportAdapterHandle,
++ IN OUT PDEVICE_OBJECT *PhysicalDeviceObject OPTIONAL,
++ IN OUT PDEVICE_OBJECT *FunctionalDeviceObject OPTIONAL,
++ IN OUT PDEVICE_OBJECT *NextDeviceObject OPTIONAL,
++ IN OUT PCM_RESOURCE_LIST *AllocatedResources OPTIONAL,
++ IN OUT PCM_RESOURCE_LIST *AllocatedResourcesTranslated OPTIONAL)
++/*
++ * FUNCTION:
++ * ARGUMENTS:
++ * NOTES:
++ * NDIS 5.0
++ */
++{
++ PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle;
++
++ NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
++
++ if (PhysicalDeviceObject != NULL)
++ *PhysicalDeviceObject = Adapter->NdisMiniportBlock.PhysicalDeviceObject;
++
++ if (FunctionalDeviceObject != NULL)
++ *FunctionalDeviceObject = Adapter->NdisMiniportBlock.DeviceObject;
++
++ if (NextDeviceObject != NULL)
++ *NextDeviceObject = Adapter->NdisMiniportBlock.NextDeviceObject;
++
++ if (AllocatedResources != NULL)
++ *AllocatedResources = Adapter->NdisMiniportBlock.AllocatedResources;
++
++ if (AllocatedResourcesTranslated != NULL)
++ *AllocatedResourcesTranslated = Adapter->NdisMiniportBlock.AllocatedResourcesTranslated;
++}
++
/* EOF */
NTSTATUS
NTAPI
--WdmAudClose(
++WdmAudIoctlClose(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PWDMAUD_DEVICE_INFO DeviceInfo,
case IOCTL_GETCAPABILITIES:
return WdmAudCapabilities(DeviceObject, Irp, DeviceInfo, ClientInfo);
case IOCTL_CLOSE_WDMAUD:
-- return WdmAudClose(DeviceObject, Irp, DeviceInfo, ClientInfo);
++ return WdmAudIoctlClose(DeviceObject, Irp, DeviceInfo, ClientInfo);
case IOCTL_GETDEVID:
case IOCTL_GETVOLUME:
case IOCTL_SETVOLUME:
MmQuerySectionView(PMEMORY_AREA MemoryArea,
PVOID Address,
PMEMORY_BASIC_INFORMATION Info,
- PULONG ResultLength)
+ PSIZE_T ResultLength)
{
PMM_REGION Region;
PVOID RegionBaseAddress;
LARGE_INTEGER Offset;
CHAR Buffer;
FILE_STANDARD_INFORMATION FileInfo;
+ ULONG Length;
/*
* Create the section
FileStandardInformation,
sizeof(FILE_STANDARD_INFORMATION),
&FileInfo,
- &Iosb.Information);
+ &Length);
+ Iosb.Information = Length;
if (!NT_SUCCESS(Status))
{
ObDereferenceObject(Section);
NtQuerySection(IN HANDLE SectionHandle,
IN SECTION_INFORMATION_CLASS SectionInformationClass,
OUT PVOID SectionInformation,
- IN ULONG SectionInformationLength,
- OUT PULONG ResultLength OPTIONAL)
+ IN SIZE_T SectionInformationLength,
+ OUT PSIZE_T ResultLength OPTIONAL)
{
PROS_SECTION_OBJECT Section;
KPROCESSOR_MODE PreviousMode;
sizeof(ExSectionInfoClass) / sizeof(ExSectionInfoClass[0]),
SectionInformation,
SectionInformationLength,
+ NULL,
ResultLength,
PreviousMode);
}
}
- DPRINT1("FIXME: didn't check for outstanding write probes\n");
+ DPRINT("FIXME: didn't check for outstanding write probes\n");
return TRUE;
}
NTSTATUS NTAPI
MmMapViewInSystemSpace (IN PVOID SectionObject,
OUT PVOID * MappedBase,
- IN OUT PULONG ViewSize)
+ IN OUT PSIZE_T ViewSize)
{
PROS_SECTION_OBJECT Section;
PMM_AVL_TABLE AddressSpace;
ProcessBasicInfo->UniqueProcessId = (ULONG_PTR)Process->
UniqueProcessId;
ProcessBasicInfo->InheritedFromUniqueProcessId =
- (ULONG)Process->InheritedFromUniqueProcessId;
+ (ULONG_PTR)Process->InheritedFromUniqueProcessId;
ProcessBasicInfo->BasePriority = Process->Pcb.BasePriority;
}
_SEH2_TRY
{
/* Write back the Session ID */
- SessionInfo->SessionId = Process->Session;
+ SessionInfo->SessionId = PtrToUlong(Process->Session);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
KIRQL OldIrql;
PAGED_CODE();
- /* Verify Information Class validity */
- #if 0
- Status = DefaultQueryInfoBufferCheck(ThreadInformationClass,
- PsThreadInfoClass,
- RTL_NUMBER_OF(PsThreadInfoClass),
- ThreadInformation,
- ThreadInformationLength,
- ReturnLength,
- PreviousMode);
- if (!NT_SUCCESS(Status)) return Status;
- #endif
+ if (PreviousMode != KernelMode)
+ {
+ _SEH2_TRY
+ {
+ ProbeForWrite(ThreadInformation,
+ ThreadInformationLength,
+ sizeof(ULONG));
+
+ if (ReturnLength)
+ {
+ ProbeForWriteUlong(ReturnLength);
+ }
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
+
+ if (!NT_SUCCESS(Status)) return Status;
+ }
/* Check what class this is */
Access = THREAD_QUERY_INFORMATION;
KeLowerIrql(OldIrql);
break;
+ case ThreadDescriptorTableEntry:
+ DPRINT1("NtQueryInformationThread(): case ThreadDescriptorTableEntry not implemented!\n");
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+
+ case ThreadPriorityBoost:
+
+ /* Set the return length*/
+ Length = sizeof(ULONG);
+
+ if (ThreadInformationLength != Length)
+ {
+ Status = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
+ _SEH2_TRY
+ {
+ *(PULONG)ThreadInformation = Thread->Tcb.DisableBoost ? 1 : 0;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
+ break;
+
/* Anything else */
default:
if (pWnd)
Wnd = pWnd->Wnd;
+ RECTL_vMakeWellOrdered(lpRc);
hMemBmp = NtGdiCreateCompatibleBitmap(hDc,
lpRc->right - lpRc->left,
lpRc->bottom - lpRc->top);
&& !(Wnd->ExStyle & WS_EX_TOOLWINDOW);
}
else
- HasIcon = (BOOL) hIcon;
+ HasIcon = (hIcon != 0);
IconWidth = UserGetSystemMetrics(SM_CXSIZE) + Padding;