csx 4 vuotta sitten
vanhempi
commit
76aadc28d5
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      controllers/his_api_controller.go

+ 7 - 5
controllers/his_api_controller.go Näytä tiedosto

@@ -34,6 +34,9 @@ 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")
37 40
 )
38 41
 
39 42
 func HisManagerApiRegistRouters() {
@@ -348,10 +351,11 @@ func StrPtr2(s string) uintptr {
348 351
 }
349 352
 
350 353
 func GetBasBaseInfo() (jsonStr string, err error) {
351
-	//handle := syscall.MustLoadDLL("SSCard.dll")
354
+	defer syscall.FreeLibrary(&h)
355
+
352 356
 	fmt.Println(ReadCardBas)
353
-	h := syscall.NewLazyDLL("SSCard.dll")
354
-	proc := h.NewProc("ReadCardBas")
357
+	//h := syscall.NewLazyDLL("SSCard.dll")
358
+	//proc := h.NewProc("ReadCardBas")
355 359
 
356 360
 	str := ""
357 361
 	str1 := ""
@@ -360,8 +364,6 @@ func GetBasBaseInfo() (jsonStr string, err error) {
360 364
 	fmt.Println(r)
361 365
 	fmt.Println(str)
362 366
 
363
-	syscall.FreeLibrary(h)
364
-
365 367
 	return "", nil
366 368
 }
367 369