csx 4 years ago
parent
commit
83bb27ec3f
1 changed files with 7 additions and 11 deletions
  1. 7 11
      controllers/his_api_controller.go

+ 7 - 11
controllers/his_api_controller.go View File

@@ -34,9 +34,6 @@ var (
34 34
 	add, _           = DllTestDef.FindProc("Init")
35 35
 	ReadCardBas, _   = DllTestDef.FindProc("ReadCardBas")
36 36
 	ReadIDCardBas, _ = DllTestDef.FindProc("ReadSFZ")
37
-
38
-	h    = syscall.NewLazyDLL("SSCard.dll")
39
-	proc = h.NewProc("ReadCardBas")
40 37
 )
41 38
 
42 39
 func HisManagerApiRegistRouters() {
@@ -351,18 +348,17 @@ func StrPtr2(s string) uintptr {
351 348
 }
352 349
 
353 350
 func GetBasBaseInfo() (jsonStr string, err error) {
354
-	defer syscall.FreeLibrary(&h)
355 351
 
356 352
 	fmt.Println(ReadCardBas)
357
-	//h := syscall.NewLazyDLL("SSCard.dll")
358
-	//proc := h.NewProc("ReadCardBas")
353
+	h := syscall.NewLazyDLL("SSCard.dll")
354
+	proc := h.NewProc("ReadCardBas")
359 355
 
360
-	str := ""
361
-	str1 := ""
362
-	r, _, _ := proc.Call(StrPtr2(str), IntPtr(1024), StrPtr2(str1), IntPtr(1024))
356
+	//str := ""
357
+	//str1 := ""
358
+	//r, _, _ := proc.Call(StrPtr2(str), IntPtr(1024), StrPtr2(str1), IntPtr(1024))
363 359
 
364
-	fmt.Println(r)
365
-	fmt.Println(str)
360
+	fmt.Println(proc)
361
+	fmt.Println(proc)
366 362
 
367 363
 	return "", nil
368 364
 }