From: VAXman-@SendSpamHere.ORG Sent: Tuesday, November 13, 2007 7:45 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: SYS$GRANT_LICENSE output codes In article , "Tom Linden" writes: > > >The LMF System Service Manual indicate two possible, optional >output codes, LMF$_PROD_TOKEN and LMF$_HW_ID. I am unable to get >either to work. I created an appropriate license pak in a >separate testing lmf database and loaded the license. But >when running the test, the status which should be 1 if the call >is successful, got 12. When I comment out the item_list for the >HW_ID it returns 1, so it clearly found the license. > >Anyone have experience with this call? I am not convinced it >works as documented. I have been using both without any issues. First off, if you've received 12 (^x0C) back from SYS$GRANT_LICENSE, that is an ACCVIO. I would suspect that you have something amuck in your item list being passed to SYS$GRANT_LICENSE. Tom here a simple bit of Macro that invokes SYS$GRANT_LICENSE. Change the PRODUCT, PRODUCER, MY_TOKEN and MY_HW_ID values as needed. This shows how to get the TOKEN and HW_ID and then what to do with that info once it has been obtained. ;++ ; Copyright 2007 Brian Schenkenberger ; You know what you need to do if you want to use it. ;-- $LMFDEF $LICENSEDEF .PSECT DATA,WRT,NOEXE,5 LMFITM: .WORD LMF$K_VERSIONLEN,LMF$_PROD_VERSION .ADDRESS PRODUCT_VERSION,0 .WORD LMF$K_TOKENLEN,LMF$_PROD_TOKEN .ADDRESS PRODUCT_TOKEN,TOKEN_LENGTH .WORD LMF$K_HW_IDLEN,LMF$_HW_ID .ADDRESS PRODUCT_HW_ID,HW_ID_LENGTH,0 PROD_VERSION: .WORD minor,major ; Vmajor.minor PROD_TOKEN: .LONG 0[+1] ; retrieved token string TOKEN_LENGTH: .LONG 0 ; retrieved token length PROD_HW_ID: .LONG 0[+1] ; retrieved HW ID string HW_ID_LENGTH: .LONG 0 ; retrieved HW ID length CONTEXT: .LONG 0[16] PRODUCER: .ASCID "TOM_LINDEN" .ALIGN LONG PRODUCT: .ASCID "TOMS_PROD" .ALIGN LONG MY_HW_ID: "whatever HW ID" MY_TOKEN: "whatever TOKEN" .PSECT CODE,NOWRT,EXE,5 .ENTRY DEMO_FOR_TOM,0 $GRANT_LICENSE_S - ; invoke $GRANT_LICENSE PRDNAM = PRODUCT,- PRDUCER = PRODUCER,- CONTXT = CONTEXT,- ITMLST = LMFITM BLBS R0,10$ RET 10$: MOVAB MY_TOKEN,R0 MOVZWL R0,R0 MOVZWL TOKEN_LENGTH,R2 MOVAB PROD_TOKEN,R3 CMPC5 R0,(R1),#0,R2,(R3) BEQL 20$ ; if both strings equal, TOKEN OK MOVL #LICENSE$_INVALID_TOKEN,R0 ; return bad token RET 20$: MOVAB MY_HW_ID,R0 MOVZWL R0,R0 MOVZWL HW_ID_LENGTH,R2 MOVAB PROD_HW_ID,R3 CMPC5 R0,(R1),#0,R2,(R3) BEQL 30$ ; if both strings equal, HW_ID OK MOVL #LICENSE$_INVALID_HW_ID,R0 ; return bad HW ID RET 30$: ; rest of your program... RET .END DEMO_FOR_TOM Disclaimer: It's early in the morning. I had a really bad night's sleep, I have a whopper of a headache and I have not had enough caffeine yet. -- VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM "Well my son, life is like a beanstalk, isn't it?" http://tmesis.com/drat.html