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
string GBKToUTF8(const char* strGBK) | |
{ | |
int len = MultiByteToWideChar(CP_ACP, 0, strGBK, -1, NULL, 0); | |
wchar_t* wstr = new wchar_t[len+1]; | |
memset(wstr, 0, len+1); | |
MultiByteToWideChar(CP_ACP, 0, strGBK, -1, wstr, len); | |
len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); | |
char* str = new char[len+1]; | |
memset(str, 0, len+1); | |
WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); |
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
auto conn = std::make_shared<QMetaObject::Connection>(); | |
*conn = QObject::connect(obj, &Object::signal, this, [this, conn]() { | |
disconnect(*conn); | |
}); |
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
nohup omxplayer --win 0,0,640,480 -n -1 SampleVideo_640x360_30mb.mp4 & | |
nohup omxplayer --win 640,0,1280,480 -n -1 SampleVideo_640x360_30mb.mp4 & | |
nohup omxplayer --win 1280,0,1920,480 -n -1 SampleVideo_640x360_30mb.mp4 & | |
nohup omxplayer --win 0,480,640,960 -n -1 SampleVideo_640x360_30mb.mp4 & | |
nohup omxplayer --win 640,480,1280,960 -n -1 SampleVideo_640x360_30mb.mp4 & |
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 <string> | |
#include <locale.h> | |
// 需包含locale、string头文件、使用setlocale函数。 | |
std::wstring StringToWstring(const std::string str) | |
{// string转wstring | |
unsigned len = str.size() * 2;// 预留字节数 | |
setlocale(LC_CTYPE, ""); //必须调用此函数 | |
wchar_t *p = new wchar_t[len];// 申请一段内存存放转换后的字符串 | |
mbstowcs(p,str.c_str(),len);// 转换 |
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
std::string s(std::istreambuf_iterator<char>(Poco::FileInputStream(string("t.txt"))), {}); |
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
#!/bin/bash | |
xrandr --newmode "1920x1080_60_001" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync | |
xrandr --addmode VGA-1 "1920x1080_60_001" | |
xrandr --output VGA-1 --mode "1920x1080_60_001" |
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
extern GetStdHandle | |
extern WriteConsoleA | |
extern ExitProcess | |
[SECTION .data] | |
align 32 | |
_dummy: | |
dd 0 | |
_message: | |
db 'Hello, world!', 0dh, 0ah |
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 <Windows.h> | |
#include <stdio.h> | |
#include "dbghelp.h" | |
BOOL WINAPI InitSymHandler( ) | |
{ | |
BOOL bReturn = FALSE; | |
HANDLE hFile; | |
CHAR DirPath[MAX_PATH] = {0}; |
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 "stdafx.h" | |
#include <Windows.h> | |
#include <imagehlp.h> | |
#include <locale.h> | |
#pragma comment(lib,"DbgHelp.lib") | |
BOOL CALLBACK CallBackProc( PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext ) | |
{ | |
printf( "函数名: %s\r\n地址: %08X \r\n\r\n", pSymInfo->Name, pSymInfo->Address ); | |
return TRUE; |
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
线程ID | |
指定ID为0x080为开始,是否有必要?这是否跟ID的范围有关系 | |
指定ID最大值为400h,0x080~0x400的范围内必然存在GDI线程?(俺用Kernel Detective看过确实必然至少有一个GDI线程) | |
从问题2引出的问题,GDI线程和非GDI线程的ID是否有固定的ID值范围?系统分配这个ID | |
值是否存在某些规律(俺听某人说是随机的,如果是随机的话,这种方法太大偶然性了) | |
还有代码中的ID递增方式是add dwThreadId, 4,通过观察,ID值确实有这样的规律,但是 | |
不懂,这是固定的还是怎么样的?俺有没有必要去了解? | |
PVOID PsGetThreadWin32Thread(KTHREAD* Thread);这个返回KTHREAD后面的Wind2Thread指针,win32Thread保存线程有关GUI的一些信息,如果这个不为空就是GUI的线程了 |
NewerOlder