This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module sockint | |
go 1.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = /usr/bin/i686-w64-mingw32-gcc | |
GOOS = windows | |
GOARCH = 386 | |
CGO_ENABLED = 1 | |
export CC GOOS GOARCH CGO_ENABLED | |
.PHONY: all build run clean | |
all: run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"log" | |
"strings" | |
"syscall" | |
"unsafe" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <locale.h> | |
#define WIN32_LEAN_AND_MEAN | |
#define _UNICODE | |
#include <windows.h> | |
int print_sys_error(DWORD last_error) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A demonstration example for http://stackoverflow.com/a/26124494 | |
// It runs a goroutine locked to an OS thread on Windows | |
// then impersonates that thread as another user using its name | |
// and plaintext password, then reverts to the default security | |
// context before detaching from its OS thread. | |
package main | |
import ( | |
"log" | |
"runtime" |
OlderNewer