Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: cloud_print/service/win/cloud_print_service.cc

Issue 10222011: Adding Windows service template for Cloud Print connector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cloud_print/service/win/cloud_print_service.h"
6
7 #include "cloud_print/service/win/resource.h"
8
9 class CloudPrintServiceModule
10 : public ATL::CAtlServiceModuleT<CloudPrintServiceModule, IDS_SERVICENAME> {
11 public:
12 DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CLOUDPRINTSERVICE,
13 "{8013FB7C-2E3E-4992-B8BD-05C0C4AB0627}")
14 HRESULT InitializeSecurity() throw() {
15 // TODO(gene): Check if we need to call CoInitializeSecurity and provide
16 // the appropriate security settings for service.
17 return S_OK;
18 }
19 };
20
21 CloudPrintServiceModule _AtlModule;
22
23 int WINAPI WinMain(__in HINSTANCE hInstance,
24 __in HINSTANCE hPrevInstance,
25 __in LPSTR lpCmdLine,
26 __in int nCmdShow) {
27 // Handle service unstall case manually.
28 // Service install is handled through ATL, command line flag "/Service"
29 // http://msdn.microsoft.com/en-US/library/z8868y94(v=vs.80).aspx
30 if (StrStrA(lpCmdLine, "/UninstallService") != NULL) {
31 _AtlModule.Uninstall();
32 return 0;
33 }
34
35 // TODO(gene): When running this program with "/Service" flag it fails
36 // silently if command prompt is not elevated.
37 // Consider adding manifest to require elevated prompt, or at least
38 // print warning in this case.
39 return _AtlModule.WinMain(nCmdShow);
40 }
41
OLDNEW
« no previous file with comments | « cloud_print/service/win/cloud_print_service.h ('k') | cloud_print/service/win/cloud_print_service.rc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698