Sync to trunk r40610
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 20 Apr 2009 19:32:39 +0000 (19:32 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 20 Apr 2009 19:32:39 +0000 (19:32 +0000)
svn path=/branches/ros-amd64-bringup/; revision=40611

14 files changed:
1  2 
reactos/base/setup/usetup/interface/usetup.c
reactos/base/setup/usetup/settings.c
reactos/boot/freeldr/freeldr/reactos/reactos.c
reactos/dll/ntdll/ldr/utils.c
reactos/dll/win32/gdi32/misc/stubs.c
reactos/dll/win32/setupapi/parser.c
reactos/dll/win32/setupapi/query.c
reactos/drivers/network/ndis/ndis/50stubs.c
reactos/drivers/network/ndis/ndis/io.c
reactos/drivers/network/ndis/ndis/miniport.c
reactos/drivers/wdm/audio/legacy/wdmaud/control.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/ps/query.c
reactos/subsystems/win32/win32k/ntuser/painting.c

@@@ -580,6 -580,6 +580,11 @@@ UpdateKBLayout(VOID
      if (LayoutList == NULL)
      {
          LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
++        if (LayoutList == NULL)
++        {
++            /* FIXME: Handle error! */
++            return;
++        }
      }
  
      ListEntry = GetFirstListEntry(LayoutList);
@@@ -841,9 -841,9 +846,9 @@@ SetupStartPage(PINPUT_RECORD Ir
  
                        ListEntry = GetNextListEntry(ListEntry);
                }
--        SetConsoleCodePage();
++              SetConsoleCodePage();
  
--          return INSTALL_INTRO_PAGE;
++              return INSTALL_INTRO_PAGE;
      }
  
      return LANGUAGE_PAGE;
@@@ -825,6 -825,6 +825,7 @@@ CreateKeyboardLayoutList(HINF InfFile, 
      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;
  }
  
@@@ -330,7 -330,7 +330,7 @@@ FrLdrLoadNlsFiles(PCHAR szSystemRoot
      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);
      }
  
Simple merge
@@@ -78,9 -78,9 +78,8 @@@ BOO
  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;
@@@ -182,10 -182,10 +191,21 @@@ SetBoundsRect(HDC hdc
  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;
@@@ -1425,11 -1494,11 +1494,9 @@@ BOOL WINAPI SetupGetLineByIndexW( HINF 
      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;
  }
  
@@@ -1485,7 -1554,7 +1553,6 @@@ BOOL WINAPI SetupFindFirstLineW( HINF h
      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;
  }
  
@@@ -563,19 -563,19 +563,25 @@@ BOOL WINAPI SetupGetTargetPathW( HINF h
          {'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;
  }
  
@@@ -246,29 -246,29 +246,6 @@@ NdisMDeregisterDevice
  }
  
  
--/*
-- * @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
   */
@@@ -2602,5 -2625,5 +2625,44 @@@ NdisRegisterAdapterShutdownHandler
                                          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 */
  
@@@ -556,7 -556,7 +556,7 @@@ WdmAudCapabilities
  
  NTSTATUS
  NTAPI
--WdmAudClose(
++WdmAudIoctlClose(
      IN  PDEVICE_OBJECT DeviceObject,
      IN  PIRP Irp,
      IN  PWDMAUD_DEVICE_INFO DeviceInfo,
@@@ -630,7 -630,7 +630,7 @@@ WdmAudDeviceControl
          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:
Simple merge
Simple merge