Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f47d2118
Commit
f47d2118
authored
Nov 02, 2010
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Nov 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wer: Implement Wer*ExcludedApplication.
parent
ab47cca2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
11 deletions
+76
-11
Makefile.in
dlls/wer/Makefile.in
+1
-0
main.c
dlls/wer/main.c
+75
-11
No files found.
dlls/wer/Makefile.in
View file @
f47d2118
MODULE
=
wer.dll
IMPORTLIB
=
wer
IMPORTS
=
advapi32
C_SRCS
=
\
main.c
...
...
dlls/wer/main.c
View file @
f47d2118
/*
* Copyright 2010 Louis Lenders
* Copyright 2010 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -22,8 +23,10 @@
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "werapi.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wer
);
...
...
@@ -47,6 +50,11 @@ static CRITICAL_SECTION report_table_cs = { &report_table_cs_debug, -1, 0, 0, 0,
static
struct
list
report_table
=
LIST_INIT
(
report_table
);
static
WCHAR
regpath_exclude
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
' '
,
'R'
,
'e'
,
'p'
,
'o'
,
'r'
,
't'
,
'i'
,
'n'
,
'g'
,
'\\'
,
'E'
,
'x'
,
'c'
,
'l'
,
'u'
,
'd'
,
'e'
,
'd'
,
'A'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
's'
,
0
};
/***********************************************************************
* Memory alloccation helper
*/
...
...
@@ -61,12 +69,6 @@ static inline BOOL heap_free(void *mem)
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
HRESULT
WINAPI
WerAddExcludedApplication
(
PCWSTR
exeName
,
BOOL
allUsers
)
{
FIXME
(
"(%s, %d) stub
\n
"
,
debugstr_w
(
exeName
),
allUsers
);
return
E_NOTIMPL
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
TRACE
(
"(0x%p, %d, %p)
\n
"
,
hinstDLL
,
fdwReason
,
lpvReserved
);
...
...
@@ -86,6 +88,47 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
/***********************************************************************
* WerAddExcludedApplication (wer.@)
*
* Add an application to the user specific or the system wide exclusion list
*
* PARAMS
* exeName [i] The application name
* allUsers [i] for all users (TRUE) or for the current user (FALSE)
*
* RETURNS
* Success: S_OK
* Faulure: A HRESULT error code
*
*/
HRESULT
WINAPI
WerAddExcludedApplication
(
PCWSTR
exeName
,
BOOL
allUsers
)
{
HKEY
hkey
;
DWORD
value
=
1
;
LPWSTR
bs
;
TRACE
(
"(%s, %d)
\n
"
,
debugstr_w
(
exeName
),
allUsers
);
if
(
!
exeName
||
!
exeName
[
0
])
return
E_INVALIDARG
;
bs
=
strrchrW
(
exeName
,
'\\'
);
if
(
bs
)
{
bs
++
;
/* skip the backslash */
if
(
!
bs
[
0
])
{
return
E_INVALIDARG
;
}
}
else
bs
=
(
LPWSTR
)
exeName
;
if
(
!
RegCreateKeyW
(
allUsers
?
HKEY_LOCAL_MACHINE
:
HKEY_CURRENT_USER
,
regpath_exclude
,
&
hkey
))
{
RegSetValueExW
(
hkey
,
bs
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
value
,
sizeof
(
DWORD
));
RegCloseKey
(
hkey
);
return
S_OK
;
}
return
E_ACCESSDENIED
;
}
/***********************************************************************
* WerRemoveExcludedApplication (wer.@)
*
* remove an application from the exclusion list
...
...
@@ -94,15 +137,36 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
* exeName [i] The application name
* allUsers [i] for all users (TRUE) or for the current user (FALSE)
*
* RE
SULT
S
* S
UCCESS
S_OK
* F
AILURE
A HRESULT error code
* RE
TURN
S
* S
uccess:
S_OK
* F
aulure:
A HRESULT error code
*
*/
HRESULT
WINAPI
WerRemoveExcludedApplication
(
PCWSTR
exeName
,
BOOL
allUsers
)
{
FIXME
(
"(%s, %d) :stub
\n
"
,
debugstr_w
(
exeName
),
allUsers
);
return
E_NOTIMPL
;
HKEY
hkey
;
LPWSTR
bs
;
LONG
lres
;
TRACE
(
"(%s, %d)
\n
"
,
debugstr_w
(
exeName
),
allUsers
);
if
(
!
exeName
||
!
exeName
[
0
])
return
E_INVALIDARG
;
bs
=
strrchrW
(
exeName
,
'\\'
);
if
(
bs
)
{
bs
++
;
/* skip the backslash */
if
(
!
bs
[
0
])
{
return
E_INVALIDARG
;
}
}
else
bs
=
(
LPWSTR
)
exeName
;
if
(
!
RegCreateKeyW
(
allUsers
?
HKEY_LOCAL_MACHINE
:
HKEY_CURRENT_USER
,
regpath_exclude
,
&
hkey
))
{
lres
=
RegDeleteValueW
(
hkey
,
bs
);
RegCloseKey
(
hkey
);
return
lres
?
__HRESULT_FROM_WIN32
(
ERROR_ENVVAR_NOT_FOUND
)
:
S_OK
;
}
return
E_ACCESSDENIED
;
}
/***********************************************************************
...
...
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