csx 4 년 전
부모
커밋
a618257f46
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      controllers/his_api_controller.go

+ 11 - 1
controllers/his_api_controller.go 파일 보기

@@ -346,6 +346,9 @@ func GetBasBaseInfo() (jsonStr string, err error) {
346 346
 	handle := syscall.NewLazyDLL("SSCard.dll")
347 347
 	ReadCardBas := handle.NewProc("ReadCardBas")
348 348
 
349
+	str5 := ""
350
+	str6 := ""
351
+
349 352
 	str := make([]byte, 256)
350 353
 	str1 := make([]byte, 256)
351 354
 	str3 := make([]byte, 256)
@@ -354,7 +357,7 @@ func GetBasBaseInfo() (jsonStr string, err error) {
354 357
 	//sssssswwwww
355 358
 	a := 256
356 359
 
357
-	r, _, _ := ReadCardBas.Call((uintptr)(unsafe.Pointer(&str[0])), IntPtr(a), (uintptr)(unsafe.Pointer(&str1[0])), IntPtr(a))
360
+	r, _, _ := ReadCardBas.Call(StrPtr3(str5), IntPtr(a), StrPtr3(str6), IntPtr(a))
358 361
 
359 362
 	str3 = str
360 363
 	str4 = str1
@@ -362,6 +365,9 @@ func GetBasBaseInfo() (jsonStr string, err error) {
362 365
 	fmt.Println(str4)
363 366
 	fmt.Println(r)
364 367
 
368
+	fmt.Println(str5)
369
+	fmt.Println(str6)
370
+
365 371
 	str1 = nil
366 372
 	str3 = nil
367 373
 	a = 0
@@ -2841,3 +2847,7 @@ func RemoveRepeatedCode(arr []string) (newArr []string) {
2841 2847
 //	result = int(ret)
2842 2848
 //	return
2843 2849
 //}
2850
+
2851
+func StrPtr3(s string) uintptr {
2852
+	return uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(s)))
2853
+}