Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lois Gomez
wine
Commits
a00af0d2
Commit
a00af0d2
authored
18 years ago
by
Misha Koshelev
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wineboot: Start items in StartUp folder on boot.
parent
28b68dad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/wineboot/Makefile.in
+2
-1
2 additions, 1 deletion
programs/wineboot/Makefile.in
programs/wineboot/wineboot.c
+93
-3
93 additions, 3 deletions
programs/wineboot/wineboot.c
with
95 additions
and
4 deletions
programs/wineboot/Makefile.in
+
2
−
1
View file @
a00af0d2
...
...
@@ -4,7 +4,8 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
wineboot.exe
APPMODE
=
-mconsole
IMPORTS
=
version user32 advapi32 kernel32
IMPORTS
=
shell32 shlwapi version user32 advapi32 kernel32
EXTRALIBS
=
-luuid
C_SRCS
=
\
shutdown.c
\
...
...
This diff is collapsed.
Click to expand it.
programs/wineboot/wineboot.c
+
93
−
3
View file @
a00af0d2
...
...
@@ -37,9 +37,9 @@
* - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce (all, synch)
* - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run (all, asynch)
* - HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run (all, asynch)
* - Startup folders (all, ?asynch?
, no imp
)
* - Startup folders (all, ?asynch?)
* - HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce (all, asynch)
*
*
* Somewhere in there is processing the RunOnceEx entries (also no imp)
*
* Bugs:
...
...
@@ -63,6 +63,12 @@
#include
<windows.h>
#include
<wine/debug.h>
#define COBJMACROS
#include
<shlobj.h>
#include
<shobjidl.h>
#include
<shlwapi.h>
#include
<shellapi.h>
WINE_DEFAULT_DEBUG_CHANNEL
(
wineboot
);
#define MAX_LINE_LENGTH (2*MAX_PATH+2)
...
...
@@ -616,6 +622,88 @@ static int ProcessWindowsFileProtection(void)
return
1
;
}
/* Process items in the StartUp group of the user's Programs under the Start Menu. Some installers put
* shell links here to restart themselves after boot. */
static
BOOL
ProcessStartupItems
(
void
)
{
BOOL
ret
=
FALSE
;
HRESULT
hr
;
int
iRet
;
IMalloc
*
ppM
=
NULL
;
IShellFolder
*
psfDesktop
=
NULL
,
*
psfStartup
=
NULL
;
LPITEMIDLIST
pidlStartup
=
NULL
,
pidlItem
;
ULONG
NumPIDLs
;
IEnumIDList
*
iEnumList
=
NULL
;
STRRET
strret
;
WCHAR
wszCommand
[
MAX_PATH
];
WINE_TRACE
(
"Processing items in the StartUp folder.
\n
"
);
hr
=
SHGetMalloc
(
&
ppM
);
if
(
FAILED
(
hr
))
{
WINE_ERR
(
"Couldn't get IMalloc object.
\n
"
);
goto
done
;
}
hr
=
SHGetDesktopFolder
(
&
psfDesktop
);
if
(
FAILED
(
hr
))
{
WINE_ERR
(
"Couldn't get desktop folder.
\n
"
);
goto
done
;
}
hr
=
SHGetSpecialFolderLocation
(
NULL
,
CSIDL_STARTUP
,
&
pidlStartup
);
if
(
FAILED
(
hr
))
{
WINE_TRACE
(
"Couldn't get StartUp folder location.
\n
"
);
goto
done
;
}
hr
=
IShellFolder_BindToObject
(
psfDesktop
,
pidlStartup
,
NULL
,
&
IID_IShellFolder
,
(
LPVOID
*
)
&
psfStartup
);
if
(
FAILED
(
hr
))
{
WINE_TRACE
(
"Couldn't bind IShellFolder to StartUp folder.
\n
"
);
goto
done
;
}
hr
=
IShellFolder_EnumObjects
(
psfStartup
,
NULL
,
SHCONTF_NONFOLDERS
|
SHCONTF_INCLUDEHIDDEN
,
&
iEnumList
);
if
(
FAILED
(
hr
))
{
WINE_TRACE
(
"Unable to enumerate StartUp objects.
\n
"
);
goto
done
;
}
while
(
IEnumIDList_Next
(
iEnumList
,
1
,
&
pidlItem
,
&
NumPIDLs
)
==
S_OK
&&
(
NumPIDLs
)
==
1
)
{
hr
=
IShellFolder_GetDisplayNameOf
(
psfStartup
,
pidlItem
,
SHGDN_FORPARSING
,
&
strret
);
if
(
FAILED
(
hr
))
WINE_TRACE
(
"Unable to get display name of enumeration item.
\n
"
);
else
{
hr
=
StrRetToBufW
(
&
strret
,
pidlItem
,
wszCommand
,
MAX_PATH
);
if
(
FAILED
(
hr
))
WINE_TRACE
(
"Unable to parse display name.
\n
"
);
else
if
((
iRet
=
(
int
)
ShellExecuteW
(
NULL
,
NULL
,
wszCommand
,
NULL
,
NULL
,
SW_SHOWNORMAL
))
<=
32
)
WINE_ERR
(
"Error %d executing command %s.
\n
"
,
iRet
,
wine_dbgstr_w
(
wszCommand
));
}
IMalloc_Free
(
ppM
,
pidlItem
);
}
/* Return success */
ret
=
TRUE
;
done:
if
(
iEnumList
)
IEnumIDList_Release
(
iEnumList
);
if
(
psfStartup
)
IShellFolder_Release
(
psfStartup
);
if
(
pidlStartup
)
IMalloc_Free
(
ppM
,
pidlStartup
);
return
ret
;
}
static
void
usage
(
void
)
{
WINE_MESSAGE
(
"Usage: wineboot [options]
\n
"
);
...
...
@@ -732,7 +820,9 @@ int main( int argc, char *argv[] )
FALSE
,
FALSE
))
&&
(
!
ops
.
postlogin
||
!
ops
.
startup
||
ProcessRunKeys
(
HKEY_CURRENT_USER
,
runkeys_names
[
RUNKEY_RUN
],
FALSE
,
FALSE
));
FALSE
,
FALSE
))
&&
(
!
ops
.
postlogin
||
!
ops
.
startup
||
ProcessStartupItems
(
));
WINE_TRACE
(
"Operation done
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment