13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 |
* General Public License for more details. |
* General Public License for more details. |
|
* |
|
|
* You should have received a copy of the GNU General Public License |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
|
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
16 |
*/ |
*/ |
|
|
|
17 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
18 |
#include <config.h> |
#include <config.h> |
19 |
#endif |
#endif |
106 |
HANDLE fd = NULL; |
HANDLE fd = NULL; |
107 |
SECURITY_ATTRIBUTES sec_attr; |
SECURITY_ATTRIBUTES sec_attr; |
108 |
|
|
109 |
|
*r_cb = NULL; /* reset */ |
110 |
memset (&sec_attr, 0, sizeof (sec_attr)); |
memset (&sec_attr, 0, sizeof (sec_attr)); |
111 |
sec_attr.bInheritHandle = FALSE; |
sec_attr.bInheritHandle = FALSE; |
112 |
sec_attr.nLength = sizeof (sec_attr); |
sec_attr.nLength = sizeof (sec_attr); |
133 |
} |
} |
134 |
|
|
135 |
err = gpgme_data_new_from_cbs (&cb->dat, &cb->cbs, cb); |
err = gpgme_data_new_from_cbs (&cb->dat, &cb->cbs, cb); |
136 |
if (err) { |
if (!err) |
137 |
|
*r_cb = cb; |
138 |
|
else { |
139 |
CloseHandle (fd); |
CloseHandle (fd); |
140 |
free_if_alloc (cb); |
free_if_alloc (cb); |
141 |
return err; |
} |
|
} |
|
142 |
|
|
|
*r_cb = cb; |
|
143 |
return err; |
return err; |
144 |
} |
} |
145 |
|
|
146 |
|
|
147 |
/* Activate the progress callback for the given object @ctx. */ |
/* Set the progress callback for the given object @ctx. */ |
148 |
void |
void |
149 |
gpg_file_data_set_cb (file_data_t ctx, struct progress_filter_s *pfx) |
gpg_file_data_set_cb (file_data_t ctx, struct progress_filter_s *pfx) |
150 |
{ |
{ |
160 |
} |
} |
161 |
|
|
162 |
|
|
163 |
/* Release the context in @cb. Close all internal handles if possible. */ |
/* Release the context in @cb. |
164 |
|
Close all internal handles if possible. */ |
165 |
void |
void |
166 |
gpg_file_data_release (file_data_t cb) |
gpg_file_data_release (file_data_t cb) |
167 |
{ |
{ |