summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
Diffstat (limited to 'printing')
-rw-r--r--printing/backend/win_helper.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/printing/backend/win_helper.h b/printing/backend/win_helper.h
index 9ac9df3..0f6b7ef 100644
--- a/printing/backend/win_helper.h
+++ b/printing/backend/win_helper.h
@@ -62,6 +62,31 @@ class ScopedPrinterHandle
}
};
+class PrinterChangeHandleTraits {
+ public:
+ typedef HANDLE Handle;
+
+ static bool CloseHandle(HANDLE handle) {
+ ::FindClosePrinterChangeNotification(handle);
+ return true;
+ }
+
+ static bool IsHandleValid(HANDLE handle) {
+ return handle != NULL;
+ }
+
+ static HANDLE NullHandle() {
+ return NULL;
+ }
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PrinterChangeHandleTraits);
+};
+
+typedef base::win::GenericScopedHandle<PrinterChangeHandleTraits,
+ base::win::DummyVerifierTraits>
+ ScopedPrinterChangeHandle;
+
// Wrapper class to wrap the XPS APIs (PTxxx APIs). This is needed because these
// APIs are not available by default on XP. We could delayload prntvpt.dll but
// this would mean having to add that to every binary that links with