@@ -18,23 +18,23 @@ struct cmodule_t : obj_t
18
18
wstring Path () // FIXME: behavior change, now may throw, check callers
19
19
{
20
20
static wchar buf[MAX_PATH];
21
- API_CALL (GetModuleFileNameW,NULL ,buf,MAX_PATH);
21
+ OS_API_CALL (GetModuleFileNameW,NULL ,buf,MAX_PATH);
22
22
wcsrchr (buf,L' \\ ' )[1 ] = 0 ;
23
23
return buf; // TODO: cache this result
24
24
}
25
25
26
26
var Install (const wstring &x) // FIXME: behavior change, now may throw, check callers
27
27
{
28
28
auto_ptr<cmodule_t > r (new cmodule_t );
29
- API_CALL_R (r->rep , LoadLibraryW, x.c_str ());
29
+ OS_API_CALL_R (r->rep , LoadLibraryW, x.c_str ());
30
30
if (r->rep ) return r.release ();
31
31
return 0 ;
32
32
}
33
33
34
34
bool Uninstall (Var x) // FIXME: behavior change, now may throw, check callers
35
35
{
36
36
BOOL r;
37
- API_CALL_R (r,FreeLibrary,dynamic_cast <cmodule_t *>(x)->rep );
37
+ OS_API_CALL_R (r,FreeLibrary,dynamic_cast <cmodule_t *>(x)->rep );
38
38
return r == TRUE ;
39
39
}
40
40
@@ -48,7 +48,7 @@ bool Run(const wstring &x) // FIXME: behavior change, now may throw, check call
48
48
ZeroMemory ( &pi, sizeof (pi) );
49
49
50
50
// Start the child process.
51
- API_CALL (CreateProcessW,
51
+ OS_API_CALL (CreateProcessW,
52
52
NULL , // No module name (use command line)
53
53
// FIXME: 应该创建一个长为32768的buffer来转储,而不是使用const_cast
54
54
const_cast <wchar*>(x.c_str ()), // Command line
@@ -63,11 +63,11 @@ bool Run(const wstring &x) // FIXME: behavior change, now may throw, check call
63
63
);
64
64
65
65
// Wait until child process exits.
66
- API_CALL (WaitForSingleObject, pi.hProcess , INFINITE );
66
+ OS_API_CALL (WaitForSingleObject, pi.hProcess , INFINITE );
67
67
68
68
// Close process and thread handles.
69
- API_CALL (CloseHandle, pi.hProcess );
70
- API_CALL (CloseHandle, pi.hThread );
69
+ OS_API_CALL (CloseHandle, pi.hProcess );
70
+ OS_API_CALL (CloseHandle, pi.hThread );
71
71
return true ;
72
72
}
73
73
0 commit comments