diff options
author | jmagne <jmagne@fba4d07e-fe0f-4d7f-8147-e0026e666dc0> | 2009-10-02 01:43:53 +0000 |
---|---|---|
committer | jmagne <jmagne@fba4d07e-fe0f-4d7f-8147-e0026e666dc0> | 2009-10-02 01:43:53 +0000 |
commit | 5e714b451a301a0f85ca13250c7dea7ba7a507cb (patch) | |
tree | 18c13bb428edeb7c5901b425ab001f4cb2e6cbee /src | |
parent | 81a9d74fa2dfb93fe64971f9941bf374bfcf2523 (diff) |
Bugzilla #514341, get coolkey working on 64bit Windows.
git-svn-id: http://svn.fedorahosted.org/svn/coolkey/trunk@82 fba4d07e-fe0f-4d7f-8147-e0026e666dc0
Diffstat (limited to 'src')
-rw-r--r-- | src/libckyapplet/cky_card.c | 16 | ||||
-rw-r--r-- | src/windows/csp/Makefile | 53 | ||||
-rw-r--r-- | src/windows/csp/RegDll.cpp | 2 | ||||
-rw-r--r-- | src/windows/csp/Session.cpp | 6 | ||||
-rw-r--r-- | src/windows/csp/csp.cpp | 4 |
5 files changed, 56 insertions, 25 deletions
diff --git a/src/libckyapplet/cky_card.c b/src/libckyapplet/cky_card.c index 3c615e0..d2edfd4 100644 --- a/src/libckyapplet/cky_card.c +++ b/src/libckyapplet/cky_card.c @@ -50,10 +50,10 @@ typedef long (WINAPI * SCardReleaseContextFn) ( SCARDCONTEXT hContext); typedef long (WINAPI * SCardBeginTransactionFn) ( - long hCard); + SCARDHANDLE hCard); typedef long (WINAPI * SCardEndTransactionFn) ( - long hCard, + SCARDHANDLE hCard, unsigned long dwDisposition); typedef long (WINAPI * SCardConnectFn) ( @@ -61,15 +61,15 @@ typedef long (WINAPI * SCardConnectFn) ( const char *szReader, unsigned long dwShareMode, unsigned long dwPreferredProtocols, - long *phCard, + SCARDHANDLE *phCard, unsigned long *pdwActiveProtocol); typedef long (WINAPI * SCardDisconnectFn) ( - long hCard, + SCARDHANDLE hCard, unsigned long dwDisposition); typedef long (WINAPI * SCardTransmitFn) ( - long hCard, + SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, const unsigned char *pbSendBuffer, unsigned long cbSendLength, @@ -78,7 +78,7 @@ typedef long (WINAPI * SCardTransmitFn) ( unsigned long *pcbRecvLength); typedef long (WINAPI * SCardReconnectFn) ( - long hCard, + SCARDHANDLE hCard, unsigned long dwShareMode, unsigned long dwPreferredProtocols, unsigned long dwInitialization, @@ -91,7 +91,7 @@ typedef long (WINAPI * SCardListReadersFn) ( unsigned long *pcchReaders); typedef long (WINAPI * SCardStatusFn) ( - long hCard, + SCARDHANDLE hCard, char *mszReaderNames, unsigned long *pcchReaderLen, unsigned long *pdwState, @@ -100,7 +100,7 @@ typedef long (WINAPI * SCardStatusFn) ( unsigned long *pcbAtrLen); typedef long (WINAPI * SCardGetAttribFn) ( - long hCard, + SCARDHANDLE hCard, unsigned long dwAttId, char *pbAttr, unsigned long *pchAttrLen); diff --git a/src/windows/csp/Makefile b/src/windows/csp/Makefile index b522cfe..427666c 100644 --- a/src/windows/csp/Makefile +++ b/src/windows/csp/Makefile @@ -18,29 +18,51 @@ # # # Nmake capable makefile. +# + + +# Deal with flags for the debug version. # -LCFLAGS=-Od -I$(CAPISDK)/sdkinc -DWIN32 -D_DEBUG -D_WINDOWS -D_USRDLL \ +DBGLCFLAGS = +DBGFLAGS = +MTLIB = -MT + +!IF "$(BUILD_OPT)" == "1" +DBGLCFLAGS = -ZI -DEBUG -D_DEBUG +DBGFLAGS = /DEBUG +MTLIB = -MTd +!ENDIF + +# Deal with 32 or 64 bit machine. +# +ARCH = X86 + +!IF "$(USE_64)" == "1" +ARCH = X64 +!ENDIF + +LCFLAGS=-Od -I$(CAPISDK)/sdkinc -DWIN32 -D_WINDOWS -D_USRDLL \ -D_CONSOLE -DCSP_EXPORTS -D_WINDLL -DIDA_PROMPT_PINGUI -D_MBCS \ - -Gm -EHsc -RTC1 -W3 -nologo -c -ZI -TP + -EHsc -RTC1 -W3 -nologo -c $(DBGCLFLAGS) -TP -CSPRESFLAGS=/INCREMENTAL:NO /NOLOGO /DLL /DEF:"cspres.def" /DEBUG \ +CSPRESFLAGS=/INCREMENTAL:NO /NOLOGO /DLL /DEF:"cspres.def" $(DBGFLAGS) \ /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /IMPLIB:"cspres.lib" \ - /MACHINE:X86 + /MACHINE:$(ARCH) -CSPFLAGS=/INCREMENTAL:NO /NOLOGO /DLL /DEF:"csp.def" /DEBUG \ - /SUBSYSTEM:WINDOWS /IMPLIB:"clkcsp.lib" /MACHINE:X86 crypt32.lib \ +CSPFLAGS=/INCREMENTAL:NO /NOLOGO /DLL /DEF:"csp.def" $(DBGFLAGS) \ + /SUBSYSTEM:WINDOWS /IMPLIB:"clkcsp.lib" /MACHINE:$(ARCH) crypt32.lib \ RpcRT4.Lib winscard.lib Scarddlg.lib cspres.lib kernel32.lib \ user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib \ shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib -REGCERTSFLAGS=/INCREMENTAL:NO /NOLOGO /DEBUG /SUBSYSTEM:CONSOLE /MACHINE:X86 \ +REGCERTSFLAGS=/INCREMENTAL:NO /NOLOGO $(DBGFLAGS) /SUBSYSTEM:CONSOLE /MACHINE:$(ARCH) \ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \ odbc32.lib odbccp32.lib CC=cl TARGETS=cspres.dll clkcsp.dll regcerts.exe clkcsp.sig -TRASH=*.pdb *.lib *.exp *.idb +TRASH=*.pdb *.lib *.exp *.idb *.manifest CSP_OBJ = \ csp.obj \ @@ -67,7 +89,7 @@ REG_CERTS_OBJ = \ .SUFFIXES: .cpp .obj .OBJ .rc .res .Obj .dll .sig .cpp.obj: - $(CC) $(LCFLAGS) -MTd $< + $(CC) $(LCFLAGS) $(MTLIB) $< .cpp.Obj: $(CC) $(LCFLAGS) -MLd -Wp64 $< @@ -89,10 +111,17 @@ clean: cspres.dll: $(CSP_RES_OBJ) link /OUT:cspres.dll $(CSP_RES_OBJ) $(CSPRESFLAGS) - +#Process manifest file if applicable. +!IF "$(_NMAKE_VER)" >= "8.00" + mt.exe -manifest cspres.dll.manifest -outputresource:"cspres.dll;2" +!ENDIF clkcsp.dll: $(CSP_OBJ) link /OUT:clkcsp.dll $(CSP_OBJ) $(CSPFLAGS) - +!IF "$(_NMAKE_VER)" >= "8.00" + mt.exe -manifest clkcsp.dll.manifest -outputresource:"clkcsp.dll;2" +!ENDIF regcerts.exe: $(REG_CERTS_OBJ) link /OUT:regcerts.exe $(REG_CERTS_OBJ) $(REGCERTSFLAGS) - +!IF "$(_NMAKE_VER)" >= "8.00" + mt.exe -manifest regcerts.exe.manifest -outputresource:"regcerts.exe;1" +!ENDIF diff --git a/src/windows/csp/RegDll.cpp b/src/windows/csp/RegDll.cpp index 66f1a96..bc5418b 100644 --- a/src/windows/csp/RegDll.cpp +++ b/src/windows/csp/RegDll.cpp @@ -101,7 +101,7 @@ getSigFileName(const char *libName) return NULL; } - ext = strrchr(libName, '.'); + ext = (char *) strrchr(libName, '.'); if (ext) { libLen = ext - libName; } diff --git a/src/windows/csp/Session.cpp b/src/windows/csp/Session.cpp index a910d62..35bafa9 100644 --- a/src/windows/csp/Session.cpp +++ b/src/windows/csp/Session.cpp @@ -107,8 +107,10 @@ void Session::parseFQCN(const char* fqcn0, BinStr* container_name, BinStr* reade else (*container_name) = fqcn; - LOG("ParseFQCN: container_name: \"%s\"\n", StringifyBin(*container_name, false).c_str()); - LOG("ParseFQCN: reader_name: \"%s\"\n", StringifyBin(*reader_name, false).c_str()); + if(container_name->size()) + LOG("ParseFQCN: container_name: \"%s\"\n", StringifyBin(*container_name, false).c_str()); + if(reader_name->size()) + LOG("ParseFQCN: reader_name: \"%s\"\n", StringifyBin(*reader_name, false).c_str()); } } // namespace MCSP diff --git a/src/windows/csp/csp.cpp b/src/windows/csp/csp.cpp index 1ed32af..bcbdcba 100644 --- a/src/windows/csp/csp.cpp +++ b/src/windows/csp/csp.cpp @@ -999,8 +999,8 @@ CPSetProvParam( BinStr containerName = (char*)pbData; CRYPT_KEY_PROV_INFO provInfo; - provInfo.pwszContainerName = new unsigned short[containerName.size()]; - provInfo.pwszProvName = new unsigned short[strlen(PROVIDER_NAME) + 1];; + provInfo.pwszContainerName = (LPWSTR) new unsigned short[containerName.size()]; + provInfo.pwszProvName = (LPWSTR) new unsigned short[strlen(PROVIDER_NAME) + 1]; provInfo.dwProvType = PROVIDER_TYPE; provInfo.dwFlags = 0; provInfo.cProvParam = 0; |