int _tmain(int argc, _TCHAR* argv[]) { //CreateA(); //CreateB(); HANDLE handle1 = CreateThread(NULL, 0, ThreadFunA, NULL, 0, NULL); HANDLE handle2 = CreateThread(NULL, 0, ThreadFunB, NULL, 0, NULL); WaitForSingleObject(handle1, INFINITE); WaitForSingleObject(handle2, INFINITE); A::Sington().SetM(100); PrintA(); PrintB(); A::Sington().SetM(1010); PrintA(); PrintB(); int n[2]; n[0] = 0; n[1] = 1; printf("n1:%p\n",&n[0]); printf("n2:%p\n",&n[1]); char *p = (char *)&n[0]; char *qQ[]={p,(char *)&n[1]}; char **q = qQ; printf("q:%p\n",*q); ++q; printf("q:%p\n",*q); char *r = *q; int *s = (int *)r; cout << *s << endl; A a; const type_info &pinfo = typeid(a); int aaa = 1; cout << typeid(aaa).name(); return 1; }
int SpiWrite(struct DibBridgeContext *pContext, unsigned char* buf, unsigned int size) { #if (DIBCOM_TEST_MODE == TEST_MODE_HOOK) unsigned int lsize=size; PrintB("WR",buf,size); while (lsize > 64) { HookSpiBusWrite(pContext,buf,64); lsize -= 64; buf += 64; } if (lsize > 0) { HookSpiBusWrite(pContext,buf,lsize); } #endif return DIBSTATUS_SUCCESS; }
int SpiRead(struct DibBridgeContext *pContext, unsigned char* buf, unsigned int size) { #if (DIBCOM_TEST_MODE == TEST_MODE_HOOK) unsigned int msb= size & 0x0000C000; unsigned int lsize=size & 0x3FFF; while (lsize > 64) { HookSpiBusRead(pContext,buf,64 | msb); lsize -= 64; buf += 64; } if (lsize > 0) { HookSpiBusRead(pContext,buf,lsize | msb); } PrintB("RD",buf,size&0x3FFF); #endif return DIBSTATUS_SUCCESS; }