fixed compiler warnings
This commit is contained in:
@@ -49,8 +49,6 @@ void PipeReader::init(wchar_t *section) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PipeReader::CheckATR() {
|
bool PipeReader::CheckATR() {
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
|
|
||||||
if (pipe==NULL)
|
if (pipe==NULL)
|
||||||
return false;
|
return false;
|
||||||
DWORD read=0;
|
DWORD read=0;
|
||||||
@@ -72,8 +70,6 @@ bool PipeReader::CheckATR() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool PipeReader::QueryTransmit(BYTE *APDU,int APDUlen,BYTE **Resp,int *Resplen) {
|
bool PipeReader::QueryTransmit(BYTE *APDU,int APDUlen,BYTE **Resp,int *Resplen) {
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
|
|
||||||
if (pipe==NULL)
|
if (pipe==NULL)
|
||||||
return false;
|
return false;
|
||||||
DWORD command=2;
|
DWORD command=2;
|
||||||
@@ -112,8 +108,6 @@ bool PipeReader::QueryTransmit(BYTE *APDU,int APDUlen,BYTE **Resp,int *Resplen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PipeReader::QueryATR(BYTE *ATR,DWORD *ATRsize,bool reset) {
|
bool PipeReader::QueryATR(BYTE *ATR,DWORD *ATRsize,bool reset) {
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
|
|
||||||
if (pipe==NULL)
|
if (pipe==NULL)
|
||||||
return false;
|
return false;
|
||||||
DWORD command=reset ? 0 : 1;
|
DWORD command=reset ? 0 : 1;
|
||||||
@@ -150,7 +144,7 @@ DWORD PipeReader::startServer() {
|
|||||||
swprintf(temp,L"\\\\.\\pipe\\%s",pipeEventName);
|
swprintf(temp,L"\\\\.\\pipe\\%s",pipeEventName);
|
||||||
HANDLE _eventpipe=CreateNamedPipe(temp,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,PIPE_UNLIMITED_INSTANCES,0,0,0,&sa);
|
HANDLE _eventpipe=CreateNamedPipe(temp,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,PIPE_UNLIMITED_INSTANCES,0,0,0,&sa);
|
||||||
wchar_t log[300];
|
wchar_t log[300];
|
||||||
swprintf(log,L"[BixVReader]Pipe created:%s:%08Ix",pipeName,_pipe);
|
swprintf(log,L"[BixVReader]Pipe created:%s:%p",pipeName,_pipe);
|
||||||
OutputDebugString(log);
|
OutputDebugString(log);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -220,7 +214,6 @@ DWORD PipeReader::startServer() {
|
|||||||
while (!waitInsertIpr.empty()) {
|
while (!waitInsertIpr.empty()) {
|
||||||
CComPtr<IWDFIoRequest> ipr = waitInsertIpr.back();
|
CComPtr<IWDFIoRequest> ipr = waitInsertIpr.back();
|
||||||
OutputDebugString(L"[BixVReader]cancel Wait Remove");
|
OutputDebugString(L"[BixVReader]cancel Wait Remove");
|
||||||
SectionLocker lock(device->m_RequestLock);
|
|
||||||
if (ipr->UnmarkCancelable()==S_OK) {
|
if (ipr->UnmarkCancelable()==S_OK) {
|
||||||
OutputDebugString(L"[BixVReader]Wait Insert Unmarked");
|
OutputDebugString(L"[BixVReader]Wait Insert Unmarked");
|
||||||
ipr->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
|
ipr->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ void TcpIpReader::init(wchar_t *section) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool TcpIpReader::CheckATR() {
|
bool TcpIpReader::CheckATR() {
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
if (AcceptSocket==NULL)
|
if (AcceptSocket==NULL)
|
||||||
return false;
|
return false;
|
||||||
int read=0;
|
int read=0;
|
||||||
@@ -46,7 +45,6 @@ bool TcpIpReader::CheckATR() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool TcpIpReader::QueryTransmit(BYTE *APDU,int APDUlen,BYTE **Resp,int *Resplen) {
|
bool TcpIpReader::QueryTransmit(BYTE *APDU,int APDUlen,BYTE **Resp,int *Resplen) {
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
if (AcceptSocket==NULL)
|
if (AcceptSocket==NULL)
|
||||||
return false;
|
return false;
|
||||||
DWORD command=2;
|
DWORD command=2;
|
||||||
@@ -90,7 +88,6 @@ bool TcpIpReader::QueryTransmit(BYTE *APDU,int APDUlen,BYTE **Resp,int *Resplen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool TcpIpReader::QueryATR(BYTE *ATR,DWORD *ATRsize,bool reset) {
|
bool TcpIpReader::QueryATR(BYTE *ATR,DWORD *ATRsize,bool reset) {
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
if (AcceptSocket==NULL)
|
if (AcceptSocket==NULL)
|
||||||
return false;
|
return false;
|
||||||
int read=0;
|
int read=0;
|
||||||
@@ -141,7 +138,6 @@ DWORD TcpIpReader::startServer() {
|
|||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
break;
|
break;
|
||||||
if (ret<0) {
|
if (ret<0) {
|
||||||
wchar_t log[100];
|
|
||||||
DWORD err=WSAGetLastError();
|
DWORD err=WSAGetLastError();
|
||||||
swprintf(log,L"[BixVReader]wsa err:%x",err);
|
swprintf(log,L"[BixVReader]wsa err:%x",err);
|
||||||
OutputDebugString(log);
|
OutputDebugString(log);
|
||||||
@@ -257,7 +253,6 @@ DWORD TcpIpReader::startServer() {
|
|||||||
while (!waitInsertIpr.empty()) {
|
while (!waitInsertIpr.empty()) {
|
||||||
CComPtr<IWDFIoRequest> ipr = waitInsertIpr.back();
|
CComPtr<IWDFIoRequest> ipr = waitInsertIpr.back();
|
||||||
OutputDebugString(L"[BixVReader]cancel Wait Remove");
|
OutputDebugString(L"[BixVReader]cancel Wait Remove");
|
||||||
SectionLocker lock(device->m_RequestLock);
|
|
||||||
if (ipr->UnmarkCancelable()==S_OK) {
|
if (ipr->UnmarkCancelable()==S_OK) {
|
||||||
OutputDebugString(L"[BixVReader]Wait Insert Unmarked");
|
OutputDebugString(L"[BixVReader]Wait Insert Unmarked");
|
||||||
ipr->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
|
ipr->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
|
||||||
@@ -311,7 +306,6 @@ void TcpIpReader::shutdown() {
|
|||||||
state=SCARD_ABSENT;
|
state=SCARD_ABSENT;
|
||||||
breakSocket=true;
|
breakSocket=true;
|
||||||
{
|
{
|
||||||
//SectionLocker lock(dataSection);
|
|
||||||
closesocket(eventsocket);
|
closesocket(eventsocket);
|
||||||
closesocket(socket);
|
closesocket(socket);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,6 @@ void VpcdReader::signalRemoval(void) {
|
|||||||
SectionLocker lock(device->m_RequestLock);
|
SectionLocker lock(device->m_RequestLock);
|
||||||
while (!waitInsertIpr.empty()) {
|
while (!waitInsertIpr.empty()) {
|
||||||
CComPtr<IWDFIoRequest> ipr = waitInsertIpr.back();
|
CComPtr<IWDFIoRequest> ipr = waitInsertIpr.back();
|
||||||
SectionLocker lock(device->m_RequestLock);
|
|
||||||
if (ipr->UnmarkCancelable()==S_OK) {
|
if (ipr->UnmarkCancelable()==S_OK) {
|
||||||
ipr->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
|
ipr->CompleteWithInformation(HRESULT_FROM_WIN32(ERROR_CANCELLED), 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ SectionLocker::SectionLocker(CRITICAL_SECTION &critsection,char *function,int li
|
|||||||
Object=object;
|
Object=object;
|
||||||
DWORD start=GetTickCount();
|
DWORD start=GetTickCount();
|
||||||
if (TryEnterCriticalSection(section)==0) {
|
if (TryEnterCriticalSection(section)==0) {
|
||||||
OutputDebugStringA("[BixVReader]RACE!");
|
|
||||||
char logBuffer[500];
|
char logBuffer[500];
|
||||||
sprintf(logBuffer,"[BixVReader]Richiesto da:Function:%s,Line:%i,Object:%Ix,Lock:%Ix",Function,Line,Object,section);
|
sprintf(logBuffer,"[BixVReader]Locking:Function:%s,Line:%i,Object:%p,Lock:%p",Function,Line,Object,section);
|
||||||
OutputDebugStringA(logBuffer);
|
OutputDebugStringA(logBuffer);
|
||||||
ShowMe=section;
|
ShowMe=section;
|
||||||
EnterCriticalSection(section);
|
EnterCriticalSection(section);
|
||||||
@@ -23,7 +22,7 @@ SectionLocker::SectionLocker(CRITICAL_SECTION &critsection,char *function,int li
|
|||||||
SectionLocker::~SectionLocker() {
|
SectionLocker::~SectionLocker() {
|
||||||
if (section==ShowMe) {
|
if (section==ShowMe) {
|
||||||
char logBuffer[500];
|
char logBuffer[500];
|
||||||
sprintf(logBuffer,"[BixVReader]Posseduto da:Function:%s,Line:%i,Object:%Ix,Lock:%Ix",Function,Line,Object,section);
|
sprintf(logBuffer,"[BixVReader]Unlocking:Function:%s,Line:%i,Object:%p,Lock:%p",Function,Line,Object,section);
|
||||||
OutputDebugStringA(logBuffer);
|
OutputDebugStringA(logBuffer);
|
||||||
ShowMe=NULL;
|
ShowMe=NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user