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
06b64a1a
Commit
06b64a1a
authored
Jun 05, 2007
by
Stefan Leichter
Committed by
Alexandre Julliard
Jun 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool.drv: Replace WINSPOOL_SHDeleteKeyW with RegDeleteTreeW.
parent
5c06fb0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
55 deletions
+3
-55
info.c
dlls/winspool.drv/info.c
+3
-55
No files found.
dlls/winspool.drv/info.c
View file @
06b64a1a
...
@@ -246,58 +246,6 @@ static const WCHAR default_doc_title[] = {'L','o','c','a','l',' ','D','o','w','n
...
@@ -246,58 +246,6 @@ static const WCHAR default_doc_title[] = {'L','o','c','a','l',' ','D','o','w','n
'D'
,
'o'
,
'c'
,
'u'
,
'm'
,
'e'
,
'n'
,
't'
,
0
};
'D'
,
'o'
,
'c'
,
'u'
,
'm'
,
'e'
,
'n'
,
't'
,
0
};
/*****************************************************************************
* WINSPOOL_SHRegDeleteKey
*
* Recursively delete subkeys.
* Cut & paste from shlwapi.
*
*/
static
DWORD
WINSPOOL_SHDeleteKeyW
(
HKEY
hKey
,
LPCWSTR
lpszSubKey
)
{
DWORD
dwRet
,
dwKeyCount
=
0
,
dwMaxSubkeyLen
=
0
,
dwSize
,
i
;
WCHAR
szNameBuf
[
MAX_PATH
],
*
lpszName
=
szNameBuf
;
HKEY
hSubKey
=
0
;
dwRet
=
RegOpenKeyExW
(
hKey
,
lpszSubKey
,
0
,
KEY_READ
,
&
hSubKey
);
if
(
!
dwRet
)
{
/* Find how many subkeys there are */
dwRet
=
RegQueryInfoKeyW
(
hSubKey
,
NULL
,
NULL
,
NULL
,
&
dwKeyCount
,
&
dwMaxSubkeyLen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
dwRet
)
{
dwMaxSubkeyLen
++
;
if
(
dwMaxSubkeyLen
>
sizeof
(
szNameBuf
)
/
sizeof
(
WCHAR
))
/* Name too big: alloc a buffer for it */
lpszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxSubkeyLen
*
sizeof
(
WCHAR
));
if
(
!
lpszName
)
dwRet
=
ERROR_NOT_ENOUGH_MEMORY
;
else
{
/* Recursively delete all the subkeys */
for
(
i
=
0
;
i
<
dwKeyCount
&&
!
dwRet
;
i
++
)
{
dwSize
=
dwMaxSubkeyLen
;
dwRet
=
RegEnumKeyExW
(
hSubKey
,
i
,
lpszName
,
&
dwSize
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
dwRet
)
dwRet
=
WINSPOOL_SHDeleteKeyW
(
hSubKey
,
lpszName
);
}
if
(
lpszName
!=
szNameBuf
)
HeapFree
(
GetProcessHeap
(),
0
,
lpszName
);
/* Free buffer if allocated */
}
}
RegCloseKey
(
hSubKey
);
if
(
!
dwRet
)
dwRet
=
RegDeleteKeyW
(
hKey
,
lpszSubKey
);
}
return
dwRet
;
}
/******************************************************************
/******************************************************************
* validate the user-supplied printing-environment [internal]
* validate the user-supplied printing-environment [internal]
*
*
...
@@ -2323,7 +2271,7 @@ BOOL WINAPI DeleteMonitorW (LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorNa
...
@@ -2323,7 +2271,7 @@ BOOL WINAPI DeleteMonitorW (LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorNa
}
}
/* change this, when advapi32.dll/RegDeleteTree is implemented */
/* change this, when advapi32.dll/RegDeleteTree is implemented */
if
(
WINSPOOL_SHDeleteKey
W
(
hroot
,
pMonitorName
)
==
ERROR_SUCCESS
)
{
if
(
RegDeleteTree
W
(
hroot
,
pMonitorName
)
==
ERROR_SUCCESS
)
{
TRACE
(
"monitor %s deleted
\n
"
,
debugstr_w
(
pMonitorName
));
TRACE
(
"monitor %s deleted
\n
"
,
debugstr_w
(
pMonitorName
));
RegCloseKey
(
hroot
);
RegCloseKey
(
hroot
);
return
TRUE
;
return
TRUE
;
...
@@ -3044,7 +2992,7 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter)
...
@@ -3044,7 +2992,7 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter)
return
FALSE
;
return
FALSE
;
}
}
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
PrintersW
,
&
hkeyPrinters
)
==
ERROR_SUCCESS
)
{
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
PrintersW
,
&
hkeyPrinters
)
==
ERROR_SUCCESS
)
{
WINSPOOL_SHDeleteKey
W
(
hkeyPrinters
,
lpNameW
);
RegDeleteTree
W
(
hkeyPrinters
,
lpNameW
);
RegCloseKey
(
hkeyPrinters
);
RegCloseKey
(
hkeyPrinters
);
}
}
WriteProfileStringW
(
devicesW
,
lpNameW
,
NULL
);
WriteProfileStringW
(
devicesW
,
lpNameW
,
NULL
);
...
@@ -6432,7 +6380,7 @@ BOOL WINAPI DeletePrinterDriverExW( LPWSTR pName, LPWSTR pEnvironment,
...
@@ -6432,7 +6380,7 @@ BOOL WINAPI DeletePrinterDriverExW( LPWSTR pName, LPWSTR pEnvironment,
return
FALSE
;
return
FALSE
;
}
}
if
(
WINSPOOL_SHDeleteKey
W
(
hkey_drivers
,
pDriverName
)
==
ERROR_SUCCESS
)
if
(
RegDeleteTree
W
(
hkey_drivers
,
pDriverName
)
==
ERROR_SUCCESS
)
ret
=
TRUE
;
ret
=
TRUE
;
RegCloseKey
(
hkey_drivers
);
RegCloseKey
(
hkey_drivers
);
...
...
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