summaryrefslogtreecommitdiffstats
path: root/rlz/win/dll
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 14:10:52 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-21 14:10:52 +0000
commit0a5e34a5386fa254a3b133f0a5f7667f1f790f67 (patch)
treed1dd0e80264f900004c56ad5ce6b56efea0bec49 /rlz/win/dll
parentb049c382ff842f546e2bcc261ce23438bc8764bf (diff)
downloadchromium_src-0a5e34a5386fa254a3b133f0a5f7667f1f790f67.zip
chromium_src-0a5e34a5386fa254a3b133f0a5f7667f1f790f67.tar.gz
chromium_src-0a5e34a5386fa254a3b133f0a5f7667f1f790f67.tar.bz2
Check-in rlz code to src\rlz from http://code.google.com/p/rlz/.
Review URL: https://chromiumcodereview.appspot.com/10597002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'rlz/win/dll')
-rw-r--r--rlz/win/dll/dll_main.cc15
-rw-r--r--rlz/win/dll/exports.cc108
2 files changed, 123 insertions, 0 deletions
diff --git a/rlz/win/dll/dll_main.cc b/rlz/win/dll/dll_main.cc
new file mode 100644
index 0000000..943f517
--- /dev/null
+++ b/rlz/win/dll/dll_main.cc
@@ -0,0 +1,15 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Main function for the RLZ DLL.
+
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+#include <windows.h>
+
+BOOL APIENTRY DllMain(HANDLE module, DWORD reason, LPVOID reserved) {
+ return TRUE;
+}
+
diff --git a/rlz/win/dll/exports.cc b/rlz/win/dll/exports.cc
new file mode 100644
index 0000000..efe5cd98
--- /dev/null
+++ b/rlz/win/dll/exports.cc
@@ -0,0 +1,108 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Functions exported by the RLZ DLL.
+
+#include "rlz/win/lib/rlz_lib.h"
+
+#define RLZ_DLL_EXPORT extern "C" __declspec(dllexport)
+
+RLZ_DLL_EXPORT bool RecordProductEvent(rlz_lib::Product product,
+ rlz_lib::AccessPoint point,
+ rlz_lib::Event event_id) {
+ return rlz_lib::RecordProductEvent(product, point, event_id);
+}
+
+RLZ_DLL_EXPORT bool GetProductEventsAsCgi(rlz_lib::Product product,
+ char* unescaped_cgi,
+ size_t unescaped_cgi_size) {
+ return rlz_lib::GetProductEventsAsCgi(product, unescaped_cgi,
+ unescaped_cgi_size);
+}
+RLZ_DLL_EXPORT bool ClearAllProductEvents(rlz_lib::Product product) {
+ return rlz_lib::ClearAllProductEvents(product);
+}
+
+RLZ_DLL_EXPORT bool ClearProductEvent(rlz_lib::Product product,
+ rlz_lib::AccessPoint point,
+ rlz_lib::Event event_id) {
+ return rlz_lib::ClearProductEvent(product, point, event_id);
+}
+
+RLZ_DLL_EXPORT bool GetAccessPointRlz(rlz_lib::AccessPoint point,
+ char* rlz,
+ size_t rlz_size) {
+ return rlz_lib::GetAccessPointRlz(point, rlz, rlz_size);
+}
+
+RLZ_DLL_EXPORT bool SetAccessPointRlz(rlz_lib::AccessPoint point,
+ const char* new_rlz) {
+ return rlz_lib::SetAccessPointRlz(point, new_rlz);
+}
+
+RLZ_DLL_EXPORT bool CreateMachineState() {
+ return rlz_lib::CreateMachineState();
+}
+
+RLZ_DLL_EXPORT bool SetMachineDealCode(const char* dcc) {
+ return rlz_lib::SetMachineDealCode(dcc);
+}
+
+RLZ_DLL_EXPORT bool GetMachineDealCodeAsCgi(char* cgi, size_t cgi_size) {
+ return rlz_lib::GetMachineDealCodeAsCgi(cgi, cgi_size);
+}
+
+RLZ_DLL_EXPORT bool GetMachineDealCode2(char* dcc, size_t dcc_size) {
+ return rlz_lib::GetMachineDealCode(dcc, dcc_size);
+}
+
+RLZ_DLL_EXPORT bool GetPingParams(rlz_lib::Product product,
+ const rlz_lib::AccessPoint* access_points,
+ char* unescaped_cgi,
+ size_t unescaped_cgi_size) {
+ return rlz_lib::GetPingParams(product, access_points, unescaped_cgi,
+ unescaped_cgi_size);
+}
+
+RLZ_DLL_EXPORT bool ParsePingResponse(rlz_lib::Product product,
+ const char* response) {
+ return rlz_lib::ParsePingResponse(product, response);
+}
+
+RLZ_DLL_EXPORT bool IsPingResponseValid(const char* response,
+ int* checksum_idx) {
+ return rlz_lib::IsPingResponseValid(response, checksum_idx);
+}
+
+RLZ_DLL_EXPORT bool SetMachineDealCodeFromPingResponse(const char* response) {
+ return rlz_lib::SetMachineDealCodeFromPingResponse(response);
+}
+
+RLZ_DLL_EXPORT bool SendFinancialPing(rlz_lib::Product product,
+ const rlz_lib::AccessPoint* access_points,
+ const char* product_signature,
+ const char* product_brand,
+ const char* product_id,
+ const char* product_lang,
+ bool exclude_machine_id) {
+ return rlz_lib::SendFinancialPing(product, access_points, product_signature,
+ product_brand, product_id, product_lang, exclude_machine_id);
+}
+
+RLZ_DLL_EXPORT bool SendFinancialPingNoDelay(
+ rlz_lib::Product product,
+ const rlz_lib::AccessPoint* access_points,
+ const char* product_signature,
+ const char* product_brand,
+ const char* product_id,
+ const char* product_lang,
+ bool exclude_machine_id) {
+ return rlz_lib::SendFinancialPing(product, access_points, product_signature,
+ product_brand, product_id, product_lang, exclude_machine_id, true);
+}
+
+RLZ_DLL_EXPORT void ClearProductState(
+ rlz_lib::Product product, const rlz_lib::AccessPoint* access_points) {
+ return rlz_lib::ClearProductState(product, access_points);
+}