Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c751ec6a
Commit
c751ec6a
authored
Mar 07, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
schedsvc: Implement SchRpcRetrieveTask.
parent
adab8514
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
2 deletions
+72
-2
schedsvc.c
dlls/schedsvc/schedsvc.c
+72
-2
No files found.
dlls/schedsvc/schedsvc.c
View file @
c751ec6a
...
...
@@ -214,10 +214,80 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl
return
hr
;
}
static
int
detect_encoding
(
const
void
*
buffer
,
DWORD
size
)
{
static
const
char
bom_utf8
[]
=
{
0xef
,
0xbb
,
0xbf
};
if
(
size
>=
sizeof
(
bom_utf8
)
&&
!
memcmp
(
buffer
,
bom_utf8
,
sizeof
(
bom_utf8
)))
return
CP_UTF8
;
else
{
int
flags
=
IS_TEXT_UNICODE_SIGNATURE
|
IS_TEXT_UNICODE_REVERSE_SIGNATURE
|
IS_TEXT_UNICODE_ODD_LENGTH
;
IsTextUnicode
(
buffer
,
size
,
&
flags
);
if
(
flags
&
IS_TEXT_UNICODE_SIGNATURE
)
return
-
1
;
if
(
flags
&
IS_TEXT_UNICODE_REVERSE_SIGNATURE
)
return
-
2
;
return
CP_ACP
;
}
}
static
HRESULT
read_xml
(
const
WCHAR
*
name
,
WCHAR
**
xml
)
{
HANDLE
hfile
;
DWORD
size
;
char
*
src
;
int
cp
;
hfile
=
CreateFileW
(
name
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
hfile
==
INVALID_HANDLE_VALUE
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
size
=
GetFileSize
(
hfile
,
NULL
);
src
=
heap_alloc
(
size
+
2
);
if
(
!
src
)
{
CloseHandle
(
hfile
);
return
E_OUTOFMEMORY
;
}
src
[
size
]
=
0
;
src
[
size
+
1
]
=
0
;
ReadFile
(
hfile
,
src
,
size
,
&
size
,
NULL
);
CloseHandle
(
hfile
);
cp
=
detect_encoding
(
src
,
size
);
if
(
cp
<
0
)
{
*
xml
=
(
WCHAR
*
)
src
;
return
S_OK
;
}
size
=
MultiByteToWideChar
(
cp
,
0
,
src
,
-
1
,
NULL
,
0
);
*
xml
=
heap_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
!*
xml
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
cp
,
0
,
src
,
-
1
,
*
xml
,
size
);
return
S_OK
;
}
HRESULT
__cdecl
SchRpcRetrieveTask
(
const
WCHAR
*
path
,
const
WCHAR
*
languages
,
ULONG
*
n_languages
,
WCHAR
**
xml
)
{
WINE_FIXME
(
"%s,%s,%p,%p: stub
\n
"
,
wine_dbgstr_w
(
path
),
wine_dbgstr_w
(
languages
),
n_languages
,
xml
);
return
E_NOTIMPL
;
WCHAR
*
full_name
;
HRESULT
hr
;
WINE_TRACE
(
"%s,%s,%p,%p
\n
"
,
wine_dbgstr_w
(
path
),
wine_dbgstr_w
(
languages
),
n_languages
,
xml
);
full_name
=
get_full_name
(
path
,
NULL
);
if
(
!
full_name
)
return
E_OUTOFMEMORY
;
hr
=
read_xml
(
full_name
,
xml
);
if
(
hr
!=
S_OK
)
*
xml
=
NULL
;
heap_free
(
full_name
);
return
hr
;
}
HRESULT
__cdecl
SchRpcCreateFolder
(
const
WCHAR
*
path
,
const
WCHAR
*
sddl
,
DWORD
flags
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment