Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create TXT records #466

Open
StefanoN-Infotronics opened this issue May 14, 2024 · 2 comments
Open

Unable to create TXT records #466

StefanoN-Infotronics opened this issue May 14, 2024 · 2 comments

Comments

@StefanoN-Infotronics
Copy link

Describe the bug and how to reproduce
When trying to assign a DATA_TEXT_PTR structure to the Data property of a DNS_RECORD, an out of memory exception occurs.
The DATA_TEXT_PTR only has one string in the string array.

A clear and concise description of the bug and how to reproduce it. If an exception is involved, include the full output of the exception (stack trace, message, error code, etc.).

Unhandled exception: System.InsufficientMemoryException: Insufficient memory to continue the execution of the program.
at Vanara.Extensions.InteropExtensions.WriteNoChecks(IntPtr ptr, Object value, Int32 offset, SizeT allocatedBytes)
at Vanara.Extensions.InteropExtensions.Write(IntPtr ptr, Object value, Int32 offset, SizeT allocatedBytes)
at Vanara.PInvoke.DnsApi.DNS_RECORD.set_Data(Object value)
at InfoTronics.AOD.AspAdmin.ASPDns.CreateTextDNSEntry(String uri, HdbValues data) in e:\source\projects\Infotronics.AOD.AspAdmin\src\Infotronics.AOD.AspAdmin\ASPDns.cs:line 261
at AspAdminConsoleTest.Engine.Run() in e:\source\projects\Infotronics.AOD.AspAdmin\src\AspAdminConsoleTest\Engine.cs:line 56
at AspAdminConsoleTest.Program.Run(EngineOptions engineOptions, IHost host) in e:\source\projects\Infotronics.AOD.AspAdmin\src\AspAdminConsoleTest\Program.cs:line 81
at System.CommandLine.NamingConventionBinder.CommandHandler.GetExitCodeAsync(Object returnValue)
at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
at System.CommandLine.Hosting.HostingAction.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
at System.CommandLine.Hosting.HostingAction.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
What code is involved
Vanara.PInvoke.DnsApi

The method, file path and library causing the issue. If you have code that will reproduce the bug, please include it here.

Expected behavior
It should not have an insufficient memory exception.,
A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

@dahall
Copy link
Owner

dahall commented May 29, 2024

I am not finding documentation on the internet for DATA_TEXT_PTR. Can you point me to any details? Do you maybe mean the TXT field of type DNS_TXT_DATA? Can you confirm your program is using Unicode instead of Ansi as well?

@dahall
Copy link
Owner

dahall commented May 29, 2024

If a DNS_TXT_DATA, are you setting both fields?

Data = new DNS_TXT_DATA { dwStringCount = 1, pStringArray = ["Test"] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants