tools+csdk: 恢复脱敏后脚本的可运行性——resume_android.ps1 的 adb 改为探测已知安装位置、resume_rev.ps1 对临时分析脚本加存在性守卫、legacy demo 两个 C 程序的日志/快照路径改用 getenv("TEMP") 运行时解析(原硬编码本机路径本就不可移植)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* ---- libusb-win32 (libusb0) API ---------------------------------------- */
|
||||
typedef struct usb_bus {
|
||||
@@ -319,7 +320,12 @@ static int init_camera(void) {
|
||||
|
||||
int WINAPI WinMain(HINSTANCE inst, HINSTANCE hprev, LPSTR cmd, int show) {
|
||||
(void)hprev; (void)cmd; (void)show;
|
||||
g_log = fopen("%TEMP%/opencode/demo_usb0_log.txt", "w");
|
||||
static char logpath[MAX_PATH];
|
||||
const char *tmp = getenv("TEMP");
|
||||
if (!tmp || !*tmp) tmp = ".";
|
||||
snprintf(logpath, sizeof(logpath) - 1, "%s\\mag160c_demo_usb0_log.txt", tmp);
|
||||
logpath[sizeof(logpath) - 1] = 0;
|
||||
g_log = fopen(logpath, "w");
|
||||
if (g_log) { fprintf(g_log, "demo start\n"); fflush(g_log); }
|
||||
|
||||
HMODULE l0 = LoadLibraryA("libusb0.dll");
|
||||
|
||||
Reference in New Issue
Block a user