You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ------------------------------------------------------------------------------// <auto-generated>// This code was generated by a tool.//// Changes to this file may cause incorrect behavior and will be lost if// the code is regenerated.// </auto-generated>// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981usingglobal::System;usingglobal::System.Diagnostics;usingglobal::System.Diagnostics.CodeAnalysis;usingglobal::System.Runtime.CompilerServices;usingglobal::System.Runtime.InteropServices;usingwinmdroot=global::Windows.Win32;namespaceWindows.Win32{namespaceUI.WindowsAndMessaging{/// <summary>Serves as a standard header for information related to a device event reported through the WM_DEVICECHANGE message.</summary>/// <remarks>/// <para><see href="https://learn.microsoft.com/windows/win32/api/dbt/ns-dbt-dev_broadcast_hdr">Learn more about this API from docs.microsoft.com</see>.</para>/// </remarks>[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32","0.3.162+1beb6ff56f.RR")]internalpartialstructDEV_BROADCAST_HDR{/// <summary>/// <para>The size of this structure, in bytes.</para>/// <para>If this is a user-defined event, this member must be the size of this header, plus the size of the variable-length data in the <a href="https://docs.microsoft.com/windows/win32/api/dbt/ns-dbt-_dev_broadcast_userdefined">_DEV_BROADCAST_USERDEFINED</a> structure.</para>/// <para><see href="https://learn.microsoft.com/windows/win32/api/dbt/ns-dbt-dev_broadcast_hdr#members">Read more on docs.microsoft.com</see>.</para>/// </summary>internaluintdbch_size;/// <summary></summary>internalwinmdroot.UI.WindowsAndMessaging.DEV_BROADCAST_HDR_DEVICE_TYPEdbch_devicetype;/// <summary>Reserved; do not use.</summary>internaluintdbch_reserved;}}}
Code for which the compiler is complaining: `private Windows.Win32.UI.WindowsAndMessaging.DEV_BROADCAST_HDR_DEVICE_TYPE broadcast;`
with error ` error CS0234: The type or namespace name 'UI' does not exist in the namespace 'Windows.Win32' (are you missing an assembly reference?)`
EDIT
PInvoke only contains following constants, which doesn't match the docs
// ------------------------------------------------------------------------------// <auto-generated>// This code was generated by a tool.//// Changes to this file may cause incorrect behavior and will be lost if// the code is regenerated.// </auto-generated>// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981usingglobal::System;usingglobal::System.Diagnostics;usingglobal::System.Diagnostics.CodeAnalysis;usingglobal::System.Runtime.CompilerServices;usingglobal::System.Runtime.InteropServices;usingwinmdroot=global::Windows.Win32;namespaceWindows.Win32{internalstaticpartialclassPInvoke{internalconstuintDBT_DEVTYP_DEVNODE=1U;internalconstuintDBT_DEVTYP_NET=4U;}}
EDIT: generated source files are empty

reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The
NativeMethods.txt
contains following lines:From references following code is available:
Windows.Win32.DEV_BROADCAST_HDR.g.cs
EDIT
PInvoke only contains following constants, which doesn't match the docs
EDIT: generated source files are empty
What am i doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions