Skip to content

x/sys/windows: Add WSALookupService #54232

@PumpkinSeed

Description

@PumpkinSeed

Brief overview

Adding the following structs and functions:

Implementation proposal

I started to wrap up a possible implementation. I wrote everything in C first and after I implemented the same functionality and structs in Go.

Exact functionality and structs

  • structs - this implements the WSAQUERYSET and structs belongs to it. (Proofs can be found below)
  • lookup functions - these are the wrappers of the lookup functions.

Testing environment

  • test implementation - this creates a Scan function which using the implemented functionality
  • go test - this is a go test for the test implementation
  • main - a main package to build and run the implementation

Proofs of memory layout

There are proofs, that the WSAQUERYSET and other functions memory layout and data alignment are the same as the syscall can accept it.

  • types test - these are the test files which prints the memory layout and data alignment
  • memory layout - this file contains the comparison between C and Go memory layout and data alignment.

C implementation

  • file - this is the c implementation and investigation of the functionality implemented above

Current issue what I run into

The implementation works fine, prints the device what I expect, but at the and of the Scan function in the discover.go I just get something like a panic, which says runtime: unknown pc 0x0. I couldn't solve this issue yet. The detailed view shows that it's printing the devices and it's MAC addresses and the debug lines as well, and right after dies. It seems like the closing } wants to free some memory which doesn't exists or I don't know.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions