U.S. patent application number 16/590853 was filed with the patent office on 2020-01-30 for programming interface for licensing.
The applicant listed for this patent is Microsoft Technology Licensing, LLC. Invention is credited to Caglar Gunyakti, Wen-Pin Scott Hsu, Ning Zhang.
Application Number | 20200034516 16/590853 |
Document ID | / |
Family ID | 34394578 |
Filed Date | 2020-01-30 |
![](/patent/app/20200034516/US20200034516A1-20200130-D00000.png)
![](/patent/app/20200034516/US20200034516A1-20200130-D00001.png)
![](/patent/app/20200034516/US20200034516A1-20200130-D00002.png)
![](/patent/app/20200034516/US20200034516A1-20200130-D00003.png)
![](/patent/app/20200034516/US20200034516A1-20200130-D00004.png)
![](/patent/app/20200034516/US20200034516A1-20200130-D00005.png)
United States Patent
Application |
20200034516 |
Kind Code |
A1 |
Gunyakti; Caglar ; et
al. |
January 30, 2020 |
PROGRAMMING INTERFACE FOR LICENSING
Abstract
A software licensing Application Programming Interface (API)
that allows software products to use the license management
functionality of a common service. A license specifies rights in a
software product. The software product calls a consume method on
the API in order to consume a right. If the right exists, the
service binds the right to the license in which the right is found.
The software product enforces the terms of the license by granting,
or denying, access to some or all features depending on whether a
valid instance of the right is found. Arbitrary data can be
associated with a right. The API includes a method to retrieve data
from a right that has been previously bound by the consume
method.
Inventors: |
Gunyakti; Caglar; (Redmond,
WA) ; Hsu; Wen-Pin Scott; (Redmond, WA) ;
Zhang; Ning; (Sammamish, WA) |
|
Applicant: |
Name |
City |
State |
Country |
Type |
Microsoft Technology Licensing, LLC |
Redmond |
WA |
US |
|
|
Family ID: |
34394578 |
Appl. No.: |
16/590853 |
Filed: |
October 2, 2019 |
Related U.S. Patent Documents
|
|
|
|
|
|
Application
Number |
Filing Date |
Patent Number |
|
|
10692868 |
Oct 24, 2003 |
10437964 |
|
|
16590853 |
|
|
|
|
Current U.S.
Class: |
1/1 |
Current CPC
Class: |
G06F 21/10 20130101;
H01Q 1/22 20130101; G06F 2221/2137 20130101; G06F 2221/0742
20130101; A01K 87/00 20130101; H01Q 1/3275 20130101 |
International
Class: |
G06F 21/10 20060101
G06F021/10; H01Q 1/22 20060101 H01Q001/22; H01Q 1/32 20060101
H01Q001/32; A01K 87/00 20060101 A01K087/00 |
Claims
1-20. (canceled)
21. An apparatus comprising: at least one computer processor; a
license store that stores license files for different software
products, said license files including licenses to the different
software products specifying rights and conditions on the exercise
of said rights; and memory coupled to the at least one computer
processor, the memory comprising executable instructions that,
based on execution by the at least one computer processor, cause
the at least one computer processor to automatically: expose an
application programming interface that provides access by
application programs to license information associated with the
different software products in said license files in said license
store; receive from an application program via said application
programming interface a request comprising an indication of a
software product and a request to exercise a right granted in a
license to the software product in said license files; check
whether the license for the indicated software product is valid;
based at least on the license for the indicated software product
being valid, obtaining from said license store rights and
conditions of the exercise of said rights granted in the license
for the software product indicated in the request; and provide,
based at least on receiving the request via said application
programming interface, the rights and conditions of the exercise of
said rights granted in the license for the software product
indicated in the request to the application program without
implementing any mechanism for granting or denying the rights
granted in the license for the software product, wherein the
instructions for checking whether the license for the indicated
software product is valid further comprises instructions for
determining that the license for the indicated software product is
bound to the software product by determining whether the rights
granted in the license for the software product indicated in the
request can be exercised based on whether the rights are bound to
an entity for which execution of the application program was
requested, wherein the instructions further comprise instructions
for establishing a context for asynchronous processing and
processing the request from the application program,
asynchronously, in accordance with the established context, and
wherein the executable instructions are executed by an operating
system.
22. The apparatus of claim 21, further comprising a trust store
that stores data used in a license validation process in a
tamper-resistant manner.
23. The apparatus of claim 21, wherein the instructions for
checking that the license for the indicated software product is
valid includes instructions for determining, via a conflict rule,
which license to obtain from a plurality of licenses indicated by
said license files that are stored in the license store for the
software product, the plurality of licenses including the license
to the software product.
24. The apparatus of claim 21, wherein the rights and conditions of
the exercise of said rights granted in the license for the software
product indicated in the request comprise an indication of a
validity of the rights granted in the license for the software
product.
25. The apparatus of claim 21, wherein the instructions for
obtaining said license store rights and conditions of the exercise
of said rights includes instructions for determining whether the
license for the indicated software product is valid and bound to
the software product, and for obtaining said license store rights
and conditions of the exercise of said rights granted in the
license for the software product indicated in the request when said
license store rights and conditions of the exercise of said rights
granted in the license for the software product indicated in the
request is valid and bound to the software product.
26. The apparatus of claim 21, wherein instructions for providing
the rights and conditions of the exercise of said rights includes
instructions for providing the rights and conditions of the
exercise of said rights granted in the license for the software
product indicated in the request or the information from the
license to the software product indicated in the request to the
application software without implementing any mechanism for
granting or denying the rights granted in the license for the
software product.
27. A method comprising: exposing an application programming
interface that provides access by application programs to license
information in a license store storing license files for different
software products, said license files including licenses to the
different software products specifying rights and conditions on the
exercise of said rights; receiving from an application program via
said application programming interface a request comprising an
indication of a software product having a license file in the
license store and a request to exercise a right granted in a
license to the software product in said license files; checking
whether the license for the indicated software product is valid;
based at least on the license for the indicated software product
being valid, obtaining from said license store rights and
conditions of the exercise of said rights granted in the license
for the software product indicated in the request; providing, based
at least on receiving the request via said application programming
interface, the rights and conditions of the exercise of said rights
granted in the license for the software product indicated in the
request to the application program without implementing any
mechanism for granting or denying the rights granted in the license
for the software product, wherein checking whether the license for
the indicated software product is valid further comprises
determining that the license for the indicated software product is
bound to the software product by determining whether the rights
granted in the license for the software product indicated in the
request can be exercised; establishing a context for asynchronous
processing; and processing the request from the application
program, asynchronously, in accordance with the established
context, wherein the method is executed by an operating system.
28. The method of claim 27, further comprising storing data used in
a license validation process in a trust store in tamper-resistant
manner.
29. The method of claim 27, wherein checking that the license for
the indicated software product is valid includes determining, via a
conflict rule, which license to obtain from a plurality of licenses
in said license files that are stored in the license store for the
software product, the plurality of licenses including the license
to the software product.
30. The method of claim 27, wherein the rights and conditions of
the exercise of said rights granted in the license for the software
product indicated in the request comprise an indication of a
validity of the rights granted in the license for the software
product.
31. The method of claim 27, wherein the license files further
specify at least one condition on the exercise of the right granted
in the license.
32. The method of claim 27, wherein the obtaining rights and
conditions of the exercise of said rights further comprises
determining whether the license for the indicated software product
is valid and bound to the software product, and obtaining rights
and conditions of the exercise of said rights granted in the
license for the software product indicated in the request when
rights and conditions of the exercise of said rights granted in the
license for the software product indicated in the request is valid
and bound to the software product.
33. A computer-readable memory device comprising executable
instructions that, based on execution by at least one computer
processor, cause the at least one computer processor to: expose an
application programming interface that allows application programs
to request license information contained in a license store storing
license files for different software products, said license files
including licenses to the different software products specifying at
least one right; receive from an application program at least via
said application programming interface a request comprising an
indication of a software product having a license file in the
license store and a request to exercise a right granted in a
license to the software product in said license files; check
whether the license for the indicated software product is valid;
based at least on the license for the indicated software product
being valid, obtain from said license store the at least one right
granted in the license for the software product indicated in the
request; provide, based at least on receiving the request via said
application programming interface, the at least one right granted
in the license for the software product indicated in the request to
the application program without implementing any mechanism for
granting or denying the rights granted in the license for the
software product, wherein checking whether the license for the
indicated software product is valid further comprises determining
that the license for the indicated software product is bound to the
software product by determining whether the rights granted in the
license for the software product indicated in the request can be
exercised based on whether the rights are bound to an entity
associated with the received request; establishing a context for
asynchronous processing; and processing the request from the
application program, asynchronously, in accordance with the
established context, wherein the instructions are executed by an
operating system.
34. The memory device of claim 33, further comprising instructions
for storing data used in a license validation process in a trust
store in tamper-resistant manner.
35. The memory device of claim 33, wherein instructions for
checking that the license for the indicated software product is
valid includes instructions for determining, via a conflict rule,
which license to obtain from a plurality of licenses in said
license files that are stored in the license store for the software
product, the plurality of licenses including the license to the
software product.
36. The memory device of claim 33, wherein instructions to check
whether the license for the indicated software product is valid
comprises instructions that further cause the at least one
processor to determine whether the rights granted in the license
for the software product indicated in the request can be exercised
based on whether rights are bound to a class of machines of which a
machine executing the application program from which the request
was received is a member.
37. The memory device of claim 33, wherein the license files
further specify at least one condition on the exercise of said at
least one right.
38. The memory device of claim 33, wherein the check further
comprises checking whether the license for the indicated software
product is bound to the software product.
39. The memory device of claim 33, wherein the obtaining the at
least one right further comprises determining whether the license
for the indicated software product is valid and bound to the
software product, and obtaining the at least one right and
conditions of the exercise of said at least one right granted in
the license for the software product indicated in the request when
the at least one right and conditions of the exercise of said at
least one right granted in the license for the software product
indicated in the request is valid and bound to the software
product.
40. The memory device of claim 39, wherein providing the at least
one right based at least on receiving the request, further
comprises providing the at least one right and the conditions of
the exercise of said at least one right granted in the license for
the software product indicated in the request or the information
from the license to the software product indicated in the request
to the application software without implementing any mechanism for
granting or denying the rights granted in the license for the
software product.
Description
CROSS-REFERENCE TO RELATED APPLICATION(S)
[0001] This application is a continuation of U.S. patent
application Ser. No. 10/692,868, filed Oct. 24, 2003, entitled
"PROGRAMMING INTERFACE FOR LICENSING," (Atty. Dkt. No.
305442-US-NP). The entirety of this afore-mentioned application is
incorporated herein by reference.
FIELD OF THE INVENTION
[0002] The present invention relates generally to the field of
computer software, and, more particularly, to a programming
interface that supports the enforcement of electronic licenses.
BACKGROUND OF THE INVENTION
[0003] Commercially-produced software has traditionally been made
available under a license that defines the permissible terms of the
software's use. When the practice of software licensing first
began, the license generally took the form of a legal document that
defined the user's rights with respect to the software. Such a
document relied upon the legal system for enforcement. It has since
become desirable for licenses to be enforced electronically--i.e.,
it is desirable that a computer program contain code that actively
discourages or prevents use of the software in a manner that is
contrary to the license.
[0004] Most software that provides for electronic license
enforcement provides its own infrastructure to manage the licensing
of the software and the use of the licenses. Thus, a typical
commercial software product may include not only the code to
perform the product's core function, but may also carry with it the
code to obtain, evaluate, protect, and manage licenses for the
software. For each software vendor to develop and incorporate this
infrastructure into its software is often a wasteful duplication of
effort. It is therefore desirable to provide a system that performs
the basic functions related to software licensing, where the system
can be used by a broad variety of software applications in a
uniform and defined way.
[0005] In view of the foregoing, there is a need for a mechanism
that overcomes the drawbacks of the prior art.
SUMMARY OF THE INVENTION
[0006] The present invention provides a software licensing
Application Programming Interface (API) that provides certain
licensing functions for use by software products. A license service
performs functions relating to the use of licenses, and exposes
these functions to software products through the API. The service
performs functions such as obtaining licenses, storing and managing
licenses, protecting licenses from tampering, evaluating a
license's validity, and evaluating whether a license is correctly
bound to the machine and/or software product on which it is used.
The software is able to make use of this functionality by calling
the methods of the API.
[0007] In a typical use of the API, a software product calls an
"open" API method in order to obtain a unique handle that is used
by the license service to identify the application. The software
product then calls a "consume right" API method. "Consume," in this
context, means the exercise of a specified right. The call to the
"consume right" method is parameterized by the software product's
handle, and by the name of the right to be consumed. The license
service then attempts to locate one or more valid, correctly bound
licenses that contains the named right. If no such license exists,
then the software product is notified of the failure. If such
licenses exist, then the right is bound to one of the licenses, and
the calling software product is notified of the binding. In such a
case, the software product knows that the right exists, and can
perform whatever functions are associated with this right.
[0008] In a preferred embodiment, the license service does not
define what the software can or cannot do under the right, or
enforce substantive constraints on the use of the software. Rather,
the license service manages the licenses in such a way that a
software product can determine by calling the API whether a right
does, or does not, exist, so that the software can behave
accordingly. For example, a right may be called "run," indicating
that the user has the right to run the software product. The
software product can use the API to determine whether there is a
valid (and correctly bound, and non-expired) right to run the
software. However, if the API call returns with an indication that
there is no right to run the software, it is up to the software to
cease operation or take some other action based on the
non-existence of this right.
[0009] A right may be associated with information, which becomes
available after a successful call to the "consume right" method.
For example, a given software product may have individual rules
about when it is permissible to edit, print, save, etc., and these
rules can be stored in the license that contains the right. The API
provides a "get information" method that allows this information to
be retrieved from the license.
[0010] Other features of the invention are described below.
BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The foregoing summary, as well as the following detailed
description of preferred embodiments, is better understood when
read in conjunction with the appended drawings. For the purpose of
illustrating the invention, there is shown in the drawings
exemplary constructions of the invention; however, the invention is
not limited to the specific methods and instrumentalities
disclosed. In the drawings:
[0012] FIG. 1 is a block diagram of an example computing
environment in which aspects of the invention may be
implemented;
[0013] FIG. 2 is a block diagram of an architecture in which a
system performs licensing functions and exposes an API for use by
software products;
[0014] FIG. 3 is a flow diagram of a method through which a
software product uses a licensing API;
[0015] FIG. 4 is a flow diagram of a method by which a software
product consumes a right; and
[0016] FIG. 5 is a flow diagram of a method by which a software
product retrieves information relating to a consumed right.
DETAILED DESCRIPTION OF THE INVENTION
Overview
[0017] The use of commercial software is typically governed by a
license, and it has become increasingly common for this license to
be embodied in an electronic form that can be enforced by the
software itself. One challenge in creating an electronic licensing
system is that an infrastructure is needed to manage the use of the
licenses. Replicating this infrastructure for every software
product is cumbersome and wasteful. The present invention provides
an API that allows different software products to use a common
infrastructure that performs various licensing functions.
Exemplary Computing Arrangement
[0018] FIG. 1 shows an exemplary computing environment in which
aspects of the invention may be implemented. The computing system
environment 100 is only one example of a suitable computing
environment and is not intended to suggest any limitation as to the
scope of use or functionality of the invention. Neither should the
computing environment 100 be interpreted as having any dependency
or requirement relating to any one or combination of components
illustrated in the exemplary operating environment 100.
[0019] The invention is operational with numerous other general
purpose or special purpose computing system environments or
configurations. Examples of well known computing systems,
environments, and/or configurations that may be suitable for use
with the invention include, but are not limited to, personal
computers, server computers, hand-held or laptop devices,
multiprocessor systems, microprocessor-based systems, set top
boxes, programmable consumer electronics, network PCs,
minicomputers, mainframe computers, embedded systems, distributed
computing environments that include any of the above systems or
devices, and the like.
[0020] The invention may be described in the general context of
computer-executable instructions, such as program modules, being
executed by a computer. Generally, program modules include
routines, programs, objects, components, data structures, etc. that
perform particular tasks or implement particular abstract data
types. The invention may also be practiced in distributed computing
environments where tasks are performed by remote processing devices
that are linked through a communications network or other data
transmission medium. In a distributed computing environment,
program modules and other data may be located in both local and
remote computer storage media including memory storage devices.
[0021] With reference to FIG. 1, an exemplary system for
implementing the invention includes a general purpose computing
device in the form of a computer 110. Components of computer 110
may include, but are not limited to, a processing unit 120, a
system memory 130, and a system bus 121 that couples various system
components including the system memory to the processing unit 120.
The processing unit 120 may represent multiple logical processing
units such as those supported on a multi-threaded processor. The
system bus 121 may be any of several types of bus structures
including a memory bus or memory controller, a peripheral bus, and
a local bus using any of a variety of bus architectures. By way of
example, and not limitation, such architectures include Industry
Standard Architecture (ISA) bus, Micro Channel Architecture (MCA)
bus, Enhanced ISA (EISA) bus, Video Electronics Standards
Association (VESA) local bus, and Peripheral Component Interconnect
(PCI) bus (also known as Mezzanine bus). The system bus 121 may
also be implemented as a point-to-point connection, switching
fabric, or the like, among the communicating devices.
[0022] Computer 110 typically includes a variety of computer
readable media. Computer readable media can be any available media
that can be accessed by computer 110 and includes both volatile and
nonvolatile media, removable and non-removable media. By way of
example, and not limitation, computer readable media may comprise
computer storage media and communication media. Computer storage
media includes both volatile and nonvolatile, removable and
non-removable media implemented in any method or technology for
storage of information such as computer readable instructions, data
structures, program modules or other data. Computer storage media
includes, but is not limited to, RAM, ROM, EEPROM, flash memory or
other memory technology, CDROM, digital versatile disks (DVD) or
other optical disk storage, magnetic cassettes, magnetic tape,
magnetic disk storage or other magnetic storage devices, or any
other medium which can be used to store the desired information and
which can accessed by computer 110. Communication media typically
embodies computer readable instructions, data structures, program
modules or other data in a modulated data signal such as a carrier
wave or other transport mechanism and includes any information
delivery media. The term "modulated data signal" means a signal
that has one or more of its characteristics set or changed in such
a manner as to encode information in the signal. By way of example,
and not limitation, communication media includes wired media such
as a wired network or direct-wired connection, and wireless media
such as acoustic, RF, infrared and other wireless media.
Combinations of any of the above should also be included within the
scope of computer readable media.
[0023] The system memory 130 includes computer storage media in the
form of volatile and/or nonvolatile memory such as read only memory
(ROM) 131 and random access memory (RAM) 132. A basic input/output
system 133 (BIOS), containing the basic routines that help to
transfer information between elements within computer 110, such as
during start-up, is typically stored in ROM 131. RAM 132 typically
contains data and/or program modules that are immediately
accessible to and/or presently being operated on by processing unit
120. By way of example, and not limitation, FIG. 1 illustrates
operating system 134, application programs 135, other program
modules 136, and program data 137.
[0024] The computer 110 may also include other
removable/non-removable, volatile/nonvolatile computer storage
media. By way of example only, FIG. 1 illustrates a hard disk drive
140 that reads from or writes to non-removable, nonvolatile
magnetic media, a magnetic disk drive 151 that reads from or writes
to a removable, nonvolatile magnetic disk 152, and an optical disk
drive 155 that reads from or writes to a removable, nonvolatile
optical disk 156, such as a CD ROM or other optical media. Other
removable/non-removable, volatile/nonvolatile computer storage
media that can be used in the exemplary operating environment
include, but are not limited to, magnetic tape cassettes, flash
memory cards, digital versatile disks, digital video tape, solid
state RAM, solid state ROM, and the like. The hard disk drive 141
is typically connected to the system bus 121 through a
non-removable memory interface such as interface 140, and magnetic
disk drive 151 and optical disk drive 155 are typically connected
to the system bus 121 by a removable memory interface, such as
interface 150.
[0025] The drives and their associated computer storage media
discussed above and illustrated in FIG. 1, provide storage of
computer readable instructions, data structures, program modules
and other data for the computer 110. In FIG. 1, for example, hard
disk drive 141 is illustrated as storing operating system 144,
application programs 145, other program modules 146, and program
data 147. Note that these components can either be the same as or
different from operating system 134, application programs 135,
other program modules 136, and program data 137. Operating system
144, application programs 145, other program modules 146, and
program data 147 are given different numbers here to illustrate
that, at a minimum, they are different copies. A user may enter
commands and information into the computer 20 through input devices
such as a keyboard 162 and pointing device 161, commonly referred
to as a mouse, trackball or touch pad. Other input devices (not
shown) may include a microphone, joystick, game pad, satellite
dish, scanner, or the like. These and other input devices are often
connected to the processing unit 120 through a user input interface
160 that is coupled to the system bus, but may be connected by
other interface and bus structures, such as a parallel port, game
port or a universal serial bus (USB). A monitor 191 or other type
of display device is also connected to the system bus 121 via an
interface, such as a video interface 190. In addition to the
monitor, computers may also include other peripheral output devices
such as speakers 197 and printer 196, which may be connected
through an output peripheral interface 195
[0026] The computer 110 may operate in a networked environment
using logical connections to one or more remote computers, such as
a remote computer 180. The remote computer 180 may be a personal
computer, a server, a router, a network PC, a peer device or other
common network node, and typically includes many or all of the
elements described above relative to the computer 110, although
only a memory storage device 181 has been illustrated in FIG. 1.
The logical connections depicted in FIG. 1 include a local area
network (LAN) 171 and a wide area network (WAN) 173, but may also
include other networks. Such networking environments are
commonplace in offices, enterprise-wide computer networks,
intranets and the Internet.
[0027] When used in a LAN networking environment, the computer 110
is connected to the LAN 171 through a network interface or adapter
170. When used in a WAN networking environment, the computer 110
typically includes a modem 172 or other means for establishing
communications over the WAN 173, such as the Internet. The modem
172, which may be internal or external, may be connected to the
system bus 121 via the user input interface 160, or other
appropriate mechanism. In a networked environment, program modules
depicted relative to the computer 110, or portions thereof, may be
stored in the remote memory storage device. By way of example, and
not limitation, FIG. 1 illustrates remote application programs 185
as residing on memory device 181. It will be appreciated that the
network connections shown are exemplary and other means of
establishing a communications link between the computers may be
used.
Software Licensing Service
[0028] FIG. 2 shows an example system that provides a software
licensing service 202. Software licensing service 202 operates
inside of computer 110 (shown in FIG. 1). In one example, software
licensing service 202 is part of an operating system that executes
on computer 110. Software licensing service maintains a license
store 204 in which license files for software are stored. License
files may, for example, be eXtensible Rights Markup Language (XrML)
files that specify rights to software, and that also may specify
various types of conditions on the exercise of those rights.
Software 204 also maintains a trust store 206. Trust store 206
stores un-authenticatable, dynamic data in a tamper-resistant
manner; trust store 206 stores data that is used in the license
validation process. For example, certain licenses may have
expiration dates, and, in order to prevent the expiration data from
being circumvented through clock rollback, the current time (and
elapsed time) may be periodically stored in trust store 206 to
ensure that the clock is always moving forward.
[0029] Software licensing service 202 manages license store 204 and
trust store 206, and also performs various functions relating to
the licensing of software. For example, software licensing service
202 may contain modules that parse license files, modules that
enforce the binding of a license to a particular machine and/or to
a particular instance of a software product, and a secure
timer/counter (that uses trust store 206 in the manner described
above).
[0030] Software licensing service 202 exposes an application
programming interface (API) 208 that allows application software
(such as application 135) to use software licensing service 202.
Application 135 may invoke the features of software licensing
service 208 by making local procedure call (LPC) to the methods of
API 208. An example set of API methods that may be exposed by
software licensing service 202 is described below.
[0031] The manner in which API 208 is used by an application is
described with reference to FIG. 3. Initially, the application
makes an API call (302). Service 202 then processes the API call
(304), and returns the result of the API call to the application
306. For example, an API call may request to exercise ("consume") a
right granted in a license, or to retrieve information from a
license. The application then receives the result of the API call,
and determines, based on that result, what the application's
behavior should be (308). In other words, software licensing
service 202, in a preferred embodiment, does not enforce a license
directly, but rather provides the infrastructure through which
licenses can be managed and used. For example, if an application
makes an API call to consume a right and service 202 determines
that there is no valid license granting this right, service 202, in
a preferred embodiment, does not prevent the application from
running, but instead informs the application that the right is not
available. Thus, the application can use its own mechanisms to
determine what to do in response to the unavailability of the
right. This facet of the API provides software vendors the
flexibility to decide how the licensing infrastructure provided by
service 202 should be used. In another implementation, application
can be bound to licensing service functionality.
Example Software Licensing API
[0032] The following is an example set of API methods that may be
exposed by a software licensing service:
SLOpen
[0033] The SLOpen function opens a SL client context handle that
must be used for all subsequent SL API calls. (Throughout the
example API descriptions, "SL" shall refer to the software
licensing service. Thus, the SL client context handle is the handle
used by a client in communicating with the software licensing
service.)
TABLE-US-00001 HRESULT SLOpen( CONST GUID* pguidApp, HSLC* phSLC
);
[0034] Parameters
[0035] pguidApp
[0036] [in] Pointer to application GUID that uniquely identifies an
application. If this argument is NULL, an E_INVALIDARG error is
returned.
[0037] phSLC
[0038] [out] SL client context Handle or INVALID_HANDLE_VALUE if
failed.
[0039] Remarks
[0040] Use the SLClose function to close an context handle returned
by SLOpen.
[0041] Application GUID: Unique ID of application. For the WINDOWS
version of the MICROSOFT OFFICE application suite, WinWord has an
Application GUID which is different from Excel's Application GUID.
For Windows, Windows itself is an application, although it is a
composite of many programs.
[0042] In Office case, A user can install both Office Suite and
WinWord standalone products on the machine. From SL point of view,
the WinWord in both products has same Application GUID. WinWord's
Application GUID associated to two Product GUID. In other words,
WinWord can use either Office Suite's product license or WinWord's
product license.
[0043] When SLOpen succeeds:
[0044] A RPC (remote procedure call) binding has been
established.
[0045] A context memory is created on SL service. The context is
used to keep the status information for the caller of the
client.
[0046] The SLC handle is like a file handle. A process can open
multiple SL context handles but handles are valid within the caller
process.
[0047] Returns
[0048] Success or failure
SLClose
[0049] The SLClose function closes an opened SL client context
handle. Any information in the context is released
automatically.
TABLE-US-00002 HRESULT SLClose( HSLC hSLC );
[0050] Parameters
[0051] hSLC
[0052] [in] Handle to current SL client context handle
[0053] Remarks
[0054] When SLClose is done, the RPC binding is released, and the
context is destroyed.
[0055] Returns
[0056] Success or failure.
SLInstall
[0057] The SLInstall function installs applications' licenses and
registers applications' information.
TABLE-US-00003 HRESULT SLInstall( HSLC hSLC, CONST SL_PRODKEY*
pAppPrdKey, DWORD dwNumOfApps, CONST GUID* pguidApps, DWORD
dwNumOfLicFiles, PCWSTR ppszLicFiles[ ], BOOL bVerify );
[0058] Parameters
[0059] hSLC
[0060] [in] Handle to current SL client context handle
[0061] pAppPrdKey
[0062] [in] Application product key structure. The product key can
be Microsoft product key format or Application's product key
format.
TABLE-US-00004 typedef struct_tagSL_PRODKEY { DWORD cb Size; //
Size of SL_PRODKEY structure DWORD dwVersion; // Version of
SL_PRODKEY structure WCHAR szProdKey[MAX_PRODKEYSTR_SIZE+1];
SL_PRODKEY_TYPE eProdKeyType; // Type of Product key
SL_CUSTOM_PRODKEY_INFO CustomPrdKeyInfo; // Customer product key
info } SL_PRODKEY;
[0063] The eProdKeyType can be one of following values:
TABLE-US-00005 SL_PRODKEY_CUSTOM SL_PRODKEY_MS2002
SL_PRODKEY_MS2003
[0064] If the Product Key type is non-MS Product Key (i.e.
eProdKeyType==SL_PRODKEY_CUSTOM), the caller has to fill in its
custom product key information. If the product uses MS Product Key,
then CustomPrdKeyInfo can be ignored.
TABLE-US-00006 typedef struct_tagSL_CUSTOM_PRODKEY_INFO DWORD
dwSKUID; // Unique ID for specific SKU, for example Group ID in MS
PID. DWORD dwSerialNumber; // unique serial number, e.g. channel +
sequence number in MS PID. } SL_CUSTOM_PRODKEY_INFO;
[0065] Current version number of SL_PRODKEY is 1. The caller can
use SL_CURRENT_PRODKEY_VERSION in dwVersion field.
[0066] dwNumOfApps
[0067] [in] The number of application GUID in pguidApps.
[0068] pguidApps
[0069] [in] A list of application of GUID. The application GUID
represents the application that the license is being installed for.
For example, Office Setup program can call this function to install
the license(s) for Word, Excel by specifying each application GUID
in pguidApps. pguidApp cannot be NULL here.
[0070] dwNumOfApps
[0071] [in] The number of license files.
[0072] ppszLicFile
[0073] [in] File names in array of strings.
[0074] Returns
[0075] Success or failure
SLUninstall
[0076] The SLUninstall function uninstalls a product's license from
an application.
TABLE-US-00007 HRESULT SLUninstall ( HSLC hSLC, CONST SL_PRODKEY*
pAppPrdKey );
[0077] Parameters
[0078] hSLC
[0079] [in] Handle to current SL client context handle
[0080] pAppPrdKey
[0081] [in] See above definition in connection with SLInstall.
[0082] Remarks
[0083] An application could have more than one product licenses.
For example, when the user uninstalls Office suite, the association
between Office Suite license and WinWord should be removed, but the
license from WinWord Standalone product should not be removed.
[0084] When SLUninstall succeeds:
[0085] The information associated with this Product Key is removed.
(see SLInstall, above, for the associated information)
[0086] The product keys associated with the Application GUID is
removed.
[0087] The license files associated with the product GUID are
preferably still kept.
[0088] Returns
[0089] Success or failure
SLConsumeRight
[0090] The SLConsumeRight function lets an application to examine
or exercise the rights on a locally-stored license. Calling this
function binds a license to the right mentioned in pszRightName. If
this right cannot be exercised by the current caller, then the
application fails. If the function succeeds, the action associated
with the right can be executed (like decreasing usage count,
decreasing time quota, or nothing)
TABLE-US-00008 HRESULT SLConsumeRight( HSLC hSLC, PCWSTR
pszRightName, SL_ASYNC_CONTEXT* pAsyncContext };
[0091] Parameters
[0092] hSLC
[0093] [in] Handle to current SL client context handle
[0094] pszRightName
[0095] [in] The name of right needs to be evaluated. In current
design, the right name is defined by applications. SL opens the
license and evaluates the condition based on the right name.
[0096] pAsyncContext
[0097] [in/out] If pAsyncContext is NULL, this function works in
synchronous mode, otherwise, the function works in asynchronous
mode. SL_ASYNC_CONTEXT is opaque to caller and managed by SLC.
[0098] Remarks
[0099] All licenses associated with the application GUID (specified
in SLOpen) will be conceptually combined in one logic license.
[0100] If their are multiple consumable grants of the right, then
the license with higher priority will be consumed first.
[0101] Returns
[0102] Success or failure
SLInitializeAsyncContext
[0103] The SLInitializeAsyncContext function initializes the
asynchronous context for SLC functions to make asynchronous
call.
TABLE-US-00009 HRESULT SLInitializeAsyncContext(
SL_ASYNC_CONTEXT*pAsyncContext, // asynchronous context HANDLE
hEvent, // event handle PVOID pvReserved // reserved, NULL };
[0104] Parameters
[0105] pAsyncContext
[0106] [in/out] pointer to asynchronous context that contains
asynchronous call information.
[0107] hEvent
[0108] [in] The event object used for synchronization.
[0109] pvReserved
[0110] [in] reserved for extension.
[0111] Returns
[0112] Success or failure.
SLCancelAsyncCall
[0113] The SLCancelAsyncCall function is used to cancel an
asynchronous call.
TABLE-US-00010 HRESULT SLCancelAsyncCall( SL_ASYNC_CONTEXT*
pAsyncContext, // asynchronous context BOOL fAbortCall // cancel
immediately };
[0114] Parameters
[0115] pAsyncContext
[0116] [in] asynchronous context for SL asynchronous call.
[0117] fAbortCall
[0118] [in] If TRUE, the call is cancelled immediately. If FALSE,
wait for the SL to complete the call.
[0119] Remarks
[0120] There are two ways for the caller to request cancellation of
an asynchronous call--abortive and nonabortive. In an abortive
cancel (fAbortCall is TRUE), the SLCancelAsyncCall function sends a
cancel notification to the SLC and the asynchronous call is
canceled immediately, without waiting for a response from the SLC.
In a nonabortive cancel (fAbortCall is FALSE) the SLCancelAsyncCall
function notifies SLC of the cancel and the caller waits for SLC to
complete the call.
[0121] Returns
[0122] Success or failure.
SLCompleteAsyncCall
[0123] The SLCompleteAsyncCall function is used to complete an SLC
asynchronous call.
TABLE-US-00011 HRESULT SLCompleteAsyncCall( SL_ASYNC_CONTEXT*
pAsyncContext, // asynchronous context HRESULT* phrAsyncCall //
error code of the submitted asynchronous call };
[0124] Parameters
[0125] pAsyncContext
[0126] [in] asynchronous context for SL asynchronous call.
[0127] phrAsyncCall
[0128] [out] the error code of the submitted asynchronous call.
[0129] Remarks
[0130] If the caller calls this function before the reply has
arrived, the call returns E_SLC_ASYNC_CALL_PENDING. The buffer must
be valid and it must be big enough to receive the return value. If
the call does not return E_SLC_ASYNC_CALL_PENDING, this
SLCompleteAsyncCall invocation is final for the asynchronous call.
After this function call, regardless of success or failure, all
resources allocated for this asynchronous call are freed.
(Subsequent calls to the SLCompleteAsyncCall or SLCancelAsyncCall
functions have undefined results until a new call on the
SL_ASYNC_CONTEXT structure is initiated).
[0131] Returns
TABLE-US-00012 Value Meaning S_OK The call was completed
successfully. E_SLC_INVALID_ASYNC_CONTEXT The asynchronous call
context is not valid. E_SLC_ASYNC_CALL_PENDING The call has not yet
completed. E_SLC_CALL_CANCELLED The call was cancelled.
SLGetInformation
[0132] The SLGetLicenseInfo function is used to get a variety of
information.
TABLE-US-00013 HRESULT SLGetInfomation( HSLC hSLC, // SL client
context handle DWORD dwCategory, // The category of information to
retrieve PCWSTR pszKeyName, // Name of the Key DWORD* pdwType, //
Type of value SIZE_T* pcbValue, // Size of value PBYTE* ppbValue //
Pointer to buffer of value );
[0133] Parameters
[0134] hSLC
[0135] [in] Handle to current SL client context handle
[0136] dwCategory
[0137] [in] The category of information.
TABLE-US-00014 Category Meaning SL_CAT_RIGHTDATA Get the
information from bound right. The license has to be consumed
successfully before getting these right data.
SL_CAT_DYNAMICPROPERTY Get the information that is not in the
license but calculating in the run-time. For example,
RemainingGracePeriodDays. The right has to be consumed before
calling. Name Meaning RemainingGracePeriod The grace period is
defined in Days:DWORD out-of-box license. Once the application is
installed, the time is counting down. Applications can check
remaining grace period after they have consumed license.
ActivationStatus: After applications consumed DWORD license, it can
get consumed license type. The return value could be: SL_LIC_OOB
The consumed license is out- of-box license. SL_LIC_ACQUIRED The
consumed license is acquired license. SL_LIC_NONE No license is
available. SL_CAT_SERVICEINFO Get the information that is not
dependent on license. The caller can get this category of
information without consuming license. Name Meaning SLVersion: The
version of SL. 1.2.3.4 DWORD format. HWID:BINARY Current HWID
SL_CAT_WINDOWSINFO Get information that is bound right property in
Windows license. This is for Componentization. Windows License has
been consumed by SL service and SL service keeps the bound right
properties. SL_CAT_ENUMLICINFO When SLEnumLicenseis called and is
succeed, the caller can query the information of enumerated license
by using this category.
[0138] pszKeyName
[0139] [in] the name of the key. E.g. BuildNumber
[0140] pdwType
[0141] [out] type of data
TABLE-US-00015 Value Meaning SL_DATATYPE_SZ Unicode string
SL_DATATYPE_DWORD DWORD SL_DATATYPE_BINARY Binary
[0142] pcbValue
[0143] [out] Size of the buffer allocated (in bytes).
[0144] ppbValue
[0145] [out] If successful, the data is returned in the buffer
allocated by SLC. The caller has to call SLFreeMemory to free the
memory.
[0146] Returns
[0147] Success or failure
SLAcquireLicense
[0148] The SLAcquireLicense function is used to acquire on-line
license for the user. SLC enumerates the product keys associated
with the Application and picks up the product key with highest
product priority (see SLInstall, registration information). Then SL
gets the clearing house URL from out-of-box license and connects to
clearing house to get a license.
[0149] SLAcquireLicense could be a lengthy process. Applications
can call this function in asynchronous mode by specifying
pAsyncContext (NULL means synchronous mode).
TABLE-US-00016 HRESULT SLAcquireLicense( HSLC hSLC, // SL client
context handle PCWSTR pszProdKeyHash, // hash of product key PCWSTR
pszPublishLicense, // string of publishing license.
SL_ASYNC_CONTEXT* pAsyncContext );
[0150] Parameters
[0151] hSLC
[0152] [in] Handle to current SL client context handle
[0153] pszProdKeyHash
[0154] [in] string of product key hash. The product key hash is
created when SLInstall is called and is maintained by the licensing
service.
[0155] pszPublishingLicense
[0156] [in] string of publishing license.
[0157] pAsyncContext
[0158] [in] asynchronous context for SL asynchronous call.
[0159] Remarks
[0160] The acquired license will be stored in license store
accordingly and the license information will be registered, too.
(see SLInstall)
[0161] Applications might need to add more client information to
license. The application can put the information to pbAppData in
the call and this data will be sent to clearing house.
[0162] When this function succeeds:
[0163] It sent necessary binding information to the specified
license server.
[0164] It receives the license from license server.
[0165] It stored the license in license store. See description of
SLInstall, above, for how the license file is stored.
[0166] Returns
[0167] Success or failure.
SLGenerateTextChallenge
[0168] Generates and installation challenge text to be routed to a
license issuer in an out of band fashion (telephone, email, file
share, etc).
TABLE-US-00017 HRESULT SLGenerateTextChallenge( HSLC hSLC, // SL
client context handle PCWSTR pszProdKeyHash, // string of product
key hash BOOL fSingleSession, // Single session only? PWSTR
*ppszChallenge // Pointer to buffer to hold challenge text );
[0169] Parameters
[0170] hSLC
[0171] [in] Handle to current SL client context handle
[0172] pszProdKeyHash
[0173] [in] String of product key hash. The product key hash is
created when SLInstall is called and maintained by the licensing
service.
[0174] bSingleSession
[0175] [in] Specifies whether or not the corresponding text
response from the license issue will be valid only for the lifetime
of this SLC session handle.
[0176] ppszChallenge
[0177] [out] If successful, the text challenge is returned in the
buffer allocated by SLC. The caller needs to call SLFreeMemory to
free the allocated memory.
[0178] Returns
[0179] Success or failure.
SLDepositTextResponse
[0180] Deposits the response to an installation challenge text in
the licensing system. Used to activate a license with a conditional
access code. Only valid if there is an outstanding text challenge
which has been issued for a license. If the original license
specified that the challenge was only valid for a single session,
this API must be called with the response before the SLC handle is
closed or depositing the response will fail.
TABLE-US-00018 HRESULT SLDepositTextResponse( HSLC hSLC, // SL
client context handle PCWSTR pszProdKeyHash, PWSTR pszResponse //
Buffer containing response text );
[0181] Parameters
[0182] hSLC
[0183] [in] Handle to current SL client context handle
[0184] pszProdKeyHash
[0185] string of the product key hash
[0186] pszChallenge
[0187] [in] Response text
[0188] Returns
[0189] Success or failure.
SLEnumLicense
[0190] The SLEnumLicensefunction is used to enumerate installed
licenses and get information from the license.
TABLE-US-00019 HRESULT SLEnumLicense( HSLC hSLC, // SL client
context handle CONST GUID* pguidApp, // application GUID DWORD
dwIndex // index number );
[0191] Parameters
[0192] hSLC
[0193] [in] Handle to current SL client context handle
[0194] pguidApp
[0195] [in] See SLInstall. If pguidApp is not NULL, then licenses
associated with this GUID are enumerated. If the GUID is NULL, then
all licenses are enumerated.
[0196] dwIndex
[0197] [in] The index number of the license to be retrieved. This
value should be zero for the first call to the SLEnumLicense
function and then incremented for subsequent calls.
[0198] The function may return licenses in any order.
[0199] Returns
[0200] E_SL_NO_MORE_DATA--No license at the specified index.
[0201] Remarks
[0202] If SLEnumLicenses succeeded, the selected license
information can be accessed by calling SLGetInformation and the
category is SL_CAT_ENUMLICINFO
[0203] Sample:
TABLE-US-00020 DWORD i=0; PBYTE pbProductPriority = NULL; PBYTE
pbRemainingGracePeriodDays = NULL; for (i=0; ; i++) {
EXIT_ON_ERROR(SLEnumLicense(hSLC, NULL, dwIndex)); if
(E_SL_NO_MORE_DATA == SCODE(hr)) { hr = S_OK; break; }
[0204] EXIT_ON_ERROR(SLGetInformation(hSLC, SL_CAT_ENUMLIC,
"ProductPriority", &dwType, &cbProductPriority,
&pbProductPriority));
[0205] EXIT_ON_ERROR(SLGetInformation(hSLC, SL_CAT_ENUMLIC,
"RemainingGracePeriodDays", &dwType,
&cbRemainingGracePeriodDays,
&pbRemainingGracePeriodDays));
[0206] Exit:
TABLE-US-00021 SLFreeMemory(pbProductPriority);
SLFreeMemory(pbRemainingGracePeriodDays); }
SLFreeMemory
[0207] The SLFreeMemory function is used to free the memory
allocated by SLC.
TABLE-US-00022 VOID SLFreeMemory( PVOID pvMemblock, // pointer to
memory );
[0208] Parameters
[0209] pvMemBlock
[0210] [in] Previously allocated memory block to be freed
[0211] Returns
[0212] None
Use of Software Licensing API to Control Use of Software
[0213] A software product uses the API of the present invention for
various purposes related to licensing, including the consumption of
rights in a license, and the retrieval of data from the license. As
noted above, the API allows the software to determine what rights
are present in the license, but, preferably, it is up to the
software to determine what to do with that information--e.g., grant
or deny access to a feature, cease operation altogether, etc. The
following description of FIGS. 4 and 5 show how the API of the
present invention is used by a software product.
[0214] FIG. 4 shows an example process by which an application
"consumes" a right. The application calls the SLConsumeRight method
(402). As discussed above, the arguments to the SLConsumeRight
function include the client handle assigned by the licensing
service, and the name of the right (which is assigned by the vendor
of the software to which the right pertains). The licensing service
(service 202, shown in FIG. 2) receives the call (404). The service
then locates licenses that contains the right, and checks the
licenses bindings and validity. As noted above, the license is
located in the license store; if there is more than one license
that pertains to the application software to which the
SLConsumeRight call pertains, then a priority rule may be used to
select one of the applicable licenses. Checking the binding means
determining that: (1) the license is bound to the product key of
the application identified by the client handle; and (2) the
license is bound to the machine on which the software is running
(or to the group of machines of which the current machine is a
member). Checking validity may include determining that the right
has not expired (in the case of licenses that specify an expiration
date), and that the maximum number of uses of the right is not
exceeded (in the case where the license specifies a maximum number
of times that the right may be used (i.e., "consumed")).
[0215] If the license and/or right are found to be correctly bound
and valid (408), then the license is bound to the right requested
in the API call (412). (It should be noted that "binding" a license
to a machine, environment, and a product key means that the license
specifies which machine(s) and product key it can be used with;
"binding" a license to a right means that the consume function has
been successful, and the right is being consumed from a particular
license. Throughout this description, it will be clear from context
which meaning of "binding" applies.) The API call then returns to
the calling application and indicates that the call was successful
(414). If the license and/or right has been found to be invalid, or
not correctly bound to the machine, environment, or product ID,
then the SLConsumeRight call returns to the calling application and
indicates that the operation failed (410).
[0216] If the SLConsumeRight call returns with a failure, then the
right specified in the call cannot be consumed from a license, and
no information about that right will be available to the calling
application. However, if the right is successfully consumed, then
the application can use the binding of the right to the license to
get information from the license about the right. For example, a
license may contain a general right called "run," which indicates
that the application may be run. However, for the "run" right, the
license may contain more specific parameters about the usage of the
application--e.g., the license may specify whether particular
features of an application (e.g., print, edit, save, etc.) should
be turned on or off, and may give specific parameters for the use
of these features (e.g., the document can be saved only on machines
that are running in a particular domain, or the print feature can
only be used for thirty days, etc.). The SL API does not require
any particular type of information to be associated with a right,
but rather provides a mechanism whereby an application vendor can
associate any type of information with a right, which can then be
retrieved and interpreted by the application.
[0217] Assuming that a right has been successfully consumed as
described in FIG. 4, the application may then retrieve the
information associated with the right. The process of retrieving
this information is described in FIG. 5.
[0218] First, the application calls the SLGetInformation method on
the bound right (502). The various types of information that can be
retrieved are described above in connection with the description of
the SLGetInformation method. The licensing service then receives
the call (504). The service retrieves the requested information
from the license file that contains the bound right (506). The
licensing service then places this information in a buffer (508),
and returns to the calling application (510). The calling
application then reads the contents of the buffer, and performs
whatever actions it deems necessary based on the retrieved
information.
[0219] It should be noted that the licensing service may not be
aware of the meaning of the information that it is handling as part
of an SLGetInformation call. As discussed above, the licensing
framework provides a mechanism whereby a software vendor can create
rights, and can associate information with the rights. The
invention is not limited either to any particular type of
information that can be associated with the right. When the
information is retrieved from the license, it is simply passed by
the licensing service to the application in a buffer. The
application then interprets the retrieved information, decides what
actions to be taken based on that information, and uses its own
security features to enforce the application's decision. (E.g., if,
based on the retrieved information, the application decides to
disable the print feature, the application contains the code that
actually disables this features and, possibly, code that prevents a
hacker from tampering with the disabling of the print feature.)
[0220] It is noted that the foregoing examples have been provided
merely for the purpose of explanation and are in no way to be
construed as limiting of the present invention. While the invention
has been described with reference to various embodiments, it is
understood that the words which have been used herein are words of
description and illustration, rather than words of limitations.
Further, although the invention has been described herein with
reference to particular means, materials and embodiments, the
invention is not intended to be limited to the particulars
disclosed herein; rather, the invention extends to all functionally
equivalent structures, methods and uses, such as are within the
scope of the appended claims. Those skilled in the art, having the
benefit of the teachings of this specification, may effect numerous
modifications thereto and changes may be made without departing
from the scope and spirit of the invention in its aspects.
* * * * *