BenchmarkDotNet=v0.10.9, OS=Windows 10.0.16257
Processor=Intel Core i7-3770 CPU 3.40GHz (Ivy Bridge), ProcessorCount=8
Frequency=3312785 Hz, Resolution=301.8608 ns, Timer=TSC
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2542.1
DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2542.1
This file contains hidden or 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
ffmpeg -f gdigrab -framerate 6 -i desktop -vcodec h264 -g 30 -pix_fmt yuv420p -s 640x360 -profile:v main -crf 28 -f hls -hls_time 5 -hls_list_size 0 -hls_flags '+append_list' out.m3u8 |
This file contains hidden or 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
private unsafe Task Write(void* ptr, int size) | |
{ | |
var p = (byte*)ptr; | |
var buf = new byte[size]; | |
for (var i = 0; i < buf.Length; i++) | |
buf[i] = p[i]; | |
return this._stream.WriteAsync(buf, 0, size); | |
} |
This file contains hidden or 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
use std::ffi; | |
use std::fmt; | |
use std::mem; | |
use std::os::windows::prelude::*; | |
use kernel32; | |
use winapi::*; | |
use super::WindowsError; | |
pub struct ProcessInfo { | |
entry: PROCESSENTRY32W |
This file contains hidden or 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
pub fn open_process(process_id: u32) -> Result<Option<ProcessHandle>, WindowsError> { | |
let handle = unsafe { | |
kernel32::OpenProcess( | |
PROCESS_TERMINATE | SYNCHRONIZE, | |
FALSE, | |
process_id as DWORD | |
) | |
}; | |
if handle.is_null() { |
This file contains hidden or 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
using System; | |
using System.Runtime.InteropServices; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
GetStdHandle(-11); | |
} |
This file contains hidden or 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
FROM ubuntu:17.04 | |
# apt-get update がクソ遅いので日本サーバーに変更 | |
RUN sed -i 's|//archive\.ubuntu\.com|//jp\.archive\.ubuntu\.com|g' /etc/apt/sources.list | |
RUN dpkg --add-architecture i386 && \ | |
apt-get update -y && \ | |
apt-get install -y wget apt-transport-https software-properties-common && \ | |
wget -O - https://dl.winehq.org/wine-builds/Release.key | apt-key add - && \ | |
apt-add-repository -y https://dl.winehq.org/wine-builds/ubuntu/ && \ |
This file contains hidden or 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
using System; | |
using System.Runtime.InteropServices; | |
namespace ConsoleApp2.WindowsApi | |
{ | |
public abstract class DCHandle : SafeHandle | |
{ | |
public DCHandle(bool ownsHandle) | |
: base(IntPtr.Zero, ownsHandle) | |
{ } |
This file contains hidden or 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
Unhandled exception: unimplemented function KERNEL32.dll.AddDllDirectory called in 32-bit code (0x7bc52ef9). | |
Register dump: | |
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b | |
EIP:7bc52ef9 ESP:003bf2a8 EBP:003bf31c EFLAGS:00000212( - -- I -A- - ) | |
EAX:00587ace EBX:7bcdd000 ECX:003bf310 EDX:7ebb129a | |
ESI:003bf2c0 EDI:00422298 | |
Stack dump: | |
0x003bf2a8: 003bf2d0 0042dea8 7bc52ed3 0042dea8 | |
0x003bf2b8: 003bf2e8 7ebb12d7 80000100 00000001 | |
0x003bf2c8: 00000000 7bc52ef9 00000002 00587b0a |
This file contains hidden or 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
public struct BitmapInfoHeader | |
{ | |
public int Width; | |
public int Height; | |
public ushort Planes; | |
public ushort BitCount; | |
public BitmapCompression Compression; | |
public uint SizeImage; | |
public int XPelsPerMeter; | |
public int YPelsPerMeter; |