OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "stdafx.h" | 5 #include "stdafx.h" |
6 #include "winrt_utils.h" | 6 #include "winrt_utils.h" |
7 | 7 |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 | 178 |
179 base::win::ScopedCOMInitializer sta_com_initializer; | 179 base::win::ScopedCOMInitializer sta_com_initializer; |
180 | 180 |
181 // Get pointer to the IShellLink interface | 181 // Get pointer to the IShellLink interface |
182 result = i_shell_link.CreateInstance(CLSID_ShellLink, NULL, | 182 result = i_shell_link.CreateInstance(CLSID_ShellLink, NULL, |
183 CLSCTX_INPROC_SERVER); | 183 CLSCTX_INPROC_SERVER); |
184 if (SUCCEEDED(result)) { | 184 if (SUCCEEDED(result)) { |
185 base::win::ScopedComPtr<IPersistFile> persist; | 185 base::win::ScopedComPtr<IPersistFile> persist; |
186 // Query IShellLink for the IPersistFile interface | 186 // Query IShellLink for the IPersistFile interface |
187 result = persist.QueryFrom(i_shell_link); | 187 result = persist.QueryFrom(i_shell_link.get()); |
188 if (SUCCEEDED(result)) { | 188 if (SUCCEEDED(result)) { |
189 WCHAR temp_arguments[MAX_PATH]; | 189 WCHAR temp_arguments[MAX_PATH]; |
190 // Load the shell link | 190 // Load the shell link |
191 result = persist->Load(shortcut.value().c_str(), STGM_READ); | 191 result = persist->Load(shortcut.value().c_str(), STGM_READ); |
192 if (SUCCEEDED(result)) { | 192 if (SUCCEEDED(result)) { |
193 result = i_shell_link->GetArguments(temp_arguments, MAX_PATH); | 193 result = i_shell_link->GetArguments(temp_arguments, MAX_PATH); |
194 *arguments = temp_arguments; | 194 *arguments = temp_arguments; |
195 is_resolved = true; | 195 is_resolved = true; |
196 } | 196 } |
197 } | 197 } |
(...skipping 19 matching lines...) Expand all Loading... |
217 base::string16 arguments; | 217 base::string16 arguments; |
218 if (GetArgumentsFromShortcut(shortcut, &arguments)) { | 218 if (GetArgumentsFromShortcut(shortcut, &arguments)) { |
219 return arguments; | 219 return arguments; |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 return L""; | 223 return L""; |
224 } | 224 } |
225 | 225 |
226 } // namespace winrt_utils | 226 } // namespace winrt_utils |
OLD | NEW |