From e67af5393098216569470faa84ae6b5f28e93212 Mon Sep 17 00:00:00 2001 From: Mike Hunhoff Date: Fri, 20 Sep 2024 16:13:55 -0600 Subject: [PATCH] rules: dotnet: adding new .NET rules --- nursery/access-unmanaged-com-objects-in-dotnet.yml | 12 ++++++++++++ .../implement-ui-automation-client-in-dotnet.yml | 14 ++++++++++++++ ...ct-with-shortcut-via-iwshshortcut-in-dotnet.yml | 14 ++++++++++++++ ...eract-with-windows-scripting-host-in-dotnet.yml | 14 ++++++++++++++ nursery/use-dotnet-library-simplejson.yml | 14 ++++++++++++++ nursery/use-dotnet-library-websocket-sharp.yml | 14 ++++++++++++++ 6 files changed, 82 insertions(+) create mode 100644 nursery/access-unmanaged-com-objects-in-dotnet.yml create mode 100644 nursery/implement-ui-automation-client-in-dotnet.yml create mode 100644 nursery/interact-with-shortcut-via-iwshshortcut-in-dotnet.yml create mode 100644 nursery/interact-with-windows-scripting-host-in-dotnet.yml create mode 100644 nursery/use-dotnet-library-simplejson.yml create mode 100644 nursery/use-dotnet-library-websocket-sharp.yml diff --git a/nursery/access-unmanaged-com-objects-in-dotnet.yml b/nursery/access-unmanaged-com-objects-in-dotnet.yml new file mode 100644 index 00000000..7e179075 --- /dev/null +++ b/nursery/access-unmanaged-com-objects-in-dotnet.yml @@ -0,0 +1,12 @@ +rule: + meta: + name: access unmanaged COM objects in .NET + namespace: host-interaction/com + authors: + - mehunhoff@google.com + scopes: + static: function + dynamic: unsupported # requires .NET API feature + features: + - or: + - api: System.Runtime.InteropServices.Marshal::GetTypeFromCLSID diff --git a/nursery/implement-ui-automation-client-in-dotnet.yml b/nursery/implement-ui-automation-client-in-dotnet.yml new file mode 100644 index 00000000..b54f3e59 --- /dev/null +++ b/nursery/implement-ui-automation-client-in-dotnet.yml @@ -0,0 +1,14 @@ +rule: + meta: + name: implement UI automation client in .NET + namespace: host-interaction/ui/automation + authors: + - mehunhoff@google.com + scopes: + static: file + dynamic: unsupported # requires .NET Namespace feature + references: + - https://learn.microsoft.com/en-us/dotnet/api/system.windows.automation?view=windowsdesktop-8.0 + features: + - or: + - namespace: System.Windows.Automation diff --git a/nursery/interact-with-shortcut-via-iwshshortcut-in-dotnet.yml b/nursery/interact-with-shortcut-via-iwshshortcut-in-dotnet.yml new file mode 100644 index 00000000..367679de --- /dev/null +++ b/nursery/interact-with-shortcut-via-iwshshortcut-in-dotnet.yml @@ -0,0 +1,14 @@ +rule: + meta: + name: interact with shortcut via IWshShortcut in .NET + namespace: host-interaction/shortcut + authors: + - mehunhoff@google.com + scopes: + static: function + dynamic: unsupported # requires .NET Class feature + references: + - https://stackoverflow.com/questions/4897655/create-a-shortcut-on-desktop + features: + - or: + - class: IWshRuntimeLibrary.IWshShortcut diff --git a/nursery/interact-with-windows-scripting-host-in-dotnet.yml b/nursery/interact-with-windows-scripting-host-in-dotnet.yml new file mode 100644 index 00000000..fb54460d --- /dev/null +++ b/nursery/interact-with-windows-scripting-host-in-dotnet.yml @@ -0,0 +1,14 @@ +rule: + meta: + name: interact with Windows Scripting Host in .NET + namespace: host-interaction/wsh + authors: + - mehunhoff@google.com + scopes: + static: file + dynamic: unsupported # requires .NET Namespace feature + references: + - https://stackoverflow.com/questions/4897655/create-a-shortcut-on-desktop + features: + - or: + - namespace: IWshRuntimeLibrary diff --git a/nursery/use-dotnet-library-simplejson.yml b/nursery/use-dotnet-library-simplejson.yml new file mode 100644 index 00000000..ba5963e2 --- /dev/null +++ b/nursery/use-dotnet-library-simplejson.yml @@ -0,0 +1,14 @@ +rule: + meta: + name: use .NET library SimpleJSON + namespace: data-manipulation/json + authors: + - mehunhoff@google.com + scopes: + static: file + dynamic: unsupported # requires .NET Class feature + references: + - https://github.com/mhallin/SimpleJSON.NET + features: + - or: + - class: Json.SimpleJson diff --git a/nursery/use-dotnet-library-websocket-sharp.yml b/nursery/use-dotnet-library-websocket-sharp.yml new file mode 100644 index 00000000..791e61d1 --- /dev/null +++ b/nursery/use-dotnet-library-websocket-sharp.yml @@ -0,0 +1,14 @@ +rule: + meta: + name: use .NET library websocket-sharp + namespace: communication/websocket + authors: + - mehunhoff@google.com + scopes: + static: file + dynamic: unsupported # requires .NET Namespace feature + references: + - https://github.com/sta/websocket-sharp + features: + - or: + - namespace: WebSocketSharp