Skip to content

Samples\Windowing\cpp\cpp-winui custom title bar crash #329

@JamasChuang94

Description

@JamasChuang94

Select the titlebar twice and use the minimize and maximize buttons in the custom status bar to crash. The void* value{} in TitleBar() is empty.

In

void TitlebarPage::SetCustomTitleBarDragRegion()
   {
      int titleBarHeight = m_appWindow.TitleBar().Height(); 
    }

  template <typename D> auto consume_Microsoft_UI_Windowing_IAppWindow<D>::TitleBar() const
  {
      void* value{};//Empty
      check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::UI::Windowing::IAppWindow)->get_TitleBar(&value));// &value 0xFFFFFFFFFFFFFFFF 
      return winrt::Microsoft::UI::Windowing::AppWindowTitleBar{ value, take_ownership_from_abi };
  }

'SampleApp.exe' (Win32): 'C:\Windows\System32\ninput.dll' has been loaded.
'SampleApp.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.5_5001.70.1338.0_x64__8wekyb3d8bbwe\Microsoft.UI.Xaml.Phone.dll'.
Natvis C++/WinRT: Exception in
...
cppwinrt_visualizer::EvaluateVisualizedExpression
Exception thrown at 0x00007FF6CFFF7645 (in SampleApp.exe): 0xC0000005: An access violation occurred while reading location 0xFFFFFFFFFFFFFFFF.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions