RE: cat installing under Vista x64

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi

maybe someone from MicroSoft who know how it works can answer my question
please.

thank you
horatiu



"Pavel A." wrote:

Maybe you need to sign the .sys file, not the cat.
AKS support should help you.

--PA


"horatiu guja" wrote:
Hi

I have the followinbg problem:

I have a legacy driver with the following inf

;;;
;;; Hardlock sys
;;;
;;;
;;; Copyright (c) 2006, Aladdin Knwoledge Systems LTD.
;;;

[Version]
Signature = "$Windows NT$"
Provider = %Aks%
DriverVer = 11/9/2006,3.41
CatalogFile = hardlock.cat


[DestinationDirs]
DefaultDestDir = 12
Hlk.DriverFiles = 12
;%windir%\system32\drivers

;;
;; Default install sections
;;

[DefaultInstall]
OptionDesc = %HlkServiceDesc%
CopyFiles = Hlk.DriverFiles

[DefaultInstall.Services]
AddService = %HlkServiceName%,,Hlk.Service

;
; Services Section
;

[Hlk.Service]
DisplayName = %HlkServiceName%
Description = %HlkServiceDesc%
ServiceBinary = %12%\hardlock.sys
;%windir%\system32\drivers\hardlock.sys
ServiceType = 1 ;SERVICE_FILE_SYSTEM_DRIVER
StartType = 2 ;SERVICE_AUTO_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL


;
; Copy Files
;

[Hlk.DriverFiles]
hardlock.sys


[SourceDisksNames]
1 = %Disk1%

[SourceDisksFiles]
hardlock.sys = 1


;;
;; String Section
;;

[Strings]
Aks = "Aladdin Knowledge Systems"
HlkServiceDesc = "Aladdin Hardlock Legacy Driver"
HlkServiceName = "hardlock"
Disk1 = "File Source Media"


I've build a .cat using makecat -v hardlock.cdf from following file:


[CatalogHeader]
Name=hardlock.cat
PublicVersion=0x0000001
EncodingType=0x00010001
CATATTR1=0x10010001:OSAttr:2:6.0
[CatalogFiles]
<hash>File1=hardlock.sys
<hash>File2=hardlock.inf

then signed the cat with our own certificate whic is added on the test
machine in the Trusted Root Store and Trusted Publisher store. On the test
Vista X64 build 5744 the testsigned is on and when I've embedded sign the
drivber there is no problem to load the driver.


I've used the fvollowing program to add the .cat to the cat data base and I
see that it is added in the cat root.


#include <windows.h>
#include <stdio.h>


typedef BOOL (__stdcall * PCryptCATAdminAcquireContext)(PVOID*
phCatAdmin,const GUID* pgSubsystem,DWORD dwFlags);
typedef BOOL (__stdcall* PCryptCATAdminReleaseContext)(PVOID hCatAdmin,DWORD
dwFlags);
typedef PVOID (__stdcall * PCryptCATAdminAddCatalog)(PVOID hCatAdmin, WCHAR*
pwszCatalogFile, WCHAR* pwszSelectBaseName,DWORD dwFlags);
typedef BOOL (__stdcall* PCryptCATAdminReleaseCatalogContext)( PVOID
hCatAdmin, PVOID hCatInfo, DWORD dwFlags);

typedef struct wintrust_functions{
PCryptCATAdminAcquireContext pCryptCATAdminAcquireContext;
PCryptCATAdminReleaseContext pCryptCATAdminReleaseContext;
PCryptCATAdminAddCatalog pCryptCATAdminAddCatalog;
PCryptCATAdminReleaseCatalogContext pCryptCATAdminReleaseCatalogContext;
}WINTRUST_FCT;


void Char2Wchar(char* cmdline,unsigned int Srcsizem,char* wcmdline,unsigned
int DestSize)
{
int i = 0;

memset(wcmdline,0x0,DestSize);

for(i=0;i<strlen(cmdline);i++)
wcmdline[i*2]=cmdline[i];

}


int hhls_GetWinTrustFct(WINTRUST_FCT * fct)
{
HMODULE wintrust;

wintrust = LoadLibrary("wintrust.dll");
if( NULL == wintrust ){
printf("can not load wintrust.dll\n");
exit(0);
}

fct->pCryptCATAdminAcquireContext =
(PCryptCATAdminAcquireContext)GetProcAddress(wintrust,"CryptCATAdminAcquireContext");
if( NULL == fct->pCryptCATAdminAcquireContext ){
printf("can not get address for CryptCATAdminAcquireContext\n");
exit(0);
}

fct->pCryptCATAdminReleaseContext =
(PCryptCATAdminReleaseContext)GetProcAddress(wintrust,"CryptCATAdminReleaseContext");
if( NULL == fct->pCryptCATAdminReleaseContext ){
printf("can not get address for CryptCATAdminReleaseContext\n");
exit(0);
}

fct->pCryptCATAdminAddCatalog =
(PCryptCATAdminAddCatalog)GetProcAddress(wintrust,"CryptCATAdminAddCatalog");
if( NULL == fct->pCryptCATAdminAddCatalog ){
printf("can not get address for CryptCATAdminAddCatalog\n");
exit(0);
}

fct->pCryptCATAdminReleaseCatalogContext =
(PCryptCATAdminReleaseCatalogContext)GetProcAddress(wintrust,"CryptCATAdminReleaseCatalogContext");
if( NULL == fct->pCryptCATAdminReleaseCatalogContext ){
printf("can not get address for CryptCATAdminReleaseCatalogContext\n");
exit(0);
}

return 1;

}


int main(int argc, char* argv[])
{


WINTRUST_FCT wintrust;
int status;
PVOID catAdmin;
PVOID hcat;
char wPath[2*MAX_PATH]={0};

printf("usage: instcat <full_path_to_cat\catfilename.cat>\n");

if( argc != 2 ){
printf("usage: instcat <full_path_to_cat\catfilename.cat>\n");
exit(0);
}


hhls_GetWinTrustFct(&wintrust);

if( FALSE == wintrust.pCryptCATAdminAcquireContext(&catAdmin,NULL,0)){
printf("CryptCATAdminAcquireContext failed error %d\n",GetLastError());
exit(1);
}



Char2Wchar(argv[1],strlen(argv[1]),wPath,MAX_PATH);

hcat = wintrust.pCryptCATAdminAddCatalog(catAdmin,wPath,NULL,0);

if( NULL == hcat ){
printf("CryptCATAdminAddCatalog failed error %d\n",GetLastError());
exit(1);
}

if( FALSE == wintrust.pCryptCATAdminReleaseCatalogContext(catAdmin,hcat,0)
){
printf("CryptCATAdminReleaseCatalogContext failed error
%d\n",GetLastError());
exit(1);
}

if( FALSE == wintrust.pCryptCATAdminReleaseContext(catAdmin,0) ){
printf("CryptCATAdminReleaseContext failed error %d\n",GetLastError());
exit(1);
}

printf("cat succesfully installed\n");
return 0;

}

after running the program and cat is added to the cat database I'm
installing the driver by right clicking the mouse and choosing Install.
Driver is copyed to system32\drivers and no message reporting errors occurs.

when from command prompt I use sc start hardlock to load the driver Vista is
reporting that driver is not sign.


Anyone can help ?

thanks
horatiu



.



Relevant Pages

  • RE: cat installing under Vista x64
    ... Maybe you need to sign the .sys file, not the cat. ... HlkServiceDesc = "Aladdin Hardlock Legacy Driver" ... int DestSize) ... printf("CryptCATAdminAcquireContext failed error %d\n",GetLastError()); ...
    (microsoft.public.development.device.drivers)
  • cat installing under Vista x64
    ... HlkServiceDesc = "Aladdin Hardlock Legacy Driver" ... I've build a .cat using makecat -v hardlock.cdf from following file: ... int DestSize) ...
    (microsoft.public.development.device.drivers)
  • [git patches] IDE updates part #5
    ... Palmchip BK3710 IDE driver ... int stat, err, sense_key; ... + * After each failed packet command we issue a request sense command and retry ...
    (Linux-Kernel)
  • [git patches] net driver updates for .26
    ... Fix a bug where the pointer never moves for dma_unmap... ... Update and fix driver debugging messages ... int reset); ... * header structure can be anywhere in the mcp. ...
    (Linux-Kernel)
  • Re: [RFC PATCH 1/1] input/touchscreen: Synaptics Touchscreen Driver
    ... To compile this driver as a module, ... See the GNU General Public License ... * and for checking what source had caused the attention line interrupt. ... +module_param(polljif, int, 0644); ...
    (Linux-Kernel)